Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
eic_tools
Spack
Commits
29f81b77
Commit
29f81b77
authored
8 years ago
by
Denis Davydov
Committed by
Todd Gamblin
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
trilinos: switch to CMakePackage and minor cleanup (#2226)
parent
453331db
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
var/spack/repos/builtin/packages/trilinos/package.py
+21
-31
21 additions, 31 deletions
var/spack/repos/builtin/packages/trilinos/package.py
with
21 additions
and
31 deletions
var/spack/repos/builtin/packages/trilinos/package.py
+
21
−
31
View file @
29f81b77
...
...
@@ -36,7 +36,7 @@
# https://github.com/trilinos/Trilinos/issues/175
class
Trilinos
(
Package
):
class
Trilinos
(
CMake
Package
):
"""
The Trilinos Project is an effort to develop algorithms and enabling
technologies within an object-oriented software framework for the solution
of large-scale, complex multi-physics engineering and scientific problems.
...
...
@@ -124,7 +124,8 @@ def variants_check(self):
raise
RuntimeError
(
'
The superlu-dist variant can only be used
'
+
'
with Trilinos @12.0.1:
'
)
def
install
(
self
,
spec
,
prefix
):
def
cmake_args
(
self
):
spec
=
self
.
spec
self
.
variants_check
()
cxx_flags
=
[]
...
...
@@ -157,7 +158,8 @@ def install(self, spec, prefix):
'
-DTrilinos_ENABLE_CXX11:BOOL=ON
'
,
'
-DTPL_ENABLE_Netcdf:BOOL=ON
'
,
'
-DTPL_ENABLE_HYPRE:BOOL=%s
'
%
(
'
ON
'
if
'
+hypre
'
in
spec
else
'
OFF
'
)
'
ON
'
if
'
+hypre
'
in
spec
else
'
OFF
'
),
'
-DCMAKE_INSTALL_NAME_DIR:PATH=%s/lib
'
%
self
.
prefix
])
if
spec
.
satisfies
(
'
%intel
'
)
and
spec
.
satisfies
(
'
@12.6.2
'
):
...
...
@@ -206,11 +208,6 @@ def install(self, spec, prefix):
'
-DTrilinos_ENABLE_Fortran=ON
'
])
# for build-debug only:
# options.extend([
# '-DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE'
# ])
# suite-sparse related
if
'
+suite-sparse
'
in
spec
:
options
.
extend
([
...
...
@@ -330,27 +327,20 @@ def install(self, spec, prefix):
options
.
extend
([
'
-DTrilinos_ENABLE_FEI=OFF
'
])
return
options
with
working_dir
(
'
spack-build
'
,
create
=
True
):
cmake
(
'
..
'
,
*
options
)
make
()
make
(
'
install
'
)
# When trilinos is built with Python, libpytrilinos is included
# through cmake configure files. Namely, Trilinos_LIBRARIES in
# TrilinosConfig.cmake contains pytrilinos. This leads to a
# run-time error: Symbol not found: _PyBool_Type and prevents
# Trilinos to be used in any C++ code, which links executable
# against the libraries listed in Trilinos_LIBRARIES. See
# https://github.com/Homebrew/homebrew-science/issues/2148#issuecomment-103614509
# A workaround it to remove PyTrilinos from the COMPONENTS_LIST :
if
'
+python
'
in
self
.
spec
:
filter_file
(
r
'
(SET\(COMPONENTS_LIST.*)(PyTrilinos;)(.*)
'
,
(
r
'
\1\3
'
),
'
%s/cmake/Trilinos/TrilinosConfig.cmake
'
%
prefix
.
lib
)
# The shared libraries are not installed correctly on Darwin;
# correct this
if
(
sys
.
platform
==
'
darwin
'
)
and
(
'
+shared
'
in
spec
):
fix_darwin_install_name
(
prefix
.
lib
)
@CMakePackage.sanity_check
(
'
install
'
)
def
filter_python
(
self
):
# When trilinos is built with Python, libpytrilinos is included
# through cmake configure files. Namely, Trilinos_LIBRARIES in
# TrilinosConfig.cmake contains pytrilinos. This leads to a
# run-time error: Symbol not found: _PyBool_Type and prevents
# Trilinos to be used in any C++ code, which links executable
# against the libraries listed in Trilinos_LIBRARIES. See
# https://github.com/Homebrew/homebrew-science/issues/2148#issuecomment-103614509
# A workaround is to remove PyTrilinos from the COMPONENTS_LIST :
if
'
+python
'
in
self
.
spec
:
filter_file
(
r
'
(SET\(COMPONENTS_LIST.*)(PyTrilinos;)(.*)
'
,
(
r
'
\1\3
'
),
'
%s/cmake/Trilinos/TrilinosConfig.cmake
'
%
self
.
prefix
.
lib
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment