Update Adol-C to AutotoolsPackage; Change develop repository (#3246)
The new repository for the development version points to the most up-to-date official source for Adol-C. The previous SVN repository was only occasionally sync'd with this repository.
This commit is contained in:
parent
315dfe0970
commit
86276cd734
1 changed files with 34 additions and 23 deletions
|
@ -25,68 +25,79 @@
|
||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class AdolC(Package):
|
class AdolC(AutotoolsPackage):
|
||||||
"""A package for the automatic differentiation of first and higher
|
"""A package for the automatic differentiation of first and higher
|
||||||
derivatives of vector functions in C and C++ programs by operator
|
derivatives of vector functions in C and C++ programs by operator
|
||||||
overloading."""
|
overloading."""
|
||||||
homepage = "https://projects.coin-or.org/ADOL-C"
|
homepage = "https://projects.coin-or.org/ADOL-C"
|
||||||
url = "http://www.coin-or.org/download/source/ADOL-C/ADOL-C-2.6.1.tgz"
|
url = "http://www.coin-or.org/download/source/ADOL-C/ADOL-C-2.6.1.tgz"
|
||||||
|
|
||||||
version('develop', svn='https://projects.coin-or.org/svn/ADOL-C/trunk/')
|
version('develop', git='https://gitlab.com/adol-c/adol-c.git',
|
||||||
|
branch='master')
|
||||||
version('2.6.2', '0f9547584c99c0673e4f81cf64e8d865')
|
version('2.6.2', '0f9547584c99c0673e4f81cf64e8d865')
|
||||||
version('2.6.1', '1032b28427d6e399af4610e78c0f087b')
|
version('2.6.1', '1032b28427d6e399af4610e78c0f087b')
|
||||||
|
|
||||||
variant('advanced_branching', default=False,
|
variant('advanced_branching', default=False,
|
||||||
description='Enable advanced branching to reduce retaping')
|
description='Enable advanced branching to reduce retaping')
|
||||||
|
variant('atrig_erf', default=True,
|
||||||
|
description='Enable arc-trig and error functions')
|
||||||
variant('doc', default=True, description='Install documentation')
|
variant('doc', default=True, description='Install documentation')
|
||||||
variant('openmp', default=False, description='Enable OpenMP support')
|
variant('openmp', default=False, description='Enable OpenMP support')
|
||||||
variant('sparse', default=False, description='Enable sparse drivers')
|
variant('sparse', default=False, description='Enable sparse drivers')
|
||||||
variant('tests', default=True,
|
variant('tests', default=True,
|
||||||
description='Build all included examples as a test case')
|
description='Build all included examples as a test case')
|
||||||
|
|
||||||
|
# Build dependencies
|
||||||
|
depends_on('automake', type='build', when='@develop')
|
||||||
|
depends_on('autoconf', type='build', when='@develop')
|
||||||
|
depends_on('libtool', type='build', when='@develop')
|
||||||
|
depends_on('m4', type='build', when='@develop')
|
||||||
|
|
||||||
patch('openmp_exam_261.patch', when='@2.6.1')
|
patch('openmp_exam_261.patch', when='@2.6.1')
|
||||||
|
|
||||||
def install(self, spec, prefix):
|
def configure_args(self):
|
||||||
make_args = ['--prefix=%s' % prefix,
|
spec = self.spec
|
||||||
'--enable-atrig-erf']
|
|
||||||
|
configure_args = []
|
||||||
|
|
||||||
if '+advanced_branching' in spec:
|
if '+advanced_branching' in spec:
|
||||||
make_args.extend([
|
configure_args.extend([
|
||||||
'--enable-advanced-branching'
|
'--enable-advanced-branching'
|
||||||
])
|
])
|
||||||
|
|
||||||
|
if '+atrig_erf' in spec:
|
||||||
|
configure_args.extend([
|
||||||
|
'--enable-atrig-erf'
|
||||||
|
])
|
||||||
|
|
||||||
if '+openmp' in spec:
|
if '+openmp' in spec:
|
||||||
if spec.satisfies('%gcc'):
|
configure_args.extend([
|
||||||
make_args.extend([
|
'--with-openmp-flag={0}'.format(self.compiler.openmp_flag)
|
||||||
# FIXME: Is this required? -I <path to omp.h> -L <LLVM
|
])
|
||||||
# OpenMP library path>
|
|
||||||
'--with-openmp-flag=-fopenmp'
|
|
||||||
])
|
|
||||||
else:
|
|
||||||
raise InstallError(
|
|
||||||
"OpenMP flags for compilers other than GCC "
|
|
||||||
"are not implemented.")
|
|
||||||
|
|
||||||
if '+sparse' in spec:
|
if '+sparse' in spec:
|
||||||
make_args.extend([
|
configure_args.extend([
|
||||||
'--enable-sparse'
|
'--enable-sparse'
|
||||||
])
|
])
|
||||||
|
|
||||||
# We can simply use the bundled examples to check
|
# We can simply use the bundled examples to check
|
||||||
# whether Adol-C works as expected
|
# whether Adol-C works as expected
|
||||||
if '+tests' in spec:
|
if '+tests' in spec:
|
||||||
make_args.extend([
|
configure_args.extend([
|
||||||
'--enable-docexa', # Documeted examples
|
'--enable-docexa', # Documented examples
|
||||||
'--enable-addexa' # Additional examples
|
'--enable-addexa' # Additional examples
|
||||||
])
|
])
|
||||||
if '+openmp' in spec:
|
if '+openmp' in spec:
|
||||||
make_args.extend([
|
configure_args.extend([
|
||||||
'--enable-parexa' # Parallel examples
|
'--enable-parexa' # Parallel examples
|
||||||
])
|
])
|
||||||
|
|
||||||
configure(*make_args)
|
return configure_args
|
||||||
make()
|
|
||||||
make("install")
|
@run_after('install')
|
||||||
|
def install_additional_files(self):
|
||||||
|
spec = self.spec
|
||||||
|
prefix = self.prefix
|
||||||
|
|
||||||
# Copy the config.h file, as some packages might require it
|
# Copy the config.h file, as some packages might require it
|
||||||
source_directory = self.stage.source_path
|
source_directory = self.stage.source_path
|
||||||
|
|
Loading…
Reference in a new issue