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
This commit is contained in:
Jonas Lippuner 2018-10-26 19:13:48 -06:00 committed by Peter Scheibel
parent 8d288cd8eb
commit 70bdcd703a

View file

@ -31,6 +31,10 @@ class Kokkos(Package):
variant('cuda', default=False, description="enable Cuda backend") variant('cuda', default=False, description="enable Cuda backend")
variant('openmp', default=False, description="enable OpenMP backend") variant('openmp', default=False, description="enable OpenMP backend")
# Compilation options
variant('pic', default=False,
description="enable position independent code (-fPIC flag)")
# Kokkos options # Kokkos options
variant('aggressive_vectorization', default=False, variant('aggressive_vectorization', default=False,
description="set aggressive_vectorization Kokkos option") description="set aggressive_vectorization Kokkos option")
@ -138,6 +142,10 @@ def install(self, spec, prefix):
kokkos_options_args = [] kokkos_options_args = []
cuda_options_args = [] cuda_options_args = []
# PIC
if '+pic' in spec:
g_args.append('--cxxflags=-fPIC')
# Backends # Backends
if '+serial' in spec: if '+serial' in spec:
g_args.append('--with-serial') g_args.append('--with-serial')