From 0ee993569f8f47f5ca94873bc779d98639e9a1b4 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 22 Mar 2016 23:04:59 +0100 Subject: add deal.ii package --- var/spack/repos/builtin/packages/dealii/package.py | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 var/spack/repos/builtin/packages/dealii/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py new file mode 100644 index 0000000000..cddf5cd98b --- /dev/null +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -0,0 +1,67 @@ +from spack import * + +class Dealii(Package): + """C++ software library providing well-documented tools to build finite element codes for a broad variety of PDEs.""" + homepage = "https://www.dealii.org" + url = "https://github.com/dealii/dealii/releases/download/v8.4.0/dealii-8.4.0.tar.gz" + + version('8.4.0', 'ac5dbf676096ff61e092ce98c80c2b00') + + depends_on ("cmake") + depends_on ("blas") + depends_on ("lapack") + depends_on ("mpi") + + #depends_on ("arpack") + depends_on ("boost") + #depends_on ("doxygen") + depends_on ("hdf5+mpi") + depends_on ("metis") + #depends_on "muparser" + depends_on ("netcdf") + #depends_on ("numdiff") + #depends_on ("oce") + depends_on ("p4est") + depends_on ("parmetis") + depends_on ("petsc") + #depends_on ("slepc") + depends_on ("SuiteSparse") + #depends_on "tbb" + depends_on ("trilinos") + + def install(self, spec, prefix): + options = [] + options.extend(std_cmake_args) + + # CMAKE_BUILD_TYPE should be DebugRelease | Debug | Release + for word in options[:]: + if word.startswith('-DCMAKE_BUILD_TYPE'): + options.remove(word) + + options.extend([ + '-DCMAKE_BUILD_TYPE=DebugRelease', + '-DDEAL_II_WITH_THREADS:BOOL=ON' + '-DDEAL_II_WITH_MPI:BOOL=ON', + '-DCMAKE_C_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), + '-DCMAKE_CXX_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpic++'), + '-DCMAKE_Fortran_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif90'), + #'-DARPACK_DIR=%s' % , + '-DBOOST_DIR=%s' % spec['boost'].prefix, + '-DHDF5_DIR=%s' % spec['hdf5'].prefix, + '-DMETIS_DIR=%s' % spec['metis'].prefix, + #'-DMUPARSER_DIR=%s ' + '-DNETCDF_DIR=%s' % spec['netcdf'].prefix, + #'-DOPENCASCADE_DIR= + '-DP4EST_DIR=%s' % spec['p4est'].prefix, + '-DPETSC_DIR=%s' % spec['petsc'].prefix, + #'-DSLEPC_DIR= + '-DUMFPACK_DIR=%s' % spec['SuiteSparse'].prefix, + #'-DTBB_DIR=%s' + '-DTRILINOS_DIR=%s' % spec['trilinos'].prefix + ]) + + cmake('.', *options) + + make() + make("test") + make("install") -- cgit v1.2.3-70-g09d2 From c7011d21aa95145c7b3978f4220b211e39c9ecf2 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 25 Mar 2016 22:15:39 +0100 Subject: update dependencies. Builds fine on OSX --- var/spack/repos/builtin/packages/dealii/package.py | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index cddf5cd98b..5a50481b9b 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -12,21 +12,21 @@ class Dealii(Package): depends_on ("lapack") depends_on ("mpi") - #depends_on ("arpack") + depends_on ("arpack-ng") depends_on ("boost") - #depends_on ("doxygen") - depends_on ("hdf5+mpi") + depends_on ("doxygen") + depends_on ("hdf5+mpi~cxx") #FIXME NetCDF declares dependency with ~cxx, why? depends_on ("metis") - #depends_on "muparser" + depends_on ("muparser") depends_on ("netcdf") - #depends_on ("numdiff") - #depends_on ("oce") + #depends_on ("numdiff") #FIXME + depends_on ("oce") depends_on ("p4est") depends_on ("parmetis") depends_on ("petsc") - #depends_on ("slepc") - depends_on ("SuiteSparse") - #depends_on "tbb" + depends_on ("slepc") + depends_on ("suite-sparse") + depends_on ("tbb") depends_on ("trilinos") def install(self, spec, prefix): @@ -42,21 +42,21 @@ class Dealii(Package): '-DCMAKE_BUILD_TYPE=DebugRelease', '-DDEAL_II_WITH_THREADS:BOOL=ON' '-DDEAL_II_WITH_MPI:BOOL=ON', - '-DCMAKE_C_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), + '-DCMAKE_C_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), # FIXME: avoid hardcoding mpi wrappers names '-DCMAKE_CXX_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpic++'), '-DCMAKE_Fortran_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif90'), - #'-DARPACK_DIR=%s' % , + '-DARPACK_DIR=%s' % spec['arpack-ng'].prefix, '-DBOOST_DIR=%s' % spec['boost'].prefix, '-DHDF5_DIR=%s' % spec['hdf5'].prefix, '-DMETIS_DIR=%s' % spec['metis'].prefix, - #'-DMUPARSER_DIR=%s ' + '-DMUPARSER_DIR=%s ' % spec['muparser'].prefix, '-DNETCDF_DIR=%s' % spec['netcdf'].prefix, - #'-DOPENCASCADE_DIR= + '-DOPENCASCADE_DIR=%s' % spec['oce'].prefix, '-DP4EST_DIR=%s' % spec['p4est'].prefix, '-DPETSC_DIR=%s' % spec['petsc'].prefix, - #'-DSLEPC_DIR= - '-DUMFPACK_DIR=%s' % spec['SuiteSparse'].prefix, - #'-DTBB_DIR=%s' + '-DSLEPC_DIR=%s' % spec['slepc'].prefix, + '-DUMFPACK_DIR=%s' % spec['suite-sparse'].prefix, + '-DTBB_DIR=%s' % spec['tbb'].prefix, '-DTRILINOS_DIR=%s' % spec['trilinos'].prefix ]) -- cgit v1.2.3-70-g09d2 From 9c391bbda1c8379dd60cf21d82779db704183f32 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sat, 26 Mar 2016 20:52:08 +0100 Subject: minor changes to variants --- var/spack/repos/builtin/packages/dealii/package.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 5a50481b9b..19bb3814be 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -12,7 +12,7 @@ class Dealii(Package): depends_on ("lapack") depends_on ("mpi") - depends_on ("arpack-ng") + depends_on ("arpack-ng+mpi") depends_on ("boost") depends_on ("doxygen") depends_on ("hdf5+mpi~cxx") #FIXME NetCDF declares dependency with ~cxx, why? @@ -23,7 +23,7 @@ class Dealii(Package): depends_on ("oce") depends_on ("p4est") depends_on ("parmetis") - depends_on ("petsc") + depends_on ("petsc+mpi") depends_on ("slepc") depends_on ("suite-sparse") depends_on ("tbb") -- cgit v1.2.3-70-g09d2 From 20600b8cac9488ff416397de374c2d3dacf4afe4 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sun, 27 Mar 2016 21:03:18 +0200 Subject: add tests and netcdf-cxx4 --- var/spack/repos/builtin/packages/dealii/package.py | 38 ++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 19bb3814be..1d4c800288 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -1,4 +1,5 @@ from spack import * +import shutil class Dealii(Package): """C++ software library providing well-documented tools to build finite element codes for a broad variety of PDEs.""" @@ -18,7 +19,7 @@ class Dealii(Package): depends_on ("hdf5+mpi~cxx") #FIXME NetCDF declares dependency with ~cxx, why? depends_on ("metis") depends_on ("muparser") - depends_on ("netcdf") + depends_on ("netcdf-cxx4") #depends_on ("numdiff") #FIXME depends_on ("oce") depends_on ("p4est") @@ -50,7 +51,7 @@ class Dealii(Package): '-DHDF5_DIR=%s' % spec['hdf5'].prefix, '-DMETIS_DIR=%s' % spec['metis'].prefix, '-DMUPARSER_DIR=%s ' % spec['muparser'].prefix, - '-DNETCDF_DIR=%s' % spec['netcdf'].prefix, + '-DNETCDF_DIR=%s' % spec['netcdf-cxx4'].prefix, '-DOPENCASCADE_DIR=%s' % spec['oce'].prefix, '-DP4EST_DIR=%s' % spec['p4est'].prefix, '-DPETSC_DIR=%s' % spec['petsc'].prefix, @@ -65,3 +66,36 @@ class Dealii(Package): make() make("test") make("install") + + # run some MPI examples with different solvers from PETSc and Trilinos + env['DEAL_II_DIR'] = prefix + # take bare-bones step-3 + with working_dir('examples/step-3'): + cmake('.') + make('release') + make('run',parallel=False) + + # take step-40 which can use both PETSc and Trilinos + # FIXME: switch step-40 to MPI run + with working_dir('examples/step-40'): + # list the number of cycles to speed up + filter_file(r'(const unsigned int n_cycles = 8;)', ('const unsigned int n_cycles = 2;'), 'step-40.cc') + cmake('.') + make('release') + make('run',parallel=False) + + # change Linear Algebra to Trilinos + filter_file(r'(#define USE_PETSC_LA.*)', (''), 'step-40.cc') + make('release') + make('run',parallel=False) + + with working_dir('examples/step-36'): + cmake('.') + make('release') + make('run',parallel=False) + + with working_dir('examples/step-54'): + cmake('.') + make('release') + # FIXME + # make('run',parallel=False) -- cgit v1.2.3-70-g09d2 From fc73e93b50a708ecfa2395a636bc32161c9d3051 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Sun, 27 Mar 2016 23:47:43 +0200 Subject: rework netcdf --- var/spack/repos/builtin/packages/dealii/package.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 1d4c800288..baedd155ef 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -1,5 +1,5 @@ from spack import * -import shutil +import sys class Dealii(Package): """C++ software library providing well-documented tools to build finite element codes for a broad variety of PDEs.""" @@ -39,6 +39,7 @@ class Dealii(Package): if word.startswith('-DCMAKE_BUILD_TYPE'): options.remove(word) + dsuf = 'dylib' if sys.platform == 'darwin' else 'so' options.extend([ '-DCMAKE_BUILD_TYPE=DebugRelease', '-DDEAL_II_WITH_THREADS:BOOL=ON' @@ -51,7 +52,14 @@ class Dealii(Package): '-DHDF5_DIR=%s' % spec['hdf5'].prefix, '-DMETIS_DIR=%s' % spec['metis'].prefix, '-DMUPARSER_DIR=%s ' % spec['muparser'].prefix, - '-DNETCDF_DIR=%s' % spec['netcdf-cxx4'].prefix, + # since Netcdf is spread among two, need to do it by hand: + '-DNETCDF_FOUND=true', + '-DNETCDF_LIBRARIES=%s;%s' % + (join_path(spec['netcdf-cxx4'].prefix.lib,'libnetcdf_c++4.%s' % dsuf), + join_path(spec['netcdf'].prefix.lib,'libnetcdf.%s' % dsuf)), + '-DNETCDF_INCLUDE_DIRS=%s;%s' % + (spec['netcdf-cxx4'].prefix.include, + spec['netcdf'].prefix.include), '-DOPENCASCADE_DIR=%s' % spec['oce'].prefix, '-DP4EST_DIR=%s' % spec['p4est'].prefix, '-DPETSC_DIR=%s' % spec['petsc'].prefix, -- cgit v1.2.3-70-g09d2 From 97cdd7947894b3b631e2a209f0573ed839eb7b8a Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 28 Mar 2016 10:49:20 +0200 Subject: fix netcdf --- var/spack/repos/builtin/packages/dealii/package.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index baedd155ef..486aa6e4a4 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -19,7 +19,7 @@ class Dealii(Package): depends_on ("hdf5+mpi~cxx") #FIXME NetCDF declares dependency with ~cxx, why? depends_on ("metis") depends_on ("muparser") - depends_on ("netcdf-cxx4") + depends_on ("netcdf-cxx") #depends_on ("numdiff") #FIXME depends_on ("oce") depends_on ("p4est") @@ -55,10 +55,10 @@ class Dealii(Package): # since Netcdf is spread among two, need to do it by hand: '-DNETCDF_FOUND=true', '-DNETCDF_LIBRARIES=%s;%s' % - (join_path(spec['netcdf-cxx4'].prefix.lib,'libnetcdf_c++4.%s' % dsuf), + (join_path(spec['netcdf-cxx'].prefix.lib,'libnetcdf_c++.%s' % dsuf), join_path(spec['netcdf'].prefix.lib,'libnetcdf.%s' % dsuf)), '-DNETCDF_INCLUDE_DIRS=%s;%s' % - (spec['netcdf-cxx4'].prefix.include, + (spec['netcdf-cxx'].prefix.include, spec['netcdf'].prefix.include), '-DOPENCASCADE_DIR=%s' % spec['oce'].prefix, '-DP4EST_DIR=%s' % spec['p4est'].prefix, -- cgit v1.2.3-70-g09d2 From e00cab75bd6721ac49bb6199d77ad99df80556a9 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Mon, 28 Mar 2016 12:12:55 +0200 Subject: more elaborated tests/direct solvers --- var/spack/repos/builtin/packages/dealii/package.py | 42 +++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 486aa6e4a4..9ac1572b95 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -77,7 +77,13 @@ class Dealii(Package): # run some MPI examples with different solvers from PETSc and Trilinos env['DEAL_II_DIR'] = prefix + print('=====================================') + print('============ EXAMPLES ===============') + print('=====================================') # take bare-bones step-3 + print('=====================================') + print('============ Step-3 =================') + print('=====================================') with working_dir('examples/step-3'): cmake('.') make('release') @@ -86,22 +92,56 @@ class Dealii(Package): # take step-40 which can use both PETSc and Trilinos # FIXME: switch step-40 to MPI run with working_dir('examples/step-40'): + print('=====================================') + print('========== Step-40 PETSc ============') + print('=====================================') # list the number of cycles to speed up filter_file(r'(const unsigned int n_cycles = 8;)', ('const unsigned int n_cycles = 2;'), 'step-40.cc') cmake('.') make('release') make('run',parallel=False) + print('=====================================') + print('========= Step-40 Trilinos ==========') + print('=====================================') # change Linear Algebra to Trilinos - filter_file(r'(#define USE_PETSC_LA.*)', (''), 'step-40.cc') + filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)', ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc') make('release') make('run',parallel=False) + print('=====================================') + print('=== Step-40 Trilinos SuperluDist ====') + print('=====================================') + # change to direct solvers + filter_file(r'(LA::SolverCG solver\(solver_control\);)', ('TrilinosWrappers::SolverDirect::AdditionalData data(false,"Amesos_Superludist"); TrilinosWrappers::SolverDirect solver(solver_control,data);'), 'step-40.cc') + filter_file(r'(LA::MPI::PreconditionAMG preconditioner;)', (''), 'step-40.cc') + filter_file(r'(LA::MPI::PreconditionAMG::AdditionalData data;)', (''), 'step-40.cc') + filter_file(r'(preconditioner.initialize\(system_matrix, data\);)', (''), 'step-40.cc') + filter_file(r'(solver\.solve \(system_matrix, completely_distributed_solution, system_rhs,)', ('solver.solve (system_matrix, completely_distributed_solution, system_rhs);'), 'step-40.cc') + filter_file(r'(preconditioner\);)', (''), 'step-40.cc') + + make('release') + make('run',paralle=False) + + print('=====================================') + print('====== Step-40 Trilinos MUMPS =======') + print('=====================================') + # switch to Mumps + filter_file(r'(Amesos_Superludist)', ('Amesos_Mumps'), 'step-40.cc') + make('release') + make('run',parallel=False) + + print('=====================================') + print('============ Step-36 ================') + print('=====================================') with working_dir('examples/step-36'): cmake('.') make('release') make('run',parallel=False) + print('=====================================') + print('============ Step-54 ================') + print('=====================================') with working_dir('examples/step-54'): cmake('.') make('release') -- cgit v1.2.3-70-g09d2 From 5b6eefbf0417668c19e4c898c31cf56764d5bc2b Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 30 Mar 2016 11:30:35 +0200 Subject: add variants and extra dependencies --- var/spack/repos/builtin/packages/dealii/package.py | 176 ++++++++++++++++----- 1 file changed, 140 insertions(+), 36 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 9ac1572b95..396601356c 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -8,27 +8,48 @@ class Dealii(Package): version('8.4.0', 'ac5dbf676096ff61e092ce98c80c2b00') - depends_on ("cmake") + variant('mpi', default=True, description='Compile with MPI') + variant('arpack', default=True, description='Compile with Arpack and PArpack (only with MPI)') + variant('doxygen', default=True, description='Compile with Doxygen documentation') + variant('hdf5', default=True, description='Compile with HDF5 (only with MPI)') + variant('metis', default=True, description='Compile with Metis or ParMetis') + variant('netcdf', default=True, description='Compile with Netcdf (only with MPI)') + variant('oce', default=True, description='Compile with OCE') + variant('p4est', default=True, description='Compile with P4est (only with MPI)') + variant('petsc', default=True, description='Compile with Petsc (only with MPI)') + variant('slepc', default=True, description='Compile with Slepc (only with Petsc and MPI)') + variant('trilinos', default=True, description='Compile with Trilinos (only with MPI)') + + # required dependencies, light version depends_on ("blas") + depends_on ("boost", when='~mpi') + depends_on ("boost+mpi", when='+mpi') + depends_on ("bzip2") + depends_on ("cmake") depends_on ("lapack") - depends_on ("mpi") - - depends_on ("arpack-ng+mpi") - depends_on ("boost") - depends_on ("doxygen") - depends_on ("hdf5+mpi~cxx") #FIXME NetCDF declares dependency with ~cxx, why? - depends_on ("metis") depends_on ("muparser") - depends_on ("netcdf-cxx") - #depends_on ("numdiff") #FIXME - depends_on ("oce") - depends_on ("p4est") - depends_on ("parmetis") - depends_on ("petsc+mpi") - depends_on ("slepc") depends_on ("suite-sparse") depends_on ("tbb") - depends_on ("trilinos") + depends_on ("zlib") + + # optional dependencies + depends_on ("mpi", when="+mpi") + depends_on ("arpack-ng+mpi", when='+arpack+mpi') + depends_on ("doxygen", when='+doxygen') + depends_on ("hdf5+mpi~cxx", when='+hdf5+mpi') #FIXME NetCDF declares dependency with ~cxx, why? + depends_on ("metis", when='+metis') + depends_on ("netcdf+mpi", when="+netcdf+mpi") + depends_on ("netcdf-cxx", when='+netcdf+mpi') + depends_on ("oce", when='+oce') + depends_on ("p4est", when='+p4est+mpi') + depends_on ("parmetis", when='+metis+mpi') + depends_on ("petsc+mpi", when='+petsc+mpi') + depends_on ("slepc", when='+slepc+petsc+mpi') + depends_on ("trilinos", when='+trilinos+mpi') + + # developer dependnecies + #depends_on ("numdiff") #FIXME + #depends_on ("astyle") #FIXME def install(self, spec, prefix): options = [] @@ -42,33 +63,116 @@ class Dealii(Package): dsuf = 'dylib' if sys.platform == 'darwin' else 'so' options.extend([ '-DCMAKE_BUILD_TYPE=DebugRelease', - '-DDEAL_II_WITH_THREADS:BOOL=ON' - '-DDEAL_II_WITH_MPI:BOOL=ON', - '-DCMAKE_C_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), # FIXME: avoid hardcoding mpi wrappers names - '-DCMAKE_CXX_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpic++'), - '-DCMAKE_Fortran_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif90'), - '-DARPACK_DIR=%s' % spec['arpack-ng'].prefix, + '-DDEAL_II_COMPONENT_EXAMPLES=ON', + '-DDEAL_II_WITH_THREADS:BOOL=ON', '-DBOOST_DIR=%s' % spec['boost'].prefix, - '-DHDF5_DIR=%s' % spec['hdf5'].prefix, - '-DMETIS_DIR=%s' % spec['metis'].prefix, + '-DBZIP2_DIR=%s' % spec['bzip2'].prefix, + # CMake's FindBlas/Lapack may pickup system's blas/lapack instead of Spack's. + # Be more specific to avoid this. + # Note that both lapack and blas are provided in -DLAPACK_XYZ variables + '-DLAPACK_FOUND=true', + '-DLAPACK_INCLUDE_DIRS=%s;%s' % + (spec['lapack'].prefix.include, + spec['blas'].prefix.include), + '-DLAPACK_LIBRARIES=%s;%s' % + (join_path(spec['lapack'].prefix.lib,'liblapack.%s' % dsuf), # FIXME don't hardcode names + join_path(spec['blas'].prefix.lib,'libblas.%s' % dsuf)), # FIXME don't hardcode names '-DMUPARSER_DIR=%s ' % spec['muparser'].prefix, - # since Netcdf is spread among two, need to do it by hand: - '-DNETCDF_FOUND=true', - '-DNETCDF_LIBRARIES=%s;%s' % - (join_path(spec['netcdf-cxx'].prefix.lib,'libnetcdf_c++.%s' % dsuf), - join_path(spec['netcdf'].prefix.lib,'libnetcdf.%s' % dsuf)), - '-DNETCDF_INCLUDE_DIRS=%s;%s' % - (spec['netcdf-cxx'].prefix.include, - spec['netcdf'].prefix.include), - '-DOPENCASCADE_DIR=%s' % spec['oce'].prefix, '-DP4EST_DIR=%s' % spec['p4est'].prefix, - '-DPETSC_DIR=%s' % spec['petsc'].prefix, - '-DSLEPC_DIR=%s' % spec['slepc'].prefix, '-DUMFPACK_DIR=%s' % spec['suite-sparse'].prefix, '-DTBB_DIR=%s' % spec['tbb'].prefix, - '-DTRILINOS_DIR=%s' % spec['trilinos'].prefix + '-DZLIB_DIR=%s' % spec['zlib'].prefix ]) + # MPI + if '+mpi' in spec: + options.extend([ + '-DDEAL_II_WITH_MPI:BOOL=ON', + '-DCMAKE_C_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpicc'), # FIXME: avoid hardcoding mpi wrappers names + '-DCMAKE_CXX_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpic++'), + '-DCMAKE_Fortran_COMPILER=%s' % join_path(self.spec['mpi'].prefix.bin, 'mpif90'), + ]) + else: + options.extend([ + '-DDEAL_II_WITH_MPI:BOOL=OFF', + ]) + + # Optional dependencies for which librariy names are the same as CMake variables + for library in ('hdf5', 'p4est','petsc', 'slepc','trilinos','metis','parmetis'): + if library in spec: + options.extend([ + '-D{library}_DIR={value}'.format(library=library.upper(), value=spec[library].prefix), + '-DDEAL_II_WITH_{library}:BOOL=ON'.format(library=library.upper()) + ]) + else: + options.extend([ + '-DDEAL_II_WITH_{library}:BOOL=OFF'.format(library=library.upper()) + ]) + + # doxygen + options.extend([ + '-DDEAL_II_COMPONENT_DOCUMENTATION=%s' % ('ON' if '+doxygen' in spec else 'OFF'), + ]) + + + # arpack + if '+arpack' in spec: + options.extend([ + '-DARPACK_DIR=%s' % spec['arpack-ng'].prefix, + '-DDEAL_II_WITH_ARPACK=ON', + '-DDEAL_II_ARPACK_WITH_PARPACK=ON' + ]) + else: + options.extend([ + '-DDEAL_II_WITH_ARPACK=OFF' + ]) + + # # metis + # if '+metis' in spec: + # + # if 'mpi' in spec: + # options.extend([ + # '-DMETIS_DIR=%s' % spec['parmetis'].prefix, + # ]) + # else: + # options.extend([ + # '-DMETIS_DIR=%s' % spec['metis'].prefix, + # ]) + # options.extend([ + # '-DDEAL_II_WITH_METIS=ON' + # ]) + # else: + # options.extend([ + # '-DDEAL_II_WITH_METIS=OFF' + # ]) + + # since Netcdf is spread among two, need to do it by hand: + if '+netcdf' in spec: + options.extend([ + '-DNETCDF_FOUND=true', + '-DNETCDF_LIBRARIES=%s;%s' % + (join_path(spec['netcdf-cxx'].prefix.lib,'libnetcdf_c++.%s' % dsuf), + join_path(spec['netcdf'].prefix.lib,'libnetcdf.%s' % dsuf)), + '-DNETCDF_INCLUDE_DIRS=%s;%s' % + (spec['netcdf-cxx'].prefix.include, + spec['netcdf'].prefix.include), + ]) + else: + options.extend([ + '-DDEAL_II_WITH_NETCDF=OFF' + ]) + + # Open Cascade + if '+oce' in spec: + options.extend([ + '-DOPENCASCADE_DIR=%s' % spec['oce'].prefix, + '-DDEAL_II_WITH_OPENCASCADE=ON' + ]) + else: + options.extend([ + '-DDEAL_II_WITH_OPENCASCADE=OFF' + ]) + cmake('.', *options) make() -- cgit v1.2.3-70-g09d2 From bafc6cebe1ca37116badc1baf60e88564eb01614 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 30 Mar 2016 12:00:21 +0200 Subject: doxygen off by default --- var/spack/repos/builtin/packages/dealii/package.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 396601356c..907aa33356 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -8,17 +8,17 @@ class Dealii(Package): version('8.4.0', 'ac5dbf676096ff61e092ce98c80c2b00') - variant('mpi', default=True, description='Compile with MPI') - variant('arpack', default=True, description='Compile with Arpack and PArpack (only with MPI)') - variant('doxygen', default=True, description='Compile with Doxygen documentation') - variant('hdf5', default=True, description='Compile with HDF5 (only with MPI)') - variant('metis', default=True, description='Compile with Metis or ParMetis') - variant('netcdf', default=True, description='Compile with Netcdf (only with MPI)') - variant('oce', default=True, description='Compile with OCE') - variant('p4est', default=True, description='Compile with P4est (only with MPI)') - variant('petsc', default=True, description='Compile with Petsc (only with MPI)') - variant('slepc', default=True, description='Compile with Slepc (only with Petsc and MPI)') - variant('trilinos', default=True, description='Compile with Trilinos (only with MPI)') + variant('mpi', default=True, description='Compile with MPI') + variant('arpack', default=True, description='Compile with Arpack and PArpack (only with MPI)') + variant('doxygen', default=False, description='Compile with Doxygen documentation') + variant('hdf5', default=True, description='Compile with HDF5 (only with MPI)') + variant('metis', default=True, description='Compile with Metis or ParMetis') + variant('netcdf', default=True, description='Compile with Netcdf (only with MPI)') + variant('oce', default=True, description='Compile with OCE') + variant('p4est', default=True, description='Compile with P4est (only with MPI)') + variant('petsc', default=True, description='Compile with Petsc (only with MPI)') + variant('slepc', default=True, description='Compile with Slepc (only with Petsc and MPI)') + variant('trilinos', default=True, description='Compile with Trilinos (only with MPI)') # required dependencies, light version depends_on ("blas") -- cgit v1.2.3-70-g09d2 From 2abdd71b414b4f551e927edb7304b4dcc053d09e Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 30 Mar 2016 15:19:29 +0200 Subject: add dev version and conditionals for tests; remove parmetis --- var/spack/repos/builtin/packages/dealii/package.py | 62 +++++++++------------- 1 file changed, 24 insertions(+), 38 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 907aa33356..32dfb33c6d 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -7,12 +7,13 @@ class Dealii(Package): url = "https://github.com/dealii/dealii/releases/download/v8.4.0/dealii-8.4.0.tar.gz" version('8.4.0', 'ac5dbf676096ff61e092ce98c80c2b00') + version('dev', git='https://github.com/dealii/dealii.git') variant('mpi', default=True, description='Compile with MPI') variant('arpack', default=True, description='Compile with Arpack and PArpack (only with MPI)') variant('doxygen', default=False, description='Compile with Doxygen documentation') variant('hdf5', default=True, description='Compile with HDF5 (only with MPI)') - variant('metis', default=True, description='Compile with Metis or ParMetis') + variant('metis', default=True, description='Compile with Metis') variant('netcdf', default=True, description='Compile with Netcdf (only with MPI)') variant('oce', default=True, description='Compile with OCE') variant('p4est', default=True, description='Compile with P4est (only with MPI)') @@ -42,7 +43,6 @@ class Dealii(Package): depends_on ("netcdf-cxx", when='+netcdf+mpi') depends_on ("oce", when='+oce') depends_on ("p4est", when='+p4est+mpi') - depends_on ("parmetis", when='+metis+mpi') depends_on ("petsc+mpi", when='+petsc+mpi') depends_on ("slepc", when='+slepc+petsc+mpi') depends_on ("trilinos", when='+trilinos+mpi') @@ -98,7 +98,7 @@ class Dealii(Package): ]) # Optional dependencies for which librariy names are the same as CMake variables - for library in ('hdf5', 'p4est','petsc', 'slepc','trilinos','metis','parmetis'): + for library in ('hdf5', 'p4est','petsc', 'slepc','trilinos','metis'): if library in spec: options.extend([ '-D{library}_DIR={value}'.format(library=library.upper(), value=spec[library].prefix), @@ -127,25 +127,6 @@ class Dealii(Package): '-DDEAL_II_WITH_ARPACK=OFF' ]) - # # metis - # if '+metis' in spec: - # - # if 'mpi' in spec: - # options.extend([ - # '-DMETIS_DIR=%s' % spec['parmetis'].prefix, - # ]) - # else: - # options.extend([ - # '-DMETIS_DIR=%s' % spec['metis'].prefix, - # ]) - # options.extend([ - # '-DDEAL_II_WITH_METIS=ON' - # ]) - # else: - # options.extend([ - # '-DDEAL_II_WITH_METIS=OFF' - # ]) - # since Netcdf is spread among two, need to do it by hand: if '+netcdf' in spec: options.extend([ @@ -202,16 +183,18 @@ class Dealii(Package): # list the number of cycles to speed up filter_file(r'(const unsigned int n_cycles = 8;)', ('const unsigned int n_cycles = 2;'), 'step-40.cc') cmake('.') - make('release') - make('run',parallel=False) + if '^petsc' in spec: + make('release') + make('run',parallel=False) print('=====================================') print('========= Step-40 Trilinos ==========') print('=====================================') # change Linear Algebra to Trilinos filter_file(r'(\/\/ #define FORCE_USE_OF_TRILINOS.*)', ('#define FORCE_USE_OF_TRILINOS'), 'step-40.cc') - make('release') - make('run',parallel=False) + if '^trilinos+hypre' in spec: + make('release') + make('run',parallel=False) print('=====================================') print('=== Step-40 Trilinos SuperluDist ====') @@ -223,31 +206,34 @@ class Dealii(Package): filter_file(r'(preconditioner.initialize\(system_matrix, data\);)', (''), 'step-40.cc') filter_file(r'(solver\.solve \(system_matrix, completely_distributed_solution, system_rhs,)', ('solver.solve (system_matrix, completely_distributed_solution, system_rhs);'), 'step-40.cc') filter_file(r'(preconditioner\);)', (''), 'step-40.cc') - - make('release') - make('run',paralle=False) + if '^trilinos+superlu-dist' in spec: + make('release') + make('run',paralle=False) print('=====================================') print('====== Step-40 Trilinos MUMPS =======') print('=====================================') # switch to Mumps filter_file(r'(Amesos_Superludist)', ('Amesos_Mumps'), 'step-40.cc') - make('release') - make('run',parallel=False) + if '^trilinos+mumps' in spec: + make('release') + make('run',parallel=False) print('=====================================') print('============ Step-36 ================') print('=====================================') with working_dir('examples/step-36'): - cmake('.') - make('release') - make('run',parallel=False) + if 'slepc' in spec: + cmake('.') + make('release') + make('run',parallel=False) print('=====================================') print('============ Step-54 ================') print('=====================================') with working_dir('examples/step-54'): - cmake('.') - make('release') - # FIXME - # make('run',parallel=False) + if 'oce' in spec: + cmake('.') + make('release') + if sys.platform != 'darwin': #FIXME + make('run',parallel=False) -- cgit v1.2.3-70-g09d2 From 5506e89aa9f45b94a7b16a24e24e3c081fdf1e38 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Wed, 30 Mar 2016 21:41:23 +0200 Subject: rename variant doxygen to doc --- var/spack/repos/builtin/packages/dealii/package.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/dealii/package.py b/var/spack/repos/builtin/packages/dealii/package.py index 32dfb33c6d..7aaf33380e 100644 --- a/var/spack/repos/builtin/packages/dealii/package.py +++ b/var/spack/repos/builtin/packages/dealii/package.py @@ -11,7 +11,7 @@ class Dealii(Package): variant('mpi', default=True, description='Compile with MPI') variant('arpack', default=True, description='Compile with Arpack and PArpack (only with MPI)') - variant('doxygen', default=False, description='Compile with Doxygen documentation') + variant('doc', default=False, description='Compile with documentation') variant('hdf5', default=True, description='Compile with HDF5 (only with MPI)') variant('metis', default=True, description='Compile with Metis') variant('netcdf', default=True, description='Compile with Netcdf (only with MPI)') @@ -36,7 +36,7 @@ class Dealii(Package): # optional dependencies depends_on ("mpi", when="+mpi") depends_on ("arpack-ng+mpi", when='+arpack+mpi') - depends_on ("doxygen", when='+doxygen') + depends_on ("doxygen", when='+doc') depends_on ("hdf5+mpi~cxx", when='+hdf5+mpi') #FIXME NetCDF declares dependency with ~cxx, why? depends_on ("metis", when='+metis') depends_on ("netcdf+mpi", when="+netcdf+mpi") @@ -111,7 +111,7 @@ class Dealii(Package): # doxygen options.extend([ - '-DDEAL_II_COMPONENT_DOCUMENTATION=%s' % ('ON' if '+doxygen' in spec else 'OFF'), + '-DDEAL_II_COMPONENT_DOCUMENTATION=%s' % ('ON' if '+doc' in spec else 'OFF'), ]) -- cgit v1.2.3-70-g09d2 From 44b89474453bf80fd603eb5ea5b629b0d9dff123 Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 30 Mar 2016 23:33:57 -0700 Subject: arpack-ng needs an extra libtoolize to build. --- var/spack/repos/builtin/packages/arpack-ng/package.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/arpack-ng/package.py b/var/spack/repos/builtin/packages/arpack-ng/package.py index dd86b17a53..6b152f7863 100644 --- a/var/spack/repos/builtin/packages/arpack-ng/package.py +++ b/var/spack/repos/builtin/packages/arpack-ng/package.py @@ -41,10 +41,17 @@ class ArpackNg(Package): depends_on('blas') depends_on('lapack') + depends_on('automake') + depends_on('autoconf') + depends_on('libtool@2.4.2:') + depends_on('mpi', when='+mpi') def install(self, spec, prefix): # Apparently autotools are not bootstrapped + # TODO: switch to use the CMake build in the next version + # rather than bootstrapping. + which('libtoolize')() bootstrap = Executable('./bootstrap') options = ['--prefix=%s' % prefix] -- cgit v1.2.3-70-g09d2