summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Lippuner <jlippuner@lanl.gov>2018-10-26 19:13:48 -0600
committerPeter Scheibel <scheibel1@llnl.gov>2018-10-26 18:13:48 -0700
commit70bdcd703add93ae8d647ce1e60a22fa7c765ab1 (patch)
tree282940a80de0c5b428824c1bce5a17f61dc4d0c2
parent8d288cd8eb923dc205500cf4c377219c5a855b05 (diff)
downloadspack-70bdcd703add93ae8d647ce1e60a22fa7c765ab1.tar.gz
spack-70bdcd703add93ae8d647ce1e60a22fa7c765ab1.tar.bz2
spack-70bdcd703add93ae8d647ce1e60a22fa7c765ab1.tar.xz
spack-70bdcd703add93ae8d647ce1e60a22fa7c765ab1.zip
kokkos: add pic option (#9643)
Since kokkos only compiles a static library, the -fPIC compiler flag is required to link kokkos into a Fortran executable
-rw-r--r--var/spack/repos/builtin/packages/kokkos/package.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/kokkos/package.py b/var/spack/repos/builtin/packages/kokkos/package.py
index 06c408d730..6de38510c4 100644
--- a/var/spack/repos/builtin/packages/kokkos/package.py
+++ b/var/spack/repos/builtin/packages/kokkos/package.py
@@ -31,6 +31,10 @@ class Kokkos(Package):
variant('cuda', default=False, description="enable Cuda backend")
variant('openmp', default=False, description="enable OpenMP backend")
+ # Compilation options
+ variant('pic', default=False,
+ description="enable position independent code (-fPIC flag)")
+
# Kokkos options
variant('aggressive_vectorization', default=False,
description="set aggressive_vectorization Kokkos option")
@@ -138,6 +142,10 @@ class Kokkos(Package):
kokkos_options_args = []
cuda_options_args = []
+ # PIC
+ if '+pic' in spec:
+ g_args.append('--cxxflags=-fPIC')
+
# Backends
if '+serial' in spec:
g_args.append('--with-serial')