Skip to content

Commit

Permalink
Merge pull request #208 from FreeFem/release-v4.10
Browse files Browse the repository at this point in the history
Version v4.10
  • Loading branch information
prj- authored Nov 13, 2021
2 parents 897a6ed + 23b9e00 commit 9b88bed
Show file tree
Hide file tree
Showing 171 changed files with 5,568 additions and 2,885 deletions.
7 changes: 4 additions & 3 deletions 3rdparty/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ install-other: tag-install-other

tag-install-other:
if test -n "$(TOOL_COMPILE_hpddm)" ; then $(MAKE) install-hpddm; else true; fi
if test -n "$(TOOL_COMPILE_bem)" ; then $(MAKE) install-htool install-boost install-bemtool; else true; fi
if test -n "$(TOOL_COMPILE_htool)" ; then $(MAKE) install-htool; else true; fi
if test -n "$(TOOL_COMPILE_bem)" ; then $(MAKE) install-boost install-bemtool; else true; fi
touch tag-install-other

WHERE-OTHER: lib/WHERE.hpddm lib/WHERE.htool lib/WHERE.bemtool lib/WHERE.boost
Expand Down Expand Up @@ -133,12 +134,12 @@ lib/WHERE.hpddm: ./getall

# begin HTOOL
install-htool: ./getall
if test -n "$(TOOL_COMPILE_bem)"; then ./getall -o htool -a; $(MAKE) include/htool/done.tag lib/WHERE.htool; else true;fi
if test -n "$(TOOL_COMPILE_htool)"; then ./getall -o htool -a; $(MAKE) include/htool/done.tag lib/WHERE.htool; else true;fi
reinstall-htool:./getall
-rm lib/WHERE.htool
-rm ./pkg/htool.zip
-rm -rf include/htool
-test -n "$(TOOL_COMPILE_bem)" && $(MAKE) install-htool || true
-test -n "$(TOOL_COMPILE_htool)" && $(MAKE) install-htool || true
include/htool/done.tag:./pkg/htool.zip
-if test -f ./pkg/htool.zip ; then \
cd include;rm -rf htool htool-*; unzip -q ../pkg/htool.zip ; mv htool-* htool ; touch htool/done.tag; \
Expand Down
18 changes: 10 additions & 8 deletions 3rdparty/ff-petsc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ PETSC_DOWNLOAD := --download-metis --download-ptscotch \
ifeq ($(FFCMAKE),no)
PETSC_DOWNLOAD := $(PETSC_DOWNLOAD) --download-cmake
endif
PETSC_DOWNLOAD_C := $(PETSC_DOWNLOAD_C) --download-slepc --download-hpddm
PETSC_DOWNLOAD_C := $(PETSC_DOWNLOAD_C) --download-slepc --download-hpddm --download-htool
endif
ifeq ($(FF_generic_petsc), yes)
FLAGS_MTUNE := -mtune=generic
Expand Down Expand Up @@ -124,7 +124,7 @@ PETSC_DOWNLOAD += '--download-metis-cmake-arguments=-G "MSYS Makefiles"' \
'--download-hypre-configure-arguments=--build=x86_64-linux-gnu --host=x86_64-linux-gnu'
ifneq ($(FC),)
COMMON_FLAGS += --with-fc='$(FC)'
PETSC_DOWNLOAD += --download-scalapack --download-mumps --download-slepc-configure-arguments="--download-arpack=https://github.com/prj-/arpack-ng/archive/6d11c37b2dc9110f3f6a434029353ae1c5112227.tar.gz"
PETSC_DOWNLOAD += --download-scalapack --download-mumps --download-slepc-configure-arguments="--download-arpack=https://github.com/prj-/arpack-ng/archive/b64dccb.tar.gz"
PETSC_DOWNLOAD_C += --with-scalapack-dir=$(DIR_INSTALL_REAL) --with-mumps-dir=$(DIR_INSTALL_REAL) # --download-slepc-configure-arguments="--with-arpack-dir=$(DIR_INSTALL_REAL)"
else
COMMON_FLAGS += --with-fc=0
Expand All @@ -148,8 +148,8 @@ all-local:
@echo " make petsc-slepc "

DIRPKG=../pkg
VERSION=3.15.0
VERSION_SLEPC=3.014.2
VERSION=3.16.1
VERSION_SLEPC=3.16.0
PACKAGE=../pkg/petsc-$(VERSION).tar.gz
SRCDIR=petsc-$(VERSION)
MPI_DIR:=$(shell dirname $(MPI_INC_DIR))
Expand Down Expand Up @@ -225,7 +225,7 @@ $(SRCDIR)/tag-conf-real:$(SRCDIR)/tag-tar
touch $@
Make-petsc-download.mk:$(SRCDIR)/tag-install-real
test -e $(DIR_INSTALL_REAL)/lib/petsc/conf/petscvariables
egrep 'PETSC_LIB_BASIC|SCALAPACK_|METIS_|MUMPS_|HPDDM_|TETGEN_|SUPERLU_|MMG_|PTSCOTCH_|SUITESPARSE_' $(DIR_INSTALL_REAL)/lib/petsc/conf/petscvariables | sed 's/-I/ /g'|sort >$@
egrep 'PETSC_LIB_BASIC|SCALAPACK_|METIS_|MUMPS_|HPDDM_|HTOOL_|TETGEN_|SUPERLU_|MMG_|PTSCOTCH_|SUITESPARSE_' $(DIR_INSTALL_REAL)/lib/petsc/conf/petscvariables | sed 's/-I/ /g'|sort >$@
ifdef COMPLEX_CASE
# version COMPLEX.....
$(SRCDIR)/tag-conf-complex:$(SRCDIR)/tag-tar Make-petsc-download.mk
Expand Down Expand Up @@ -280,6 +280,8 @@ WHERE-all:Makefile WHERE WHERE-complex
test -z '$(PARMETIS_INCLUDE)' || echo parmetis INCLUDE -I$(PARMETIS_INCLUDE) >>$@
test -z '$(HPDDM_LIB)' || echo hpddm LD $(HPDDM_LIB) >>$@
test -z '$(HPDDM_INCLUDE)' || echo hpddm INCLUDE -I$(HPDDM_INCLUDE) >>$@
test -z '$(HTOOL_LIB)' || echo htool LD $(HTOOL_LIB) >>$@
test -z '$(HTOOL_INCLUDE)' || echo htool INCLUDE -I$(HTOOL_INCLUDE) >>$@
echo 'petsc LD -Wl,-rpath,"$(DIR_INSTALL_REAL)/lib" -L"$(DIR_INSTALL_REAL)/lib" -lpetsc' >>$@
echo 'petsc INCLUDE -I"$(DIR_INSTALL_REAL)/include"' >>$@
echo 'petsccomplex LD -Wl,-rpath,"$(DIR_INSTALL_COMPLEX)/lib" -L"$(DIR_INSTALL_COMPLEX)/lib" -lpetsc' >>$@
Expand All @@ -300,11 +302,11 @@ WHERE-all:Makefile Make-petsc-download.mk
$(MAKE) -f Makefile.complex $@
endif
$(SRCDIR)/tag-tar:$(PACKAGE)
-tar xzf $(PACKAGE)
-mkdir petsc-$(VERSION) 2>/dev/null
-tar xzf $(PACKAGE) -C petsc-$(VERSION) --strip-components 1
ifeq ($(WIN32DLLTARGET),)
cd petsc-$(VERSION) && patch -p1 < ../petsc-metis.patch && cd -
cd petsc-$(VERSION) && patch -p1 < ../petsc-cmake-seq.patch && cd -
endif
cd petsc-$(VERSION) && patch -p1 < ../petsc-suitesparse.patch && cd -
touch $@
$(PACKAGE):
../getall -o PETSc -a
Expand Down
221 changes: 221 additions & 0 deletions 3rdparty/ff-petsc/petsc-cmake-seq.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
diff --git a/config/BuildSystem/config/packages/metis.py b/config/BuildSystem/config/packages/metis.py
index b2d66ab23f..08219fb317 100644
--- a/config/BuildSystem/config/packages/metis.py
+++ b/config/BuildSystem/config/packages/metis.py
@@ -41,6 +41,12 @@ class Configure(config.package.CMakePackage):
if self.framework.argDB['download-metis-use-doubleprecision']:
args.append('-DMETIS_USE_DOUBLEPRECISION=1')
args.append('-DMATH_LIB="'+self.libraries.toStringNoDupes(self.mathlib.lib)+'"')
+ mpicc = self.framework.getMakeMacro('MPICC_SHOW')
+ mpicxx = self.framework.getMakeMacro('MPICXX_SHOW')
+ if mpicc and mpicxx:
+ args = self.rmArgsStartsWith(args,['-DCMAKE_CXX_COMPILER','-DCMAKE_C_COMPILER'])
+ args.append('-DCMAKE_C_COMPILER="'+mpicc.split(None, 1)[0]+'"')
+ args.append('-DCMAKE_CXX_COMPILER="'+mpicxx.split(None, 1)[0]+'"')
return args

def configureLibrary(self):
diff --git a/config/BuildSystem/config/packages/mmg.py b/config/BuildSystem/config/packages/mmg.py
index 43fe0c8981..a574b06fe3 100644
--- a/config/BuildSystem/config/packages/mmg.py
+++ b/config/BuildSystem/config/packages/mmg.py
@@ -28,4 +28,10 @@ class Configure(config.package.CMakePackage):
args.append('-DUSE_VTK=OFF')
args.append('-DUSE_POINTMAP=ON')
args.append('-DSCOTCH_DIR:STRING="'+self.ptscotch.directory+'"')
+ mpicc = self.framework.getMakeMacro('MPICC_SHOW')
+ mpicxx = self.framework.getMakeMacro('MPICXX_SHOW')
+ if mpicc and mpicxx:
+ args = self.rmArgsStartsWith(args,['-DCMAKE_CXX_COMPILER','-DCMAKE_C_COMPILER'])
+ args.append('-DCMAKE_C_COMPILER="'+mpicc.split(None, 1)[0]+'"')
+ args.append('-DCMAKE_CXX_COMPILER="'+mpicxx.split(None, 1)[0]+'"')
return args
diff --git a/src/mat/impls/aij/mpi/mumps/mumps.c b/src/mat/impls/aij/mpi/mumps/mumps.c
index 3226ffb961..95f38a899f 100644
--- a/src/mat/impls/aij/mpi/mumps/mumps.c
+++ b/src/mat/impls/aij/mpi/mumps/mumps.c
@@ -1792,11 +1792,7 @@ PetscErrorCode PetscSetMUMPSFromOptions(Mat F, Mat A)
see https://github.com/pmodels/mpich/issues/5589. This bug was fixed by https://github.com/pmodels/mpich/pull/5590.
In short, we could not use distributed RHS with MPICH until v4.0b1.
*/
-#if PETSC_PKG_MUMPS_VERSION_LT(5,3,0) || (defined(PETSC_HAVE_MPICH_NUMVERSION) && (PETSC_HAVE_MPICH_NUMVERSION < 40000101))
mumps->ICNTL20 = 0; /* Centralized dense RHS*/
-#else
- mumps->ICNTL20 = 10; /* Distributed dense RHS*/
-#endif
ierr = PetscOptionsMUMPSInt("-mat_mumps_icntl_20","ICNTL(20): give mumps centralized (0) or distributed (10) dense right-hand sides","None",mumps->ICNTL20,&mumps->ICNTL20,&flg);CHKERRQ(ierr);
if (flg && mumps->ICNTL20 != 10 && mumps->ICNTL20 != 0) SETERRQ1(PETSC_COMM_SELF,PETSC_ERR_SUP,"ICNTL(20)=%d is not supported by the PETSc/MUMPS interface. Allowed values are 0, 10\n",(int)mumps->ICNTL20);
#if PETSC_PKG_MUMPS_VERSION_LT(5,3,0)
diff --git a/config/BuildSystem/config/compilers.py b/config/BuildSystem/config/compilers.py
index 24780f1f9b..eb6d7c515f 100644
--- a/config/BuildSystem/config/compilers.py
+++ b/config/BuildSystem/config/compilers.py
@@ -364,7 +364,7 @@ class Configure(config.base.Configure):
# Check for '-rpath /sharedlibpath/ or -R /sharedlibpath/'
if arg == '-rpath' or arg == '-R':
lib = next(argIter)
- if lib.startswith('-'): continue # perhaps the path was striped due to quotes?
+ if lib.startswith('-') or lib.startswith('@loader_path'): continue # perhaps the path was striped due to quotes?
if lib.startswith('"') and lib.endswith('"') and lib.find(' ') == -1: lib = lib[1:-1]
lib = os.path.abspath(lib)
if lib in skipdefaultpaths: continue
@@ -964,7 +964,7 @@ class Configure(config.base.Configure):
# Check for '-rpath /sharedlibpath/ or -R /sharedlibpath/'
if arg == '-rpath' or arg == '-R':
lib = next(argIter)
- if lib.startswith('-'): continue # perhaps the path was striped due to quotes?
+ if lib.startswith('-') or lib.startswith('@loader_path'): continue # perhaps the path was striped due to quotes?
if lib.startswith('"') and lib.endswith('"') and lib.find(' ') == -1: lib = lib[1:-1]
lib = os.path.abspath(lib)
if lib in skipdefaultpaths: continue
@@ -1394,7 +1394,7 @@ Otherwise you need a different combination of C, C++, and Fortran compilers")
if arg == '-rpath' or arg == '-R':
lib = next(argIter)
if lib == '\\': lib = next(argIter)
- if lib.startswith('-'): continue # perhaps the path was striped due to quotes?
+ if lib.startswith('-') or lib.startswith('@loader_path'): continue # perhaps the path was striped due to quotes?
if lib.startswith('"') and lib.endswith('"') and lib.find(' ') == -1: lib = lib[1:-1]
lib = os.path.abspath(lib)
if lib in skipdefaultpaths: continue
diff --git a/config/BuildSystem/config/packages/hpddm.py b/config/BuildSystem/config/packages/hpddm.py
index eacc8521e6..0e76e71be9 100644
--- a/config/BuildSystem/config/packages/hpddm.py
+++ b/config/BuildSystem/config/packages/hpddm.py
@@ -3,7 +3,7 @@ import config.package
class Configure(config.package.Package):
def __init__(self,framework):
config.package.Package.__init__(self,framework)
- self.gitcommit = '832303ecdffd25c34206e5392fb3cf85960490a2' # main oct-09-2021
+ self.gitcommit = '5fd4ea2cec52b491874ccd3907b53f92f43e5093' # main nov-03-2021
self.download = ['git://https://github.com/hpddm/hpddm','https://github.com/hpddm/hpddm/archive/'+self.gitcommit+'.tar.gz']
self.minversion = '2.0.8'
self.versionname = 'HPDDM_VERSION'
@@ -23,13 +23,14 @@ class Configure(config.package.Package):
config.package.Package.setupDependencies(self,framework)
self.setCompilers = framework.require('config.setCompilers',self)
self.sharedLibraries = framework.require('PETSc.options.sharedLibraries',self)
- self.mathlib = framework.require('config.packages.mathlib',self)
+ self.blasLapack = framework.require('config.packages.BlasLapack',self)
self.cxxlibs = framework.require('config.packages.cxxlibs',self)
+ self.mathlib = framework.require('config.packages.mathlib',self)
+ self.flibs = framework.require('config.packages.flibs',self)
+ self.deps = [self.blasLapack,self.cxxlibs,self.mathlib,self.flibs] # KSPHPDDM
self.mpi = framework.require('config.packages.MPI',self)
- self.blasLapack = framework.require('config.packages.BlasLapack',self)
self.slepc = framework.require('config.packages.slepc',self)
- self.deps = [self.blasLapack,self.cxxlibs,self.mathlib]
- self.odeps = [self.mpi,self.slepc]
+ self.odeps = [self.mpi,self.slepc] # KSPHPDDM + PCHPDDM
return

def Install(self):
@@ -63,50 +64,44 @@ class Configure(config.package.Package):
except RuntimeError as e:
raise RuntimeError('Error copying HPDDM: '+str(e))
# SLEPc dependency
- if self.mpi.found:
- if self.slepc.found:
- if self.checkSharedLibrariesEnabled():
- slepcbuilddep = ''
- ldflags = ' '.join(self.setCompilers.sharedLibraryFlags)
- # how can we get the slepc lib? Eventually, we may want to use the variables from the framework
- #cxxflags += self.headers.toStringNoDupes(self.slepc.dinclude)
- #ldflags += self.libraries.toString(self.slepc.dlib)
- dinclude = [incDir]+self.dinclude+[os.path.join(PETSC_DIR,'include'),os.path.join(PETSC_DIR,PETSC_ARCH,'include'),os.path.join(self.petscdir.dir,'include'),os.path.join(self.packageDir,'include')]
- dlib = [os.path.join(libDir,'libslepc.'+self.setCompilers.sharedLibraryExt)]
- cxxflags += ' '+self.headers.toStringNoDupes(dinclude)
- ldflags += ' '+self.libraries.toStringNoDupes(dlib)
- slepcbuilddep = 'slepc-install slepc-build'
- oldFlags = self.compilers.CXXPPFLAGS
- self.compilers.CXXPPFLAGS += ' -I'+incDir
- self.checkVersion()
- self.compilers.CXXPPFLAGS = oldFlags
- # check for Windows-specific define
- if self.sharedLibraries.getMakeMacro('PETSC_DLL_EXPORTS'):
- cxxflags += ' -Dpetsc_EXPORTS'
- # need to explicitly link to PETSc and BLAS on Windows
- ldflags += ' '+self.libraries.toStringNoDupes([os.path.join(libDir,'libpetsc.'+self.setCompilers.sharedLibraryExt),self.libraries.toStringNoDupes(self.blasLapack.lib)])
- self.addMakeRule('hpddmbuild',slepcbuilddep,\
- ['@echo "*** Building and installing HPDDM ***"',\
- '@${RM} -f ${PETSC_ARCH}/lib/petsc/conf/hpddm.errorflg',\
- '@'+cxx+' '+cxxflags+' '+self.packageDir+'/interface/hpddm_petsc.cpp '+ldflags+' -o '+libDir+os.path.join('/libhpddm_petsc.'+self.setCompilers.sharedLibraryExt)+' > ${PETSC_ARCH}/lib/petsc/conf/hpddm.log 2>&1 || \\\n\
- (echo "**************************ERROR*************************************" && \\\n\
- echo "Error building HPDDM. Check ${PETSC_ARCH}/lib/petsc/conf/hpddm.log" && \\\n\
- echo "********************************************************************" && \\\n\
- touch '+os.path.join('${PETSC_ARCH}','lib','petsc','conf','hpddm.errorflg')+' && \\\n\
- exit 1)'])
- if self.argDB['prefix'] and not 'package-prefix-hash' in self.argDB:
- self.addMakeRule('hpddm-build','')
- self.addMakeRule('hpddm-install','hpddmbuild')
- return self.installDir
- else:
- self.addMakeRule('hpddm-build','hpddmbuild')
- self.addMakeRule('hpddm-install','')
- return self.installDir
+ if self.slepc.found:
+ if self.checkSharedLibrariesEnabled():
+ slepcbuilddep = ''
+ ldflags = ' '.join(self.setCompilers.sharedLibraryFlags)
+ cxxflags += ' '+self.headers.toStringNoDupes(self.dinclude+[os.path.join(PETSC_DIR,'include'),os.path.join(PETSC_DIR,PETSC_ARCH,'include')])
+ ldflags += ' '+self.libraries.toStringNoDupes(self.dlib)
+ slepcbuilddep = 'slepc-install slepc-build'
+ oldFlags = self.compilers.CXXPPFLAGS
+ self.compilers.CXXPPFLAGS += ' -I'+incDir
+ self.checkVersion()
+ self.compilers.CXXPPFLAGS = oldFlags
+ # check for Windows-specific define
+ if self.sharedLibraries.getMakeMacro('PETSC_DLL_EXPORTS'):
+ cxxflags += ' -Dpetsc_EXPORTS'
+ # need to explicitly link to PETSc and BLAS on Windows
+ ldflags += ' '+self.libraries.toStringNoDupes([os.path.join(libDir,'libpetsc.'+self.setCompilers.sharedLibraryExt),self.libraries.toStringNoDupes(self.blasLapack.lib)])
+ self.addMakeRule('hpddmbuild',slepcbuilddep,\
+ ['@echo "*** Building and installing HPDDM ***"',\
+ '@${RM} -f ${PETSC_ARCH}/lib/petsc/conf/hpddm.errorflg',\
+ '@'+cxx+' '+cxxflags+' '+os.path.join(self.packageDir,'interface','hpddm_petsc.cpp')+' '+ldflags+' -o '+os.path.join(libDir,'libhpddm_petsc.'+self.setCompilers.sharedLibraryExt)+' > ${PETSC_ARCH}/lib/petsc/conf/hpddm.log 2>&1 || \\\n\
+ (echo "**************************ERROR*************************************" && \\\n\
+ echo "Error building HPDDM. Check ${PETSC_ARCH}/lib/petsc/conf/hpddm.log" && \\\n\
+ echo "********************************************************************" && \\\n\
+ touch '+os.path.join('${PETSC_ARCH}','lib','petsc','conf','hpddm.errorflg')+' && \\\n\
+ exit 1)'])
+ if self.argDB['prefix'] and not 'package-prefix-hash' in self.argDB:
+ self.addMakeRule('hpddm-build','')
+ self.addMakeRule('hpddm-install','hpddmbuild')
+ return self.installDir
else:
- self.logPrintBox('***** WARNING: Skipping PCHPDDM installation,\n\
-remove --with-shared-libraries=0 *****')
+ self.addMakeRule('hpddm-build','hpddmbuild')
+ self.addMakeRule('hpddm-install','')
+ return self.installDir
else:
- self.logPrintBox('***** WARNING: Compiling HPDDM with MPI but no SLEPc,\n\
+ self.logPrintBox('***** WARNING: Skipping PCHPDDM installation,\n\
+remove --with-shared-libraries=0 *****')
+ else:
+ self.logPrintBox('***** WARNING: Compiling HPDDM without SLEPc,\n\
PCHPDDM won\'t be available, unless reconfiguring with --download-slepc *****')
self.addMakeRule('hpddm-build','')
self.addMakeRule('hpddm-install','')
diff --git a/config/BuildSystem/config/packages/slepc.py b/config/BuildSystem/config/packages/slepc.py
index bdf0bbe4be..ec77d1e06a 100644
--- a/config/BuildSystem/config/packages/slepc.py
+++ b/config/BuildSystem/config/packages/slepc.py
@@ -27,6 +27,9 @@ class Configure(config.package.Package):
self.installdir = framework.require('PETSc.options.installDir',self)
self.parch = framework.require('PETSc.options.arch',self)
self.scalartypes = framework.require('PETSc.options.scalarTypes',self)
+ self.cuda = framework.require('config.packages.cuda',self)
+ self.thrust = framework.require('config.packages.thrust',self)
+ self.odeps = [self.cuda,self.thrust]
return

def Install(self):
@@ -51,6 +54,8 @@ class Configure(config.package.Package):
else:
configargs = ''

+ self.include = [os.path.join(prefix,'include')]
+ self.lib = [os.path.join(prefix,'lib','libslepc.'+self.setCompilers.sharedLibraryExt)]
self.addDefine('HAVE_SLEPC',1)
self.addMakeMacro('SLEPC','yes')
self.addMakeRule('slepcbuild','', \
17 changes: 0 additions & 17 deletions 3rdparty/ff-petsc/petsc-metis.patch

This file was deleted.

Loading

0 comments on commit 9b88bed

Please sign in to comment.