Skip to content
Snippets Groups Projects
Commit 00d84b19 authored by thelfer's avatar thelfer Committed by Adam J. Stewart
Browse files

Update TFEL package (#9995)

* add the tfel package

* fix the tfel package

* fix the tfel package

* fix the tfel package

* Taking Adam J. Steward' remarks into account

* fixes trailing white spaces

* Update description

* Update dependencies following @adamjstewart adices

* Style fixes

* Style fixes

* Add java optional support

* add the maintainers attribute (following @alalazo advice), disable interface not selected (following @adamjstewart advice)

* flake8 fixes

* Fix Cast3M and python-bindings support. Python detection is made compatible with cmake'FindPythonLibs module (at least how it is used in TFEL)

* Style fixes

* Style fixes

* Fix test on python version

* Follow @adamjstewart advices: code is much cleaner and readable

* Small fix

* Small fix

* Add comment

* Small fix in cmake option

* try again (trying to overcome Travis CI unstable build process)
parent 7ded7fdb
Branches
Tags
No related merge requests found
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
# #
# SPDX-License-Identifier: (Apache-2.0 OR MIT) # SPDX-License-Identifier: (Apache-2.0 OR MIT)
# Maintainer comments:
# 18/12/2018: fix python detection
from spack import * from spack import *
...@@ -75,22 +78,52 @@ class Tfel(CMakePackage): ...@@ -75,22 +78,52 @@ class Tfel(CMakePackage):
variant('java', default=False, variant('java', default=False,
description='Enables java interface') description='Enables java interface')
variant('build_type', default='Release',
description='The build type to build',
values=('Debug', 'Release'))
depends_on('java', when='+java') depends_on('java', when='+java')
depends_on('python', when='+python') depends_on('python', when='+python',
depends_on('python', when='+python_bindings') type=('build', 'link', 'run'))
depends_on('python', when='+python_bindings',
type=('build', 'link', 'run'))
depends_on('boost+python', when='+python_bindings') depends_on('boost+python', when='+python_bindings')
extends('python', when='+python_bindings')
def cmake_args(self): def cmake_args(self):
args = [] args = []
for i in ['fortran', 'java', 'castem', 'aster', for i in ['fortran', 'java', 'aster', 'abaqus', 'calculix',
'abaqus', 'calculix', 'ansys', 'ansys', 'europlexus', 'cyrano', 'lsdyna', 'python']:
'europlexus', 'cyrano', 'lsdyna',
'python', 'python_bindings']:
if '+' + i in self.spec: if '+' + i in self.spec:
args.append("-Denable-{0}=ON".format(i)) args.append("-Denable-{0}=ON".format(i))
else: else:
args.append("-Denable-{0}=OFF".format(i)) args.append("-Denable-{0}=OFF".format(i))
if '+castem' in self.spec:
args.append("-Dlocal-castem-header=ON")
else:
args.append("-Dlocal-castem-header=OFF")
if '+python_bindings' in self.spec:
args.append("-Denable-python-bindings=ON")
else:
args.append("-Denable-python-bindings=OFF")
if(('+python' in self.spec) or
('+python_bindings' in self.spec)):
python = self.spec['python']
args.append('-DPYTHON_LIBRARY={0}'.
format(python.libs[0]))
args.append('-DPYTHON_INCLUDE_DIR={0}'.
format(python.headers.directories[0]))
args.append('-DPython_ADDITIONAL_VERSIONS={0}'.
format(python.version.up_to(2)))
if '+python_bindings' in self.spec:
args.append('-DBOOST_ROOT={0}'.
format(self.spec['boost'].prefix))
return args return args
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment