Unique package with one variant per module
This commit is contained in:
parent
93193cd33d
commit
99615d3cdd
|
@ -1,31 +0,0 @@
|
||||||
--- a/cmake/modules/AddQuadMathFlags.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/AddQuadMathFlags.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,28 @@
|
|
||||||
+# Defines the functions to use QuadMath
|
|
||||||
+#
|
|
||||||
+# .. cmake_function:: add_dune_quadmath_flags
|
|
||||||
+#
|
|
||||||
+# .. cmake_param:: targets
|
|
||||||
+# :positional:
|
|
||||||
+# :single:
|
|
||||||
+# :required:
|
|
||||||
+#
|
|
||||||
+# A list of targets to use QuadMath with.
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+function(add_dune_quadmath_flags _targets)
|
|
||||||
+ if(QUADMATH_FOUND)
|
|
||||||
+ foreach(_target ${_targets})
|
|
||||||
+ target_link_libraries(${_target} "quadmath")
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-DENABLE_QUADMATH=1 -D_GLIBCXX_USE_FLOAT128=1 ")
|
|
||||||
+ if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-fext-numeric-literals ")
|
|
||||||
+ endif()
|
|
||||||
+ endforeach(_target ${_targets})
|
|
||||||
+ endif(QUADMATH_FOUND)
|
|
||||||
+endfunction(add_dune_quadmath_flags)
|
|
|
@ -1,62 +0,0 @@
|
||||||
--- a/cmake/modules/FindQuadMath.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/FindQuadMath.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,59 @@
|
|
||||||
+# .. cmake_module::
|
|
||||||
+#
|
|
||||||
+# Find the GCC Quad-Precision library
|
|
||||||
+#
|
|
||||||
+# Sets the following variables:
|
|
||||||
+#
|
|
||||||
+# :code:`QUADMATH_FOUND`
|
|
||||||
+# True if the Quad-Precision library was found.
|
|
||||||
+#
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# search for the header quadmath.h
|
|
||||||
+include(CheckIncludeFile)
|
|
||||||
+check_include_file(quadmath.h QUADMATH_HEADER)
|
|
||||||
+
|
|
||||||
+include(CheckCSourceCompiles)
|
|
||||||
+include(CMakePushCheckState)
|
|
||||||
+
|
|
||||||
+cmake_push_check_state() # Save variables
|
|
||||||
+set(CMAKE_REQUIRED_LIBRARIES quadmath)
|
|
||||||
+check_c_source_compiles("
|
|
||||||
+#include <quadmath.h>
|
|
||||||
+
|
|
||||||
+int main ()
|
|
||||||
+{
|
|
||||||
+ __float128 r = 1.0q;
|
|
||||||
+ r = strtoflt128(\"1.2345678\", NULL);
|
|
||||||
+ return 0;
|
|
||||||
+}" QUADMATH_COMPILES)
|
|
||||||
+cmake_pop_check_state()
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+include(FindPackageHandleStandardArgs)
|
|
||||||
+find_package_handle_standard_args(
|
|
||||||
+ "QuadMath"
|
|
||||||
+ DEFAULT_MSG
|
|
||||||
+ QUADMATH_HEADER
|
|
||||||
+ QUADMATH_COMPILES
|
|
||||||
+)
|
|
||||||
+
|
|
||||||
+# text for feature summary
|
|
||||||
+set_package_properties("QuadMath" PROPERTIES
|
|
||||||
+ DESCRIPTION "GCC Quad-Precision library")
|
|
||||||
+
|
|
||||||
+# set HAVE_QUADMATH for config.h
|
|
||||||
+set(HAVE_QUADMATH ${QUADMATH_FOUND})
|
|
||||||
+
|
|
||||||
+# -fext-numeric-literals is a GCC extension not available in other compilers like clang
|
|
||||||
+if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set(_QUADMATH_EXT_NUMERIC_LITERALS "-fext-numeric-literals")
|
|
||||||
+endif()
|
|
||||||
+
|
|
||||||
+# register all QuadMath related flags
|
|
||||||
+if(HAVE_QUADMATH)
|
|
||||||
+ dune_register_package_flags(COMPILE_DEFINITIONS "ENABLE_QUADMATH=1" "_GLIBCXX_USE_FLOAT128=1"
|
|
||||||
+ COMPILE_OPTIONS ${_QUADMATH_EXT_NUMERIC_LITERALS}
|
|
||||||
+ LIBRARIES "quadmath")
|
|
||||||
+endif()
|
|
|
@ -1,120 +0,0 @@
|
||||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# If you submit this package back to Spack as a pull request,
|
|
||||||
# please first remove this boilerplate and all FIXME comments.
|
|
||||||
#
|
|
||||||
# This is a template package file for Spack. We've put "FIXME"
|
|
||||||
# next to all the things you'll want to change. Once you've handled
|
|
||||||
# them, you can save this file and test your package like this:
|
|
||||||
#
|
|
||||||
# spack install dune-alugrid
|
|
||||||
#
|
|
||||||
# You can edit this file again by typing:
|
|
||||||
#
|
|
||||||
# spack edit dune-alugrid
|
|
||||||
#
|
|
||||||
# See the Spack documentation for more information on packaging.
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
from spack import *
|
|
||||||
|
|
||||||
|
|
||||||
class DuneAlugrid(CMakePackage):
|
|
||||||
"""ALUGrid is an adaptive, loadbalancing, unstructured implementation of the DUNE grid interface supporting either simplices or cubes."""
|
|
||||||
|
|
||||||
homepage = "https://www.dune-project.org"
|
|
||||||
url = "https://github.com/dune-mirrors/dune-alugrid/archive/v2.6.0.tar.gz"
|
|
||||||
|
|
||||||
version('2.6.0', sha256='25fa4a5127837a0def2f93ae7fda38c5098dd066536236533015755ad264a870')
|
|
||||||
version('2.4.0', sha256='fd0fab5b2c6e1e0c9f792947dad1f9c2e2d6b65242935474017e0c278bab3ae1')
|
|
||||||
|
|
||||||
#option
|
|
||||||
variant('blas', default=True, description='Build with BLAS support')
|
|
||||||
variant('lapack', default=True, description='Build with LAPACK support')
|
|
||||||
variant('gmp', default=True, description='Build with GNU multi-precision library support')
|
|
||||||
variant('tbb', default=True, description='Build with Threading Building Blocks library support')
|
|
||||||
variant('mkl', default=True, description='Build with Math Kernel library support')
|
|
||||||
variant('doxygen', default=True, description='Create Doxygen documentation')
|
|
||||||
variant('sphinx', default=True, description='Create Sphinx documentation')
|
|
||||||
variant('python', default=False, description='Build with Python and dune-python')
|
|
||||||
variant('vc', default=True, description='Build C++ Vectorization library support')
|
|
||||||
variant('zlib', default=True, description='Build zlib library support')
|
|
||||||
variant('imagemagick', default=False, description='Imagemagick support')
|
|
||||||
variant('corepy', default=False, description='Build with dune-corepy support')
|
|
||||||
variant('uggrid', default=False, description='Build with dune-uggrid support')
|
|
||||||
variant('ptscotch', default=True, description='Build with PT-Scotch support')
|
|
||||||
variant('metis', default=True, description='Build with METIS support')
|
|
||||||
variant('parmetis', default=True, description='Build with ParMETIS support')
|
|
||||||
variant('alberta', default=False, description='Build with Alberta support')
|
|
||||||
variant('psurface', default=False, description='Build with Psurface support')
|
|
||||||
variant('amiramesh', default=False, description='Build with AmiraMesh support')
|
|
||||||
variant('sionlib', default=False, description='Build with SIONlib support')
|
|
||||||
variant('zoltan', default=True, description='Build with Zoltan support')
|
|
||||||
variant('threads', default=True, description='Whether we are using pthreads')
|
|
||||||
variant('extrautils', default=True, description='Enable compilation and installation of extra utilities from the src subdirectory')
|
|
||||||
variant('selector', default=True, description='Grid selector definition added to config.h')
|
|
||||||
variant('shared', default=True, description='Enables the build of shared libraries.')
|
|
||||||
|
|
||||||
#dependencies
|
|
||||||
depends_on('dune-common')
|
|
||||||
depends_on('dune-geometry')
|
|
||||||
depends_on('dune-grid')
|
|
||||||
depends_on('dune-corepy', when='+corepy')
|
|
||||||
depends_on('dune-python', when='+python')
|
|
||||||
depends_on('dune-uggrid', when='+uggrid')
|
|
||||||
depends_on('cmake@3.1:', type='build')
|
|
||||||
depends_on('mpi')
|
|
||||||
depends_on('blas', when='+blas')
|
|
||||||
depends_on('lapack', when='+lapack')
|
|
||||||
depends_on('doxygen', type='build', when='+doxygen')
|
|
||||||
depends_on('gmp', when='+gmp')
|
|
||||||
depends_on('intel-tbb', when='+tbb')
|
|
||||||
depends_on('intel-mkl', when='+mkl')
|
|
||||||
depends_on('python@3.0:')
|
|
||||||
depends_on('py-sphinx', type='build', when='+sphinx')
|
|
||||||
depends_on('vc', when='+vc')
|
|
||||||
depends_on('zlib', when='+zlib')
|
|
||||||
depends_on('scotch+mpi', when='+ptscotch')
|
|
||||||
depends_on('zoltan', when='+zoltan')
|
|
||||||
depends_on('metis', when='+metis')
|
|
||||||
depends_on('parmetis', when='+parmetis')
|
|
||||||
depends_on('pkg-config', type='build')
|
|
||||||
depends_on('imagemagick', type='build', when='+imagemagick')
|
|
||||||
depends_on('alberta', when='+alberta')
|
|
||||||
depends_on('psurface', when='+psurface')
|
|
||||||
depends_on('amiramesh', when='+amiramesh')
|
|
||||||
depends_on('sionlib', when='+sionlib')
|
|
||||||
|
|
||||||
patch('AddQuadMathFlags.cmake.patch', when='@2.6')
|
|
||||||
patch('FindQuadMath.cmake.patch', when='@2.6')
|
|
||||||
|
|
||||||
def cmake_args(self):
|
|
||||||
"""Populate cmake arguments."""
|
|
||||||
spec = self.spec
|
|
||||||
def variant_bool(feature, on='ON', off='OFF'):
|
|
||||||
"""Ternary for spec variant to ON/OFF string"""
|
|
||||||
if feature in spec:
|
|
||||||
return on
|
|
||||||
return off
|
|
||||||
|
|
||||||
def nvariant_bool(feature):
|
|
||||||
"""Negated ternary for spec variant to OFF/ON string"""
|
|
||||||
return variant_bool(feature, on='OFF', off='ON')
|
|
||||||
|
|
||||||
cmake_args = [
|
|
||||||
# '-DDUNE_BUILD_BOTH_LIBS=%s' % variant_bool('+shared'),
|
|
||||||
'-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
|
|
||||||
'-DDUNE_GRID_EXTRA_UTILS:BOOL=%s' % variant_bool('+extrautils'),
|
|
||||||
'-DDUNE_GRID_GRIDTYPE_SELECTOR:BOOL=%s' % variant_bool('+selector'),
|
|
||||||
'-DUSE_PTHREADS:BOOL=%s' % variant_bool('+threads'),
|
|
||||||
]
|
|
||||||
if 'python' in spec:
|
|
||||||
cmake_args.append('-DDUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS:BOOL=TRUE')
|
|
||||||
cmake_args.append('-DPYTHON_INSTALL_LOCATION:STRING="system"')
|
|
||||||
|
|
||||||
return cmake_args
|
|
||||||
|
|
|
@ -1,106 +0,0 @@
|
||||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# If you submit this package back to Spack as a pull request,
|
|
||||||
# please first remove this boilerplate and all FIXME comments.
|
|
||||||
#
|
|
||||||
# This is a template package file for Spack. We've put "FIXME"
|
|
||||||
# next to all the things you'll want to change. Once you've handled
|
|
||||||
# them, you can save this file and test your package like this:
|
|
||||||
#
|
|
||||||
# spack install dune-common
|
|
||||||
#
|
|
||||||
# You can edit this file again by typing:
|
|
||||||
#
|
|
||||||
# spack edit dune-common
|
|
||||||
#
|
|
||||||
# See the Spack documentation for more information on packaging.
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
from spack import *
|
|
||||||
|
|
||||||
|
|
||||||
class DuneCommon(CMakePackage):
|
|
||||||
"""
|
|
||||||
dune-common provides basic infrastructure classes for all Dune
|
|
||||||
modules.
|
|
||||||
"""
|
|
||||||
|
|
||||||
homepage = "https://www.dune-project.org"
|
|
||||||
url = "https://www.dune-project.org/download/2.7.0/dune-common-2.7.0.tar.gz"
|
|
||||||
list_url = "https://www.dune-project.org/download/"
|
|
||||||
list_depth = 1
|
|
||||||
|
|
||||||
version('2.7.0', sha256='3c83c583a45325513113148cb94bd978e601907a6591c765f6253342e00f1890')
|
|
||||||
version('2.6.0', sha256='1c566abb509ffd29690055acb5a7a69e3eda3848c2171f7af75c1e8743663c05')
|
|
||||||
version('2.5.2', sha256='042fc7b9ae4b781e027a48048ea4067deb924ae172e56821f679bc8afe312159')
|
|
||||||
version('2.5.1', sha256='fa9b1e538236e761d4eec703343e1345e8da1b75b3d2adbdde5fc53012d05814')
|
|
||||||
version('2.5.0', sha256='3a6e20189926f0908316d43b2b130ae89e3662865926325a236c5465640a33c2')
|
|
||||||
version('2.4.2', sha256='93e973e1db81950c378cf3ebe6cffca32fb642c7bd5e40a8883ebdc8c6909536')
|
|
||||||
version('2.4.1', sha256='e4e9a4d6207484728a8582c5bca14c1479075b655d095790a037e6f0135762a8')
|
|
||||||
version('2.4.0', sha256='7c2865e467883adbfdf4b248b8dbf3cd171a47c7498164d2dbe700171fdb7b1f')
|
|
||||||
|
|
||||||
variant('blas', default=True, description='Build with BLAS support')
|
|
||||||
variant('lapack', default=True, description='Build with LAPACK support')
|
|
||||||
variant('gmp', default=True, description='Build with GNU multi-precision library support')
|
|
||||||
variant('tbb', default=True, description='Build with Threading Building Blocks library support')
|
|
||||||
variant('mkl', default=True, description='Build with Math Kernel library support')
|
|
||||||
variant('doxygen', default=True, description='Create Doxygen documentation')
|
|
||||||
variant('sphinx', default=True, description='Create Sphinx documentation')
|
|
||||||
variant('vc', default=True, description='Build C++ Vectorization library support')
|
|
||||||
variant('imagemagick', default=False, description='Imagemagick support')
|
|
||||||
variant('threads', default=True, description='Activate pThread support')
|
|
||||||
variant('shared', default=True, description='Enables the build of shared libraries.')
|
|
||||||
variant('python', default=True, description='Build with Python')
|
|
||||||
variant('extrautils', default=True, description='Enable compilation and installation of extra utilities from the src subdirectory')
|
|
||||||
variant('selector', default=True, description='Grid selector definition added to config.h')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# FIXME: Add dependencies if required.
|
|
||||||
#option
|
|
||||||
depends_on('cmake@3.1:', type='build')
|
|
||||||
depends_on('mpi')
|
|
||||||
depends_on('blas', when='+blas')
|
|
||||||
depends_on('lapack', when='+lapack')
|
|
||||||
depends_on('doxygen', when='+doxygen')
|
|
||||||
depends_on('gmp', when='+gmp')
|
|
||||||
depends_on('intel-tbb', when='+tbb')
|
|
||||||
depends_on('intel-mkl', when='+mkl')
|
|
||||||
depends_on('python@3.0:', when='+python')
|
|
||||||
depends_on('py-sphinx', type='build', when='+sphinx')
|
|
||||||
depends_on('vc', when='+vc')
|
|
||||||
depends_on('pkg-config', type='build')
|
|
||||||
depends_on('imagemagick', type='build', when='+imagemagick')
|
|
||||||
|
|
||||||
def url_for_version(self, version):
|
|
||||||
url = "https://www.dune-project.org/download/{1}/dune-common-{1}.tar.gz"
|
|
||||||
return url.format(version.up_to(2), version)
|
|
||||||
|
|
||||||
def cmake_args(self):
|
|
||||||
"""Populate cmake arguments."""
|
|
||||||
spec = self.spec
|
|
||||||
def variant_bool(feature, on='ON', off='OFF'):
|
|
||||||
"""Ternary for spec variant to ON/OFF string"""
|
|
||||||
if feature in spec:
|
|
||||||
return on
|
|
||||||
return off
|
|
||||||
|
|
||||||
def nvariant_bool(feature):
|
|
||||||
"""Negated ternary for spec variant to OFF/ON string"""
|
|
||||||
return variant_bool(feature, on='OFF', off='ON')
|
|
||||||
|
|
||||||
cmake_args = [
|
|
||||||
# '-DDUNE_BUILD_BOTH_LIBS=%s' % variant_bool('+shared'),
|
|
||||||
'-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
|
|
||||||
'-DDUNE_GRID_EXTRA_UTILS:BOOL=%s' % variant_bool('+extrautils'),
|
|
||||||
'-DDUNE_GRID_GRIDTYPE_SELECTOR:BOOL=%s' % variant_bool('+selector'),
|
|
||||||
'-DUSE_PTHREADS:BOOL=%s' % variant_bool('+threads'),
|
|
||||||
]
|
|
||||||
if 'python' in spec:
|
|
||||||
cmake_args.append('-DPYTHON_INSTALL_LOCATION:STRING="system"')
|
|
||||||
|
|
||||||
return cmake_args
|
|
|
@ -1,31 +0,0 @@
|
||||||
--- a/cmake/modules/AddQuadMathFlags.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/AddQuadMathFlags.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,28 @@
|
|
||||||
+# Defines the functions to use QuadMath
|
|
||||||
+#
|
|
||||||
+# .. cmake_function:: add_dune_quadmath_flags
|
|
||||||
+#
|
|
||||||
+# .. cmake_param:: targets
|
|
||||||
+# :positional:
|
|
||||||
+# :single:
|
|
||||||
+# :required:
|
|
||||||
+#
|
|
||||||
+# A list of targets to use QuadMath with.
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+function(add_dune_quadmath_flags _targets)
|
|
||||||
+ if(QUADMATH_FOUND)
|
|
||||||
+ foreach(_target ${_targets})
|
|
||||||
+ target_link_libraries(${_target} "quadmath")
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-DENABLE_QUADMATH=1 -D_GLIBCXX_USE_FLOAT128=1 ")
|
|
||||||
+ if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-fext-numeric-literals ")
|
|
||||||
+ endif()
|
|
||||||
+ endforeach(_target ${_targets})
|
|
||||||
+ endif(QUADMATH_FOUND)
|
|
||||||
+endfunction(add_dune_quadmath_flags)
|
|
|
@ -1,62 +0,0 @@
|
||||||
--- a/cmake/modules/FindQuadMath.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/FindQuadMath.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,59 @@
|
|
||||||
+# .. cmake_module::
|
|
||||||
+#
|
|
||||||
+# Find the GCC Quad-Precision library
|
|
||||||
+#
|
|
||||||
+# Sets the following variables:
|
|
||||||
+#
|
|
||||||
+# :code:`QUADMATH_FOUND`
|
|
||||||
+# True if the Quad-Precision library was found.
|
|
||||||
+#
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# search for the header quadmath.h
|
|
||||||
+include(CheckIncludeFile)
|
|
||||||
+check_include_file(quadmath.h QUADMATH_HEADER)
|
|
||||||
+
|
|
||||||
+include(CheckCSourceCompiles)
|
|
||||||
+include(CMakePushCheckState)
|
|
||||||
+
|
|
||||||
+cmake_push_check_state() # Save variables
|
|
||||||
+set(CMAKE_REQUIRED_LIBRARIES quadmath)
|
|
||||||
+check_c_source_compiles("
|
|
||||||
+#include <quadmath.h>
|
|
||||||
+
|
|
||||||
+int main ()
|
|
||||||
+{
|
|
||||||
+ __float128 r = 1.0q;
|
|
||||||
+ r = strtoflt128(\"1.2345678\", NULL);
|
|
||||||
+ return 0;
|
|
||||||
+}" QUADMATH_COMPILES)
|
|
||||||
+cmake_pop_check_state()
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+include(FindPackageHandleStandardArgs)
|
|
||||||
+find_package_handle_standard_args(
|
|
||||||
+ "QuadMath"
|
|
||||||
+ DEFAULT_MSG
|
|
||||||
+ QUADMATH_HEADER
|
|
||||||
+ QUADMATH_COMPILES
|
|
||||||
+)
|
|
||||||
+
|
|
||||||
+# text for feature summary
|
|
||||||
+set_package_properties("QuadMath" PROPERTIES
|
|
||||||
+ DESCRIPTION "GCC Quad-Precision library")
|
|
||||||
+
|
|
||||||
+# set HAVE_QUADMATH for config.h
|
|
||||||
+set(HAVE_QUADMATH ${QUADMATH_FOUND})
|
|
||||||
+
|
|
||||||
+# -fext-numeric-literals is a GCC extension not available in other compilers like clang
|
|
||||||
+if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set(_QUADMATH_EXT_NUMERIC_LITERALS "-fext-numeric-literals")
|
|
||||||
+endif()
|
|
||||||
+
|
|
||||||
+# register all QuadMath related flags
|
|
||||||
+if(HAVE_QUADMATH)
|
|
||||||
+ dune_register_package_flags(COMPILE_DEFINITIONS "ENABLE_QUADMATH=1" "_GLIBCXX_USE_FLOAT128=1"
|
|
||||||
+ COMPILE_OPTIONS ${_QUADMATH_EXT_NUMERIC_LITERALS}
|
|
||||||
+ LIBRARIES "quadmath")
|
|
||||||
+endif()
|
|
|
@ -1,128 +0,0 @@
|
||||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# If you submit this package back to Spack as a pull request,
|
|
||||||
# please first remove this boilerplate and all FIXME comments.
|
|
||||||
#
|
|
||||||
# This is a template package file for Spack. We've put "FIXME"
|
|
||||||
# next to all the things you'll want to change. Once you've handled
|
|
||||||
# them, you can save this file and test your package like this:
|
|
||||||
#
|
|
||||||
# spack install dune-functions
|
|
||||||
#
|
|
||||||
# You can edit this file again by typing:
|
|
||||||
#
|
|
||||||
# spack edit dune-functions
|
|
||||||
#
|
|
||||||
# See the Spack documentation for more information on packaging.
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
from spack import *
|
|
||||||
|
|
||||||
|
|
||||||
class DuneFunctions(CMakePackage):
|
|
||||||
"""Abstractions for functions and discrete function space bases"""
|
|
||||||
|
|
||||||
|
|
||||||
homepage = "https://www.dune-project.org"
|
|
||||||
url = "https://gitlab.dune-project.org/staging/dune-functions/-/archive/releases/2.7/dune-functions-releases-2.7.tar.gz"
|
|
||||||
list_url = 'https://gitlab.dune-project.org/staging/dune-functions/-/archive/releases/'
|
|
||||||
list_depth = 1
|
|
||||||
|
|
||||||
version('2.7', sha256='cd9b16748f285ded2c9a4378d5b2b320e81180c9da88ea647f5a712cba442f80')
|
|
||||||
version('2.6', sha256='3df99f6d741ceb0b0f2fbba05e5562f5c65b9e45385991801f68fa163a2474a1')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#option
|
|
||||||
variant('blas', default=True, description='Build with BLAS support')
|
|
||||||
variant('lapack', default=True, description='Build with LAPACK support')
|
|
||||||
variant('gmp', default=True, description='Build with GNU multi-precision library support')
|
|
||||||
variant('tbb', default=True, description='Build with Threading Building Blocks library support')
|
|
||||||
variant('mkl', default=True, description='Build with Math Kernel library support')
|
|
||||||
variant('doxygen', default=True, description='Create Doxygen documentation')
|
|
||||||
variant('sphinx', default=True, description='Create Sphinx documentation')
|
|
||||||
variant('vc', default=True, description='Build C++ Vectorization library support')
|
|
||||||
variant('uggrid', default=True, description='Build with dune-uggrid support')
|
|
||||||
variant('imagemagick', default=False, description='Imagemagick support')
|
|
||||||
variant('metis', default=True, description='Build METIS library support')
|
|
||||||
variant('parmetis', default=True, description='Build ParMETIS library support')
|
|
||||||
variant('arpack', default=True, description='Build ARnoldi PACKage library support')
|
|
||||||
variant('suitesparse', default=True, description='Build SuiteSparse library support')
|
|
||||||
variant('superlu', default=True, description='Build Supernodal LU library support')
|
|
||||||
variant('alberta', default=False, description='Build with Alberta support')
|
|
||||||
variant('psurface', default=False, description='Build with Psurface support')
|
|
||||||
variant('amiramesh', default=False, description='Build with AmiraMesh support')
|
|
||||||
variant('selector', default=True, description='Grid selector definition added to config.h')
|
|
||||||
variant('oldcategory', default=True, description='Enable/Disable the backwards compatibility of the category enum/method in dune-istl solvers, preconditioner, etc.')
|
|
||||||
variant('extrautils', default=True, description='Enable compilation and installation of extra utilities from the src subdirectory')
|
|
||||||
variant('threads', default=True, description='Activate pThread support')
|
|
||||||
variant('shared', default=True, description='Enables the build of shared libraries.')
|
|
||||||
variant('alugrid', default=False, description='Support of dune-alugrid module')
|
|
||||||
variant('fempy', default=False, description='Support of dune-fempy module')
|
|
||||||
variant('spgrid', default=False, description='Support of dune-spgrid module')
|
|
||||||
|
|
||||||
|
|
||||||
#dependencies
|
|
||||||
depends_on('dune-localfunctions')
|
|
||||||
depends_on('dune-grid+uggrid')
|
|
||||||
depends_on('dune-typetree')
|
|
||||||
depends_on('dune-istl')
|
|
||||||
depends_on('dune-common+python+shared')
|
|
||||||
depends_on('cmake@3.1:', type='build')
|
|
||||||
depends_on('mpi')
|
|
||||||
depends_on('blas', when='+blas')
|
|
||||||
depends_on('lapack', when='+lapack')
|
|
||||||
depends_on('doxygen', type='build', when='+doxygen')
|
|
||||||
depends_on('gmp', when='+gmp')
|
|
||||||
depends_on('intel-tbb', when='+tbb')
|
|
||||||
depends_on('intel-mkl', when='+mkl')
|
|
||||||
depends_on('python@3.8.2:')
|
|
||||||
depends_on('py-sphinx', type='build', when='+sphinx')
|
|
||||||
depends_on('vc', when='+vc')
|
|
||||||
depends_on('pkg-config', type='build')
|
|
||||||
depends_on('imagemagick', type='build', when='+imagemagick')
|
|
||||||
depends_on('metis', when='+metis')
|
|
||||||
depends_on('parmetis', when='+parmetis')
|
|
||||||
depends_on('arpack-ng', when='+arpack')
|
|
||||||
depends_on('suite-sparse', when='+suitesparse')
|
|
||||||
depends_on('superlu', when='+superlu')
|
|
||||||
depends_on('alberta', when='+alberta')
|
|
||||||
depends_on('psurface', when='+psurface')
|
|
||||||
depends_on('amiramesh', when='+amiramesh')
|
|
||||||
|
|
||||||
def url_for_version(self, version):
|
|
||||||
url = 'https://gitlab.dune-project.org/staging/dune-functions/-/archive/releases/{1}/dune-functions-releases-{1}.tar.gz'
|
|
||||||
return url.format(version.up_to(2), version)
|
|
||||||
|
|
||||||
patch('AddQuadMathFlags.cmake.patch')
|
|
||||||
patch('FindQuadMath.cmake.patch')
|
|
||||||
|
|
||||||
def cmake_args(self):
|
|
||||||
"""Populate cmake arguments."""
|
|
||||||
spec = self.spec
|
|
||||||
def variant_bool(feature, on='ON', off='OFF'):
|
|
||||||
"""Ternary for spec variant to ON/OFF string"""
|
|
||||||
if feature in spec:
|
|
||||||
return on
|
|
||||||
return off
|
|
||||||
|
|
||||||
def nvariant_bool(feature):
|
|
||||||
"""Negated ternary for spec variant to OFF/ON string"""
|
|
||||||
return variant_bool(feature, on='OFF', off='ON')
|
|
||||||
|
|
||||||
cmake_args = [
|
|
||||||
# '-DDUNE_BUILD_BOTH_LIBS=%s' % variant_bool('+shared'),
|
|
||||||
'-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
|
|
||||||
'-DDUNE_GRID_EXTRA_UTILS:BOOL=%s' % variant_bool('+extrautils'),
|
|
||||||
'-DDUNE_GRID_GRIDTYPE_SELECTOR:BOOL=%s' % variant_bool('+selector'),
|
|
||||||
'-DDUNE_ISTL_SUPPORT_OLD_CATEGORY=%s' % variant_bool('+oldcategory'),
|
|
||||||
'-DUSE_PTHREADS:BOOL=%s' % variant_bool('+threads'),
|
|
||||||
]
|
|
||||||
if 'python' in spec:
|
|
||||||
cmake_args.append('-DPYTHON_INSTALL_LOCATION:STRING="system"')
|
|
||||||
|
|
||||||
return cmake_args
|
|
|
@ -1,109 +0,0 @@
|
||||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# If you submit this package back to Spack as a pull request,
|
|
||||||
# please first remove this boilerplate and all FIXME comments.
|
|
||||||
#
|
|
||||||
# This is a template package file for Spack. We've put "FIXME"
|
|
||||||
# next to all the things you'll want to change. Once you've handled
|
|
||||||
# them, you can save this file and test your package like this:
|
|
||||||
#
|
|
||||||
# spack install dune-geometry
|
|
||||||
#
|
|
||||||
# You can edit this file again by typing:
|
|
||||||
#
|
|
||||||
# spack edit dune-geometry
|
|
||||||
#
|
|
||||||
# See the Spack documentation for more information on packaging.
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
from spack import *
|
|
||||||
|
|
||||||
|
|
||||||
class DuneGeometry(CMakePackage):
|
|
||||||
"""
|
|
||||||
dune-geometry includes everything related to the DUNE reference
|
|
||||||
elements. This includes the reference elements themselves, mappings
|
|
||||||
on the reference elements (geometries), and quadratures.
|
|
||||||
"""
|
|
||||||
|
|
||||||
homepage = "https://www.dune-project.org"
|
|
||||||
url = "https://www.dune-project.org/download/2.7.0/dune-geometry-2.7.0.tar.gz"
|
|
||||||
list_url = "https://www.dune-project.org/download/"
|
|
||||||
list_depth = 1
|
|
||||||
|
|
||||||
version('2.7.0', sha256='d996c73efa345338766c5e4774e3b06ec1ed27eb745916af35877bbf38dd2cb2')
|
|
||||||
version('2.6.0', sha256='7661155a0be3d001db43c6d99f1ee1a04101bc3e666dade82a40a6ed65578a42')
|
|
||||||
version('2.5.2', sha256='30e9e6c22206034e3e490d3b0bf841cd49e8ece0d3a2f6df453e8594f546ec0d')
|
|
||||||
version('2.5.1', sha256='f3782b27a4622bd7b7bc52fa7561d5bcf4f0dc39d6c161c082047c7b92140076')
|
|
||||||
version('2.5.0', sha256='0b8ea21c046b703dbb4dfb1481e5ea74c9ea7487930be66d7a3fd74c854fb08e')
|
|
||||||
version('2.4.2', sha256='4fe3d09b1dba6c36b73662af32088639eac5af33e01599469de2b71bd0a8c4e3')
|
|
||||||
version('2.4.1', sha256='a6b92785150d309760f95add38d8a12bfd906d994e298cd54e744f34064b4e0f')
|
|
||||||
version('2.4.0', sha256='f0f8acb95fd325b9b78f9d1e35d733830865378c4d5d5c34e3ecce687341fe86')
|
|
||||||
|
|
||||||
#option
|
|
||||||
variant('blas', default=True, description='Build with BLAS support')
|
|
||||||
variant('lapack', default=True, description='Build with LAPACK support')
|
|
||||||
variant('gmp', default=True, description='Build with GNU multi-precision library support')
|
|
||||||
variant('tbb', default=True, description='Build with Threading Building Blocks library support')
|
|
||||||
variant('mkl', default=True, description='Build with Threading Building Blocks library support')
|
|
||||||
variant('doxygen', default=True, description='Create Doxygen documentation')
|
|
||||||
variant('sphinx', default=True, description='Create Sphinx documentation')
|
|
||||||
variant('python', default=True, description='Build with Python')
|
|
||||||
variant('vc', default=True, description='Build C++ Vectorization library support')
|
|
||||||
variant('imagemagick', default=False, description='Imagemagick support')
|
|
||||||
variant('threads', default=True, description='Activate pThread support')
|
|
||||||
variant('shared', default=True, description='Enables the build of shared libraries.')
|
|
||||||
variant('extrautils', default=True, description='Enable compilation and installation of extra utilities from the src subdirectory')
|
|
||||||
variant('selector', default=True, description='Grid selector definition added to config.h')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#dependencies
|
|
||||||
depends_on('dune-common')
|
|
||||||
depends_on('cmake@3.1:', type='build')
|
|
||||||
depends_on('mpi')
|
|
||||||
depends_on('blas', when='+blas')
|
|
||||||
depends_on('lapack', when='+lapack')
|
|
||||||
depends_on('doxygen', type='build', when='+doxygen')
|
|
||||||
depends_on('gmp', when='+gmp')
|
|
||||||
depends_on('intel-tbb', when='+tbb')
|
|
||||||
depends_on('intel-mkl', when='+mkl')
|
|
||||||
depends_on('python@3.0:')
|
|
||||||
depends_on('py-sphinx', type='build', when='+sphinx')
|
|
||||||
depends_on('vc', when='+vc')
|
|
||||||
depends_on('pkg-config', type='build')
|
|
||||||
depends_on('imagemagick', type='build', when='+imagemagick')
|
|
||||||
def url_for_version(self, version):
|
|
||||||
url = "https://www.dune-project.org/download/{1}/dune-geometry-{1}.tar.gz"
|
|
||||||
return url.format(version.up_to(2), version)
|
|
||||||
|
|
||||||
def cmake_args(self):
|
|
||||||
"""Populate cmake arguments."""
|
|
||||||
spec = self.spec
|
|
||||||
def variant_bool(feature, on='ON', off='OFF'):
|
|
||||||
"""Ternary for spec variant to ON/OFF string"""
|
|
||||||
if feature in spec:
|
|
||||||
return on
|
|
||||||
return off
|
|
||||||
|
|
||||||
def nvariant_bool(feature):
|
|
||||||
"""Negated ternary for spec variant to OFF/ON string"""
|
|
||||||
return variant_bool(feature, on='OFF', off='ON')
|
|
||||||
|
|
||||||
cmake_args = [
|
|
||||||
# '-DDUNE_BUILD_BOTH_LIBS=%s' % variant_bool('+shared'),
|
|
||||||
'-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
|
|
||||||
'-DDUNE_GRID_EXTRA_UTILS:BOOL=%s' % variant_bool('+extrautils'),
|
|
||||||
'-DDUNE_GRID_GRIDTYPE_SELECTOR:BOOL=%s' % variant_bool('+selector'),
|
|
||||||
'-DUSE_PTHREADS:BOOL=%s' % variant_bool('+threads'),
|
|
||||||
]
|
|
||||||
if 'python' in spec:
|
|
||||||
cmake_args.append('-DDUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS:BOOL=TRUE')
|
|
||||||
cmake_args.append('-DPYTHON_INSTALL_LOCATION:STRING="system"')
|
|
||||||
|
|
||||||
return cmake_args
|
|
||||||
|
|
|
@ -1,116 +0,0 @@
|
||||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# If you submit this package back to Spack as a pull request,
|
|
||||||
# please first remove this boilerplate and all FIXME comments.
|
|
||||||
#
|
|
||||||
# This is a template package file for Spack. We've put "FIXME"
|
|
||||||
# next to all the things you'll want to change. Once you've handled
|
|
||||||
# them, you can save this file and test your package like this:
|
|
||||||
#
|
|
||||||
# spack install dune-grid
|
|
||||||
#
|
|
||||||
# You can edit this file again by typing:
|
|
||||||
#
|
|
||||||
# spack edit dune-grid
|
|
||||||
#
|
|
||||||
# See the Spack documentation for more information on packaging.
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
from spack import *
|
|
||||||
|
|
||||||
|
|
||||||
class DuneGrid(CMakePackage):
|
|
||||||
"""
|
|
||||||
dune-grid provides grid interface and some grid implementations
|
|
||||||
"""
|
|
||||||
|
|
||||||
homepage = "https://www.dune-project.org"
|
|
||||||
url = "https://www.dune-project.org/download/2.7.0/dune-grid-2.7.0.tar.gz"
|
|
||||||
list_url = "https://www.dune-project.org/download/"
|
|
||||||
list_depth = 1
|
|
||||||
|
|
||||||
version('2.7.0', sha256='fa88dd60619df51100327a9128c3f7242a3a13b7ddfbac43a04f7e85c1f8d29d')
|
|
||||||
version('2.6.0', sha256='a03145e8fd9b0d585f84ca8b62a65d6fc3e918fb571d48c1eb69f95499dee4ca')
|
|
||||||
version('2.5.2', sha256='5763e36a0623f37a2cec14d62631e56468e10c3b4ed68f7a36b9479b13fd87d5')
|
|
||||||
version('2.5.1', sha256='228f4bbeb8e810b02389f08307997b1f6290d49265e61281566e50afdadee511')
|
|
||||||
version('2.5.0', sha256='a5ce78e6cf59b2968fdf4a638e199bae5c935b43e428b2492d7adf34fb609027')
|
|
||||||
version('2.4.2', sha256='b3ab581b48f65da16200486ac56320ed0ea7811f88a5d00a131b23b3299e0c72')
|
|
||||||
version('2.4.1', sha256='eeb3858bef485faa2c2f570ebc303742fa0b8581725523ba85fd87c5306353d7')
|
|
||||||
version('2.4.0', sha256='e608bb47e7e9965b561c5eaceeb55cdc0a22adc5caf96c2eb67ee0cd1f8db9b4')
|
|
||||||
|
|
||||||
#option
|
|
||||||
variant('blas', default=True, description='Build with BLAS support')
|
|
||||||
variant('lapack', default=True, description='Build with LAPACK support')
|
|
||||||
variant('gmp', default=True, description='Build with GNU multi-precision library support')
|
|
||||||
variant('tbb', default=True, description='Build with Threading Building Blocks library support')
|
|
||||||
variant('mkl', default=True, description='Build with Math Kernel library support')
|
|
||||||
variant('doxygen', default=True, description='Create Doxygen documentation')
|
|
||||||
variant('sphinx', default=True, description='Create Sphinx documentation')
|
|
||||||
variant('python', default=True, description='Build with Python and dune-python')
|
|
||||||
variant('vc', default=True, description='Build C++ Vectorization library support')
|
|
||||||
variant('imagemagick', default=False, description='Imagemagick support')
|
|
||||||
variant('uggrid', default=False, description='Build with dune-uggrid support')
|
|
||||||
variant('metis', default=True, description='Build with METIS support')
|
|
||||||
variant('parmetis', default=True, description='Build with ParMETIS support')
|
|
||||||
variant('alberta', default=False, description='Build with Alberta support')
|
|
||||||
variant('psurface', default=False, description='Build with Psurface support')
|
|
||||||
variant('amiramesh', default=False, description='Build with AmiraMesh support')
|
|
||||||
variant('extrautils', default=True, description='Enable compilation and installation of extra utilities from the src subdirectory')
|
|
||||||
variant('selector', default=True, description='Grid selector definition added to config.h')
|
|
||||||
variant('threads', default=True, description='Activate pThread support')
|
|
||||||
variant('shared', default=True, description='Enables the build of shared libraries.')
|
|
||||||
|
|
||||||
#dependencies
|
|
||||||
depends_on('dune-common')
|
|
||||||
depends_on('dune-geometry')
|
|
||||||
depends_on('cmake@3.1:', type='build')
|
|
||||||
depends_on('mpi')
|
|
||||||
depends_on('blas', when='+blas')
|
|
||||||
depends_on('lapack', when='+lapack')
|
|
||||||
depends_on('doxygen', type='build', when='+doxygen')
|
|
||||||
depends_on('gmp', when='+gmp')
|
|
||||||
depends_on('intel-tbb', when='+tbb')
|
|
||||||
depends_on('intel-mkl', when='+mkl')
|
|
||||||
depends_on('python@3.0:')
|
|
||||||
depends_on('py-sphinx', type='build', when='+sphinx')
|
|
||||||
depends_on('vc', when='+vc')
|
|
||||||
depends_on('pkg-config', type='build')
|
|
||||||
depends_on('imagemagick', type='build', when='+imagemagick')
|
|
||||||
depends_on('metis', when='+metis')
|
|
||||||
depends_on('parmetis', when='+parmetis')
|
|
||||||
depends_on('dune-uggrid', when='+uggrid')
|
|
||||||
depends_on('alberta', when='+alberta')
|
|
||||||
depends_on('psurface', when='+psurface')
|
|
||||||
depends_on('amiramesh', when='+amiramesh')
|
|
||||||
def url_for_version(self, version):
|
|
||||||
url = "https://www.dune-project.org/download/{1}/dune-grid-{1}.tar.gz"
|
|
||||||
return url.format(version.up_to(2), version)
|
|
||||||
|
|
||||||
def cmake_args(self):
|
|
||||||
"""Populate cmake arguments."""
|
|
||||||
spec = self.spec
|
|
||||||
def variant_bool(feature, on='ON', off='OFF'):
|
|
||||||
"""Ternary for spec variant to ON/OFF string"""
|
|
||||||
if feature in spec:
|
|
||||||
return on
|
|
||||||
return off
|
|
||||||
|
|
||||||
def nvariant_bool(feature):
|
|
||||||
"""Negated ternary for spec variant to OFF/ON string"""
|
|
||||||
return variant_bool(feature, on='OFF', off='ON')
|
|
||||||
|
|
||||||
cmake_args = [
|
|
||||||
# '-DDUNE_BUILD_BOTH_LIBS=%s' % variant_bool('+shared'),
|
|
||||||
'-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
|
|
||||||
'-DDUNE_GRID_EXTRA_UTILS:BOOL=%s' % variant_bool('+extrautils'),
|
|
||||||
'-DDUNE_GRID_GRIDTYPE_SELECTOR:BOOL=%s' % variant_bool('+selector'),
|
|
||||||
'-DUSE_PTHREADS:BOOL=%s' % variant_bool('+threads'),
|
|
||||||
]
|
|
||||||
if 'python' in spec:
|
|
||||||
cmake_args.append('-DPYTHON_INSTALL_LOCATION:STRING="system"')
|
|
||||||
|
|
||||||
return cmake_args
|
|
|
@ -1,122 +0,0 @@
|
||||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# If you submit this package back to Spack as a pull request,
|
|
||||||
# please first remove this boilerplate and all FIXME comments.
|
|
||||||
#
|
|
||||||
# This is a template package file for Spack. We've put "FIXME"
|
|
||||||
# next to all the things you'll want to change. Once you've handled
|
|
||||||
# them, you can save this file and test your package like this:
|
|
||||||
#
|
|
||||||
# spack install dune-istl
|
|
||||||
#
|
|
||||||
# You can edit this file again by typing:
|
|
||||||
#
|
|
||||||
# spack edit dune-istl
|
|
||||||
#
|
|
||||||
# See the Spack documentation for more information on packaging.
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
from spack import *
|
|
||||||
|
|
||||||
|
|
||||||
class DuneIstl(CMakePackage):
|
|
||||||
"""
|
|
||||||
dune-istl is the iterative solver template library which provides
|
|
||||||
generic sparse matrix/vector classes and a variety of solvers based
|
|
||||||
on these classes. A special feature is the use of templates to
|
|
||||||
exploit the recursive block structure of finite element matrices at
|
|
||||||
compile time. Available solvers include Krylov methods, (block-)
|
|
||||||
incomplete decompositions and aggregation-based algebraic multigrid.
|
|
||||||
"""
|
|
||||||
|
|
||||||
homepage = "https://www.dune-project.org"
|
|
||||||
url = "https://www.dune-project.org/download/2.7.0/dune-istl-2.7.0.tar.gz"
|
|
||||||
list_url = "https://www.dune-project.org/download/"
|
|
||||||
list_depth = 1
|
|
||||||
|
|
||||||
version('2.7.0', sha256='c98d218bdf79549bb2e96fc465e9f9a72f5d88b78090812a59dae85cfee3833e')
|
|
||||||
version('2.6.0', sha256='5ce06fc396624f654c3f34e333fd5900e992c4596b3230abe68617ed77f64f50')
|
|
||||||
version('2.5.2', sha256='9fe33fb60b9c9f98100bfc909eb4d56598bae4f036f01f00b4a9fd2498387178')
|
|
||||||
version('2.5.1', sha256='7e183b1361419620e3df7287d962bcbc1860fa8233588f5b25507ef7a20649dc')
|
|
||||||
version('2.5.0', sha256='f9af37af1e8186443df384f155d66d2f16e95a909f9574d2bcae85d6d14b95ab')
|
|
||||||
version('2.4.2', sha256='7e02eaa3d2d054f056709d1c9a91235b73bc0f96b47630f91c914d349093f572')
|
|
||||||
version('2.4.1', sha256='0ea512e538935812cd6f3a9504f3b06fadff5c15d9d1b0dc499a5a913ea02a4d')
|
|
||||||
version('2.4.0', sha256='205686b77f7e36d6bc0d2771b1514d98d221b608e5f4efdeeafb1a750e3ca2ba')
|
|
||||||
|
|
||||||
#option
|
|
||||||
variant('blas', default=True, description='Build with BLAS support')
|
|
||||||
variant('lapack', default=True, description='Build with LAPACK support')
|
|
||||||
variant('gmp', default=True, description='Build with GNU multi-precision library support')
|
|
||||||
variant('tbb', default=True, description='Build with Threading Building Blocks library support')
|
|
||||||
variant('mkl', default=True, description='Build with Threading Building Blocks library support')
|
|
||||||
variant('doxygen', default=True, description='Create Doxygen documentation')
|
|
||||||
variant('sphinx', default=True, description='Create Sphinx documentation')
|
|
||||||
variant('python', default=True, description='Build with Python')
|
|
||||||
variant('vc', default=True, description='Build C++ Vectorization library support')
|
|
||||||
variant('metis', default=True, description='Build METIS library support')
|
|
||||||
variant('parmetis', default=True, description='Build ParMETIS library support')
|
|
||||||
variant('suitesparse', default=True, description='Build SuiteSparse library support')
|
|
||||||
variant('superlu', default=True, description='Build Supernodal LU library support')
|
|
||||||
variant('arpack', default=True, description='Build ARnoldi PACKage library support')
|
|
||||||
variant('imagemagick', default=False, description='Imagemagick support')
|
|
||||||
variant('oldcategory', default=True, description='Enable/Disable the backwards compatibility of the category enum/method in dune-istl solvers, preconditioner, etc.')
|
|
||||||
variant('threads', default=True, description='Activate pThread support')
|
|
||||||
variant('shared', default=True, description='Enables the build of shared libraries.')
|
|
||||||
variant('extrautils', default=True, description='Enable compilation and installation of extra utilities from the src subdirectory')
|
|
||||||
variant('selector', default=True, description='Grid selector definition added to config.h')
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#dependencies
|
|
||||||
depends_on('dune-common')
|
|
||||||
depends_on('cmake@3.1:', type='build')
|
|
||||||
depends_on('mpi')
|
|
||||||
depends_on('blas', when='+blas')
|
|
||||||
depends_on('lapack', when='+lapack')
|
|
||||||
depends_on('doxygen', type='build', when='+doxygen')
|
|
||||||
depends_on('gmp', when='+gmp')
|
|
||||||
depends_on('intel-tbb', when='+tbb')
|
|
||||||
depends_on('intel-mkl', when='+mkl')
|
|
||||||
depends_on('python@3.0:')
|
|
||||||
depends_on('py-sphinx', type='build', when='+sphinx')
|
|
||||||
depends_on('vc', when='+vc')
|
|
||||||
depends_on('metis', when='+metis')
|
|
||||||
depends_on('parmetis', when='+parmetis')
|
|
||||||
depends_on('suite-sparse', when='+suitesparse')
|
|
||||||
depends_on('superlu', when='+superlu')
|
|
||||||
depends_on('arpack-ng', when='+arpack')
|
|
||||||
depends_on('pkg-config', type='build')
|
|
||||||
depends_on('imagemagick', type='build', when='+imagemagick')
|
|
||||||
def url_for_version(self, version):
|
|
||||||
url = "https://www.dune-project.org/download/{1}/dune-istl-{1}.tar.gz"
|
|
||||||
return url.format(version.up_to(2), version)
|
|
||||||
|
|
||||||
def cmake_args(self):
|
|
||||||
"""Populate cmake arguments."""
|
|
||||||
spec = self.spec
|
|
||||||
def variant_bool(feature, on='ON', off='OFF'):
|
|
||||||
"""Ternary for spec variant to ON/OFF string"""
|
|
||||||
if feature in spec:
|
|
||||||
return on
|
|
||||||
return off
|
|
||||||
|
|
||||||
def nvariant_bool(feature):
|
|
||||||
"""Negated ternary for spec variant to OFF/ON string"""
|
|
||||||
return variant_bool(feature, on='OFF', off='ON')
|
|
||||||
|
|
||||||
cmake_args = [
|
|
||||||
# '-DDUNE_BUILD_BOTH_LIBS=%s' % variant_bool('+shared'),
|
|
||||||
'-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
|
|
||||||
'-DDUNE_GRID_EXTRA_UTILS:BOOL=%s' % variant_bool('+extrautils'),
|
|
||||||
'-DDUNE_GRID_GRIDTYPE_SELECTOR:BOOL=%s' % variant_bool('+selector'),
|
|
||||||
'-DUSE_PTHREADS:BOOL=%s' % variant_bool('+threads'),
|
|
||||||
]
|
|
||||||
cmake_args.append('-DDUNE_ISTL_SUPPORT_OLD_CATEGORY=%s' % variant_bool('+oldcategory'))
|
|
||||||
if 'python' in spec:
|
|
||||||
cmake_args.append('-DPYTHON_INSTALL_LOCATION:STRING="system"')
|
|
||||||
|
|
||||||
return cmake_args
|
|
|
@ -1,31 +0,0 @@
|
||||||
--- a/cmake/modules/AddQuadMathFlags.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/AddQuadMathFlags.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,28 @@
|
|
||||||
+# Defines the functions to use QuadMath
|
|
||||||
+#
|
|
||||||
+# .. cmake_function:: add_dune_quadmath_flags
|
|
||||||
+#
|
|
||||||
+# .. cmake_param:: targets
|
|
||||||
+# :positional:
|
|
||||||
+# :single:
|
|
||||||
+# :required:
|
|
||||||
+#
|
|
||||||
+# A list of targets to use QuadMath with.
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+function(add_dune_quadmath_flags _targets)
|
|
||||||
+ if(QUADMATH_FOUND)
|
|
||||||
+ foreach(_target ${_targets})
|
|
||||||
+ target_link_libraries(${_target} "quadmath")
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-DENABLE_QUADMATH=1 -D_GLIBCXX_USE_FLOAT128=1 ")
|
|
||||||
+ if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-fext-numeric-literals ")
|
|
||||||
+ endif()
|
|
||||||
+ endforeach(_target ${_targets})
|
|
||||||
+ endif(QUADMATH_FOUND)
|
|
||||||
+endfunction(add_dune_quadmath_flags)
|
|
|
@ -1,62 +0,0 @@
|
||||||
--- a/cmake/modules/FindQuadMath.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/FindQuadMath.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,59 @@
|
|
||||||
+# .. cmake_module::
|
|
||||||
+#
|
|
||||||
+# Find the GCC Quad-Precision library
|
|
||||||
+#
|
|
||||||
+# Sets the following variables:
|
|
||||||
+#
|
|
||||||
+# :code:`QUADMATH_FOUND`
|
|
||||||
+# True if the Quad-Precision library was found.
|
|
||||||
+#
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# search for the header quadmath.h
|
|
||||||
+include(CheckIncludeFile)
|
|
||||||
+check_include_file(quadmath.h QUADMATH_HEADER)
|
|
||||||
+
|
|
||||||
+include(CheckCSourceCompiles)
|
|
||||||
+include(CMakePushCheckState)
|
|
||||||
+
|
|
||||||
+cmake_push_check_state() # Save variables
|
|
||||||
+set(CMAKE_REQUIRED_LIBRARIES quadmath)
|
|
||||||
+check_c_source_compiles("
|
|
||||||
+#include <quadmath.h>
|
|
||||||
+
|
|
||||||
+int main ()
|
|
||||||
+{
|
|
||||||
+ __float128 r = 1.0q;
|
|
||||||
+ r = strtoflt128(\"1.2345678\", NULL);
|
|
||||||
+ return 0;
|
|
||||||
+}" QUADMATH_COMPILES)
|
|
||||||
+cmake_pop_check_state()
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+include(FindPackageHandleStandardArgs)
|
|
||||||
+find_package_handle_standard_args(
|
|
||||||
+ "QuadMath"
|
|
||||||
+ DEFAULT_MSG
|
|
||||||
+ QUADMATH_HEADER
|
|
||||||
+ QUADMATH_COMPILES
|
|
||||||
+)
|
|
||||||
+
|
|
||||||
+# text for feature summary
|
|
||||||
+set_package_properties("QuadMath" PROPERTIES
|
|
||||||
+ DESCRIPTION "GCC Quad-Precision library")
|
|
||||||
+
|
|
||||||
+# set HAVE_QUADMATH for config.h
|
|
||||||
+set(HAVE_QUADMATH ${QUADMATH_FOUND})
|
|
||||||
+
|
|
||||||
+# -fext-numeric-literals is a GCC extension not available in other compilers like clang
|
|
||||||
+if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set(_QUADMATH_EXT_NUMERIC_LITERALS "-fext-numeric-literals")
|
|
||||||
+endif()
|
|
||||||
+
|
|
||||||
+# register all QuadMath related flags
|
|
||||||
+if(HAVE_QUADMATH)
|
|
||||||
+ dune_register_package_flags(COMPILE_DEFINITIONS "ENABLE_QUADMATH=1" "_GLIBCXX_USE_FLOAT128=1"
|
|
||||||
+ COMPILE_OPTIONS ${_QUADMATH_EXT_NUMERIC_LITERALS}
|
|
||||||
+ LIBRARIES "quadmath")
|
|
||||||
+endif()
|
|
|
@ -1,114 +0,0 @@
|
||||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# If you submit this package back to Spack as a pull request,
|
|
||||||
# please first remove this boilerplate and all FIXME comments.
|
|
||||||
#
|
|
||||||
# This is a template package file for Spack. We've put "FIXME"
|
|
||||||
# next to all the things you'll want to change. Once you've handled
|
|
||||||
# them, you can save this file and test your package like this:
|
|
||||||
#
|
|
||||||
# spack install dune-localfunctions
|
|
||||||
#
|
|
||||||
# You can edit this file again by typing:
|
|
||||||
#
|
|
||||||
# spack edit dune-localfunctions
|
|
||||||
#
|
|
||||||
# See the Spack documentation for more information on packaging.
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
from spack import *
|
|
||||||
|
|
||||||
|
|
||||||
class DuneLocalfunctions(CMakePackage):
|
|
||||||
"""
|
|
||||||
dune-localfunctions provides interface and implementation for shape
|
|
||||||
functions defined on the DUNE reference elements. In addition to the
|
|
||||||
shape function, interpolation operators and special keys are
|
|
||||||
provided which can be used to assemble global function spaces on
|
|
||||||
finite-element grids.
|
|
||||||
"""
|
|
||||||
|
|
||||||
homepage = "https://www.dune-project.org"
|
|
||||||
url = "https://www.dune-project.org/download/2.7.0/dune-localfunctions-2.7.0.tar.gz"
|
|
||||||
list_url = "https://www.dune-project.org/download/"
|
|
||||||
list_depth = 1
|
|
||||||
|
|
||||||
version('2.7.0', sha256='0dbb8e559cc9ca3a506116fc49648c990a40e3162cf4659289f1d96d602a30fa')
|
|
||||||
version('2.6.0', sha256='14664b007fbc5e3592740075d2aeca6890e6e185f9924da044fe726ea3fc86a5')
|
|
||||||
version('2.5.2', sha256='7253fb9186f73bf58d49ecaee22cccd4ad197eff09b07955568307f0cc946958')
|
|
||||||
version('2.5.1', sha256='4308d45132f463ca6c37cf59f0ef52b30b13dc01afba782c467e7ed6511dd0c0')
|
|
||||||
version('2.5.0', sha256='d92e05fbfcb10750aba0597eca1c43c3842a657bb53ab7f25c33c1e24cc654ea')
|
|
||||||
version('2.4.2', sha256='652dea9a47934be62f8c3777a7fda5c1e2d2b2fead5777d180f467acf8472a31')
|
|
||||||
version('2.4.1', sha256='569cd4839564f4d419e52a51873c3e2b153f9656d77a37e0b5fb22f15423399f')
|
|
||||||
version('2.4.0', sha256='5edb297ac26901232dd0cb2899a56d562192abe1cc6ac79efec57818359112e3')
|
|
||||||
|
|
||||||
#option
|
|
||||||
variant('blas', default=True, description='Build with BLAS support')
|
|
||||||
variant('lapack', default=True, description='Build with LAPACK support')
|
|
||||||
variant('gmp', default=True, description='Build with GNU multi-precision library support')
|
|
||||||
variant('tbb', default=True, description='Build with Threading Building Blocks library support')
|
|
||||||
variant('mkl', default=True, description='Build with Threading Building Blocks library support')
|
|
||||||
variant('doxygen', default=True, description='Create Doxygen documentation')
|
|
||||||
variant('sphinx', default=True, description='Create Sphinx documentation')
|
|
||||||
variant('vc', default=True, description='Build C++ Vectorization library support')
|
|
||||||
variant('imagemagick', default=False, description='Imagemagick support')
|
|
||||||
variant('threads', default=True, description='Activate pThread support')
|
|
||||||
variant('shared', default=True, description='Enables the build of shared libraries.')
|
|
||||||
variant('python', default=True, description='Build with Python')
|
|
||||||
variant('extrautils', default=True, description='Enable compilation and installation of extra utilities from the src subdirectory')
|
|
||||||
variant('selector', default=True, description='Grid selector definition added to config.h')
|
|
||||||
|
|
||||||
#dependencies
|
|
||||||
depends_on('dune-common')
|
|
||||||
depends_on('dune-geometry')
|
|
||||||
depends_on('cmake@3.1:', type='build')
|
|
||||||
depends_on('mpi')
|
|
||||||
depends_on('blas', when='+blas')
|
|
||||||
depends_on('lapack', when='+lapack')
|
|
||||||
depends_on('doxygen', type='build', when='+doxygen')
|
|
||||||
depends_on('gmp', when='+gmp')
|
|
||||||
depends_on('intel-tbb', when='+tbb')
|
|
||||||
depends_on('intel-mkl', when='+mkl')
|
|
||||||
depends_on('python@3.0:')
|
|
||||||
depends_on('py-sphinx', type='build', when='+sphinx')
|
|
||||||
depends_on('vc', when='+vc')
|
|
||||||
depends_on('pkg-config', type='build')
|
|
||||||
depends_on('imagemagick', type='build', when='+imagemagick')
|
|
||||||
|
|
||||||
patch('AddQuadMathFlags.cmake.patch', when='@2.6')
|
|
||||||
patch('FindQuadMath.cmake.patch', when='@2.6')
|
|
||||||
|
|
||||||
|
|
||||||
def url_for_version(self, version):
|
|
||||||
url = "https://www.dune-project.org/download/{1}/dune-localfunctions-{1}.tar.gz"
|
|
||||||
return url.format(version.up_to(2), version)
|
|
||||||
|
|
||||||
def cmake_args(self):
|
|
||||||
"""Populate cmake arguments."""
|
|
||||||
spec = self.spec
|
|
||||||
def variant_bool(feature, on='ON', off='OFF'):
|
|
||||||
"""Ternary for spec variant to ON/OFF string"""
|
|
||||||
if feature in spec:
|
|
||||||
return on
|
|
||||||
return off
|
|
||||||
|
|
||||||
def nvariant_bool(feature):
|
|
||||||
"""Negated ternary for spec variant to OFF/ON string"""
|
|
||||||
return variant_bool(feature, on='OFF', off='ON')
|
|
||||||
|
|
||||||
cmake_args = [
|
|
||||||
# '-DDUNE_BUILD_BOTH_LIBS=%s' % variant_bool('+shared'),
|
|
||||||
'-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
|
|
||||||
'-DDUNE_GRID_EXTRA_UTILS:BOOL=%s' % variant_bool('+extrautils'),
|
|
||||||
'-DDUNE_GRID_GRIDTYPE_SELECTOR:BOOL=%s' % variant_bool('+selector'),
|
|
||||||
'-DUSE_PTHREADS:BOOL=%s' % variant_bool('+threads'),
|
|
||||||
]
|
|
||||||
if 'python' in spec:
|
|
||||||
cmake_args.append('-DDUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS:BOOL=TRUE')
|
|
||||||
cmake_args.append('-DPYTHON_INSTALL_LOCATION:STRING="system"')
|
|
||||||
|
|
||||||
return cmake_args
|
|
|
@ -1,31 +0,0 @@
|
||||||
--- a/cmake/modules/AddQuadMathFlags.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/AddQuadMathFlags.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,28 @@
|
|
||||||
+# Defines the functions to use QuadMath
|
|
||||||
+#
|
|
||||||
+# .. cmake_function:: add_dune_quadmath_flags
|
|
||||||
+#
|
|
||||||
+# .. cmake_param:: targets
|
|
||||||
+# :positional:
|
|
||||||
+# :single:
|
|
||||||
+# :required:
|
|
||||||
+#
|
|
||||||
+# A list of targets to use QuadMath with.
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+function(add_dune_quadmath_flags _targets)
|
|
||||||
+ if(QUADMATH_FOUND)
|
|
||||||
+ foreach(_target ${_targets})
|
|
||||||
+ target_link_libraries(${_target} "quadmath")
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-DENABLE_QUADMATH=1 -D_GLIBCXX_USE_FLOAT128=1 ")
|
|
||||||
+ if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-fext-numeric-literals ")
|
|
||||||
+ endif()
|
|
||||||
+ endforeach(_target ${_targets})
|
|
||||||
+ endif(QUADMATH_FOUND)
|
|
||||||
+endfunction(add_dune_quadmath_flags)
|
|
|
@ -1,62 +0,0 @@
|
||||||
--- a/cmake/modules/FindQuadMath.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/FindQuadMath.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,59 @@
|
|
||||||
+# .. cmake_module::
|
|
||||||
+#
|
|
||||||
+# Find the GCC Quad-Precision library
|
|
||||||
+#
|
|
||||||
+# Sets the following variables:
|
|
||||||
+#
|
|
||||||
+# :code:`QUADMATH_FOUND`
|
|
||||||
+# True if the Quad-Precision library was found.
|
|
||||||
+#
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# search for the header quadmath.h
|
|
||||||
+include(CheckIncludeFile)
|
|
||||||
+check_include_file(quadmath.h QUADMATH_HEADER)
|
|
||||||
+
|
|
||||||
+include(CheckCSourceCompiles)
|
|
||||||
+include(CMakePushCheckState)
|
|
||||||
+
|
|
||||||
+cmake_push_check_state() # Save variables
|
|
||||||
+set(CMAKE_REQUIRED_LIBRARIES quadmath)
|
|
||||||
+check_c_source_compiles("
|
|
||||||
+#include <quadmath.h>
|
|
||||||
+
|
|
||||||
+int main ()
|
|
||||||
+{
|
|
||||||
+ __float128 r = 1.0q;
|
|
||||||
+ r = strtoflt128(\"1.2345678\", NULL);
|
|
||||||
+ return 0;
|
|
||||||
+}" QUADMATH_COMPILES)
|
|
||||||
+cmake_pop_check_state()
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+include(FindPackageHandleStandardArgs)
|
|
||||||
+find_package_handle_standard_args(
|
|
||||||
+ "QuadMath"
|
|
||||||
+ DEFAULT_MSG
|
|
||||||
+ QUADMATH_HEADER
|
|
||||||
+ QUADMATH_COMPILES
|
|
||||||
+)
|
|
||||||
+
|
|
||||||
+# text for feature summary
|
|
||||||
+set_package_properties("QuadMath" PROPERTIES
|
|
||||||
+ DESCRIPTION "GCC Quad-Precision library")
|
|
||||||
+
|
|
||||||
+# set HAVE_QUADMATH for config.h
|
|
||||||
+set(HAVE_QUADMATH ${QUADMATH_FOUND})
|
|
||||||
+
|
|
||||||
+# -fext-numeric-literals is a GCC extension not available in other compilers like clang
|
|
||||||
+if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set(_QUADMATH_EXT_NUMERIC_LITERALS "-fext-numeric-literals")
|
|
||||||
+endif()
|
|
||||||
+
|
|
||||||
+# register all QuadMath related flags
|
|
||||||
+if(HAVE_QUADMATH)
|
|
||||||
+ dune_register_package_flags(COMPILE_DEFINITIONS "ENABLE_QUADMATH=1" "_GLIBCXX_USE_FLOAT128=1"
|
|
||||||
+ COMPILE_OPTIONS ${_QUADMATH_EXT_NUMERIC_LITERALS}
|
|
||||||
+ LIBRARIES "quadmath")
|
|
||||||
+endif()
|
|
|
@ -1,7 +1,5 @@
|
||||||
|
|
||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class DuneNewmodule(CMakePackage):
|
class DuneNewmodule(CMakePackage):
|
||||||
"""Abstractions for functions and discrete function space bases"""
|
"""Abstractions for functions and discrete function space bases"""
|
||||||
|
|
||||||
|
@ -15,64 +13,9 @@ class DuneNewmodule(CMakePackage):
|
||||||
|
|
||||||
|
|
||||||
#option
|
#option
|
||||||
variant('geometry', default=True, description='Build with dune-geometry support')
|
|
||||||
variant('grid', default=True, description='Build with dune-grid support')
|
|
||||||
variant('istl', default=True, description='Build with dune-istl support')
|
|
||||||
variant('localfunctions', default=True, description='Build with dune-localfunctions support')
|
|
||||||
variant('uggrid', default=True, description='Build with dune-uggrid support')
|
|
||||||
variant('functions', default=True, description='Build with dune-functions support')
|
|
||||||
variant('python', default=True, description='Build with dune-python support')
|
|
||||||
variant('typetree', default=True, description='Build with dune-typetree support')
|
|
||||||
|
|
||||||
variant('alugrid', default=False, description='Build with dune-alugrid support')
|
|
||||||
|
|
||||||
variant('selector', default=True, description='Grid selector definition added to config.h')
|
|
||||||
variant('oldcategory', default=True, description='Enable/Disable the backwards compatibility of the category enum/method in dune-istl solvers, preconditioner, etc.')
|
|
||||||
variant('extrautils', default=True, description='Enable compilation and installation of extra utilities from the src subdirectory')
|
|
||||||
variant('selector', default=True, description='Grid selector definition added to config.h')
|
|
||||||
variant('threads', default=True, description='Activate pThread support')
|
|
||||||
variant('shared', default=True, description='Enables the build of shared libraries.')
|
|
||||||
|
|
||||||
#dependencies
|
#dependencies
|
||||||
depends_on('dune-common',type=('build', 'link', 'run'))
|
depends_on('dune',type=('build', 'link', 'run'))
|
||||||
depends_on('dune-alugrid', when='+alugrid')
|
|
||||||
depends_on('dune-functions', when='+functions')
|
|
||||||
depends_on('dune-geometry', when='+geometry')
|
|
||||||
depends_on('dune-istl', when='+istl')
|
|
||||||
depends_on('dune-localfunctions', when='+localfunctions')
|
|
||||||
depends_on('dune-python', when='+python')
|
|
||||||
depends_on('dune-typetree', when='+typetree')
|
|
||||||
depends_on('dune-grid+uggrid', when='+grid')
|
|
||||||
depends_on('dune-uggrid', when='+uggrid')
|
|
||||||
|
|
||||||
depends_on('cmake@3.1:', type='build')
|
depends_on('cmake@3.1:', type='build')
|
||||||
|
|
||||||
patch('AddQuadMathFlags.cmake.patch')
|
|
||||||
patch('FindQuadMath.cmake.patch')
|
|
||||||
|
|
||||||
def cmake_args(self):
|
|
||||||
"""Populate cmake arguments."""
|
|
||||||
spec = self.spec
|
|
||||||
def variant_bool(feature, on='ON', off='OFF'):
|
|
||||||
"""Ternary for spec variant to ON/OFF string"""
|
|
||||||
if feature in spec:
|
|
||||||
return on
|
|
||||||
return off
|
|
||||||
|
|
||||||
def nvariant_bool(feature):
|
|
||||||
"""Negated ternary for spec variant to OFF/ON string"""
|
|
||||||
return variant_bool(feature, on='OFF', off='ON')
|
|
||||||
|
|
||||||
cmake_args = [
|
|
||||||
# '-DDUNE_BUILD_BOTH_LIBS=%s' % variant_bool('+shared'),
|
|
||||||
'-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
|
|
||||||
'-DDUNE_GRID_EXTRA_UTILS:BOOL=%s' % variant_bool('+extrautils'),
|
|
||||||
'-DDUNE_GRID_GRIDTYPE_SELECTOR:BOOL=%s' % variant_bool('+selector'),
|
|
||||||
'-DDUNE_ISTL_SUPPORT_OLD_CATEGORY=%s' % variant_bool('+oldcategory'),
|
|
||||||
'-DUSE_PTHREADS:BOOL=%s' % variant_bool('+threads'),
|
|
||||||
]
|
|
||||||
if 'python' in spec:
|
|
||||||
cmake_args.append('-DPYTHON_INSTALL_LOCATION:STRING="system"')
|
|
||||||
|
|
||||||
return cmake_args
|
|
||||||
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
--- a/cmake/modules/AddQuadMathFlags.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/AddQuadMathFlags.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,28 @@
|
|
||||||
+# Defines the functions to use QuadMath
|
|
||||||
+#
|
|
||||||
+# .. cmake_function:: add_dune_quadmath_flags
|
|
||||||
+#
|
|
||||||
+# .. cmake_param:: targets
|
|
||||||
+# :positional:
|
|
||||||
+# :single:
|
|
||||||
+# :required:
|
|
||||||
+#
|
|
||||||
+# A list of targets to use QuadMath with.
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+function(add_dune_quadmath_flags _targets)
|
|
||||||
+ if(QUADMATH_FOUND)
|
|
||||||
+ foreach(_target ${_targets})
|
|
||||||
+ target_link_libraries(${_target} "quadmath")
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-DENABLE_QUADMATH=1 -D_GLIBCXX_USE_FLOAT128=1 ")
|
|
||||||
+ if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-fext-numeric-literals ")
|
|
||||||
+ endif()
|
|
||||||
+ endforeach(_target ${_targets})
|
|
||||||
+ endif(QUADMATH_FOUND)
|
|
||||||
+endfunction(add_dune_quadmath_flags)
|
|
|
@ -1,62 +0,0 @@
|
||||||
--- a/cmake/modules/FindQuadMath.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/FindQuadMath.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,59 @@
|
|
||||||
+# .. cmake_module::
|
|
||||||
+#
|
|
||||||
+# Find the GCC Quad-Precision library
|
|
||||||
+#
|
|
||||||
+# Sets the following variables:
|
|
||||||
+#
|
|
||||||
+# :code:`QUADMATH_FOUND`
|
|
||||||
+# True if the Quad-Precision library was found.
|
|
||||||
+#
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# search for the header quadmath.h
|
|
||||||
+include(CheckIncludeFile)
|
|
||||||
+check_include_file(quadmath.h QUADMATH_HEADER)
|
|
||||||
+
|
|
||||||
+include(CheckCSourceCompiles)
|
|
||||||
+include(CMakePushCheckState)
|
|
||||||
+
|
|
||||||
+cmake_push_check_state() # Save variables
|
|
||||||
+set(CMAKE_REQUIRED_LIBRARIES quadmath)
|
|
||||||
+check_c_source_compiles("
|
|
||||||
+#include <quadmath.h>
|
|
||||||
+
|
|
||||||
+int main ()
|
|
||||||
+{
|
|
||||||
+ __float128 r = 1.0q;
|
|
||||||
+ r = strtoflt128(\"1.2345678\", NULL);
|
|
||||||
+ return 0;
|
|
||||||
+}" QUADMATH_COMPILES)
|
|
||||||
+cmake_pop_check_state()
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+include(FindPackageHandleStandardArgs)
|
|
||||||
+find_package_handle_standard_args(
|
|
||||||
+ "QuadMath"
|
|
||||||
+ DEFAULT_MSG
|
|
||||||
+ QUADMATH_HEADER
|
|
||||||
+ QUADMATH_COMPILES
|
|
||||||
+)
|
|
||||||
+
|
|
||||||
+# text for feature summary
|
|
||||||
+set_package_properties("QuadMath" PROPERTIES
|
|
||||||
+ DESCRIPTION "GCC Quad-Precision library")
|
|
||||||
+
|
|
||||||
+# set HAVE_QUADMATH for config.h
|
|
||||||
+set(HAVE_QUADMATH ${QUADMATH_FOUND})
|
|
||||||
+
|
|
||||||
+# -fext-numeric-literals is a GCC extension not available in other compilers like clang
|
|
||||||
+if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set(_QUADMATH_EXT_NUMERIC_LITERALS "-fext-numeric-literals")
|
|
||||||
+endif()
|
|
||||||
+
|
|
||||||
+# register all QuadMath related flags
|
|
||||||
+if(HAVE_QUADMATH)
|
|
||||||
+ dune_register_package_flags(COMPILE_DEFINITIONS "ENABLE_QUADMATH=1" "_GLIBCXX_USE_FLOAT128=1"
|
|
||||||
+ COMPILE_OPTIONS ${_QUADMATH_EXT_NUMERIC_LITERALS}
|
|
||||||
+ LIBRARIES "quadmath")
|
|
||||||
+endif()
|
|
|
@ -1,157 +0,0 @@
|
||||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# If you submit this package back to Spack as a pull request,
|
|
||||||
# please first remove this boilerplate and all FIXME comments.
|
|
||||||
#
|
|
||||||
# This is a template package file for Spack. We've put "FIXME"
|
|
||||||
# next to all the things you'll want to change. Once you've handled
|
|
||||||
# them, you can save this file and test your package like this:
|
|
||||||
#
|
|
||||||
# spack install dune-python
|
|
||||||
#
|
|
||||||
# You can edit this file again by typing:
|
|
||||||
#
|
|
||||||
# spack edit dune-python
|
|
||||||
#
|
|
||||||
# See the Spack documentation for more information on packaging.
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
from spack import *
|
|
||||||
|
|
||||||
|
|
||||||
class DunePython(CMakePackage):
|
|
||||||
"""
|
|
||||||
Python bindings for the DUNE core modules
|
|
||||||
"""
|
|
||||||
|
|
||||||
homepage = "https://www.dune-project.org"
|
|
||||||
# url = "https://www.dune-project.org/download/2.6.0/dune-python-2.6.0.tar.gz"
|
|
||||||
url = 'https://gitlab.dune-project.org/staging/dune-python/-/archive/releases/2.7/dune-python-releases-2.7.tar.gz'
|
|
||||||
list_url = 'https://gitlab.dune-project.org/staging/dune-python/-/archive/releases/'
|
|
||||||
list_depth = 1
|
|
||||||
|
|
||||||
python_components = [ 'dune' ]
|
|
||||||
|
|
||||||
version('2.7', sha256='432564c8577f5d3c9e9d6b2b3710189fd3ac9551eac61986f5966d2fa2534c46')
|
|
||||||
version('2.6', sha256='cc9e9222de850eea659680e41a824bb5d7b300d0e89a8c0855f8d0a31f01ff2d')
|
|
||||||
|
|
||||||
|
|
||||||
#option
|
|
||||||
# ugggrid seems to be a requirement (does not link without)
|
|
||||||
# variant('uggrid', default=False, description='Build with dune-uggrid support')
|
|
||||||
|
|
||||||
variant('functions', default=False, description='Build with dune-functions support')
|
|
||||||
variant('blas', default=True, description='Build with BLAS support')
|
|
||||||
variant('lapack', default=True, description='Build with LAPACK support')
|
|
||||||
variant('gmp', default=True, description='Build with GNU multi-precision library support')
|
|
||||||
variant('tbb', default=True, description='Build with Threading Building Blocks library support')
|
|
||||||
variant('mkl', default=True, description='Build with Math Kernel library support')
|
|
||||||
variant('doxygen', default=True, description='Create Doxygen documentation')
|
|
||||||
variant('sphinx', default=True, description='Create Sphinx documentation')
|
|
||||||
variant('vc', default=True, description='Build C++ Vectorization library support')
|
|
||||||
variant('imagemagick', default=False, description='Imagemagick support')
|
|
||||||
variant('metis', default=True, description='Build METIS library support')
|
|
||||||
variant('parmetis', default=True, description='Build ParMETIS library support')
|
|
||||||
variant('arpack', default=True, description='Build ARnoldi PACKage library support')
|
|
||||||
variant('suitesparse', default=True, description='Build SuiteSparse library support')
|
|
||||||
variant('superlu', default=True, description='Build Supernodal LU library support')
|
|
||||||
variant('alberta', default=False, description='Build with Alberta support')
|
|
||||||
variant('psurface', default=False, description='Build with Psurface support')
|
|
||||||
variant('amiramesh', default=False, description='Build with AmiraMesh support')
|
|
||||||
variant('jupyter', default=False, description='Build with Jupyter support')
|
|
||||||
variant('extrautils', default=True, description='Enable compilation and installation of extra utilities from the src subdirectory')
|
|
||||||
variant('selector', default=True, description='Grid selector definition added to config.h')
|
|
||||||
variant('oldcategory', default=True, description='Enable/Disable the backwards compatibility of the category enum/method in dune-istl solvers, preconditioner, etc.')
|
|
||||||
variant('threads', default=True, description='Activate pThread support')
|
|
||||||
variant('shared', default=True, description='Enables the build of shared libraries.')
|
|
||||||
variant('localfunctions', default=False, description='Support of dune-localfunctions module')
|
|
||||||
variant('functions', default=False, description='Support of dune-functions module')
|
|
||||||
variant('alugrid', default=False, description='Support of dune-alugrid module')
|
|
||||||
variant('fempy', default=False, description='Support of dune-fempy module')
|
|
||||||
variant('spgrid', default=False, description='Support of dune-spgrid module')
|
|
||||||
variant('typetree', default=False, description='Support of dune-typetree module')
|
|
||||||
|
|
||||||
extends('python')
|
|
||||||
|
|
||||||
#dependencies
|
|
||||||
depends_on('dune-grid+uggrid+python+shared')
|
|
||||||
depends_on('dune-istl+python+shared')
|
|
||||||
depends_on('dune-geometry+python+shared')
|
|
||||||
# depends_on('dune-uggrid', when='+uggrid')
|
|
||||||
depends_on('dune-uggrid+python+shared')
|
|
||||||
depends_on('dune-common+python+shared')
|
|
||||||
depends_on('dune-localfunctions+python+shared', when='+localfunctions')
|
|
||||||
depends_on('dune-functions+python+shared', when='+functions')
|
|
||||||
depends_on('dune-alugrid+python+shared', when='+alugrid')
|
|
||||||
depends_on('dune-fempy+python+shared', when='+fempy')
|
|
||||||
depends_on('dune-spgrid+python+shared', when='+spgrid')
|
|
||||||
depends_on('dune-typetree+python+shared', when='+typetree')
|
|
||||||
depends_on('cmake@3.1:', type='build')
|
|
||||||
depends_on('mpi')
|
|
||||||
depends_on('blas', when='+blas')
|
|
||||||
depends_on('lapack', when='+lapack')
|
|
||||||
depends_on('doxygen', type='build', when='+doxygen')
|
|
||||||
depends_on('gmp', when='+gmp')
|
|
||||||
depends_on('intel-tbb', when='+tbb')
|
|
||||||
depends_on('intel-mkl', when='+mkl')
|
|
||||||
depends_on('python@3.8.2:')
|
|
||||||
depends_on('py-setuptools', type='build')
|
|
||||||
depends_on('py-numpy')
|
|
||||||
depends_on('py-pip')
|
|
||||||
depends_on('py-sphinx', type='build', when='+sphinx')
|
|
||||||
depends_on('vc', when='+vc')
|
|
||||||
depends_on('pkg-config', type='build')
|
|
||||||
depends_on('imagemagick', type='build', when='+imagemagick')
|
|
||||||
depends_on('metis', when='+metis')
|
|
||||||
depends_on('parmetis', when='+parmetis')
|
|
||||||
depends_on('arpack-ng', when='+arpack')
|
|
||||||
depends_on('suite-sparse', when='+suitesparse')
|
|
||||||
depends_on('superlu', when='+superlu')
|
|
||||||
depends_on('alberta', when='+alberta')
|
|
||||||
depends_on('psurface', when='+psurface')
|
|
||||||
depends_on('amiramesh', when='+amiramesh')
|
|
||||||
depends_on('py-jupyter', when='+jupyter')
|
|
||||||
|
|
||||||
def url_for_version(self, version):
|
|
||||||
url = 'https://gitlab.dune-project.org/staging/dune-python/-/archive/releases/{1}/dune-python-releases-{1}.tar.gz'
|
|
||||||
return url.format(version.up_to(2), version)
|
|
||||||
|
|
||||||
patch('AddQuadMathFlags.cmake.patch')
|
|
||||||
patch('FindQuadMath.cmake.patch')
|
|
||||||
|
|
||||||
def cmake_args(self):
|
|
||||||
"""Populate cmake arguments."""
|
|
||||||
spec = self.spec
|
|
||||||
def variant_bool(feature, on='ON', off='OFF'):
|
|
||||||
"""Ternary for spec variant to ON/OFF string"""
|
|
||||||
if feature in spec:
|
|
||||||
return on
|
|
||||||
return off
|
|
||||||
|
|
||||||
def nvariant_bool(feature):
|
|
||||||
"""Negated ternary for spec variant to OFF/ON string"""
|
|
||||||
return variant_bool(feature, on='OFF', off='ON')
|
|
||||||
|
|
||||||
cmake_args = [
|
|
||||||
# '-DDUNE_BUILD_BOTH_LIBS=%s' % variant_bool('+shared'),
|
|
||||||
'-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
|
|
||||||
'-DDUNE_GRID_EXTRA_UTILS:BOOL=%s' % variant_bool('+extrautils'),
|
|
||||||
'-DDUNE_GRID_GRIDTYPE_SELECTOR:BOOL=%s' % variant_bool('+selector'),
|
|
||||||
'-DDUNE_ISTL_SUPPORT_OLD_CATEGORY=%s' % variant_bool('+oldcategory'),
|
|
||||||
'-DUSE_PTHREADS:BOOL=%s' % variant_bool('+threads'),
|
|
||||||
]
|
|
||||||
# if 'python' in spec:
|
|
||||||
# cmake_args.append('-DPYTHON_INSTALL_LOCATION:STRING="system"')
|
|
||||||
|
|
||||||
return cmake_args
|
|
||||||
|
|
||||||
@run_after('install')
|
|
||||||
def install_python_components(self):
|
|
||||||
for package in self.python_components:
|
|
||||||
build_directory = 'python'
|
|
||||||
with working_dir(join_path(self.build_directory,'python')):
|
|
||||||
setup_py('install', '--prefix={0}'.format(self.prefix))
|
|
|
@ -1,31 +0,0 @@
|
||||||
--- a/cmake/modules/AddQuadMathFlags.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/AddQuadMathFlags.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,28 @@
|
|
||||||
+# Defines the functions to use QuadMath
|
|
||||||
+#
|
|
||||||
+# .. cmake_function:: add_dune_quadmath_flags
|
|
||||||
+#
|
|
||||||
+# .. cmake_param:: targets
|
|
||||||
+# :positional:
|
|
||||||
+# :single:
|
|
||||||
+# :required:
|
|
||||||
+#
|
|
||||||
+# A list of targets to use QuadMath with.
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+function(add_dune_quadmath_flags _targets)
|
|
||||||
+ if(QUADMATH_FOUND)
|
|
||||||
+ foreach(_target ${_targets})
|
|
||||||
+ target_link_libraries(${_target} "quadmath")
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-DENABLE_QUADMATH=1 -D_GLIBCXX_USE_FLOAT128=1 ")
|
|
||||||
+ if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-fext-numeric-literals ")
|
|
||||||
+ endif()
|
|
||||||
+ endforeach(_target ${_targets})
|
|
||||||
+ endif(QUADMATH_FOUND)
|
|
||||||
+endfunction(add_dune_quadmath_flags)
|
|
|
@ -1,62 +0,0 @@
|
||||||
--- a/cmake/modules/FindQuadMath.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/FindQuadMath.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,59 @@
|
|
||||||
+# .. cmake_module::
|
|
||||||
+#
|
|
||||||
+# Find the GCC Quad-Precision library
|
|
||||||
+#
|
|
||||||
+# Sets the following variables:
|
|
||||||
+#
|
|
||||||
+# :code:`QUADMATH_FOUND`
|
|
||||||
+# True if the Quad-Precision library was found.
|
|
||||||
+#
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# search for the header quadmath.h
|
|
||||||
+include(CheckIncludeFile)
|
|
||||||
+check_include_file(quadmath.h QUADMATH_HEADER)
|
|
||||||
+
|
|
||||||
+include(CheckCSourceCompiles)
|
|
||||||
+include(CMakePushCheckState)
|
|
||||||
+
|
|
||||||
+cmake_push_check_state() # Save variables
|
|
||||||
+set(CMAKE_REQUIRED_LIBRARIES quadmath)
|
|
||||||
+check_c_source_compiles("
|
|
||||||
+#include <quadmath.h>
|
|
||||||
+
|
|
||||||
+int main ()
|
|
||||||
+{
|
|
||||||
+ __float128 r = 1.0q;
|
|
||||||
+ r = strtoflt128(\"1.2345678\", NULL);
|
|
||||||
+ return 0;
|
|
||||||
+}" QUADMATH_COMPILES)
|
|
||||||
+cmake_pop_check_state()
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+include(FindPackageHandleStandardArgs)
|
|
||||||
+find_package_handle_standard_args(
|
|
||||||
+ "QuadMath"
|
|
||||||
+ DEFAULT_MSG
|
|
||||||
+ QUADMATH_HEADER
|
|
||||||
+ QUADMATH_COMPILES
|
|
||||||
+)
|
|
||||||
+
|
|
||||||
+# text for feature summary
|
|
||||||
+set_package_properties("QuadMath" PROPERTIES
|
|
||||||
+ DESCRIPTION "GCC Quad-Precision library")
|
|
||||||
+
|
|
||||||
+# set HAVE_QUADMATH for config.h
|
|
||||||
+set(HAVE_QUADMATH ${QUADMATH_FOUND})
|
|
||||||
+
|
|
||||||
+# -fext-numeric-literals is a GCC extension not available in other compilers like clang
|
|
||||||
+if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set(_QUADMATH_EXT_NUMERIC_LITERALS "-fext-numeric-literals")
|
|
||||||
+endif()
|
|
||||||
+
|
|
||||||
+# register all QuadMath related flags
|
|
||||||
+if(HAVE_QUADMATH)
|
|
||||||
+ dune_register_package_flags(COMPILE_DEFINITIONS "ENABLE_QUADMATH=1" "_GLIBCXX_USE_FLOAT128=1"
|
|
||||||
+ COMPILE_OPTIONS ${_QUADMATH_EXT_NUMERIC_LITERALS}
|
|
||||||
+ LIBRARIES "quadmath")
|
|
||||||
+endif()
|
|
|
@ -1,100 +0,0 @@
|
||||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# If you submit this package back to Spack as a pull request,
|
|
||||||
# please first remove this boilerplate and all FIXME comments.
|
|
||||||
#
|
|
||||||
# This is a template package file for Spack. We've put "FIXME"
|
|
||||||
# next to all the things you'll want to change. Once you've handled
|
|
||||||
# them, you can save this file and test your package like this:
|
|
||||||
#
|
|
||||||
# spack install dune-typetree
|
|
||||||
#
|
|
||||||
# You can edit this file again by typing:
|
|
||||||
#
|
|
||||||
# spack edit dune-typetree
|
|
||||||
#
|
|
||||||
# See the Spack documentation for more information on packaging.
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
from spack import *
|
|
||||||
|
|
||||||
|
|
||||||
class DuneTypetree(CMakePackage):
|
|
||||||
"""TypeTree is a template library for constructing and operating on statically typed trees of objects."""
|
|
||||||
|
|
||||||
homepage = "https://www.dune-project.org"
|
|
||||||
url = "https://gitlab.dune-project.org/staging/dune-typetree/-/archive/releases/2.7/dune-typetree-releases-2.7.tar.gz"
|
|
||||||
list_url = 'https://gitlab.dune-project.org/staging/dune-typetree/-/archive/releases/'
|
|
||||||
list_depth = 1
|
|
||||||
|
|
||||||
version('2.7', sha256='b546c2588576d4e8b22e675865628734f2f3d9a8688255742d099f41e5db574e')
|
|
||||||
version('2.6', sha256='a5d78b00ff45a30163062812c8c85f18091b6874df72ceadb9c5c718e0db07de')
|
|
||||||
version('2.5', sha256='7596858584e6805db9db701baa6362bbda0607fe19163c99a69ffa3335eee7a2')
|
|
||||||
|
|
||||||
|
|
||||||
#option
|
|
||||||
variant('blas', default=True, description='Build with BLAS support')
|
|
||||||
variant('lapack', default=True, description='Build with LAPACK support')
|
|
||||||
variant('gmp', default=True, description='Build with GNU multi-precision library support')
|
|
||||||
variant('tbb', default=True, description='Build with Threading Building Blocks library support')
|
|
||||||
variant('mkl', default=True, description='Build with Math Kernel library support')
|
|
||||||
variant('doxygen', default=True, description='Create Doxygen documentation')
|
|
||||||
variant('sphinx', default=True, description='Create Sphinx documentation')
|
|
||||||
variant('vc', default=True, description='Build C++ Vectorization library support')
|
|
||||||
variant('imagemagick', default=False, description='Imagemagick support')
|
|
||||||
variant('oldcategory', default=True, description='Enable/Disable the backwards compatibility of the category enum/method in dune-istl solvers, preconditioner, etc.')
|
|
||||||
variant('threads', default=True, description='Activate pThread support')
|
|
||||||
variant('shared', default=True, description='Enables the build of shared libraries.')
|
|
||||||
|
|
||||||
|
|
||||||
#dependencies
|
|
||||||
depends_on('dune-common+shared')
|
|
||||||
depends_on('cmake@3.1:', type='build')
|
|
||||||
depends_on('mpi')
|
|
||||||
depends_on('blas', when='+blas')
|
|
||||||
depends_on('lapack', when='+lapack')
|
|
||||||
depends_on('doxygen', type='build', when='+doxygen')
|
|
||||||
depends_on('gmp', when='+gmp')
|
|
||||||
depends_on('intel-tbb', when='+tbb')
|
|
||||||
depends_on('intel-mkl', when='+mkl')
|
|
||||||
depends_on('python@3.8.2:')
|
|
||||||
depends_on('py-sphinx', type='build', when='+sphinx')
|
|
||||||
depends_on('vc', when='+vc')
|
|
||||||
depends_on('pkg-config', type='build')
|
|
||||||
depends_on('imagemagick', type='build', when='+imagemagick')
|
|
||||||
|
|
||||||
def url_for_version(self, version):
|
|
||||||
url = 'https://gitlab.dune-project.org/staging/dune-typetree/-/archive/releases/{1}/dune-typetree-releases-{1}.tar.gz'
|
|
||||||
return url.format(version.up_to(2), version)
|
|
||||||
|
|
||||||
patch('AddQuadMathFlags.cmake.patch')
|
|
||||||
patch('FindQuadMath.cmake.patch')
|
|
||||||
|
|
||||||
def cmake_args(self):
|
|
||||||
"""Populate cmake arguments."""
|
|
||||||
spec = self.spec
|
|
||||||
def variant_bool(feature, on='ON', off='OFF'):
|
|
||||||
"""Ternary for spec variant to ON/OFF string"""
|
|
||||||
if feature in spec:
|
|
||||||
return on
|
|
||||||
return off
|
|
||||||
|
|
||||||
def nvariant_bool(feature):
|
|
||||||
"""Negated ternary for spec variant to OFF/ON string"""
|
|
||||||
return variant_bool(feature, on='OFF', off='ON')
|
|
||||||
|
|
||||||
cmake_args = [
|
|
||||||
# '-DDUNE_BUILD_BOTH_LIBS=%s' % variant_bool('+shared'),
|
|
||||||
'-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
|
|
||||||
'-DDUNE_GRID_EXTRA_UTILS:BOOL=%s' % variant_bool('+extrautils'),
|
|
||||||
'-DDUNE_GRID_GRIDTYPE_SELECTOR:BOOL=%s' % variant_bool('+selector'),
|
|
||||||
'-DUSE_PTHREADS:BOOL=%s' % variant_bool('+threads'),
|
|
||||||
]
|
|
||||||
if 'python' in spec:
|
|
||||||
cmake_args.append('-DPYTHON_INSTALL_LOCATION:STRING="system"')
|
|
||||||
|
|
||||||
return cmake_args
|
|
|
@ -1,31 +0,0 @@
|
||||||
--- a/cmake/modules/AddQuadMathFlags.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/AddQuadMathFlags.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,28 @@
|
|
||||||
+# Defines the functions to use QuadMath
|
|
||||||
+#
|
|
||||||
+# .. cmake_function:: add_dune_quadmath_flags
|
|
||||||
+#
|
|
||||||
+# .. cmake_param:: targets
|
|
||||||
+# :positional:
|
|
||||||
+# :single:
|
|
||||||
+# :required:
|
|
||||||
+#
|
|
||||||
+# A list of targets to use QuadMath with.
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+function(add_dune_quadmath_flags _targets)
|
|
||||||
+ if(QUADMATH_FOUND)
|
|
||||||
+ foreach(_target ${_targets})
|
|
||||||
+ target_link_libraries(${_target} "quadmath")
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-DENABLE_QUADMATH=1 -D_GLIBCXX_USE_FLOAT128=1 ")
|
|
||||||
+ if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set_property(TARGET ${_target}
|
|
||||||
+ APPEND_STRING
|
|
||||||
+ PROPERTY COMPILE_FLAGS "-fext-numeric-literals ")
|
|
||||||
+ endif()
|
|
||||||
+ endforeach(_target ${_targets})
|
|
||||||
+ endif(QUADMATH_FOUND)
|
|
||||||
+endfunction(add_dune_quadmath_flags)
|
|
|
@ -1,62 +0,0 @@
|
||||||
--- a/cmake/modules/FindQuadMath.cmake 2020-03-24 07:54:22.548925006 +0100
|
|
||||||
+++ b/cmake/modules/FindQuadMath.cmake.patched 2020-03-24 22:53:43.127262894 +0100
|
|
||||||
@@ -0,0 +1,59 @@
|
|
||||||
+# .. cmake_module::
|
|
||||||
+#
|
|
||||||
+# Find the GCC Quad-Precision library
|
|
||||||
+#
|
|
||||||
+# Sets the following variables:
|
|
||||||
+#
|
|
||||||
+# :code:`QUADMATH_FOUND`
|
|
||||||
+# True if the Quad-Precision library was found.
|
|
||||||
+#
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# search for the header quadmath.h
|
|
||||||
+include(CheckIncludeFile)
|
|
||||||
+check_include_file(quadmath.h QUADMATH_HEADER)
|
|
||||||
+
|
|
||||||
+include(CheckCSourceCompiles)
|
|
||||||
+include(CMakePushCheckState)
|
|
||||||
+
|
|
||||||
+cmake_push_check_state() # Save variables
|
|
||||||
+set(CMAKE_REQUIRED_LIBRARIES quadmath)
|
|
||||||
+check_c_source_compiles("
|
|
||||||
+#include <quadmath.h>
|
|
||||||
+
|
|
||||||
+int main ()
|
|
||||||
+{
|
|
||||||
+ __float128 r = 1.0q;
|
|
||||||
+ r = strtoflt128(\"1.2345678\", NULL);
|
|
||||||
+ return 0;
|
|
||||||
+}" QUADMATH_COMPILES)
|
|
||||||
+cmake_pop_check_state()
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+include(FindPackageHandleStandardArgs)
|
|
||||||
+find_package_handle_standard_args(
|
|
||||||
+ "QuadMath"
|
|
||||||
+ DEFAULT_MSG
|
|
||||||
+ QUADMATH_HEADER
|
|
||||||
+ QUADMATH_COMPILES
|
|
||||||
+)
|
|
||||||
+
|
|
||||||
+# text for feature summary
|
|
||||||
+set_package_properties("QuadMath" PROPERTIES
|
|
||||||
+ DESCRIPTION "GCC Quad-Precision library")
|
|
||||||
+
|
|
||||||
+# set HAVE_QUADMATH for config.h
|
|
||||||
+set(HAVE_QUADMATH ${QUADMATH_FOUND})
|
|
||||||
+
|
|
||||||
+# -fext-numeric-literals is a GCC extension not available in other compilers like clang
|
|
||||||
+if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
|
||||||
+ set(_QUADMATH_EXT_NUMERIC_LITERALS "-fext-numeric-literals")
|
|
||||||
+endif()
|
|
||||||
+
|
|
||||||
+# register all QuadMath related flags
|
|
||||||
+if(HAVE_QUADMATH)
|
|
||||||
+ dune_register_package_flags(COMPILE_DEFINITIONS "ENABLE_QUADMATH=1" "_GLIBCXX_USE_FLOAT128=1"
|
|
||||||
+ COMPILE_OPTIONS ${_QUADMATH_EXT_NUMERIC_LITERALS}
|
|
||||||
+ LIBRARIES "quadmath")
|
|
||||||
+endif()
|
|
|
@ -1,110 +0,0 @@
|
||||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
|
||||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
# If you submit this package back to Spack as a pull request,
|
|
||||||
# please first remove this boilerplate and all FIXME comments.
|
|
||||||
#
|
|
||||||
# This is a template package file for Spack. We've put "FIXME"
|
|
||||||
# next to all the things you'll want to change. Once you've handled
|
|
||||||
# them, you can save this file and test your package like this:
|
|
||||||
#
|
|
||||||
# spack install dune-uggrid
|
|
||||||
#
|
|
||||||
# You can edit this file again by typing:
|
|
||||||
#
|
|
||||||
# spack edit dune-uggrid
|
|
||||||
#
|
|
||||||
# See the Spack documentation for more information on packaging.
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
|
|
||||||
from spack import *
|
|
||||||
|
|
||||||
|
|
||||||
class DuneUggrid(CMakePackage):
|
|
||||||
"""
|
|
||||||
dune-uggrid is a fork of the old UG finite element software, wrapped
|
|
||||||
as a Dune module, and stripped of everything but the grid data
|
|
||||||
structure.
|
|
||||||
You need this module if you want to use the UGGrid grid
|
|
||||||
implementation from dune-grid.
|
|
||||||
"""
|
|
||||||
|
|
||||||
homepage = "https://www.dune-project.org"
|
|
||||||
url = "https://github.com/dune-mirrors/dune-uggrid/archive/v2.6.0.tar.gz"
|
|
||||||
|
|
||||||
version('2.7.0', sha256='bcf4afd386f23cdb7f7ba16cc2fec4918c4afb516761ef7905af8378ea86eb4c')
|
|
||||||
version('2.6.0', sha256='3da75c672c151ca711526f2c0619d6f1ebf8f489c972066ee3b43252ea8daed4')
|
|
||||||
version('2.5.2', sha256='3a484376e625fff880ff9db6be53ccca0080c5ce7229ed31c09e09fa4a4a4afa')
|
|
||||||
version('2.5.1', sha256='55ccb3a4b4aad0c22c2cda6fa2b50325caf5c4493a9e033562fc03cf5a3b3f61')
|
|
||||||
version('2.5.0', sha256='b7f5ac061b6d5f30e22a2acfff205a3fc4751f57f1e301db83c66da2b9105bc9')
|
|
||||||
|
|
||||||
#option
|
|
||||||
variant('blas', default=True, description='Build with BLAS support')
|
|
||||||
variant('lapack', default=True, description='Build with LAPACK support')
|
|
||||||
variant('gmp', default=True, description='Build with GNU multi-precision library support')
|
|
||||||
variant('tbb', default=True, description='Build with Threading Building Blocks library support')
|
|
||||||
variant('mkl', default=True, description='Build with Math Kernel library support')
|
|
||||||
variant('doxygen', default=True, description='Create Doxygen documentation')
|
|
||||||
variant('sphinx', default=True, description='Create Sphinx documentation')
|
|
||||||
variant('vc', default=True, description='Build C++ Vectorization library support')
|
|
||||||
variant('imagemagick', default=False, description='Imagemagick support')
|
|
||||||
variant('2d', default=True, description='Build library for 2d')
|
|
||||||
variant('3d', default=True, description='Build library for 3d')
|
|
||||||
variant('threads', default=True, description='Activate pThread support')
|
|
||||||
variant('shared', default=True, description='Enables the build of shared libraries.')
|
|
||||||
variant('python', default=True, description='Build with Python')
|
|
||||||
variant('extrautils', default=True, description='Enable compilation and installation of extra utilities from the src subdirectory')
|
|
||||||
variant('selector', default=True, description='Grid selector definition added to config.h')
|
|
||||||
|
|
||||||
#dependencies
|
|
||||||
depends_on('dune-common')
|
|
||||||
depends_on('cmake@3.1:', type='build')
|
|
||||||
depends_on('cmake@2.8.12:', when='@2.6', type='build')
|
|
||||||
depends_on('mpi')
|
|
||||||
depends_on('blas', when='+blas')
|
|
||||||
depends_on('lapack', when='+lapack')
|
|
||||||
depends_on('doxygen', type='build', when='+doxygen')
|
|
||||||
depends_on('gmp', when='+gmp')
|
|
||||||
depends_on('intel-tbb', when='+tbb')
|
|
||||||
depends_on('intel-mkl', when='+mkl')
|
|
||||||
depends_on('python@3.0:')
|
|
||||||
depends_on('py-sphinx', type='build', when='+sphinx')
|
|
||||||
depends_on('vc', when='+vc')
|
|
||||||
depends_on('pkg-config', type='build')
|
|
||||||
depends_on('imagemagick', type='build', when='+imagemagick')
|
|
||||||
|
|
||||||
patch('parallel_CMakeList.patch', when='@2.6')
|
|
||||||
patch('AddQuadMathFlags.cmake.patch')
|
|
||||||
patch('FindQuadMath.cmake.patch')
|
|
||||||
|
|
||||||
def cmake_args(self):
|
|
||||||
"""Populate cmake arguments."""
|
|
||||||
spec = self.spec
|
|
||||||
def variant_bool(feature, on='ON', off='OFF'):
|
|
||||||
"""Ternary for spec variant to ON/OFF string"""
|
|
||||||
if feature in spec:
|
|
||||||
return on
|
|
||||||
return off
|
|
||||||
|
|
||||||
def nvariant_bool(feature):
|
|
||||||
"""Negated ternary for spec variant to OFF/ON string"""
|
|
||||||
return variant_bool(feature, on='OFF', off='ON')
|
|
||||||
|
|
||||||
cmake_args = [
|
|
||||||
# '-DDUNE_BUILD_BOTH_LIBS=%s' % variant_bool('+shared'),
|
|
||||||
'-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
|
|
||||||
'-DDUNE_GRID_EXTRA_UTILS:BOOL=%s' % variant_bool('+extrautils'),
|
|
||||||
'-DDUNE_GRID_GRIDTYPE_SELECTOR:BOOL=%s' % variant_bool('+selector'),
|
|
||||||
'-DUSE_PTHREADS:BOOL=%s' % variant_bool('+threads'),
|
|
||||||
]
|
|
||||||
if 'python' in spec:
|
|
||||||
cmake_args.append('-DPYTHON_INSTALL_LOCATION:STRING="system"')
|
|
||||||
if self.spec.variants['build_type'].value == 'Debug':
|
|
||||||
cmake_args.append('UG_ENABLE_DEBUGGING:BOOL=True')
|
|
||||||
cmake_args.append('-DUG_ENABLE_2D:BOOL=%s' % variant_bool('+2d'))
|
|
||||||
cmake_args.append('-DUG_ENABLE_3D:BOOL=%s' % variant_bool('+3d'))
|
|
||||||
|
|
||||||
return cmake_args
|
|
|
@ -1,12 +0,0 @@
|
||||||
--- a/parallel/CMakeLists.txt 2020-03-24 23:00:09.873941559 +0100
|
|
||||||
+++ b/parallel/CMakeLists.txt.patched 2020-03-24 23:11:41.287296340 +0100
|
|
||||||
@@ -3,7 +3,8 @@
|
|
||||||
# Maybe dune-common should export them?
|
|
||||||
add_definitions(-DENABLE_MPI=1 -DMPICH_SKIP_MPICXX -DMPIPP_H)
|
|
||||||
include_directories("${MPI_DUNE_INCLUDE_PATH}")
|
|
||||||
- set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "${MPI_DUNE_COMPILE_FLAGS}")
|
|
||||||
+ separate_arguments(MPI_DUNE_COMPILE_FLAGS UNIX_COMMAND "${MPI_DUNE_COMPILE_FLAGS}")
|
|
||||||
+ set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS ${MPI_DUNE_COMPILE_FLAGS})
|
|
||||||
ug_add_dim_libs(parallel OBJECT initparallel.cc) # OBJECT_DIM_LIBS ddd dddif)
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -0,0 +1,306 @@
|
||||||
|
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||||
|
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
# If you submit this package back to Spack as a pull request,
|
||||||
|
# please first remove this boilerplate and all FIXME comments.
|
||||||
|
#
|
||||||
|
# This is a template package file for Spack. We've put "FIXME"
|
||||||
|
# next to all the things you'll want to change. Once you've handled
|
||||||
|
# them, you can save this file and test your package like this:
|
||||||
|
#
|
||||||
|
# spack install dune
|
||||||
|
#
|
||||||
|
# You can edit this file again by typing:
|
||||||
|
#
|
||||||
|
# spack edit dune
|
||||||
|
#
|
||||||
|
# See the Spack documentation for more information on packaging.
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
import os
|
||||||
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
|
class Dune(CMakePackage):
|
||||||
|
"""
|
||||||
|
DUNE, the Distributed and Unified Numerics Environment is a modular toolbox for solving partial differential equations (PDEs) with grid-based methods.
|
||||||
|
"""
|
||||||
|
|
||||||
|
homepage = "https://www.dune-project.org"
|
||||||
|
url = "https://www.dune-project.org/download/2.7.0/dune-common-2.7.0.tar.gz"
|
||||||
|
list_url = "https://www.dune-project.org/download/"
|
||||||
|
list_depth = 1
|
||||||
|
|
||||||
|
python_components = [ 'dune' ]
|
||||||
|
|
||||||
|
|
||||||
|
version('2.7.0', sha256='3c83c583a45325513113148cb94bd978e601907a6591c765f6253342e00f1890', expand=False)
|
||||||
|
|
||||||
|
variant('2d', default=True, description='Build library for 2d')
|
||||||
|
variant('3d', default=True, description='Build library for 3d')
|
||||||
|
variant('alberta', default=False, description='Build with Alberta support')
|
||||||
|
variant('amiramesh', default=False, description='Build with AmiraMesh support')
|
||||||
|
variant('arpack', default=True, description='Build ARnoldi PACKage library support')
|
||||||
|
variant('blas', default=True, description='Build with BLAS support')
|
||||||
|
variant('doxygen', default=True, description='Create Doxygen documentation')
|
||||||
|
variant('extrautils', default=True, description='Enable compilation and installation of extra utilities from the src subdirectory')
|
||||||
|
variant('fempy', default=False, description='Support of dune-fempy module')
|
||||||
|
variant('gmp', default=True, description='Build with GNU multi-precision library support')
|
||||||
|
variant('imagemagick', default=False, description='Imagemagick support')
|
||||||
|
variant('jupyter', default=False, description='Build with Jupyter support')
|
||||||
|
variant('lapack', default=True, description='Build with LAPACK support')
|
||||||
|
variant('metis', default=True, description='Build with METIS library support')
|
||||||
|
variant('mkl', default=True, description='Build with Math Kernel library support')
|
||||||
|
variant('tbb', default=True, description='Build with Threading Building Blocks library support')
|
||||||
|
variant('oldcategory', default=True, description='Enable/Disable the backwards compatibility of the category enum/method in dune-istl solvers, preconditioner, etc.')
|
||||||
|
variant('parmetis', default=True, description='Build with ParMETIS support')
|
||||||
|
variant('psurface', default=False, description='Build with Psurface support')
|
||||||
|
variant('ptscotch', default=True, description='Build with PT-Scotch support')
|
||||||
|
variant('selector', default=True, description='Grid selector definition added to config.h')
|
||||||
|
variant('shared', default=True, description='Enables the build of shared libraries.')
|
||||||
|
variant('sionlib', default=False, description='Build with SIONlib support')
|
||||||
|
variant('sphinx', default=True, description='Create Sphinx documentation')
|
||||||
|
variant('suitesparse', default=True, description='Build SuiteSparse library support')
|
||||||
|
variant('superlu', default=True, description='Build Supernodal LU library support')
|
||||||
|
variant('threads', default=True, description='Activate pThread support')
|
||||||
|
variant('vc', default=True, description='Build C++ Vectorization library support')
|
||||||
|
variant('zlib', default=True, description='Build zlib library support')
|
||||||
|
variant('zoltan', default=True, description='Build with Zoltan support')
|
||||||
|
|
||||||
|
|
||||||
|
variant('alugrid', default=False, description='Build with dune-alugrid module')
|
||||||
|
variant('corepy', default=False, description='Build with dune-corepy module')
|
||||||
|
variant('functions', default=False, description='Build with dune-functions module')
|
||||||
|
variant('geometry', default=False, description='Build with dune-geometry module')
|
||||||
|
variant('grid', default=False, description='Build with dune-grid module')
|
||||||
|
variant('istl', default=False, description='Build with dune-istl module')
|
||||||
|
variant('localfunctions', default=False, description='Build with dune-localfunctions module')
|
||||||
|
variant('python', default=False, description='Build with Python and dune-python')
|
||||||
|
variant('spgrid', default=False, description='Build with dune-spgrid module')
|
||||||
|
variant('typetree', default=False, description='Build with dune-typetree module')
|
||||||
|
variant('uggrid', default=False, description='Build with dune-uggrid module')
|
||||||
|
|
||||||
|
#Dune common module
|
||||||
|
resource(
|
||||||
|
name='dune-common',
|
||||||
|
git='https://gitlab.dune-project.org/core/dune-common.git',
|
||||||
|
branch='releases/2.7',
|
||||||
|
)
|
||||||
|
#Dune geometry module
|
||||||
|
resource(
|
||||||
|
name='dune-geometry',
|
||||||
|
git='https://gitlab.dune-project.org/core/dune-geometry.git',
|
||||||
|
branch='releases/2.7',
|
||||||
|
when='+geometry')
|
||||||
|
|
||||||
|
#Dune grid module
|
||||||
|
resource(
|
||||||
|
name='dune-grid',
|
||||||
|
git='https://gitlab.dune-project.org/core/dune-grid.git',
|
||||||
|
branch='releases/2.7',
|
||||||
|
when='+grid')
|
||||||
|
|
||||||
|
#Dune uggrid module
|
||||||
|
resource(
|
||||||
|
name='dune-uggrid',
|
||||||
|
git='https://gitlab.dune-project.org/staging/dune-uggrid.git',
|
||||||
|
branch='releases/2.7',
|
||||||
|
when='+uggrid')
|
||||||
|
|
||||||
|
#Dune istl module
|
||||||
|
resource(
|
||||||
|
name='dune-istl',
|
||||||
|
git='https://gitlab.dune-project.org/core/dune-istl.git',
|
||||||
|
branch='releases/2.7',
|
||||||
|
when='+istl')
|
||||||
|
|
||||||
|
#Dune localfunctions module
|
||||||
|
resource(
|
||||||
|
name='dune-localfunctions',
|
||||||
|
git='https://gitlab.dune-project.org/core/dune-localfunctions.git',
|
||||||
|
branch='releases/2.7',
|
||||||
|
when='+localfunctions')
|
||||||
|
|
||||||
|
#Dune functions module
|
||||||
|
resource(
|
||||||
|
name='dune-functions',
|
||||||
|
git='https://gitlab.dune-project.org/staging/dune-functions.git',
|
||||||
|
branch='releases/2.7',
|
||||||
|
when='+functions')
|
||||||
|
|
||||||
|
#Dune module
|
||||||
|
resource(
|
||||||
|
name='dune-python',
|
||||||
|
git='https://gitlab.dune-project.org/staging/dune-python.git',
|
||||||
|
branch='releases/2.7',
|
||||||
|
when='+python')
|
||||||
|
#Dune module
|
||||||
|
resource(
|
||||||
|
name='dune-typetree',
|
||||||
|
git='https://gitlab.dune-project.org/staging/dune-typetree.git',
|
||||||
|
branch='releases/2.7',
|
||||||
|
when='+typetree')
|
||||||
|
#Dune module
|
||||||
|
resource(
|
||||||
|
name='dune-alugrid',
|
||||||
|
git='https://gitlab.dune-project.org/extensions/dune-alugrid.git',
|
||||||
|
branch='releases/2.7',
|
||||||
|
when='+alugrid')
|
||||||
|
|
||||||
|
#Dependence between modules
|
||||||
|
module_dependencies={"dune-common":[]}
|
||||||
|
module_dependencies["dune-geometry"]=["dune-common"]
|
||||||
|
module_dependencies["dune-grid"]=["dune-common","dune-geometry"]
|
||||||
|
module_dependencies["dune-uggrid"]=["dune-common"]
|
||||||
|
module_dependencies["dune-istl"]=["dune-common"]
|
||||||
|
module_dependencies["dune-localfunctions"]=["dune-common","dune-geometry"]
|
||||||
|
module_dependencies["dune-functions"]=["dune-grid","dune-typetree","dune-localfunctions","dune-istl"]
|
||||||
|
module_dependencies["dune-typetree"]=["dune-common"]
|
||||||
|
module_dependencies["dune-python"]=[]
|
||||||
|
module_dependencies["dune-alugrid"]=["dune-grid","dune-geometry","dune-common"]
|
||||||
|
|
||||||
|
def build_module_list(self,module_list,name):
|
||||||
|
if name in self.module_dependencies.keys():
|
||||||
|
for dep in self.module_dependencies[name]:
|
||||||
|
self.build_module_list(module_list,dep)
|
||||||
|
module_list.append(name)
|
||||||
|
return
|
||||||
|
|
||||||
|
extends('python')
|
||||||
|
#option
|
||||||
|
depends_on('cmake@3.1:', type='build')
|
||||||
|
depends_on('mpi')
|
||||||
|
depends_on('blas', when='+blas')
|
||||||
|
depends_on('lapack', when='+lapack')
|
||||||
|
depends_on('doxygen', type='build', when='+doxygen')
|
||||||
|
depends_on('gmp', when='+gmp')
|
||||||
|
depends_on('intel-tbb', when='+tbb')
|
||||||
|
depends_on('intel-mkl', when='+mkl')
|
||||||
|
depends_on('python@3.0:', type=('build', 'run'), when='+python')
|
||||||
|
depends_on('py-setuptools', type='build')
|
||||||
|
depends_on('py-jupyter', type=('build', 'run'), when='+jupyter')
|
||||||
|
depends_on('py-numpy', type=('build', 'run'), when='+python')
|
||||||
|
depends_on('py-pip', type=('build', 'run'), when='+python')
|
||||||
|
depends_on('py-sphinx', type=('build', 'run'), when='+sphinx')
|
||||||
|
depends_on('vc', when='+vc')
|
||||||
|
depends_on('pkg-config', type='build')
|
||||||
|
depends_on('imagemagick', type='build', when='+imagemagick')
|
||||||
|
depends_on('metis', when='+metis')
|
||||||
|
depends_on('parmetis', when='+parmetis')
|
||||||
|
depends_on('arpack-ng', when='+arpack')
|
||||||
|
depends_on('suite-sparse', when='+suitesparse')
|
||||||
|
depends_on('superlu', when='+superlu')
|
||||||
|
depends_on('alberta', when='+alberta')
|
||||||
|
depends_on('psurface', when='+psurface')
|
||||||
|
depends_on('amiramesh', when='+amiramesh')
|
||||||
|
depends_on('sionlib', when='+sionlib')
|
||||||
|
depends_on('zlib', when='+zlib')
|
||||||
|
depends_on('scotch+mpi', when='+ptscotch')
|
||||||
|
depends_on('zoltan', when='+zoltan')
|
||||||
|
|
||||||
|
|
||||||
|
def url_for_version(self, version):
|
||||||
|
url = "https://www.dune-project.org/download/{1}/dune-common-{1}.tar.gz"
|
||||||
|
return url.format(version.up_to(2), version)
|
||||||
|
|
||||||
|
def cmake_args(self):
|
||||||
|
"""Populate cmake arguments."""
|
||||||
|
spec = self.spec
|
||||||
|
def variant_bool(feature, on='ON', off='OFF'):
|
||||||
|
"""Ternary for spec variant to ON/OFF string"""
|
||||||
|
if feature in spec:
|
||||||
|
return on
|
||||||
|
return off
|
||||||
|
|
||||||
|
def nvariant_bool(feature):
|
||||||
|
"""Negated ternary for spec variant to OFF/ON string"""
|
||||||
|
return variant_bool(feature, on='OFF', off='ON')
|
||||||
|
|
||||||
|
cmake_args = [
|
||||||
|
# '-DDUNE_BUILD_BOTH_LIBS=%s' % variant_bool('+shared'),
|
||||||
|
'-DBUILD_SHARED_LIBS:BOOL=%s' % variant_bool('+shared'),
|
||||||
|
'-DDUNE_GRID_EXTRA_UTILS:BOOL=%s' % variant_bool('+extrautils'),
|
||||||
|
'-DDUNE_GRID_GRIDTYPE_SELECTOR:BOOL=%s' % variant_bool('+selector'),
|
||||||
|
'-DDUNE_ISTL_SUPPORT_OLD_CATEGORY=%s' % variant_bool('+oldcategory'),
|
||||||
|
'-DUSE_PTHREADS:BOOL=%s' % variant_bool('+threads'),
|
||||||
|
]
|
||||||
|
#self.define_from_variant('DETECT_HDF5', 'hdf5'),
|
||||||
|
if '+python' in spec:
|
||||||
|
cmake_args.append('-DDUNE_GRID_EXPERIMENTAL_GRID_EXTENSIONS:BOOL=TRUE')
|
||||||
|
cmake_args.append('-DPYTHON_INSTALL_LOCATION:STRING="system"')
|
||||||
|
|
||||||
|
return cmake_args
|
||||||
|
|
||||||
|
def _get_needed_resources(self):
|
||||||
|
# for variant, resource_list in self.resources.items():
|
||||||
|
resources = []
|
||||||
|
# Select the resources that are needed for this build
|
||||||
|
if self.spec.concrete:
|
||||||
|
module_list=[]
|
||||||
|
for when_spec, resource_list in self.resources.items():
|
||||||
|
if when_spec in self.spec:
|
||||||
|
for res in resource_list:
|
||||||
|
dune_module=res.name
|
||||||
|
self.build_module_list(module_list,dune_module)
|
||||||
|
# resources.extend(resource_list)
|
||||||
|
module_list = list(dict.fromkeys(module_list))
|
||||||
|
for when_spec, resource_list in self.resources.items():
|
||||||
|
for res in resource_list:
|
||||||
|
if(res.name in module_list):
|
||||||
|
resources.extend(resource_list)
|
||||||
|
else:
|
||||||
|
for when_spec, resource_list in self.resources.items():
|
||||||
|
# Note that variant checking is always strict for specs where
|
||||||
|
# the name is not specified. But with strict variant checking,
|
||||||
|
# only variants mentioned in 'other' are checked. Here we only
|
||||||
|
# want to make sure that no constraints in when_spec
|
||||||
|
# conflict with the spec, so we need to invoke
|
||||||
|
# when_spec.satisfies(self.spec) vs.
|
||||||
|
# self.spec.satisfies(when_spec)
|
||||||
|
if when_spec.satisfies(self.spec, strict=False):
|
||||||
|
resources.extend(resource_list)
|
||||||
|
# Sorts the resources by the length of the string representing their
|
||||||
|
# destination. Since any nested resource must contain another
|
||||||
|
# resource's name in its path, it seems that should work
|
||||||
|
resources = sorted(resources, key=lambda res: len(res.destination))
|
||||||
|
return resources
|
||||||
|
|
||||||
|
def cmake(self, spec, prefix):
|
||||||
|
os.remove(self.stage.archive_file)
|
||||||
|
optFile = open(self.stage.source_path+"/../dune.opts", "w")
|
||||||
|
optFile.write('CMAKE_FLAGS="')
|
||||||
|
for flag in self.cmake_args():
|
||||||
|
optFile.write(flag.replace("\"", "'")+" ")
|
||||||
|
optFile.write('-DCMAKE_INSTALL_PREFIX=%s' % prefix)
|
||||||
|
optFile.write('"')
|
||||||
|
optFile.close()
|
||||||
|
set_executable('dune-common/bin/dunecontrol')
|
||||||
|
installer = Executable('dune-common/bin/dunecontrol')
|
||||||
|
options_file=self.stage.source_path+"/../dune.opts"
|
||||||
|
installer('--builddir=%s'%self.build_directory , '--opts=%s' % options_file, 'cmake')
|
||||||
|
pass
|
||||||
|
|
||||||
|
def install(self, spec, prefix):
|
||||||
|
set_executable('dune-common/bin/dunecontrol')
|
||||||
|
installer = Executable('dune-common/bin/dunecontrol')
|
||||||
|
options_file=self.stage.source_path+"/../dune.opts"
|
||||||
|
installer('--builddir=%s'%self.build_directory , '--opts=%s' % options_file, 'make', 'install')
|
||||||
|
pass
|
||||||
|
|
||||||
|
def build(self, spec, prefix):
|
||||||
|
set_executable('dune-common/bin/dunecontrol')
|
||||||
|
installer = Executable('dune-common/bin/dunecontrol')
|
||||||
|
options_file=self.stage.source_path+"/../dune.opts"
|
||||||
|
installer('--builddir=%s'%self.build_directory , '--opts=%s' % options_file, 'make')
|
||||||
|
pass
|
||||||
|
|
||||||
|
@run_after('install')
|
||||||
|
def install_python_components(self):
|
||||||
|
if '+python' in self.spec:
|
||||||
|
for package in self.python_components:
|
||||||
|
build_directory = 'dune-python/python'
|
||||||
|
with working_dir(join_path(self.build_directory,'dune-python/python')):
|
||||||
|
setup_py('install', '--prefix={0}'.format(self.prefix))
|
Loading…
Reference in New Issue