Skip to content

Commit

Permalink
Download OpenBLAS with PETSc if no BLAS.
Browse files Browse the repository at this point in the history
  • Loading branch information
prj- committed Jan 17, 2020
1 parent f9661ac commit 58f59bf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
16 changes: 10 additions & 6 deletions 3rdparty/ff-petsc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ dir3rdparty := $(abspath $(dir $(mkfile_path))/..)

W_SUDO:=$(SHELL mkdir -p "$(DESTDIR)$(FF_prefix_petsc)" && test -w "$(DESTDIR)$(FF_prefix_petsc) || echo sudo)
W_SUDO1=$(SHELL ls )
ifeq ($(COMPILE_OPENBLAS),openblas)
PETSC_OPENBLAS := --download-openblas
PETSC_OPENBLAS_C = --with-openblas-dir=$(DIR_INSTALL_REAL)
else
PETSC_OPENBLAS = --with-blaslapack-include='$(shell echo $(BLASINC) | sed "s/-I//g")' \
--with-blaslapack-lib='$(BLAS_LAPACK_LIBS)'
PETSC_OPENBLAS_C = $(PETSC_OPENBLAS)
endif
ifeq ($(PETSC_PKG),yes)
pkg_dir=$(abspath $(dir $(mkfile_path))/pkg)
PETSC_DOWNLOAD := --download-scalapack=$(pkg_dir)/pkg-scalapack.tar.gz \
Expand All @@ -45,8 +53,6 @@ PETSC_DOWNLOAD := --download-scalapack=$(pkg_dir)/pkg-scalapack.tar.gz \
--download-slepc=$(pkg_dir)/slepc.tar.gz
PETSC_DOWNLOAD_C := --download-hpddm=$(pkg_dir)/hpddm.tar.gz \
--download-slepc=$(pkg_dir)/slepc.tar.gz


else
PETSC_DOWNLOAD := --download-scalapack --download-metis --download-ptscotch \
--download-mumps --download-hypre --download-parmetis \
Expand All @@ -70,8 +76,7 @@ ifeq ($(WIN32DLLTARGET),)
FOPTFLAGS='-O3 $(FLAGS_MTUNE)' \
--with-ssl=0 --with-x=0 --with-fortran-bindings=0 \
--with-scalar-type=real $(WITH_MPI_DIR) $(PETSC_ADDCONF) \
--with-blaslapack-include='$(shell echo $(BLASINC) | sed "s/-I//g")' \
--with-blaslapack-lib='$(BLAS_LAPACK_LIBS)' \
$(PETSC_OPENBLAS) \
$(PETSC_DOWNLOAD)
FLAGS_CONF_PETSC_COMPLEX= --with-debugging=0 \
--with-cc='$(MPICC)' --with-cxx='$(MPICXX)' --with-fc='$(MPIFC)' --with-cxx-dialect=C++11 \
Expand All @@ -80,8 +85,7 @@ FLAGS_CONF_PETSC_COMPLEX= --with-debugging=0 \
FOPTFLAGS='-O3 $(FLAGS_MTUNE)' \
--with-scalar-type=complex \
--with-ssl=0 --with-x=0 --with-fortran-bindings=0 $(WITH_MPI_DIR) $(PETSC_ADDCONF) \
--with-blaslapack-include='$(shell echo $(BLASINC) | sed "s/-I//g")' \
--with-blaslapack-lib='$(BLAS_LAPACK_LIBS)' \
$(PETSC_OPENBLAS_C) \
--with-scalapack-dir=$(DIR_INSTALL_REAL) \
--with-metis-dir=$(DIR_INSTALL_REAL) \
--with-ptscotch-dir=$(DIR_INSTALL_REAL) \
Expand Down
1 change: 1 addition & 0 deletions 3rdparty/ff-petsc/Makefile-PETSc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ FC=@FC@
BLASINC=@BLASINC@
BLASLIBS=@BLASLIBS@
LAPACKLIBS=@LAPACKLIBS@
COMPILE_OPENBLAS=@COMPILE_OPENBLAS@
# Use:
# -DAdd_ if your Fortran compiler adds an underscore at the end
# of symbols,
Expand Down

0 comments on commit 58f59bf

Please sign in to comment.