dealii: add nanoflann, sundials and adol-c plus fixes on macOS (#5175)
* expat: fix build on macOS * nanoflann: add new package * sundials: fix compilation on macOS with clang+gfortran * adol-c: add 2.6.3 * dealii: add adol-c, nanoflann, sundials and 8.5.1 * sundials: minor cleanup
This commit is contained in:
		 Denis Davydov
					Denis Davydov
				
			
				
					committed by
					
						 Adam J. Stewart
						Adam J. Stewart
					
				
			
			
				
	
			
			
			 Adam J. Stewart
						Adam J. Stewart
					
				
			
						parent
						
							61cc55985b
						
					
				
				
					commit
					c0d3d33b58
				
			| @@ -34,6 +34,7 @@ class AdolC(AutotoolsPackage): | |||||||
|  |  | ||||||
|     version('develop',  git='https://gitlab.com/adol-c/adol-c.git', |     version('develop',  git='https://gitlab.com/adol-c/adol-c.git', | ||||||
|             branch='master') |             branch='master') | ||||||
|  |     version('2.6.3', 'f78f67f70d5874830a1ad1c0f54e54f7') | ||||||
|     version('2.6.2', '0f9547584c99c0673e4f81cf64e8d865') |     version('2.6.2', '0f9547584c99c0673e4f81cf64e8d865') | ||||||
|     version('2.6.1', '1032b28427d6e399af4610e78c0f087b') |     version('2.6.1', '1032b28427d6e399af4610e78c0f087b') | ||||||
|  |  | ||||||
|   | |||||||
| @@ -36,6 +36,7 @@ class Dealii(CMakePackage): | |||||||
|     # only add for immediate deps. |     # only add for immediate deps. | ||||||
|     transitive_rpaths = False |     transitive_rpaths = False | ||||||
|  |  | ||||||
|  |     version('8.5.1', '39b9ebd6ab083d63cfc9044319aaa2ee') | ||||||
|     version('8.5.0', 'ef999cc310b007559a6343bf5b1759bc') |     version('8.5.0', 'ef999cc310b007559a6343bf5b1759bc') | ||||||
|     version('8.4.2', '84c6bd3f250d3e0681b645d24cb987a7') |     version('8.4.2', '84c6bd3f250d3e0681b645d24cb987a7') | ||||||
|     version('8.4.1', 'efbaf16f9ad59cfccad62302f36c3c1d') |     version('8.4.1', 'efbaf16f9ad59cfccad62302f36c3c1d') | ||||||
| @@ -48,12 +49,15 @@ class Dealii(CMakePackage): | |||||||
|     variant('mpi',      default=True,  description='Compile with MPI') |     variant('mpi',      default=True,  description='Compile with MPI') | ||||||
|     variant('arpack',   default=True, |     variant('arpack',   default=True, | ||||||
|             description='Compile with Arpack and PArpack (only with MPI)') |             description='Compile with Arpack and PArpack (only with MPI)') | ||||||
|  |     variant('adol-c',   default=False, | ||||||
|  |             description='Compile with Adol-c') | ||||||
|     variant('doc',      default=False, |     variant('doc',      default=False, | ||||||
|             description='Compile with documentation') |             description='Compile with documentation') | ||||||
|     variant('gsl',      default=True,  description='Compile with GSL') |     variant('gsl',      default=True,  description='Compile with GSL') | ||||||
|     variant('hdf5',     default=True, |     variant('hdf5',     default=True, | ||||||
|             description='Compile with HDF5 (only with MPI)') |             description='Compile with HDF5 (only with MPI)') | ||||||
|     variant('metis',    default=True,  description='Compile with Metis') |     variant('metis',    default=True,  description='Compile with Metis') | ||||||
|  |     variant('nanoflann', default=False, description='Compile with Nanoflann') | ||||||
|     variant('netcdf',   default=True, |     variant('netcdf',   default=True, | ||||||
|             description='Compile with Netcdf (only with MPI)') |             description='Compile with Netcdf (only with MPI)') | ||||||
|     variant('oce',      default=True,  description='Compile with OCE') |     variant('oce',      default=True,  description='Compile with OCE') | ||||||
| @@ -61,6 +65,8 @@ class Dealii(CMakePackage): | |||||||
|             description='Compile with P4est (only with MPI)') |             description='Compile with P4est (only with MPI)') | ||||||
|     variant('petsc',    default=True, |     variant('petsc',    default=True, | ||||||
|             description='Compile with Petsc (only with MPI)') |             description='Compile with Petsc (only with MPI)') | ||||||
|  |     variant('sundials', default=False, | ||||||
|  |             description='Compile with Sundials') | ||||||
|     variant('slepc',    default=True, |     variant('slepc',    default=True, | ||||||
|             description='Compile with Slepc (only with Petsc and MPI)') |             description='Compile with Slepc (only with Petsc and MPI)') | ||||||
|     variant('trilinos', default=True, |     variant('trilinos', default=True, | ||||||
| @@ -109,6 +115,7 @@ class Dealii(CMakePackage): | |||||||
|  |  | ||||||
|     # optional dependencies |     # optional dependencies | ||||||
|     depends_on("mpi",              when="+mpi") |     depends_on("mpi",              when="+mpi") | ||||||
|  |     depends_on("adol-c@2.6.4:",    when='@9.0:+adol-c') | ||||||
|     depends_on("arpack-ng+mpi",    when='+arpack+mpi') |     depends_on("arpack-ng+mpi",    when='+arpack+mpi') | ||||||
|     depends_on("doxygen+graphviz", when='+doc') |     depends_on("doxygen+graphviz", when='+doc') | ||||||
|     depends_on("graphviz",         when='+doc') |     depends_on("graphviz",         when='+doc') | ||||||
| @@ -118,6 +125,7 @@ class Dealii(CMakePackage): | |||||||
|     # but we should not need it |     # but we should not need it | ||||||
|     depends_on("metis@5:+int64+real64",   when='+metis+int64') |     depends_on("metis@5:+int64+real64",   when='+metis+int64') | ||||||
|     depends_on("metis@5:~int64+real64",   when='+metis~int64') |     depends_on("metis@5:~int64+real64",   when='+metis~int64') | ||||||
|  |     depends_on("nanoflann",        when="@9.0:+nanoflann") | ||||||
|     depends_on("netcdf+mpi",       when="+netcdf+mpi") |     depends_on("netcdf+mpi",       when="+netcdf+mpi") | ||||||
|     depends_on("netcdf-cxx",       when='+netcdf+mpi') |     depends_on("netcdf-cxx",       when='+netcdf+mpi') | ||||||
|     depends_on("oce",              when='+oce') |     depends_on("oce",              when='+oce') | ||||||
| @@ -129,10 +137,14 @@ class Dealii(CMakePackage): | |||||||
|     depends_on("slepc",            when='+slepc+petsc+mpi') |     depends_on("slepc",            when='+slepc+petsc+mpi') | ||||||
|     depends_on("slepc@:3.6.3",     when='@:8.4.1+slepc+petsc+mpi') |     depends_on("slepc@:3.6.3",     when='@:8.4.1+slepc+petsc+mpi') | ||||||
|     depends_on("slepc~arpack",     when='+slepc+petsc+mpi+int64') |     depends_on("slepc~arpack",     when='+slepc+petsc+mpi+int64') | ||||||
|  |     depends_on("sundials",         when='@9.0:+sundials') | ||||||
|     depends_on("trilinos+amesos+aztec+epetra+ifpack+ml+muelu+sacado+teuchos",       when='+trilinos+mpi~int64') |     depends_on("trilinos+amesos+aztec+epetra+ifpack+ml+muelu+sacado+teuchos",       when='+trilinos+mpi~int64') | ||||||
|     depends_on("trilinos+amesos+aztec+epetra+ifpack+ml+muelu+sacado+teuchos~hypre", when="+trilinos+mpi+int64") |     depends_on("trilinos+amesos+aztec+epetra+ifpack+ml+muelu+sacado+teuchos~hypre", when="+trilinos+mpi+int64") | ||||||
|  |  | ||||||
|     # check that the combination of variants makes sense |     # check that the combination of variants makes sense | ||||||
|  |     conflicts('+nanoflann', when='@:8.5.1') | ||||||
|  |     conflicts('+sundials', when='@:8.5.1') | ||||||
|  |     conflicts('+adol-c', when='@:8.5.1') | ||||||
|     conflicts('+gsl',    when='@:8.4.2') |     conflicts('+gsl',    when='@:8.4.2') | ||||||
|     conflicts('+python', when='@:8.4.2') |     conflicts('+python', when='@:8.4.2') | ||||||
|     for p in ['+arpack', '+hdf5', '+netcdf', '+p4est', '+petsc', |     for p in ['+arpack', '+hdf5', '+netcdf', '+p4est', '+petsc', | ||||||
| @@ -211,7 +223,8 @@ def cmake_args(self): | |||||||
|         # Optional dependencies for which library names are the same as CMake |         # Optional dependencies for which library names are the same as CMake | ||||||
|         # variables: |         # variables: | ||||||
|         for library in ( |         for library in ( | ||||||
|                 'gsl', 'hdf5', 'p4est', 'petsc', 'slepc', 'trilinos', 'metis'): |                 'gsl', 'hdf5', 'p4est', 'petsc', 'slepc', 'trilinos', 'metis', | ||||||
|  |                 'sundials', 'nanoflann'): | ||||||
|             if library in spec: |             if library in spec: | ||||||
|                 options.extend([ |                 options.extend([ | ||||||
|                     '-D%s_DIR=%s' % (library.upper(), spec[library].prefix), |                     '-D%s_DIR=%s' % (library.upper(), spec[library].prefix), | ||||||
| @@ -222,6 +235,17 @@ def cmake_args(self): | |||||||
|                     '-DDEAL_II_WITH_%s:BOOL=OFF' % library.upper() |                     '-DDEAL_II_WITH_%s:BOOL=OFF' % library.upper() | ||||||
|                 ]) |                 ]) | ||||||
|  |  | ||||||
|  |         # adol-c | ||||||
|  |         if '+adol-c' in spec: | ||||||
|  |             options.extend([ | ||||||
|  |                 '-DADOLC_DIR=%s' % spec['adol-c'].prefix, | ||||||
|  |                 '-DDEAL_II_WITH_ADOLC=ON' | ||||||
|  |             ]) | ||||||
|  |         else: | ||||||
|  |             options.extend([ | ||||||
|  |                 '-DDEAL_II_WITH_ADOLC=OFF' | ||||||
|  |             ]) | ||||||
|  |  | ||||||
|         # doxygen |         # doxygen | ||||||
|         options.extend([ |         options.extend([ | ||||||
|             '-DDEAL_II_COMPONENT_DOCUMENTATION=%s' % |             '-DDEAL_II_COMPONENT_DOCUMENTATION=%s' % | ||||||
|   | |||||||
| @@ -23,6 +23,7 @@ | |||||||
| # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||||||
| ############################################################################## | ############################################################################## | ||||||
| from spack import * | from spack import * | ||||||
|  | import sys | ||||||
|  |  | ||||||
|  |  | ||||||
| class Expat(AutotoolsPackage): | class Expat(AutotoolsPackage): | ||||||
| @@ -39,7 +40,7 @@ class Expat(AutotoolsPackage): | |||||||
|     # someone's asking for an older version and also libbsd. |     # someone's asking for an older version and also libbsd. | ||||||
|     # In order to install an older version, you'll need to add |     # In order to install an older version, you'll need to add | ||||||
|     # `~libbsd`. |     # `~libbsd`. | ||||||
|     variant('libbsd', default=True, |     variant('libbsd', default=sys.platform != 'darwin', | ||||||
|             description="Use libbsd (for high quality randomness)") |             description="Use libbsd (for high quality randomness)") | ||||||
|     depends_on('libbsd', when="@2.2.1:+libbsd") |     depends_on('libbsd', when="@2.2.1:+libbsd") | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										39
									
								
								var/spack/repos/builtin/packages/nanoflann/package.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								var/spack/repos/builtin/packages/nanoflann/package.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,39 @@ | |||||||
|  | ############################################################################## | ||||||
|  | # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. | ||||||
|  | # Produced at the Lawrence Livermore National Laboratory. | ||||||
|  | # | ||||||
|  | # This file is part of Spack. | ||||||
|  | # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. | ||||||
|  | # LLNL-CODE-647188 | ||||||
|  | # | ||||||
|  | # For details, see https://github.com/llnl/spack | ||||||
|  | # Please also see the NOTICE and LICENSE files for our notice and the LGPL. | ||||||
|  | # | ||||||
|  | # This program is free software; you can redistribute it and/or modify | ||||||
|  | # it under the terms of the GNU Lesser General Public License (as | ||||||
|  | # published by the Free Software Foundation) version 2.1, February 1999. | ||||||
|  | # | ||||||
|  | # This program is distributed in the hope that it will be useful, but | ||||||
|  | # WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF | ||||||
|  | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and | ||||||
|  | # conditions of the GNU Lesser General Public License for more details. | ||||||
|  | # | ||||||
|  | # You should have received a copy of the GNU Lesser General Public | ||||||
|  | # License along with this program; if not, write to the Free Software | ||||||
|  | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||||||
|  | ############################################################################## | ||||||
|  | from spack import * | ||||||
|  |  | ||||||
|  |  | ||||||
|  | class Nanoflann(CMakePackage): | ||||||
|  |     """a C++ header-only library for Nearest Neighbor (NN) search wih KD-trees. | ||||||
|  |     """ | ||||||
|  |  | ||||||
|  |     homepage = "https://github.com/jlblancoc/nanoflann" | ||||||
|  |     url      = "https://github.com/jlblancoc/nanoflann/archive/v1.2.3.tar.gz" | ||||||
|  |  | ||||||
|  |     version('1.2.3', '92a0f44a631c41aa06f9716c51dcdb11') | ||||||
|  |  | ||||||
|  |     def cmake_args(self): | ||||||
|  |         args = ['-DBUILD_SHARED_LIBS=ON'] | ||||||
|  |         return args | ||||||
| @@ -68,10 +68,18 @@ def on_off(varstr): | |||||||
|             return 'ON' if varstr in self.spec else 'OFF' |             return 'ON' if varstr in self.spec else 'OFF' | ||||||
|  |  | ||||||
|         cmake_args = std_cmake_args[:] |         cmake_args = std_cmake_args[:] | ||||||
|  |  | ||||||
|  |         fortran_flag = self.compiler.pic_flag | ||||||
|  |         if spec.satisfies('%clang platform=darwin'): | ||||||
|  |             mpif77 = Executable(self.spec['mpi'].mpif77) | ||||||
|  |             libgfortran = LibraryList(mpif77('--print-file-name', | ||||||
|  |                                              'libgfortran.a', output=str)) | ||||||
|  |             fortran_flag += ' ' + libgfortran.ld_flags | ||||||
|  |  | ||||||
|         cmake_args.extend([ |         cmake_args.extend([ | ||||||
|             '-DBUILD_SHARED_LIBS=ON', |             '-DBUILD_SHARED_LIBS=ON', | ||||||
|             '-DCMAKE_C_FLAGS={0}'.format(self.compiler.pic_flag), |             '-DCMAKE_C_FLAGS={0}'.format(self.compiler.pic_flag), | ||||||
|             '-DCMAKE_Fortran_FLAGS={0}'.format(self.compiler.pic_flag), |             '-DCMAKE_Fortran_FLAGS={0}'.format(fortran_flag), | ||||||
|             '-DEXAMPLES_ENABLE=ON', |             '-DEXAMPLES_ENABLE=ON', | ||||||
|             '-DEXAMPLES_INSTALL=ON', |             '-DEXAMPLES_INSTALL=ON', | ||||||
|             '-DFCMIX_ENABLE=ON', |             '-DFCMIX_ENABLE=ON', | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user