From 83fea631f1765d4641cde8af2c5c931b22e4ee33 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 22 Mar 2016 23:04:17 +0100 Subject: [PATCH 01/43] extend trilinos --- .../builtin/packages/trilinos/package.py | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index edc40476e3..22c7ab6d61 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -1,5 +1,5 @@ from spack import * - +import os class Trilinos(Package): """ @@ -10,6 +10,7 @@ class Trilinos(Package): homepage = "https://trilinos.org/" url = "http://trilinos.csbsju.edu/download/files/trilinos-12.2.1-Source.tar.gz" + version('12.6.1', 'adcf2d3aab74cdda98f88fee19cd1442604199b0515ee3da4d80cbe8f37d00e4') version('12.4.2', '7c830f7f0f68b8ad324690603baf404e') version('12.2.1', '6161926ea247863c690e927687f83be9') version('12.0.1', 'bd99741d047471e127b8296b2ec08017') @@ -39,15 +40,38 @@ def install(self, spec, prefix): options.extend(std_cmake_args) options.extend(['-DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON', + '-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON', '-DTrilinos_ENABLE_TESTS:BOOL=OFF', '-DTrilinos_ENABLE_EXAMPLES:BOOL=OFF', '-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'), '-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if '+shared' in spec else 'OFF'), - '-DTPL_ENABLE_MPI:STRING=ON', - '-DBLAS_LIBRARY_DIRS:PATH=%s' % spec['blas'].prefix, - '-DLAPACK_LIBRARY_DIRS:PATH=%s' % spec['lapack'].prefix + '-DTPL_ENABLE_MPI:BOOL=ON', + '-DMPI_BASE_DIR:PATH=%s' % spec['mpi'].prefix, + '-DTPL_ENABLE_BLAS=ON', + '-DBLAS_LIBRARY_NAMES=blas', + '-DBLAS_LIBRARY_DIRS=/usr/lib', # % spec['blas'].prefix, + '-DTPL_ENABLE_LAPACK=ON', + '-DLAPACK_LIBRARY_NAMES=lapack', + '-DLAPACK_LIBRARY_DIRS=/usr/lib', # % spec['lapack'].prefix, + '-DTPL_ENABLE_Boost:BOOL=ON', + '-DBOOST_BASE_DIR:PATH=%s' % spec['boost'].prefix, + '-DTrilinos_ENABLE_Fortran=OFF', + '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', + '-DTrilinos_ENABLE_CXX11:BOOL=ON', + '-DTrilinos_CXX11_FLAGS=-std=c++11' ]) + # disable due to compiler / config errors: + options.extend(['-DTrilinos_ENABLE_SEACAS=OFF', + '-DTrilinos_ENABLE_Pike=OFF', + '-DTrilinos_ENABLE_STK=OFF' + ]) + + if self.compiler.name == "clang": + os.environ['CPPFLAGS']="-Qunused-arguments" + + #os.environ['LDFLAGS']="lgfortran" + with working_dir('spack-build', create=True): cmake('..', *options) make() From 30ba96e58fe699e92902ce53a87b5e1cfb756d6f Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 22 Mar 2016 23:56:18 +0100 Subject: [PATCH 02/43] same --- .../builtin/packages/trilinos/package.py | 84 ++++++++++++++++--- 1 file changed, 74 insertions(+), 10 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 22c7ab6d61..7b913031e3 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -2,8 +2,7 @@ import os class Trilinos(Package): - """ - The Trilinos Project is an effort to develop algorithms and enabling technologies within an object-oriented + """The Trilinos Project is an effort to develop algorithms and enabling technologies within an object-oriented software framework for the solution of large-scale, complex multi-physics engineering and scientific problems. A unique design feature of Trilinos is its focus on packages. """ @@ -28,10 +27,19 @@ class Trilinos(Package): depends_on('matio') depends_on('glm') depends_on('swig') + depends_on('metis') + depends_on('suite-sparse') + depends_on('tbb') # MPI related dependencies depends_on('mpi') depends_on('netcdf+mpi') + depends_on('parmetis') + depends_on('mumps+metis+parmetis') + depends_on('scalapack') + depends_on('superlu-dist') + depends_on('hypre') + depends_on('hdf5+mpi') depends_on('python') # Needs py-numpy activated @@ -49,23 +57,79 @@ def install(self, spec, prefix): '-DMPI_BASE_DIR:PATH=%s' % spec['mpi'].prefix, '-DTPL_ENABLE_BLAS=ON', '-DBLAS_LIBRARY_NAMES=blas', - '-DBLAS_LIBRARY_DIRS=/usr/lib', # % spec['blas'].prefix, + '-DBLAS_LIBRARY_DIRS=/usr/lib', # % spec['blas'].prefix, #FIXME '-DTPL_ENABLE_LAPACK=ON', '-DLAPACK_LIBRARY_NAMES=lapack', - '-DLAPACK_LIBRARY_DIRS=/usr/lib', # % spec['lapack'].prefix, + '-DLAPACK_LIBRARY_DIRS=/usr/lib', # % spec['lapack'].prefix, #FIXME '-DTPL_ENABLE_Boost:BOOL=ON', '-DBOOST_BASE_DIR:PATH=%s' % spec['boost'].prefix, - '-DTrilinos_ENABLE_Fortran=OFF', + '-DTrilinos_ENABLE_Fortran=OFF', # FIXME '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', '-DTrilinos_ENABLE_CXX11:BOOL=ON', - '-DTrilinos_CXX11_FLAGS=-std=c++11' + '-DTrilinos_CXX11_FLAGS=-std=c++11', + '-DTPL_ENABLE_Netcdf:BOOL=ON', + '-DTPL_ENABLE_HYPRE:BOOL=ON', + '-DTPL_ENABLE_HDF5:BOOL=ON', + '-DTPL_ENABLE_TBB:BOOL=ON' ]) + # Amesos, conflicting types of double and complex SLU_D + # see https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html + # and https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html + options.extend([ + '-DTeuchos_ENABLE_COMPLEX:BOOL=OFF', + '-DKokkosTSQR_ENABLE_Complex:BOOL=OFF' + ]) + + # suite-sparse related + options.extend([ + '-DTPL_ENABLE_Cholmod:BOOL=ON', + '-DTPL_ENABLE_UMFPACK:BOOL=ON', + '-DUMFPACK_LIBRARY_NAMES=umfpack;amd;colamd;cholmod;suitesparseconfig' + ]) + + # metis / parmetis + options.extend([ + '-DTPL_ENABLE_METIS:BOOL=ON', + '-DMETIS_LIBRARY_DIRS=%s' % spec['metis'].prefix.lib, + '-DMETIS_LIBRARY_NAMES=metis', + '-DTPL_METIS_INCLUDE_DIRS=%s' % spec['metis'].prefix.include, + '-DTPL_ENABLE_ParMETIS:BOOL=ON', + '-DParMETIS_LIBRARY_DIRS=%s;%s' % (spec['parmetis'].prefix.lib,spec['metis'].prefix.lib), + '-DParMETIS_LIBRARY_NAMES=parmetis;metis', + '-DTPL_ParMETIS_INCLUDE_DIRS=%s' % spec['parmetis'].prefix.include + ]) + + # mumps + options.extend([ + '-DTPL_ENABLE_MUMPS:BOOL=ON"', + '-DMUMPS_LIBRARY_DIRS=%s' % spec['mumps'].prefix.lib, + '-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord' # order is important! + ]) + + # scalapack + options.extend([ + '-DTPL_ENABLE_SCALAPACK:BOOL=ON', + '-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64 + ]) + + # superlu_dist + options.extend([ + '-DTPL_ENABLE_SuperLUDist:BOOL=ON', + '-DSuperLUDist_INCLUDE_DIRS=%s' % spec['superlu_dist'].prefix.include + ]) + if spec.satisfies('^superlu-dist@4.0:'): + options.extend([ + '-DHAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG:BOOL=ON' + ]) + + # disable due to compiler / config errors: - options.extend(['-DTrilinos_ENABLE_SEACAS=OFF', - '-DTrilinos_ENABLE_Pike=OFF', - '-DTrilinos_ENABLE_STK=OFF' - ]) + options.extend([ + '-DTrilinos_ENABLE_SEACAS=OFF', + '-DTrilinos_ENABLE_Pike=OFF', + '-DTrilinos_ENABLE_STK=OFF' + ]) if self.compiler.name == "clang": os.environ['CPPFLAGS']="-Qunused-arguments" From 76006fc346c7880b03356c1cf9d00bab2fdeac45 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 05:30:48 +0100 Subject: [PATCH 03/43] fix typo --- var/spack/repos/builtin/packages/trilinos/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 7b913031e3..7d7613d2b5 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -116,7 +116,7 @@ def install(self, spec, prefix): # superlu_dist options.extend([ '-DTPL_ENABLE_SuperLUDist:BOOL=ON', - '-DSuperLUDist_INCLUDE_DIRS=%s' % spec['superlu_dist'].prefix.include + '-DSuperLUDist_INCLUDE_DIRS=%s' % spec['superlu-dist'].prefix.include ]) if spec.satisfies('^superlu-dist@4.0:'): options.extend([ From 18db930866b2024b242ea7c825851d7a56b27247 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 07:09:58 +0100 Subject: [PATCH 04/43] rearrange --- .../repos/builtin/packages/trilinos/package.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 7d7613d2b5..063d179c7e 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -73,14 +73,6 @@ def install(self, spec, prefix): '-DTPL_ENABLE_TBB:BOOL=ON' ]) - # Amesos, conflicting types of double and complex SLU_D - # see https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html - # and https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html - options.extend([ - '-DTeuchos_ENABLE_COMPLEX:BOOL=OFF', - '-DKokkosTSQR_ENABLE_Complex:BOOL=OFF' - ]) - # suite-sparse related options.extend([ '-DTPL_ENABLE_Cholmod:BOOL=ON', @@ -113,7 +105,14 @@ def install(self, spec, prefix): '-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64 ]) - # superlu_dist + # superlu_dist: + # Amesos, conflicting types of double and complex SLU_D + # see https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html + # and https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html + options.extend([ + '-DTeuchos_ENABLE_COMPLEX:BOOL=OFF', + '-DKokkosTSQR_ENABLE_Complex:BOOL=OFF' + ]) options.extend([ '-DTPL_ENABLE_SuperLUDist:BOOL=ON', '-DSuperLUDist_INCLUDE_DIRS=%s' % spec['superlu-dist'].prefix.include @@ -123,7 +122,6 @@ def install(self, spec, prefix): '-DHAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG:BOOL=ON' ]) - # disable due to compiler / config errors: options.extend([ '-DTrilinos_ENABLE_SEACAS=OFF', From b91a155e8d996c9e51da7f75d4e106469ba488e6 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 07:10:31 +0100 Subject: [PATCH 05/43] more specific about dependencies --- var/spack/repos/builtin/packages/trilinos/package.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 063d179c7e..2937ed4c38 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -62,7 +62,7 @@ def install(self, spec, prefix): '-DLAPACK_LIBRARY_NAMES=lapack', '-DLAPACK_LIBRARY_DIRS=/usr/lib', # % spec['lapack'].prefix, #FIXME '-DTPL_ENABLE_Boost:BOOL=ON', - '-DBOOST_BASE_DIR:PATH=%s' % spec['boost'].prefix, + '-DBoost_BASE_DIR:PATH=%s' % spec['boost'].prefix, '-DTrilinos_ENABLE_Fortran=OFF', # FIXME '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', '-DTrilinos_ENABLE_CXX11:BOOL=ON', @@ -76,7 +76,9 @@ def install(self, spec, prefix): # suite-sparse related options.extend([ '-DTPL_ENABLE_Cholmod:BOOL=ON', + '-DCholmod_BASE_DIR:PATH=%s' % spec['suite-sparse'].prefix, '-DTPL_ENABLE_UMFPACK:BOOL=ON', + '-D_UMFPACK_BASE_DIR:PATH=%s' % spec['suite-sparse'].prefix, '-DUMFPACK_LIBRARY_NAMES=umfpack;amd;colamd;cholmod;suitesparseconfig' ]) @@ -94,7 +96,7 @@ def install(self, spec, prefix): # mumps options.extend([ - '-DTPL_ENABLE_MUMPS:BOOL=ON"', + '-DTPL_ENABLE_MUMPS:BOOL=ON', '-DMUMPS_LIBRARY_DIRS=%s' % spec['mumps'].prefix.lib, '-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord' # order is important! ]) @@ -115,6 +117,7 @@ def install(self, spec, prefix): ]) options.extend([ '-DTPL_ENABLE_SuperLUDist:BOOL=ON', + '-DSuperLUDist_BASE_DIR:PATH=%s' % spec['superlu-dist'].prefix, '-DSuperLUDist_INCLUDE_DIRS=%s' % spec['superlu-dist'].prefix.include ]) if spec.satisfies('^superlu-dist@4.0:'): From b6a35716ce3e02e1a3661e2433986ad637b65d0c Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 07:33:28 +0100 Subject: [PATCH 06/43] same --- var/spack/repos/builtin/packages/trilinos/package.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 2937ed4c38..b31cf880bc 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -43,6 +43,8 @@ class Trilinos(Package): depends_on('python') # Needs py-numpy activated + patch('umfpack_from_suitesparse.patch') + def install(self, spec, prefix): options = [] options.extend(std_cmake_args) @@ -76,9 +78,11 @@ def install(self, spec, prefix): # suite-sparse related options.extend([ '-DTPL_ENABLE_Cholmod:BOOL=ON', - '-DCholmod_BASE_DIR:PATH=%s' % spec['suite-sparse'].prefix, + '-DCholmod_LIBRARY_DIRS=%s' % spec['suite-sparse'].prefix.lib, + '-DCholmod_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include, '-DTPL_ENABLE_UMFPACK:BOOL=ON', - '-D_UMFPACK_BASE_DIR:PATH=%s' % spec['suite-sparse'].prefix, + '-D_UMFPACK_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib, + '-D_UMFPACK_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include, '-DUMFPACK_LIBRARY_NAMES=umfpack;amd;colamd;cholmod;suitesparseconfig' ]) @@ -117,7 +121,7 @@ def install(self, spec, prefix): ]) options.extend([ '-DTPL_ENABLE_SuperLUDist:BOOL=ON', - '-DSuperLUDist_BASE_DIR:PATH=%s' % spec['superlu-dist'].prefix, + '-DSuperLUDist_LIBRARY_DIRS=%s' % spec['superlu-dist'].prefix.lib, '-DSuperLUDist_INCLUDE_DIRS=%s' % spec['superlu-dist'].prefix.include ]) if spec.satisfies('^superlu-dist@4.0:'): From 45b4895888a2abb3cf11ecf2b26b7940a9f89b5a Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 07:34:22 +0100 Subject: [PATCH 07/43] patch --- .../packages/trilinos/umfpack_from_suitesparse.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 var/spack/repos/builtin/packages/trilinos/umfpack_from_suitesparse.patch diff --git a/var/spack/repos/builtin/packages/trilinos/umfpack_from_suitesparse.patch b/var/spack/repos/builtin/packages/trilinos/umfpack_from_suitesparse.patch new file mode 100644 index 0000000000..9defc55527 --- /dev/null +++ b/var/spack/repos/builtin/packages/trilinos/umfpack_from_suitesparse.patch @@ -0,0 +1,12 @@ +diff --git a/cmake/TPLs/FindTPLUMFPACK.cmake b/cmake/TPLs/FindTPLUMFPACK.cmake +index 963eb71..998cd02 100644 +--- a/cmake/TPLs/FindTPLUMFPACK.cmake ++++ b/cmake/TPLs/FindTPLUMFPACK.cmake +@@ -55,6 +55,6 @@ + + + TRIBITS_TPL_FIND_INCLUDE_DIRS_AND_LIBRARIES( UMFPACK +- REQUIRED_HEADERS umfpack.h amd.h UFconfig.h ++ REQUIRED_HEADERS umfpack.h amd.h SuiteSparse_config.h + REQUIRED_LIBS_NAMES umfpack amd + ) From bc3314a57d43963416f709a94967ae8e1758c458 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 08:05:18 +0100 Subject: [PATCH 08/43] more and more --- .../repos/builtin/packages/trilinos/package.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index b31cf880bc..77ae6f818d 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -64,7 +64,8 @@ def install(self, spec, prefix): '-DLAPACK_LIBRARY_NAMES=lapack', '-DLAPACK_LIBRARY_DIRS=/usr/lib', # % spec['lapack'].prefix, #FIXME '-DTPL_ENABLE_Boost:BOOL=ON', - '-DBoost_BASE_DIR:PATH=%s' % spec['boost'].prefix, + '-DBoost_INCLUDE_DIRS:PATH=%s' % spec['boost'].prefix.include, + '-DBoost_LIBRARY_DIRS:PATH=%s' % spec['boost'].prefix.lib, '-DTrilinos_ENABLE_Fortran=OFF', # FIXME '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', '-DTrilinos_ENABLE_CXX11:BOOL=ON', @@ -77,12 +78,13 @@ def install(self, spec, prefix): # suite-sparse related options.extend([ - '-DTPL_ENABLE_Cholmod:BOOL=ON', - '-DCholmod_LIBRARY_DIRS=%s' % spec['suite-sparse'].prefix.lib, - '-DCholmod_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include, + '-DTPL_ENABLE_Cholmod:BOOL=OFF', # FIXME: Trilinos seems to be looking for static libs only, patch CMake TPL file? + #'-DTPL_ENABLE_Cholmod:BOOL=ON', + #'-DCholmod_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib, + #'-DCholmod_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include, '-DTPL_ENABLE_UMFPACK:BOOL=ON', - '-D_UMFPACK_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib, - '-D_UMFPACK_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include, + '-DUMFPACK_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib, + '-DUMFPACK_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include, '-DUMFPACK_LIBRARY_NAMES=umfpack;amd;colamd;cholmod;suitesparseconfig' ]) From 2162627f35f98dc7f07cd34a6593f71d74095955 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 08:13:19 +0100 Subject: [PATCH 09/43] more --- var/spack/repos/builtin/packages/trilinos/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 77ae6f818d..532db69cc2 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -124,7 +124,7 @@ def install(self, spec, prefix): options.extend([ '-DTPL_ENABLE_SuperLUDist:BOOL=ON', '-DSuperLUDist_LIBRARY_DIRS=%s' % spec['superlu-dist'].prefix.lib, - '-DSuperLUDist_INCLUDE_DIRS=%s' % spec['superlu-dist'].prefix.include + '-DSuperLUDist_INCLUDE_DIRS=%s/superlu_dist' % spec['superlu-dist'].prefix.include # superlu_dist and superlu have the same header names :-( In order to avoid conflicts, try to keep "dist" version headers in a subfolder ]) if spec.satisfies('^superlu-dist@4.0:'): options.extend([ From 88a7a23132a379e526220324b8493d3be870f7e6 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 08:46:23 +0100 Subject: [PATCH 10/43] even more --- .../repos/builtin/packages/trilinos/package.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 532db69cc2..13794ae930 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -36,7 +36,7 @@ class Trilinos(Package): depends_on('netcdf+mpi') depends_on('parmetis') depends_on('mumps+metis+parmetis') - depends_on('scalapack') + # depends_on('scalapack') # see FIXME below depends_on('superlu-dist') depends_on('hypre') depends_on('hdf5+mpi') @@ -49,6 +49,7 @@ def install(self, spec, prefix): options = [] options.extend(std_cmake_args) + mpi_bin = spec['mpi'].prefix.bin options.extend(['-DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON', '-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON', '-DTrilinos_ENABLE_TESTS:BOOL=OFF', @@ -73,7 +74,12 @@ def install(self, spec, prefix): '-DTPL_ENABLE_Netcdf:BOOL=ON', '-DTPL_ENABLE_HYPRE:BOOL=ON', '-DTPL_ENABLE_HDF5:BOOL=ON', - '-DTPL_ENABLE_TBB:BOOL=ON' + '-DTPL_ENABLE_TBB:BOOL=ON', + # Need to use MPI wrappers, otherwise: Undefined symbols for architecture x86_64: "_mpi_abort_","_mpi_allgatherv_", etc from MUMPS + '-DCMAKE_C_COMPILER=%s' % join_path(mpi_bin,'mpicc'), # FIXME: dont hardcode compiler name + '-DCMAKE_CXX_COMPILER=%s' % join_path(mpi_bin,'mpicxx'), + '-DCMAKE_Fortran_COMPILER=%s' % join_path(mpi_bin,'mpicxx'), + '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-lgfortran' ]) # suite-sparse related @@ -109,8 +115,8 @@ def install(self, spec, prefix): # scalapack options.extend([ - '-DTPL_ENABLE_SCALAPACK:BOOL=ON', - '-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64 + '-DTPL_ENABLE_SCALAPACK:BOOL=OFF', #FIXME: Undefined symbols for architecture x86_64: "_blacs_gridinfo__", referenced from: Amesos_Scalapack::RedistributeA() in Amesos_Scalapack.cpp.o + #'-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64 ]) # superlu_dist: @@ -141,8 +147,6 @@ def install(self, spec, prefix): if self.compiler.name == "clang": os.environ['CPPFLAGS']="-Qunused-arguments" - #os.environ['LDFLAGS']="lgfortran" - with working_dir('spack-build', create=True): cmake('..', *options) make() From 7e4e2c988ab4e5163469395ace204d9f332a9675 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 08:48:25 +0100 Subject: [PATCH 11/43] minor --- var/spack/repos/builtin/packages/trilinos/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 13794ae930..c915d8eb1a 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -78,7 +78,7 @@ def install(self, spec, prefix): # Need to use MPI wrappers, otherwise: Undefined symbols for architecture x86_64: "_mpi_abort_","_mpi_allgatherv_", etc from MUMPS '-DCMAKE_C_COMPILER=%s' % join_path(mpi_bin,'mpicc'), # FIXME: dont hardcode compiler name '-DCMAKE_CXX_COMPILER=%s' % join_path(mpi_bin,'mpicxx'), - '-DCMAKE_Fortran_COMPILER=%s' % join_path(mpi_bin,'mpicxx'), + '-DCMAKE_Fortran_COMPILER=%s' % join_path(mpi_bin,'mpif90'), '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-lgfortran' ]) From 50e4b609c688b573ef882a079e2d45a83966f94c Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 09:11:26 +0100 Subject: [PATCH 12/43] minor --- var/spack/repos/builtin/packages/trilinos/package.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index c915d8eb1a..3622548ece 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -52,6 +52,7 @@ def install(self, spec, prefix): mpi_bin = spec['mpi'].prefix.bin options.extend(['-DTrilinos_ENABLE_ALL_PACKAGES:BOOL=ON', '-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON', + '-DTrilinos_VERBOSE_CONFIGURE:BOOL=OFF', '-DTrilinos_ENABLE_TESTS:BOOL=OFF', '-DTrilinos_ENABLE_EXAMPLES:BOOL=OFF', '-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'), @@ -145,7 +146,9 @@ def install(self, spec, prefix): ]) if self.compiler.name == "clang": - os.environ['CPPFLAGS']="-Qunused-arguments" + options.extend([ + '-DCMAKE_EXE_LINKER_FLAGS:STRING=-Qunused-arguments' + ]) with working_dir('spack-build', create=True): cmake('..', *options) From 2fb599ea86c82e3395d8402db116a3a25fed0c73 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 09:16:51 +0100 Subject: [PATCH 13/43] minor --- var/spack/repos/builtin/packages/trilinos/package.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 3622548ece..82681e004c 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -55,7 +55,7 @@ def install(self, spec, prefix): '-DTrilinos_VERBOSE_CONFIGURE:BOOL=OFF', '-DTrilinos_ENABLE_TESTS:BOOL=OFF', '-DTrilinos_ENABLE_EXAMPLES:BOOL=OFF', - '-DCMAKE_BUILD_TYPE:STRING=%s' % ('Debug' if '+debug' in spec else 'Release'), + '-DCMAKE_BUILD_TYPE:STRING=%s' % ('DEBUG' if '+debug' in spec else 'RELEASE'), '-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if '+shared' in spec else 'OFF'), '-DTPL_ENABLE_MPI:BOOL=ON', '-DMPI_BASE_DIR:PATH=%s' % spec['mpi'].prefix, @@ -83,6 +83,11 @@ def install(self, spec, prefix): '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-lgfortran' ]) + # for build-debug only: + options.extend([ + '-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE' + ]) + # suite-sparse related options.extend([ '-DTPL_ENABLE_Cholmod:BOOL=OFF', # FIXME: Trilinos seems to be looking for static libs only, patch CMake TPL file? From eb5b0767aa20b46932c36203595c124b7463a444 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 09:45:33 +0100 Subject: [PATCH 14/43] remove gfortran as we have libnotfound... --- var/spack/repos/builtin/packages/trilinos/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 82681e004c..bb6f095190 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -80,7 +80,7 @@ def install(self, spec, prefix): '-DCMAKE_C_COMPILER=%s' % join_path(mpi_bin,'mpicc'), # FIXME: dont hardcode compiler name '-DCMAKE_CXX_COMPILER=%s' % join_path(mpi_bin,'mpicxx'), '-DCMAKE_Fortran_COMPILER=%s' % join_path(mpi_bin,'mpif90'), - '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-lgfortran' + # '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-lgfortran' # FIXME ]) # for build-debug only: From 7897f10126f0f8389326c9e723d73021f654ea6a Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 13:04:43 +0100 Subject: [PATCH 15/43] fiddle with fortran --- .../builtin/packages/trilinos/package.py | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index bb6f095190..f6f24e967e 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -68,7 +68,7 @@ def install(self, spec, prefix): '-DTPL_ENABLE_Boost:BOOL=ON', '-DBoost_INCLUDE_DIRS:PATH=%s' % spec['boost'].prefix.include, '-DBoost_LIBRARY_DIRS:PATH=%s' % spec['boost'].prefix.lib, - '-DTrilinos_ENABLE_Fortran=OFF', # FIXME + # '-DTrilinos_ENABLE_Fortran=OFF', # FIXME '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', '-DTrilinos_ENABLE_CXX11:BOOL=ON', '-DTrilinos_CXX11_FLAGS=-std=c++11', @@ -79,10 +79,17 @@ def install(self, spec, prefix): # Need to use MPI wrappers, otherwise: Undefined symbols for architecture x86_64: "_mpi_abort_","_mpi_allgatherv_", etc from MUMPS '-DCMAKE_C_COMPILER=%s' % join_path(mpi_bin,'mpicc'), # FIXME: dont hardcode compiler name '-DCMAKE_CXX_COMPILER=%s' % join_path(mpi_bin,'mpicxx'), - '-DCMAKE_Fortran_COMPILER=%s' % join_path(mpi_bin,'mpif90'), - # '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-lgfortran' # FIXME + '-DCMAKE_Fortran_COMPILER=%s' % join_path(mpi_bin,'mpif90') ]) + # Fortran lib + libgfortran = os.path.dirname (os.popen('%s --print-file-name libgfortran.a' % join_path(mpi_bin,'mpif90') ).read()) + #os.environ['LDFLAGS'] = '-L%s -lgfortran' % libgfortran + options.extend([ + '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-lgfortran', + '-DCMAKE_EXE_LINKER_FLAGS:STRING=-L%s -lgfortran' % libgfortran + ]) + # for build-debug only: options.extend([ '-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE' @@ -150,10 +157,10 @@ def install(self, spec, prefix): '-DTrilinos_ENABLE_STK=OFF' ]) - if self.compiler.name == "clang": - options.extend([ - '-DCMAKE_EXE_LINKER_FLAGS:STRING=-Qunused-arguments' - ]) + #if self.compiler.name == "clang": + # options.extend([ + # '-DCMAKE_EXE_LINKER_FLAGS:STRING=-Qunused-arguments' + # ]) with working_dir('spack-build', create=True): cmake('..', *options) From fade526ae4e748a9454fd56c07ef7bc1fca38423 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 16:58:59 +0100 Subject: [PATCH 16/43] remove tbb --- var/spack/repos/builtin/packages/trilinos/package.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index f6f24e967e..12212360a0 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -29,7 +29,6 @@ class Trilinos(Package): depends_on('swig') depends_on('metis') depends_on('suite-sparse') - depends_on('tbb') # MPI related dependencies depends_on('mpi') @@ -75,7 +74,6 @@ def install(self, spec, prefix): '-DTPL_ENABLE_Netcdf:BOOL=ON', '-DTPL_ENABLE_HYPRE:BOOL=ON', '-DTPL_ENABLE_HDF5:BOOL=ON', - '-DTPL_ENABLE_TBB:BOOL=ON', # Need to use MPI wrappers, otherwise: Undefined symbols for architecture x86_64: "_mpi_abort_","_mpi_allgatherv_", etc from MUMPS '-DCMAKE_C_COMPILER=%s' % join_path(mpi_bin,'mpicc'), # FIXME: dont hardcode compiler name '-DCMAKE_CXX_COMPILER=%s' % join_path(mpi_bin,'mpicxx'), From e51fe2934e0189aa5c33c8663819d23e7706f809 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 17:38:36 +0100 Subject: [PATCH 17/43] fiddle more --- var/spack/repos/builtin/packages/trilinos/package.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 12212360a0..fb14e1f36c 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -67,7 +67,6 @@ def install(self, spec, prefix): '-DTPL_ENABLE_Boost:BOOL=ON', '-DBoost_INCLUDE_DIRS:PATH=%s' % spec['boost'].prefix.include, '-DBoost_LIBRARY_DIRS:PATH=%s' % spec['boost'].prefix.lib, - # '-DTrilinos_ENABLE_Fortran=OFF', # FIXME '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', '-DTrilinos_ENABLE_CXX11:BOOL=ON', '-DTrilinos_CXX11_FLAGS=-std=c++11', @@ -82,10 +81,9 @@ def install(self, spec, prefix): # Fortran lib libgfortran = os.path.dirname (os.popen('%s --print-file-name libgfortran.a' % join_path(mpi_bin,'mpif90') ).read()) - #os.environ['LDFLAGS'] = '-L%s -lgfortran' % libgfortran options.extend([ - '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-lgfortran', - '-DCMAKE_EXE_LINKER_FLAGS:STRING=-L%s -lgfortran' % libgfortran + '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-L%s/ -lgfortran' % libgfortran, + '-DTrilinos_ENABLE_Fortran=OFF' # FIXME: otherwise VerifyFortranC fails as it does not contain -lgfortran , issues with IMPLICIT_LINK_LIBRARIES in CMakeFiles/CMake(C|CXX|Fortran)Compiler.cmake? ]) # for build-debug only: @@ -155,11 +153,6 @@ def install(self, spec, prefix): '-DTrilinos_ENABLE_STK=OFF' ]) - #if self.compiler.name == "clang": - # options.extend([ - # '-DCMAKE_EXE_LINKER_FLAGS:STRING=-Qunused-arguments' - # ]) - with working_dir('spack-build', create=True): cmake('..', *options) make() From 3f12a51759fcdd3b11867cb849fc2aa81a4941ef Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 23 Mar 2016 19:35:49 +0100 Subject: [PATCH 18/43] keep fiddling --- .../repos/builtin/packages/trilinos/package.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index fb14e1f36c..cdc2bf2379 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -1,6 +1,11 @@ from spack import * import os +# Trilinos is complicated to build, as an inspiration a couple of links to other repositories which build it: +# https://github.com/hpcugent/easybuild-easyblocks/blob/master/easybuild/easyblocks/t/trilinos.py#L111 +# https://github.com/koecher/candi/blob/master/deal.II-toolchain/packages/trilinos.package +# https://gitlab.com/configurations/cluster-config/blob/master/trilinos.sh +# https://github.com/Homebrew/homebrew-science/blob/master/trilinos.rb class Trilinos(Package): """The Trilinos Project is an effort to develop algorithms and enabling technologies within an object-oriented software framework for the solution of large-scale, complex multi-physics engineering and scientific problems. @@ -59,11 +64,11 @@ def install(self, spec, prefix): '-DTPL_ENABLE_MPI:BOOL=ON', '-DMPI_BASE_DIR:PATH=%s' % spec['mpi'].prefix, '-DTPL_ENABLE_BLAS=ON', - '-DBLAS_LIBRARY_NAMES=blas', - '-DBLAS_LIBRARY_DIRS=/usr/lib', # % spec['blas'].prefix, #FIXME + '-DBLAS_LIBRARY_NAMES=blas', # FIXME: for Intel, Clang+GNU, GNU; easybuild add gfortran here... + '-DBLAS_LIBRARY_DIRS=%s' % spec['blas'].prefix.lib, '-DTPL_ENABLE_LAPACK=ON', '-DLAPACK_LIBRARY_NAMES=lapack', - '-DLAPACK_LIBRARY_DIRS=/usr/lib', # % spec['lapack'].prefix, #FIXME + '-DLAPACK_LIBRARY_DIRS=%s' % spec['lapack'].prefix, '-DTPL_ENABLE_Boost:BOOL=ON', '-DBoost_INCLUDE_DIRS:PATH=%s' % spec['boost'].prefix.include, '-DBoost_LIBRARY_DIRS:PATH=%s' % spec['boost'].prefix.lib, @@ -74,9 +79,9 @@ def install(self, spec, prefix): '-DTPL_ENABLE_HYPRE:BOOL=ON', '-DTPL_ENABLE_HDF5:BOOL=ON', # Need to use MPI wrappers, otherwise: Undefined symbols for architecture x86_64: "_mpi_abort_","_mpi_allgatherv_", etc from MUMPS - '-DCMAKE_C_COMPILER=%s' % join_path(mpi_bin,'mpicc'), # FIXME: dont hardcode compiler name - '-DCMAKE_CXX_COMPILER=%s' % join_path(mpi_bin,'mpicxx'), - '-DCMAKE_Fortran_COMPILER=%s' % join_path(mpi_bin,'mpif90') + #'-DCMAKE_C_COMPILER=%s' % join_path(mpi_bin,'mpicc'), # FIXME: dont hardcode compiler name + #'-DCMAKE_CXX_COMPILER=%s' % join_path(mpi_bin,'mpicxx'), + #'-DCMAKE_Fortran_COMPILER=%s' % join_path(mpi_bin,'mpif90') ]) # Fortran lib From 8c9f88761384d16c77aa9cbee55cc501712c7b12 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 24 Mar 2016 12:45:43 +0100 Subject: [PATCH 19/43] finally builds --- var/spack/repos/builtin/packages/trilinos/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index cdc2bf2379..b80123838a 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -39,7 +39,7 @@ class Trilinos(Package): depends_on('mpi') depends_on('netcdf+mpi') depends_on('parmetis') - depends_on('mumps+metis+parmetis') + depends_on('mumps+metis+parmetis+shared') # build errors with static libs # depends_on('scalapack') # see FIXME below depends_on('superlu-dist') depends_on('hypre') From df995c4ef850338823b3a5a5c2ee3b12e05a33b1 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 24 Mar 2016 12:57:22 +0100 Subject: [PATCH 20/43] minor cleanup --- .../repos/builtin/packages/trilinos/package.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index b80123838a..f2e9c37caa 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -77,24 +77,20 @@ def install(self, spec, prefix): '-DTrilinos_CXX11_FLAGS=-std=c++11', '-DTPL_ENABLE_Netcdf:BOOL=ON', '-DTPL_ENABLE_HYPRE:BOOL=ON', - '-DTPL_ENABLE_HDF5:BOOL=ON', - # Need to use MPI wrappers, otherwise: Undefined symbols for architecture x86_64: "_mpi_abort_","_mpi_allgatherv_", etc from MUMPS - #'-DCMAKE_C_COMPILER=%s' % join_path(mpi_bin,'mpicc'), # FIXME: dont hardcode compiler name - #'-DCMAKE_CXX_COMPILER=%s' % join_path(mpi_bin,'mpicxx'), - #'-DCMAKE_Fortran_COMPILER=%s' % join_path(mpi_bin,'mpif90') + '-DTPL_ENABLE_HDF5:BOOL=ON' ]) # Fortran lib libgfortran = os.path.dirname (os.popen('%s --print-file-name libgfortran.a' % join_path(mpi_bin,'mpif90') ).read()) options.extend([ '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-L%s/ -lgfortran' % libgfortran, - '-DTrilinos_ENABLE_Fortran=OFF' # FIXME: otherwise VerifyFortranC fails as it does not contain -lgfortran , issues with IMPLICIT_LINK_LIBRARIES in CMakeFiles/CMake(C|CXX|Fortran)Compiler.cmake? + '-DTrilinos_ENABLE_Fortran=OFF' # FIXME: otherwise CMake's VerifyFortranC fails as it does not contain -lgfortran ]) # for build-debug only: - options.extend([ - '-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE' - ]) + # options.extend([ + # '-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE' + # ]) # suite-sparse related options.extend([ From 0fc9326a4cc742e7a06cc1bb4192d0dfd008880d Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 24 Mar 2016 13:23:56 +0100 Subject: [PATCH 21/43] add variants --- .../builtin/packages/trilinos/package.py | 111 +++++++++++------- 1 file changed, 69 insertions(+), 42 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index f2e9c37caa..2e119581e1 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -22,8 +22,15 @@ class Trilinos(Package): version('11.14.2', 'a43590cf896c677890d75bfe75bc6254') version('11.14.1', '40febc57f76668be8b6a77b7607bb67f') - variant('shared', default=True, description='Enables the build of shared libraries') - variant('debug', default=False, description='Builds a debug version of the libraries') + variant('metis', default=True, description='Compile with METIS') + variant('parmetis', default=True, description='Compile with ParMETIS') + variant('mumps', default=True, description='Compile with support for MUMPS solvers') + variant('superlu-dist', default=True, description='Compile with SuperluDist solvers') + variant('hypre', default=True, description='Compile with Hypre preconditioner') + variant('hdf5', default=True, description='Compile with HDF5') + variant('suite-sparse', default=True, description='Compile with SuiteSparse solvers') + variant('shared', default=True, description='Enables the build of shared libraries') + variant('debug', default=False, description='Builds a debug version of the libraries') # Everything should be compiled with -fpic depends_on('blas') @@ -49,7 +56,23 @@ class Trilinos(Package): patch('umfpack_from_suitesparse.patch') + # check that the combination of variants makes sense + def variants_check(self): + if '+parmetis' in self.spec and '+metis' not in self.spec: + raise RuntimeError('You cannot use the variant parmetis without metis') + + if '+mumps' in self.spec and '+parmetis' not in self.spec: + raise RuntimeError('You cannot use the variant mumps without parmetis') + + if '+superlu-dist' in self.spec and self.spec.satisfies('@:11.4.3'): + # For Trilinos v11 we need to force SuperLUDist=OFF, + # since only the deprecated SuperLUDist v3.3 together with an Amesos patch + # is working. + raise RuntimeError('The superlu-dist variant can only be used with Trilinos @12.0.1:') + def install(self, spec, prefix): + self.variants_check() + options = [] options.extend(std_cmake_args) @@ -93,35 +116,38 @@ def install(self, spec, prefix): # ]) # suite-sparse related - options.extend([ - '-DTPL_ENABLE_Cholmod:BOOL=OFF', # FIXME: Trilinos seems to be looking for static libs only, patch CMake TPL file? - #'-DTPL_ENABLE_Cholmod:BOOL=ON', - #'-DCholmod_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib, - #'-DCholmod_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include, - '-DTPL_ENABLE_UMFPACK:BOOL=ON', - '-DUMFPACK_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib, - '-DUMFPACK_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include, - '-DUMFPACK_LIBRARY_NAMES=umfpack;amd;colamd;cholmod;suitesparseconfig' - ]) + if '+suite-sparse' in spec: + options.extend([ + '-DTPL_ENABLE_Cholmod:BOOL=OFF', # FIXME: Trilinos seems to be looking for static libs only, patch CMake TPL file? + #'-DTPL_ENABLE_Cholmod:BOOL=ON', + #'-DCholmod_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib, + #'-DCholmod_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include, + '-DTPL_ENABLE_UMFPACK:BOOL=ON', + '-DUMFPACK_LIBRARY_DIRS:PATH=%s' % spec['suite-sparse'].prefix.lib, + '-DUMFPACK_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include, + '-DUMFPACK_LIBRARY_NAMES=umfpack;amd;colamd;cholmod;suitesparseconfig' + ]) # metis / parmetis - options.extend([ - '-DTPL_ENABLE_METIS:BOOL=ON', - '-DMETIS_LIBRARY_DIRS=%s' % spec['metis'].prefix.lib, - '-DMETIS_LIBRARY_NAMES=metis', - '-DTPL_METIS_INCLUDE_DIRS=%s' % spec['metis'].prefix.include, - '-DTPL_ENABLE_ParMETIS:BOOL=ON', - '-DParMETIS_LIBRARY_DIRS=%s;%s' % (spec['parmetis'].prefix.lib,spec['metis'].prefix.lib), - '-DParMETIS_LIBRARY_NAMES=parmetis;metis', - '-DTPL_ParMETIS_INCLUDE_DIRS=%s' % spec['parmetis'].prefix.include - ]) + if '+parmetis' in spec: # metis is required, see variants_check() + options.extend([ + '-DTPL_ENABLE_METIS:BOOL=ON', + '-DMETIS_LIBRARY_DIRS=%s' % spec['metis'].prefix.lib, + '-DMETIS_LIBRARY_NAMES=metis', + '-DTPL_METIS_INCLUDE_DIRS=%s' % spec['metis'].prefix.include, + '-DTPL_ENABLE_ParMETIS:BOOL=ON', + '-DParMETIS_LIBRARY_DIRS=%s;%s' % (spec['parmetis'].prefix.lib,spec['metis'].prefix.lib), + '-DParMETIS_LIBRARY_NAMES=parmetis;metis', + '-DTPL_ParMETIS_INCLUDE_DIRS=%s' % spec['parmetis'].prefix.include + ]) # mumps - options.extend([ - '-DTPL_ENABLE_MUMPS:BOOL=ON', - '-DMUMPS_LIBRARY_DIRS=%s' % spec['mumps'].prefix.lib, - '-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord' # order is important! - ]) + if '+mumps' in spec: + options.extend([ + '-DTPL_ENABLE_MUMPS:BOOL=ON', + '-DMUMPS_LIBRARY_DIRS=%s' % spec['mumps'].prefix.lib, + '-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord' # order is important! + ]) # scalapack options.extend([ @@ -129,23 +155,24 @@ def install(self, spec, prefix): #'-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64 ]) - # superlu_dist: - # Amesos, conflicting types of double and complex SLU_D - # see https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html - # and https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html - options.extend([ - '-DTeuchos_ENABLE_COMPLEX:BOOL=OFF', - '-DKokkosTSQR_ENABLE_Complex:BOOL=OFF' - ]) - options.extend([ - '-DTPL_ENABLE_SuperLUDist:BOOL=ON', - '-DSuperLUDist_LIBRARY_DIRS=%s' % spec['superlu-dist'].prefix.lib, - '-DSuperLUDist_INCLUDE_DIRS=%s/superlu_dist' % spec['superlu-dist'].prefix.include # superlu_dist and superlu have the same header names :-( In order to avoid conflicts, try to keep "dist" version headers in a subfolder - ]) - if spec.satisfies('^superlu-dist@4.0:'): + # superlu-dist: + if '+superlu-dist' in spec: + # Amesos, conflicting types of double and complex SLU_D + # see https://trilinos.org/pipermail/trilinos-users/2015-March/004731.html + # and https://trilinos.org/pipermail/trilinos-users/2015-March/004802.html options.extend([ - '-DHAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG:BOOL=ON' + '-DTeuchos_ENABLE_COMPLEX:BOOL=OFF', + '-DKokkosTSQR_ENABLE_Complex:BOOL=OFF' ]) + options.extend([ + '-DTPL_ENABLE_SuperLUDist:BOOL=ON', + '-DSuperLUDist_LIBRARY_DIRS=%s' % spec['superlu-dist'].prefix.lib, + '-DSuperLUDist_INCLUDE_DIRS=%s/superlu_dist' % spec['superlu-dist'].prefix.include # superlu_dist and superlu have the same header names :-( In order to avoid conflicts, try to keep "dist" version headers in a subfolder + ]) + if spec.satisfies('^superlu-dist@4.0:'): + options.extend([ + '-DHAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG:BOOL=ON' + ]) # disable due to compiler / config errors: options.extend([ From 416fcd081013afa8349d311909d50b21d9685674 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 24 Mar 2016 13:33:00 +0100 Subject: [PATCH 22/43] same --- .../repos/builtin/packages/trilinos/package.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 2e119581e1..3beadeb798 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -29,6 +29,7 @@ class Trilinos(Package): variant('hypre', default=True, description='Compile with Hypre preconditioner') variant('hdf5', default=True, description='Compile with HDF5') variant('suite-sparse', default=True, description='Compile with SuiteSparse solvers') + variant('python', default=True, description='Build python wrappers') variant('shared', default=True, description='Enables the build of shared libraries') variant('debug', default=False, description='Builds a debug version of the libraries') @@ -39,20 +40,20 @@ class Trilinos(Package): depends_on('matio') depends_on('glm') depends_on('swig') - depends_on('metis') - depends_on('suite-sparse') + depends_on('metis',when='+metis') + depends_on('suite-sparse',when='+suite-sparse') # MPI related dependencies depends_on('mpi') depends_on('netcdf+mpi') - depends_on('parmetis') - depends_on('mumps+metis+parmetis+shared') # build errors with static libs + depends_on('parmetis',when='+parmetis') + depends_on('mumps+metis+parmetis+shared',when='+mumps') # build errors with static libs # depends_on('scalapack') # see FIXME below - depends_on('superlu-dist') - depends_on('hypre') - depends_on('hdf5+mpi') + depends_on('superlu-dist',when='+superlu-dist') + depends_on('hypre',when='+hypre') + depends_on('hdf5+mpi',when='+hdf5') - depends_on('python') # Needs py-numpy activated + depends_on('python',when='+python') # Needs py-numpy activated patch('umfpack_from_suitesparse.patch') From c33a63cabc8dcd8c71fc87de60a883cef4a4dae2 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 24 Mar 2016 13:47:07 +0100 Subject: [PATCH 23/43] fix python installation --- var/spack/repos/builtin/packages/trilinos/package.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 3beadeb798..886893b639 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -186,3 +186,14 @@ def install(self, spec, prefix): cmake('..', *options) make() make('install') + + # When trilinos is built with Python, libpytrilinos is included through + # cmake configure files. Namely, Trilinos_LIBRARIES in TrilinosConfig.cmake + # contains pytrilinos. This leads to a run-time error: + # Symbol not found: _PyBool_Type + # and prevents Trilinos to be used in any C++ code, which links executable + # against the libraries listed in Trilinos_LIBRARIES. + # See https://github.com/Homebrew/homebrew-science/issues/2148#issuecomment-103614509 + # A workaround it to remove PyTrilinos from the COMPONENTS_LIST : + if '+python' in self.spec: + filter_file(r'(?:SET\(COMPONENTS_LIST.*)(PyTrilinos;)(?:.*)', '', '%s/cmake/Trilinos/TrilinosConfig.cmake' % prefix.lib) From d096b155f45d97775affa2bdda640a22823cb73e Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 24 Mar 2016 19:41:37 +0100 Subject: [PATCH 24/43] fix filter_file --- var/spack/repos/builtin/packages/trilinos/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 886893b639..3967d0ef0e 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -196,4 +196,4 @@ def install(self, spec, prefix): # See https://github.com/Homebrew/homebrew-science/issues/2148#issuecomment-103614509 # A workaround it to remove PyTrilinos from the COMPONENTS_LIST : if '+python' in self.spec: - filter_file(r'(?:SET\(COMPONENTS_LIST.*)(PyTrilinos;)(?:.*)', '', '%s/cmake/Trilinos/TrilinosConfig.cmake' % prefix.lib) + filter_file(r'(SET\(COMPONENTS_LIST.*)(PyTrilinos;)(.*)', (r'\1\3'), '%s/cmake/Trilinos/TrilinosConfig.cmake' % prefix.lib) From 7f2db8c26793abb1977dbccd2ae8a3a1b5a46568 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 25 Mar 2016 11:54:51 +0100 Subject: [PATCH 25/43] fix w GCC 4.8 on Ubuntu but broke w GCC 5.3/Clang on OSX --- .../builtin/packages/trilinos/package.py | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 3967d0ef0e..1f1601e537 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -48,7 +48,7 @@ class Trilinos(Package): depends_on('netcdf+mpi') depends_on('parmetis',when='+parmetis') depends_on('mumps+metis+parmetis+shared',when='+mumps') # build errors with static libs - # depends_on('scalapack') # see FIXME below + depends_on('scalapack') depends_on('superlu-dist',when='+superlu-dist') depends_on('hypre',when='+hypre') depends_on('hdf5+mpi',when='+hdf5') @@ -108,13 +108,13 @@ def install(self, spec, prefix): libgfortran = os.path.dirname (os.popen('%s --print-file-name libgfortran.a' % join_path(mpi_bin,'mpif90') ).read()) options.extend([ '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-L%s/ -lgfortran' % libgfortran, - '-DTrilinos_ENABLE_Fortran=OFF' # FIXME: otherwise CMake's VerifyFortranC fails as it does not contain -lgfortran + '-DTrilinos_ENABLE_Fortran=ON' # FIXME: otherwise CMake's VerifyFortranC fails as it does not contain -lgfortran ]) # for build-debug only: - # options.extend([ - # '-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE' - # ]) + options.extend([ + '-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE' + ]) # suite-sparse related if '+suite-sparse' in spec: @@ -144,16 +144,22 @@ def install(self, spec, prefix): # mumps if '+mumps' in spec: + # FIXME: + # since we use mumps with MPI, it will certainly be build against Scalapack. + # Add scalapack lib here as well. + # This likely won't be need if Trilinos would compile with Scalapack options.extend([ '-DTPL_ENABLE_MUMPS:BOOL=ON', '-DMUMPS_LIBRARY_DIRS=%s' % spec['mumps'].prefix.lib, '-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord' # order is important! +# '-DMUMPS_LIBRARY_DIRS=%s;%s' % (spec['mumps'].prefix.lib,spec['scalapack'].prefix.lib), +# '-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord;scalapack' # order is important! ]) # scalapack options.extend([ - '-DTPL_ENABLE_SCALAPACK:BOOL=OFF', #FIXME: Undefined symbols for architecture x86_64: "_blacs_gridinfo__", referenced from: Amesos_Scalapack::RedistributeA() in Amesos_Scalapack.cpp.o - #'-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64 + '-DTPL_ENABLE_SCALAPACK:BOOL=ON', #FIXME: Undefined symbols for architecture x86_64: "_blacs_gridinfo__", referenced from: Amesos_Scalapack::RedistributeA() in Amesos_Scalapack.cpp.o + '-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64 ]) # superlu-dist: @@ -175,6 +181,12 @@ def install(self, spec, prefix): '-DHAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG:BOOL=ON' ]) + # python + if '~python' in spec: + options.extend([ + '-DTrilinos_ENABLE_PyTrilinos:BOOL=OFF' + ]) + # disable due to compiler / config errors: options.extend([ '-DTrilinos_ENABLE_SEACAS=OFF', From 828aeefb1d4e09deb0694c61397a3097bda85ccb Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 25 Mar 2016 12:01:00 +0100 Subject: [PATCH 26/43] minor cleanup --- var/spack/repos/builtin/packages/trilinos/package.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 1f1601e537..1dba2b8db3 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -88,7 +88,7 @@ def install(self, spec, prefix): '-DTPL_ENABLE_MPI:BOOL=ON', '-DMPI_BASE_DIR:PATH=%s' % spec['mpi'].prefix, '-DTPL_ENABLE_BLAS=ON', - '-DBLAS_LIBRARY_NAMES=blas', # FIXME: for Intel, Clang+GNU, GNU; easybuild add gfortran here... + '-DBLAS_LIBRARY_NAMES=blas', # FIXME: don't hardcode names '-DBLAS_LIBRARY_DIRS=%s' % spec['blas'].prefix.lib, '-DTPL_ENABLE_LAPACK=ON', '-DLAPACK_LIBRARY_NAMES=lapack', @@ -108,7 +108,7 @@ def install(self, spec, prefix): libgfortran = os.path.dirname (os.popen('%s --print-file-name libgfortran.a' % join_path(mpi_bin,'mpif90') ).read()) options.extend([ '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-L%s/ -lgfortran' % libgfortran, - '-DTrilinos_ENABLE_Fortran=ON' # FIXME: otherwise CMake's VerifyFortranC fails as it does not contain -lgfortran + '-DTrilinos_ENABLE_Fortran=ON' ]) # for build-debug only: @@ -144,21 +144,15 @@ def install(self, spec, prefix): # mumps if '+mumps' in spec: - # FIXME: - # since we use mumps with MPI, it will certainly be build against Scalapack. - # Add scalapack lib here as well. - # This likely won't be need if Trilinos would compile with Scalapack options.extend([ '-DTPL_ENABLE_MUMPS:BOOL=ON', '-DMUMPS_LIBRARY_DIRS=%s' % spec['mumps'].prefix.lib, '-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord' # order is important! -# '-DMUMPS_LIBRARY_DIRS=%s;%s' % (spec['mumps'].prefix.lib,spec['scalapack'].prefix.lib), -# '-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord;scalapack' # order is important! ]) # scalapack options.extend([ - '-DTPL_ENABLE_SCALAPACK:BOOL=ON', #FIXME: Undefined symbols for architecture x86_64: "_blacs_gridinfo__", referenced from: Amesos_Scalapack::RedistributeA() in Amesos_Scalapack.cpp.o + '-DTPL_ENABLE_SCALAPACK:BOOL=ON', '-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64 ]) From 21e81e92a9ac88bd498bd65aa9b77a43c27da881 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 25 Mar 2016 12:05:48 +0100 Subject: [PATCH 27/43] try to disable VerifyFortranC tests on Darwin --- var/spack/repos/builtin/packages/trilinos/package.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 1dba2b8db3..0c7d8a7967 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -110,6 +110,13 @@ def install(self, spec, prefix): '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-L%s/ -lgfortran' % libgfortran, '-DTrilinos_ENABLE_Fortran=ON' ]) + # FIXME: + # VerifyFortranC test of CMake does not contain -lgfortran and thus fails. + # This could be GCC/CMake related, but appears at least on OSX with Clang@7.0.2 and GNU Fortran@5.3.0 + if sys.platform == 'darwin': + options.extend([ + '-DTrilinos_SKIP_FORTRANCINTERFACE_VERIFY_TEST:BOOL=TRUE' + ]) # for build-debug only: options.extend([ From 26a72619aed8684019ab331889b276b8883b76c8 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 25 Mar 2016 12:42:26 +0100 Subject: [PATCH 28/43] add missing sys --- var/spack/repos/builtin/packages/trilinos/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 0c7d8a7967..e077dfbbfd 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -1,5 +1,5 @@ from spack import * -import os +import os, sys # Trilinos is complicated to build, as an inspiration a couple of links to other repositories which build it: # https://github.com/hpcugent/easybuild-easyblocks/blob/master/easybuild/easyblocks/t/trilinos.py#L111 From 5172f09b9f966a3f1be438bab972a0267cccc73b Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 25 Mar 2016 16:47:48 +0100 Subject: [PATCH 29/43] builds on OSX again (modulo CC wrappers are solved) --- .../builtin/packages/trilinos/package.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index e077dfbbfd..3003b4ab53 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -113,15 +113,15 @@ def install(self, spec, prefix): # FIXME: # VerifyFortranC test of CMake does not contain -lgfortran and thus fails. # This could be GCC/CMake related, but appears at least on OSX with Clang@7.0.2 and GNU Fortran@5.3.0 - if sys.platform == 'darwin': - options.extend([ - '-DTrilinos_SKIP_FORTRANCINTERFACE_VERIFY_TEST:BOOL=TRUE' - ]) + #if sys.platform == 'darwin': + # options.extend([ + # '-DTrilinos_SKIP_FORTRANCINTERFACE_VERIFY_TEST:BOOL=TRUE' + # ]) # for build-debug only: - options.extend([ - '-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE' - ]) + #options.extend([ + # '-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE' + #]) # suite-sparse related if '+suite-sparse' in spec: @@ -194,6 +194,11 @@ def install(self, spec, prefix): '-DTrilinos_ENABLE_Pike=OFF', '-DTrilinos_ENABLE_STK=OFF' ]) + if sys.platform == 'darwin': + options.extend([ + '-DTrilinos_ENABLE_FEI=OFF' + ]) + with working_dir('spack-build', create=True): cmake('..', *options) From eec50b524bdf9e04f9e3536bc389ce633133373b Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 25 Mar 2016 16:58:14 +0100 Subject: [PATCH 30/43] minor cleanup --- .../builtin/packages/trilinos/package.py | 46 ++++++++++++++----- 1 file changed, 35 insertions(+), 11 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 3003b4ab53..b1caca96ff 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -28,6 +28,7 @@ class Trilinos(Package): variant('superlu-dist', default=True, description='Compile with SuperluDist solvers') variant('hypre', default=True, description='Compile with Hypre preconditioner') variant('hdf5', default=True, description='Compile with HDF5') + variant('scalapack', default=True, description='Compile with Scalapack') variant('suite-sparse', default=True, description='Compile with SuiteSparse solvers') variant('python', default=True, description='Build python wrappers') variant('shared', default=True, description='Enables the build of shared libraries') @@ -110,13 +111,6 @@ def install(self, spec, prefix): '-DTrilinos_EXTRA_LINK_FLAGS:STRING=-L%s/ -lgfortran' % libgfortran, '-DTrilinos_ENABLE_Fortran=ON' ]) - # FIXME: - # VerifyFortranC test of CMake does not contain -lgfortran and thus fails. - # This could be GCC/CMake related, but appears at least on OSX with Clang@7.0.2 and GNU Fortran@5.3.0 - #if sys.platform == 'darwin': - # options.extend([ - # '-DTrilinos_SKIP_FORTRANCINTERFACE_VERIFY_TEST:BOOL=TRUE' - # ]) # for build-debug only: #options.extend([ @@ -135,6 +129,11 @@ def install(self, spec, prefix): '-DUMFPACK_INCLUDE_DIRS:PATH=%s' % spec['suite-sparse'].prefix.include, '-DUMFPACK_LIBRARY_NAMES=umfpack;amd;colamd;cholmod;suitesparseconfig' ]) + else: + options.extend([ + '-DTPL_ENABLE_Cholmod:BOOL=OFF', + '-DTPL_ENABLE_UMFPACK:BOOL=OFF', + ]) # metis / parmetis if '+parmetis' in spec: # metis is required, see variants_check() @@ -148,6 +147,11 @@ def install(self, spec, prefix): '-DParMETIS_LIBRARY_NAMES=parmetis;metis', '-DTPL_ParMETIS_INCLUDE_DIRS=%s' % spec['parmetis'].prefix.include ]) + else: + options.extend([ + '-DTPL_ENABLE_METIS:BOOL=OFF', + '-DTPL_ENABLE_ParMETIS:BOOL=OFF', + ]) # mumps if '+mumps' in spec: @@ -156,12 +160,22 @@ def install(self, spec, prefix): '-DMUMPS_LIBRARY_DIRS=%s' % spec['mumps'].prefix.lib, '-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord' # order is important! ]) + else: + options.extend([ + '-DTPL_ENABLE_MUMPS:BOOL=OFF', + ]) # scalapack - options.extend([ - '-DTPL_ENABLE_SCALAPACK:BOOL=ON', - '-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64 - ]) + if '+scalapack' in spec: + options.extend([ + '-DTPL_ENABLE_SCALAPACK:BOOL=ON', + '-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64 + ]) + else: + options.extend([ + '-DTPL_ENABLE_SCALAPACK:BOOL=OFF', + ]) + # superlu-dist: if '+superlu-dist' in spec: @@ -181,12 +195,22 @@ def install(self, spec, prefix): options.extend([ '-DHAVE_SUPERLUDIST_LUSTRUCTINIT_2ARG:BOOL=ON' ]) + else: + options.extend([ + '-DTPL_ENABLE_SuperLUDist:BOOL=OFF', + ]) + # python if '~python' in spec: options.extend([ '-DTrilinos_ENABLE_PyTrilinos:BOOL=OFF' ]) + else: + options.extend([ + '-DTrilinos_ENABLE_PyTrilinos:BOOL=ON' + ]) + # disable due to compiler / config errors: options.extend([ From 6699399e5191004ed924b9a8916ec1ae61223000 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 25 Mar 2016 17:00:42 +0100 Subject: [PATCH 31/43] add when to depends_on scalapack --- var/spack/repos/builtin/packages/trilinos/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index b1caca96ff..8b66405137 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -49,7 +49,7 @@ class Trilinos(Package): depends_on('netcdf+mpi') depends_on('parmetis',when='+parmetis') depends_on('mumps+metis+parmetis+shared',when='+mumps') # build errors with static libs - depends_on('scalapack') + depends_on('scalapack',when='+scalapack') depends_on('superlu-dist',when='+superlu-dist') depends_on('hypre',when='+hypre') depends_on('hdf5+mpi',when='+hdf5') From f603c82e814ebc59ba03b0b83be86f1a4bfcbd94 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sat, 26 Mar 2016 18:43:55 +0100 Subject: [PATCH 32/43] qualify Amesos link errors --- var/spack/repos/builtin/packages/trilinos/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 8b66405137..0ba7a51b8b 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -48,7 +48,7 @@ class Trilinos(Package): depends_on('mpi') depends_on('netcdf+mpi') depends_on('parmetis',when='+parmetis') - depends_on('mumps+metis+parmetis+shared',when='+mumps') # build errors with static libs + depends_on('mumps+metis+parmetis+shared',when='+mumps') # Amesos link errors with static: "__gfortran_adjustl", referenced from: _dmumps_ in libdmumps.a(dmumps_driver.o) "_mpi_abort_", referenced from: _mumps_abort_ in libmumps_common.a(tools_common.o) depends_on('scalapack',when='+scalapack') depends_on('superlu-dist',when='+superlu-dist') depends_on('hypre',when='+hypre') From 965ce633c311e2bcb765f5e9900f0da6205f9c23 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sat, 26 Mar 2016 18:51:59 +0100 Subject: [PATCH 33/43] cleanup variants --- .../builtin/packages/trilinos/package.py | 40 ++++++------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 0ba7a51b8b..48bffc65e0 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -22,13 +22,11 @@ class Trilinos(Package): version('11.14.2', 'a43590cf896c677890d75bfe75bc6254') version('11.14.1', '40febc57f76668be8b6a77b7607bb67f') - variant('metis', default=True, description='Compile with METIS') - variant('parmetis', default=True, description='Compile with ParMETIS') + variant('metis', default=True, description='Compile with METIS and ParMETIS') variant('mumps', default=True, description='Compile with support for MUMPS solvers') variant('superlu-dist', default=True, description='Compile with SuperluDist solvers') variant('hypre', default=True, description='Compile with Hypre preconditioner') variant('hdf5', default=True, description='Compile with HDF5') - variant('scalapack', default=True, description='Compile with Scalapack') variant('suite-sparse', default=True, description='Compile with SuiteSparse solvers') variant('python', default=True, description='Build python wrappers') variant('shared', default=True, description='Enables the build of shared libraries') @@ -47,9 +45,9 @@ class Trilinos(Package): # MPI related dependencies depends_on('mpi') depends_on('netcdf+mpi') - depends_on('parmetis',when='+parmetis') - depends_on('mumps+metis+parmetis+shared',when='+mumps') # Amesos link errors with static: "__gfortran_adjustl", referenced from: _dmumps_ in libdmumps.a(dmumps_driver.o) "_mpi_abort_", referenced from: _mumps_abort_ in libmumps_common.a(tools_common.o) - depends_on('scalapack',when='+scalapack') + depends_on('parmetis',when='+metis') + depends_on('mumps+mpi+metis+parmetis+shared',when='+mumps') # Amesos link errors with static: "__gfortran_adjustl", referenced from: _dmumps_ in libdmumps.a(dmumps_driver.o) "_mpi_abort_", referenced from: _mumps_abort_ in libmumps_common.a(tools_common.o) + depends_on('scalapack',when='+mumps') depends_on('superlu-dist',when='+superlu-dist') depends_on('hypre',when='+hypre') depends_on('hdf5+mpi',when='+hdf5') @@ -60,11 +58,8 @@ class Trilinos(Package): # check that the combination of variants makes sense def variants_check(self): - if '+parmetis' in self.spec and '+metis' not in self.spec: - raise RuntimeError('You cannot use the variant parmetis without metis') - - if '+mumps' in self.spec and '+parmetis' not in self.spec: - raise RuntimeError('You cannot use the variant mumps without parmetis') + if '+mumps' in self.spec and '+metis' not in self.spec: + raise RuntimeError('You cannot use the variant mumps without metis') if '+superlu-dist' in self.spec and self.spec.satisfies('@:11.4.3'): # For Trilinos v11 we need to force SuperLUDist=OFF, @@ -136,7 +131,7 @@ def install(self, spec, prefix): ]) # metis / parmetis - if '+parmetis' in spec: # metis is required, see variants_check() + if '+metis' in spec: options.extend([ '-DTPL_ENABLE_METIS:BOOL=ON', '-DMETIS_LIBRARY_DIRS=%s' % spec['metis'].prefix.lib, @@ -153,30 +148,21 @@ def install(self, spec, prefix): '-DTPL_ENABLE_ParMETIS:BOOL=OFF', ]) - # mumps + # mumps / scalapack if '+mumps' in spec: options.extend([ '-DTPL_ENABLE_MUMPS:BOOL=ON', '-DMUMPS_LIBRARY_DIRS=%s' % spec['mumps'].prefix.lib, - '-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord' # order is important! - ]) - else: - options.extend([ - '-DTPL_ENABLE_MUMPS:BOOL=OFF', - ]) - - # scalapack - if '+scalapack' in spec: - options.extend([ + '-DMUMPS_LIBRARY_NAMES=dmumps;mumps_common;pord', # order is important! '-DTPL_ENABLE_SCALAPACK:BOOL=ON', '-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64 ]) else: options.extend([ + '-DTPL_ENABLE_MUMPS:BOOL=OFF', '-DTPL_ENABLE_SCALAPACK:BOOL=OFF', ]) - # superlu-dist: if '+superlu-dist' in spec: # Amesos, conflicting types of double and complex SLU_D @@ -202,13 +188,13 @@ def install(self, spec, prefix): # python - if '~python' in spec: + if '+python' in spec: options.extend([ - '-DTrilinos_ENABLE_PyTrilinos:BOOL=OFF' + '-DTrilinos_ENABLE_PyTrilinos:BOOL=ON' ]) else: options.extend([ - '-DTrilinos_ENABLE_PyTrilinos:BOOL=ON' + '-DTrilinos_ENABLE_PyTrilinos:BOOL=OFF' ]) From a82a587b3298ffec0c11ddf1c9639c6de228fa6a Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sun, 27 Mar 2016 06:17:43 +0200 Subject: [PATCH 34/43] lower requirement on mumps --- var/spack/repos/builtin/packages/trilinos/package.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 48bffc65e0..e8c4bcd7e2 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -46,7 +46,7 @@ class Trilinos(Package): depends_on('mpi') depends_on('netcdf+mpi') depends_on('parmetis',when='+metis') - depends_on('mumps+mpi+metis+parmetis+shared',when='+mumps') # Amesos link errors with static: "__gfortran_adjustl", referenced from: _dmumps_ in libdmumps.a(dmumps_driver.o) "_mpi_abort_", referenced from: _mumps_abort_ in libmumps_common.a(tools_common.o) + depends_on('mumps+mpi+shared',when='+mumps') # Amesos link errors with static: "__gfortran_adjustl", referenced from: _dmumps_ in libdmumps.a(dmumps_driver.o) "_mpi_abort_", referenced from: _mumps_abort_ in libmumps_common.a(tools_common.o) depends_on('scalapack',when='+mumps') depends_on('superlu-dist',when='+superlu-dist') depends_on('hypre',when='+hypre') @@ -58,9 +58,6 @@ class Trilinos(Package): # check that the combination of variants makes sense def variants_check(self): - if '+mumps' in self.spec and '+metis' not in self.spec: - raise RuntimeError('You cannot use the variant mumps without metis') - if '+superlu-dist' in self.spec and self.spec.satisfies('@:11.4.3'): # For Trilinos v11 we need to force SuperLUDist=OFF, # since only the deprecated SuperLUDist v3.3 together with an Amesos patch From 9cff241ad52ba628a0bdad47cee98bbbf6ba5511 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sun, 27 Mar 2016 10:39:09 +0200 Subject: [PATCH 35/43] fix install name on Darwin --- var/spack/repos/builtin/packages/trilinos/package.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index e8c4bcd7e2..72f904d8aa 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -1,5 +1,5 @@ from spack import * -import os, sys +import os, sys, glob # Trilinos is complicated to build, as an inspiration a couple of links to other repositories which build it: # https://github.com/hpcugent/easybuild-easyblocks/blob/master/easybuild/easyblocks/t/trilinos.py#L111 @@ -222,3 +222,10 @@ def install(self, spec, prefix): # A workaround it to remove PyTrilinos from the COMPONENTS_LIST : if '+python' in self.spec: filter_file(r'(SET\(COMPONENTS_LIST.*)(PyTrilinos;)(.*)', (r'\1\3'), '%s/cmake/Trilinos/TrilinosConfig.cmake' % prefix.lib) + + # The shared libraries are not installed correctly on Darwin; correct this + if (sys.platform == 'darwin') and ('+shared' in spec): + fs = glob.glob(join_path(prefix.lib,"*.dylib")) + install_name_tool = which('install_name_tool') + for f in fs: + install_name_tool('-id',f,f) From 69ebc8173e1843ea570d78ac27465b0ea32c753d Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sun, 27 Mar 2016 16:04:13 +0200 Subject: [PATCH 36/43] use global tool to fix install_name --- var/spack/repos/builtin/packages/trilinos/package.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 72f904d8aa..6608f64ea7 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -225,7 +225,4 @@ def install(self, spec, prefix): # The shared libraries are not installed correctly on Darwin; correct this if (sys.platform == 'darwin') and ('+shared' in spec): - fs = glob.glob(join_path(prefix.lib,"*.dylib")) - install_name_tool = which('install_name_tool') - for f in fs: - install_name_tool('-id',f,f) + fix_darwin_install_name(prefix.lib) From 0da545ecac1c57a04abf814c9fed4f9929726ff5 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 28 Mar 2016 13:16:08 +0200 Subject: [PATCH 37/43] tell amesos that we use mumps 5 --- .../repos/builtin/packages/trilinos/package.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 6608f64ea7..90b7bff149 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -6,6 +6,9 @@ # https://github.com/koecher/candi/blob/master/deal.II-toolchain/packages/trilinos.package # https://gitlab.com/configurations/cluster-config/blob/master/trilinos.sh # https://github.com/Homebrew/homebrew-science/blob/master/trilinos.rb +# and some relevant documentation/examples: +# https://trilinos.org/docs/dev/packages/amesos2/doc/html/classAmesos2_1_1MUMPS.html +# https://github.com/trilinos/Trilinos/issues/175 class Trilinos(Package): """The Trilinos Project is an effort to develop algorithms and enabling technologies within an object-oriented software framework for the solution of large-scale, complex multi-physics engineering and scientific problems. @@ -46,7 +49,7 @@ class Trilinos(Package): depends_on('mpi') depends_on('netcdf+mpi') depends_on('parmetis',when='+metis') - depends_on('mumps+mpi+shared',when='+mumps') # Amesos link errors with static: "__gfortran_adjustl", referenced from: _dmumps_ in libdmumps.a(dmumps_driver.o) "_mpi_abort_", referenced from: _mumps_abort_ in libmumps_common.a(tools_common.o) + depends_on('mumps@5.0:+mpi+shared',when='+mumps') # Amesos link errors with static: "__gfortran_adjustl", referenced from: _dmumps_ in libdmumps.a(dmumps_driver.o) "_mpi_abort_", referenced from: _mumps_abort_ in libmumps_common.a(tools_common.o) depends_on('scalapack',when='+mumps') depends_on('superlu-dist',when='+superlu-dist') depends_on('hypre',when='+hypre') @@ -67,6 +70,7 @@ def variants_check(self): def install(self, spec, prefix): self.variants_check() + cxx_flags = [] options = [] options.extend(std_cmake_args) @@ -91,7 +95,6 @@ def install(self, spec, prefix): '-DBoost_LIBRARY_DIRS:PATH=%s' % spec['boost'].prefix.lib, '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', '-DTrilinos_ENABLE_CXX11:BOOL=ON', - '-DTrilinos_CXX11_FLAGS=-std=c++11', '-DTPL_ENABLE_Netcdf:BOOL=ON', '-DTPL_ENABLE_HYPRE:BOOL=ON', '-DTPL_ENABLE_HDF5:BOOL=ON' @@ -154,6 +157,10 @@ def install(self, spec, prefix): '-DTPL_ENABLE_SCALAPACK:BOOL=ON', '-DSCALAPACK_LIBRARY_NAMES=scalapack' # FIXME: for MKL it's mkl_scalapack_lp64;mkl_blacs_mpich_lp64 ]) + # see https://github.com/trilinos/Trilinos/blob/master/packages/amesos/README-MUMPS + cxx_flags.extend([ + '-DMUMPS_5_0' + ]) else: options.extend([ '-DTPL_ENABLE_MUMPS:BOOL=OFF', @@ -194,6 +201,10 @@ def install(self, spec, prefix): '-DTrilinos_ENABLE_PyTrilinos:BOOL=OFF' ]) + # collect CXX flags: + options.extend([ + '-DCMAKE_CXX_FLAGS:STRING=%s' % (' '.join(cxx_flags)), + ]) # disable due to compiler / config errors: options.extend([ From dd60cc326c12bfa8434b68afec72f4b68c18a94c Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 28 Mar 2016 17:52:22 +0200 Subject: [PATCH 38/43] adopt modifed superlu and hypre --- var/spack/repos/builtin/packages/trilinos/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 90b7bff149..b2dc8df0ea 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -52,7 +52,7 @@ class Trilinos(Package): depends_on('mumps@5.0:+mpi+shared',when='+mumps') # Amesos link errors with static: "__gfortran_adjustl", referenced from: _dmumps_ in libdmumps.a(dmumps_driver.o) "_mpi_abort_", referenced from: _mumps_abort_ in libmumps_common.a(tools_common.o) depends_on('scalapack',when='+mumps') depends_on('superlu-dist',when='+superlu-dist') - depends_on('hypre',when='+hypre') + depends_on('hypre~internal-superlu',when='+hypre') depends_on('hdf5+mpi',when='+hdf5') depends_on('python',when='+python') # Needs py-numpy activated @@ -179,7 +179,7 @@ def install(self, spec, prefix): options.extend([ '-DTPL_ENABLE_SuperLUDist:BOOL=ON', '-DSuperLUDist_LIBRARY_DIRS=%s' % spec['superlu-dist'].prefix.lib, - '-DSuperLUDist_INCLUDE_DIRS=%s/superlu_dist' % spec['superlu-dist'].prefix.include # superlu_dist and superlu have the same header names :-( In order to avoid conflicts, try to keep "dist" version headers in a subfolder + '-DSuperLUDist_INCLUDE_DIRS=%s' % spec['superlu-dist'].prefix.include ]) if spec.satisfies('^superlu-dist@4.0:'): options.extend([ From 207215980b05e4916e05ded8b05044b3edbe92c0 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 28 Mar 2016 17:54:27 +0200 Subject: [PATCH 39/43] make hypre and hdf5 be ON/OFF --- var/spack/repos/builtin/packages/trilinos/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index b2dc8df0ea..eb3bd1e0ee 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -96,8 +96,8 @@ def install(self, spec, prefix): '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', '-DTrilinos_ENABLE_CXX11:BOOL=ON', '-DTPL_ENABLE_Netcdf:BOOL=ON', - '-DTPL_ENABLE_HYPRE:BOOL=ON', - '-DTPL_ENABLE_HDF5:BOOL=ON' + '-DTPL_ENABLE_HYPRE:BOOL=%s' % ('ON' if '+hypre' in spec else 'OFF'),, + '-DTPL_ENABLE_HDF5:BOOL=%s' % ('ON' if '+hdf5' in spec else 'OFF'), ]) # Fortran lib From 4e87cf9d7492133d30675a64703b91ec6992ca00 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 28 Mar 2016 18:00:34 +0200 Subject: [PATCH 40/43] fix extra comma --- var/spack/repos/builtin/packages/trilinos/package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index eb3bd1e0ee..71c0be61c3 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -96,7 +96,7 @@ def install(self, spec, prefix): '-DTrilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=ON', '-DTrilinos_ENABLE_CXX11:BOOL=ON', '-DTPL_ENABLE_Netcdf:BOOL=ON', - '-DTPL_ENABLE_HYPRE:BOOL=%s' % ('ON' if '+hypre' in spec else 'OFF'),, + '-DTPL_ENABLE_HYPRE:BOOL=%s' % ('ON' if '+hypre' in spec else 'OFF'), '-DTPL_ENABLE_HDF5:BOOL=%s' % ('ON' if '+hdf5' in spec else 'OFF'), ]) From f9bcce6a683b1d948190b9927254e3ee29d3606c Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 29 Mar 2016 09:19:24 +0200 Subject: [PATCH 41/43] turn off python by default --- var/spack/repos/builtin/packages/trilinos/package.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 71c0be61c3..0ab4addd52 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -31,7 +31,8 @@ class Trilinos(Package): variant('hypre', default=True, description='Compile with Hypre preconditioner') variant('hdf5', default=True, description='Compile with HDF5') variant('suite-sparse', default=True, description='Compile with SuiteSparse solvers') - variant('python', default=True, description='Build python wrappers') + # not everyone has py-numpy activated, keep it disabled by default to avoid configure errors + variant('python', default=False, description='Build python wrappers') variant('shared', default=True, description='Enables the build of shared libraries') variant('debug', default=False, description='Builds a debug version of the libraries') @@ -55,7 +56,7 @@ class Trilinos(Package): depends_on('hypre~internal-superlu',when='+hypre') depends_on('hdf5+mpi',when='+hdf5') - depends_on('python',when='+python') # Needs py-numpy activated + depends_on('python',when='+python') patch('umfpack_from_suitesparse.patch') From 7753d823cbe1d1983957fb948bf095d624d76b7c Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 29 Mar 2016 09:27:55 +0200 Subject: [PATCH 42/43] add a comment on static mumps --- var/spack/repos/builtin/packages/trilinos/package.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/trilinos/package.py b/var/spack/repos/builtin/packages/trilinos/package.py index 0ab4addd52..6223848c68 100644 --- a/var/spack/repos/builtin/packages/trilinos/package.py +++ b/var/spack/repos/builtin/packages/trilinos/package.py @@ -7,7 +7,6 @@ # https://gitlab.com/configurations/cluster-config/blob/master/trilinos.sh # https://github.com/Homebrew/homebrew-science/blob/master/trilinos.rb # and some relevant documentation/examples: -# https://trilinos.org/docs/dev/packages/amesos2/doc/html/classAmesos2_1_1MUMPS.html # https://github.com/trilinos/Trilinos/issues/175 class Trilinos(Package): """The Trilinos Project is an effort to develop algorithms and enabling technologies within an object-oriented @@ -50,7 +49,14 @@ class Trilinos(Package): depends_on('mpi') depends_on('netcdf+mpi') depends_on('parmetis',when='+metis') - depends_on('mumps@5.0:+mpi+shared',when='+mumps') # Amesos link errors with static: "__gfortran_adjustl", referenced from: _dmumps_ in libdmumps.a(dmumps_driver.o) "_mpi_abort_", referenced from: _mumps_abort_ in libmumps_common.a(tools_common.o) + # Trilinos' Tribits config system is limited which makes it + # very tricky to link Amesos with static MUMPS, see + # https://trilinos.org/docs/dev/packages/amesos2/doc/html/classAmesos2_1_1MUMPS.html + # One could work it out by getting linking flags from mpif90 --showme:link (or alike) + # and adding results to -DTrilinos_EXTRA_LINK_FLAGS + # together with Blas and Lapack and ScaLAPACK and Blacs and -lgfortran and + # it may work at the end. But let's avoid all this by simply using shared libs + depends_on('mumps@5.0:+mpi+shared',when='+mumps') depends_on('scalapack',when='+mumps') depends_on('superlu-dist',when='+superlu-dist') depends_on('hypre~internal-superlu',when='+hypre') From 01657e6991197c999180c2fec367fc75e59fba15 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 30 Mar 2016 11:41:25 -0700 Subject: [PATCH 43/43] Make suite-sparse use spack compilers. --- .../repos/builtin/packages/suite-sparse/package.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py index b57f9967c3..c2196dcec4 100644 --- a/var/spack/repos/builtin/packages/suite-sparse/package.py +++ b/var/spack/repos/builtin/packages/suite-sparse/package.py @@ -23,4 +23,14 @@ def install(self, spec, prefix): # FIXME : this actually uses the current workaround # FIXME : (blas / lapack always provide libblas and liblapack as aliases) - make('install', 'INSTALL=%s' % prefix, 'BLAS=-lblas', 'LAPACK=-llapack') + make('install', 'INSTALL=%s' % prefix, + + # inject Spack compiler wrappers + 'AUTOCC=no', + 'CC=cc', + 'CXX=c++', + 'F77=f77', + + # BLAS arguments require path to libraries + 'BLAS=-lblas', + 'LAPACK=-llapack')