diff options
Diffstat (limited to 'var')
50 files changed, 115 insertions, 83 deletions
diff --git a/var/spack/repos/builtin/packages/adios/package.py b/var/spack/repos/builtin/packages/adios/package.py index 6994963898..c850b3058b 100644 --- a/var/spack/repos/builtin/packages/adios/package.py +++ b/var/spack/repos/builtin/packages/adios/package.py @@ -133,7 +133,7 @@ class Adios(AutotoolsPackage): extra_args = [ # required, otherwise building its python bindings will fail - 'CFLAGS={0}'.format(self.compiler.pic_flag) + 'CFLAGS={0}'.format(self.compiler.cc_pic_flag) ] extra_args += self.enable_or_disable('shared') diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py index 0f4c8394cf..cc223d2f7e 100644 --- a/var/spack/repos/builtin/packages/boost/package.py +++ b/var/spack/repos/builtin/packages/boost/package.py @@ -371,7 +371,7 @@ class Boost(Package): cxxflags.append(flag) if '+pic' in self.spec: - cxxflags.append(self.compiler.pic_flag) + cxxflags.append(self.compiler.cxx_pic_flag) # clang is not officially supported for pre-compiled headers # and at least in clang 3.9 still fails to build diff --git a/var/spack/repos/builtin/packages/cantera/package.py b/var/spack/repos/builtin/packages/cantera/package.py index 4e2728fad8..4b38ccc7b3 100644 --- a/var/spack/repos/builtin/packages/cantera/package.py +++ b/var/spack/repos/builtin/packages/cantera/package.py @@ -59,7 +59,7 @@ class Cantera(SConsPackage): 'CC={0}'.format(spack_cc), 'CXX={0}'.format(spack_cxx), 'FORTRAN={0}'.format(spack_fc), - 'cc_flags={0}'.format(self.compiler.pic_flag), + 'cc_flags={0}'.format(self.compiler.cc_pic_flag), # Allow Spack environment variables to propagate through to SCons 'env_vars=all' ] diff --git a/var/spack/repos/builtin/packages/dataspaces/package.py b/var/spack/repos/builtin/packages/dataspaces/package.py index 6e2120d399..be5c5c884f 100644 --- a/var/spack/repos/builtin/packages/dataspaces/package.py +++ b/var/spack/repos/builtin/packages/dataspaces/package.py @@ -56,7 +56,7 @@ class Dataspaces(AutotoolsPackage): args = [] cookie = self.spec.variants['gni-cookie'].value ptag = self.spec.variants['ptag'].value - args.append('CFLAGS={0}'.format(self.compiler.pic_flag)) + args.append('CFLAGS={0}'.format(self.compiler.cc_pic_flag)) if self.spec.satisfies('+dimes'): args.append('--enable-dimes') if self.spec.satisfies('+cray-drc'): diff --git a/var/spack/repos/builtin/packages/f77-zmq/package.py b/var/spack/repos/builtin/packages/f77-zmq/package.py index bab4469442..955ed2ecd6 100644 --- a/var/spack/repos/builtin/packages/f77-zmq/package.py +++ b/var/spack/repos/builtin/packages/f77-zmq/package.py @@ -31,7 +31,7 @@ class F77Zmq(MakefilePackage): makefile = FileFilter('Makefile') makefile.filter('CC=.*', 'CC={0} {1}'.format(spack_cc, - self.compiler.pic_flag)) + self.compiler.cc_pic_flag)) makefile.filter('CFLAGS=.*', 'CFLAGS={0}'.format(cflags)) makefile.filter('PREFIX=.*', 'PREFIX={0}'.format(self.prefix)) p = self.spec['libzmq'].prefix diff --git a/var/spack/repos/builtin/packages/fmt/package.py b/var/spack/repos/builtin/packages/fmt/package.py index be39f6cc83..e54bea78b4 100644 --- a/var/spack/repos/builtin/packages/fmt/package.py +++ b/var/spack/repos/builtin/packages/fmt/package.py @@ -61,8 +61,8 @@ class Fmt(CMakePackage): if '+pic' in spec: args.extend([ - '-DCMAKE_C_FLAGS={0}'.format(self.compiler.pic_flag), - '-DCMAKE_CXX_FLAGS={0}'.format(self.compiler.pic_flag) + '-DCMAKE_C_FLAGS={0}'.format(self.compiler.cc_pic_flag), + '-DCMAKE_CXX_FLAGS={0}'.format(self.compiler.cxx_pic_flag) ]) args.append('-DCMAKE_CXX_STANDARD={0}'.format( diff --git a/var/spack/repos/builtin/packages/gasnet/package.py b/var/spack/repos/builtin/packages/gasnet/package.py index 4a48df005e..8ead7c3796 100644 --- a/var/spack/repos/builtin/packages/gasnet/package.py +++ b/var/spack/repos/builtin/packages/gasnet/package.py @@ -60,8 +60,8 @@ class Gasnet(AutotoolsPackage): '--with-segment-mmap-max=%s ' % (self.spec.variants['segment-mmap-max'].value), # for consumers with shared libs - 'CC=%s %s' % (spack_cc, self.compiler.pic_flag), - 'CXX=%s %s' % (spack_cxx, self.compiler.pic_flag), + "CC=%s %s" % (spack_cc, self.compiler.cc_pic_flag), + "CXX=%s %s" % (spack_cxx, self.compiler.cxx_pic_flag), ] if '+aligned-segments' in self.spec: @@ -80,7 +80,7 @@ class Gasnet(AutotoolsPackage): '--disable-ibv', '--disable-seq', 'MPI_CC=%s %s' - % (self.spec['mpi'].mpicc, self.compiler.pic_flag)]) + % (self.spec['mpi'].mpicc, self.compiler.cc_pic_flag)]) if '+ibv' in self.spec: args.extend(['--enable-ibv', diff --git a/var/spack/repos/builtin/packages/hdf/package.py b/var/spack/repos/builtin/packages/hdf/package.py index 14f04ea294..67c2744470 100644 --- a/var/spack/repos/builtin/packages/hdf/package.py +++ b/var/spack/repos/builtin/packages/hdf/package.py @@ -35,7 +35,7 @@ class Hdf(AutotoolsPackage): spec = self.spec config_args = [ - 'CFLAGS={0}'.format(self.compiler.pic_flag), + 'CFLAGS={0}'.format(self.compiler.cc_pic_flag), '--with-jpeg={0}'.format(spec['jpeg'].prefix), '--with-zlib={0}'.format(spec['zlib'].prefix), '--disable-netcdf', # must be disabled to build NetCDF with HDF4 diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index 9d5505b5f7..b4f427ff7b 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -259,8 +259,11 @@ class Hdf5(AutotoolsPackage): extra_args.append('--enable-static-exec') if '+pic' in self.spec: - extra_args += ['%s=%s' % (f, self.compiler.pic_flag) - for f in ['CFLAGS', 'CXXFLAGS', 'FCFLAGS']] + extra_args.extend([ + 'CFLAGS=' + self.compiler.cc_pic_flag, + 'CXXFLAGS=' + self.compiler.cxx_pic_flag, + 'FCFLAGS=' + self.compiler.fc_pic_flag, + ]) if '+mpi' in self.spec: # The HDF5 configure script warns if cxx and mpi are enabled diff --git a/var/spack/repos/builtin/packages/libceed/package.py b/var/spack/repos/builtin/packages/libceed/package.py index 3b327a5058..64d04a7b89 100644 --- a/var/spack/repos/builtin/packages/libceed/package.py +++ b/var/spack/repos/builtin/packages/libceed/package.py @@ -81,7 +81,7 @@ class Libceed(Package): if '+cuda' in spec: makeopts += ['CUDA_DIR=%s' % spec['cuda'].prefix] nvccflags = ['-ccbin %s -Xcompiler "%s" -Xcompiler %s' % - (compiler.cxx, opt, compiler.pic_flag)] + (compiler.cxx, opt, compiler.cc_pic_flag)] nvccflags = ' '.join(nvccflags) makeopts += ['NVCCFLAGS=%s' % nvccflags] else: diff --git a/var/spack/repos/builtin/packages/libiberty/package.py b/var/spack/repos/builtin/packages/libiberty/package.py index fd3c6d6ea9..2168223477 100644 --- a/var/spack/repos/builtin/packages/libiberty/package.py +++ b/var/spack/repos/builtin/packages/libiberty/package.py @@ -48,7 +48,7 @@ class Libiberty(AutotoolsPackage, GNUMirrorPackage): flags.append('-O2') if '+pic' in self.spec: - flags.append(self.compiler.pic_flag) + flags.append(self.compiler.cc_pic_flag) return (None, None, flags) diff --git a/var/spack/repos/builtin/packages/lua/package.py b/var/spack/repos/builtin/packages/lua/package.py index 910d8b252f..1c6b152aa3 100644 --- a/var/spack/repos/builtin/packages/lua/package.py +++ b/var/spack/repos/builtin/packages/lua/package.py @@ -56,7 +56,7 @@ class Lua(Package): spec['ncurses'].prefix.lib), 'MYLIBS=-lncursesw', 'CC=%s -std=gnu99 %s' % (spack_cc, - self.compiler.pic_flag), + self.compiler.cc_pic_flag), target) make('INSTALL_TOP=%s' % prefix, 'install') diff --git a/var/spack/repos/builtin/packages/mbedtls/package.py b/var/spack/repos/builtin/packages/mbedtls/package.py index 73247217e4..bbe2bd0412 100644 --- a/var/spack/repos/builtin/packages/mbedtls/package.py +++ b/var/spack/repos/builtin/packages/mbedtls/package.py @@ -40,6 +40,6 @@ class Mbedtls(CMakePackage): # Compile with PIC, if requested. if name == 'cflags' and '+pic' in self.spec: - flags.append(self.compiler.pic_flag) + flags.append(self.compiler.cc_pic_flag) return (flags, None, None) diff --git a/var/spack/repos/builtin/packages/metis/package.py b/var/spack/repos/builtin/packages/metis/package.py index f9371c4b2d..ad0f78566b 100644 --- a/var/spack/repos/builtin/packages/metis/package.py +++ b/var/spack/repos/builtin/packages/metis/package.py @@ -79,7 +79,7 @@ class Metis(Package): # Process library spec and options options = [] if '+shared' in spec: - options.append('COPTIONS={0}'.format(self.compiler.pic_flag)) + options.append('COPTIONS={0}'.format(self.compiler.cc_pic_flag)) if spec.variants['build_type'].value == 'Debug': options.append('OPTFLAGS=-g -O0') make(*options) @@ -107,7 +107,7 @@ class Metis(Package): install(sharefile, prefix.share) if '+shared' in spec: - shared_flags = [self.compiler.pic_flag, '-shared'] + shared_flags = [self.compiler.cc_pic_flag, '-shared'] if sys.platform == 'darwin': shared_suffix = 'dylib' shared_flags.extend(['-Wl,-all_load', 'libmetis.a']) diff --git a/var/spack/repos/builtin/packages/mfem/package.py b/var/spack/repos/builtin/packages/mfem/package.py index 08a4790f68..f754cd915e 100644 --- a/var/spack/repos/builtin/packages/mfem/package.py +++ b/var/spack/repos/builtin/packages/mfem/package.py @@ -307,7 +307,9 @@ class Mfem(Package): if '~static' in spec: options += ['STATIC=NO'] if '+shared' in spec: - options += ['SHARED=YES', 'PICFLAG=%s' % self.compiler.pic_flag] + options += [ + 'SHARED=YES', 'PICFLAG=%s' % self.compiler.cxx_pic_flag + ] if '+mpi' in spec: options += ['MPICXX=%s' % spec['mpi'].mpicxx] diff --git a/var/spack/repos/builtin/packages/mumps/package.py b/var/spack/repos/builtin/packages/mumps/package.py index de34b6aa19..5a5110d1e1 100644 --- a/var/spack/repos/builtin/packages/mumps/package.py +++ b/var/spack/repos/builtin/packages/mumps/package.py @@ -125,7 +125,8 @@ class Mumps(Package): # when building shared libs need -fPIC, otherwise # /usr/bin/ld: graph.o: relocation R_X86_64_32 against `.rodata.str1.1' # can not be used when making a shared object; recompile with -fPIC - fpic = self.compiler.pic_flag if '+shared' in self.spec else '' + cpic = self.compiler.cc_pic_flag if '+shared' in self.spec else '' + fpic = self.compiler.fc_pic_flag if '+shared' in self.spec else '' # TODO: test this part, it needs a full blas, scalapack and # partitionning environment with 64bit integers @@ -146,8 +147,8 @@ class Mumps(Package): ]) makefile_conf.extend([ - 'OPTL = %s -O%s' % (fpic, opt_level), - 'OPTC = %s -O%s -DINTSIZE64' % (fpic, opt_level) + 'OPTL = %s -O%s' % (cpic, opt_level), + 'OPTC = %s -O%s -DINTSIZE64' % (cpic, opt_level) ]) else: if using_xlf: @@ -157,8 +158,8 @@ class Mumps(Package): fpic, opt_level)) makefile_conf.extend([ - 'OPTL = %s -O%s' % (fpic, opt_level), - 'OPTC = %s -O%s' % (fpic, opt_level) + 'OPTL = %s -O%s' % (cpic, opt_level), + 'OPTC = %s -O%s' % (cpic, opt_level) ]) if '+mpi' in self.spec: diff --git a/var/spack/repos/builtin/packages/mxml/package.py b/var/spack/repos/builtin/packages/mxml/package.py index 1f57c2b95d..4fa90802a6 100644 --- a/var/spack/repos/builtin/packages/mxml/package.py +++ b/var/spack/repos/builtin/packages/mxml/package.py @@ -28,7 +28,7 @@ class Mxml(AutotoolsPackage): def configure_args(self): return [ # ADIOS build with -fPIC, so we need it too (avoid linkage issue) - 'CFLAGS={0}'.format(self.compiler.pic_flag), + 'CFLAGS={0}'.format(self.compiler.cc_pic_flag), # Default is non-shared, but avoid any future surprises '--disable-shared', ] diff --git a/var/spack/repos/builtin/packages/ncurses/package.py b/var/spack/repos/builtin/packages/ncurses/package.py index cfb122623d..55d1900c4c 100644 --- a/var/spack/repos/builtin/packages/ncurses/package.py +++ b/var/spack/repos/builtin/packages/ncurses/package.py @@ -40,8 +40,10 @@ class Ncurses(AutotoolsPackage, GNUMirrorPackage): env.unset('TERMINFO') def flag_handler(self, name, flags): - if name == 'cflags' or name == 'cxxflags': - flags.append(self.compiler.pic_flag) + if name == 'cflags': + flags.append(self.compiler.cc_pic_flag) + elif name == 'cxxflags': + flags.append(self.compiler.cxx_pic_flag) return (flags, None, None) diff --git a/var/spack/repos/builtin/packages/netcdf-c/package.py b/var/spack/repos/builtin/packages/netcdf-c/package.py index ac12ab42b4..42c28e5321 100644 --- a/var/spack/repos/builtin/packages/netcdf-c/package.py +++ b/var/spack/repos/builtin/packages/netcdf-c/package.py @@ -158,7 +158,7 @@ class NetcdfC(AutotoolsPackage): if '~shared' in self.spec or '+pic' in self.spec: # We don't have shared libraries but we still want it to be # possible to use this library in shared builds - cflags.append(self.compiler.pic_flag) + cflags.append(self.compiler.cc_pic_flag) config_args += self.enable_or_disable('dap') # config_args += self.enable_or_disable('cdmremote') diff --git a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py index d11bc4ea41..3847cc48dd 100644 --- a/var/spack/repos/builtin/packages/netcdf-cxx4/package.py +++ b/var/spack/repos/builtin/packages/netcdf-cxx4/package.py @@ -44,7 +44,7 @@ class NetcdfCxx4(AutotoolsPackage): def flag_handler(self, name, flags): if name == 'cflags' and '+pic' in self.spec: - flags.append(self.compiler.pic_flag) + flags.append(self.compiler.cc_pic_flag) elif name == 'cppflags': flags.append('-I' + self.spec['netcdf-c'].prefix.include) diff --git a/var/spack/repos/builtin/packages/netcdf-fortran/package.py b/var/spack/repos/builtin/packages/netcdf-fortran/package.py index 51ff028276..1b55df1507 100644 --- a/var/spack/repos/builtin/packages/netcdf-fortran/package.py +++ b/var/spack/repos/builtin/packages/netcdf-fortran/package.py @@ -64,12 +64,16 @@ class NetcdfFortran(AutotoolsPackage): def flag_handler(self, name, flags): config_flags = None - if name in ['cflags', 'fflags'] and '+pic' in self.spec: + if '+pic' in self.spec: # Unlike NetCDF-C, we add PIC flag only when +pic. Adding the # flags also when ~shared would make it impossible to build a # static-only version of the library with NAG. - config_flags = [self.compiler.pic_flag] - elif name == 'cppflags': + if name == 'cflags': + config_flags = [self.compiler.cc_pic_flag] + elif name == 'fflags': + config_flags = [self.compiler.f77_pic_flag] + + if name == 'cppflags': config_flags = [self.spec['netcdf-c'].headers.cpp_flags] elif name == 'ldflags': # We need to specify LDFLAGS to get correct dependency_libs diff --git a/var/spack/repos/builtin/packages/netlib-scalapack/package.py b/var/spack/repos/builtin/packages/netlib-scalapack/package.py index a135e7b2ff..75993c4701 100644 --- a/var/spack/repos/builtin/packages/netlib-scalapack/package.py +++ b/var/spack/repos/builtin/packages/netlib-scalapack/package.py @@ -78,8 +78,8 @@ class NetlibScalapack(CMakePackage): if '+pic' in spec: options.extend([ - "-DCMAKE_C_FLAGS=%s" % self.compiler.pic_flag, - "-DCMAKE_Fortran_FLAGS=%s" % self.compiler.pic_flag + "-DCMAKE_C_FLAGS=%s" % self.compiler.cc_pic_flag, + "-DCMAKE_Fortran_FLAGS=%s" % self.compiler.fc_pic_flag ]) return options diff --git a/var/spack/repos/builtin/packages/neuron/package.py b/var/spack/repos/builtin/packages/neuron/package.py index 15a0f94ea9..8f3371a159 100644 --- a/var/spack/repos/builtin/packages/neuron/package.py +++ b/var/spack/repos/builtin/packages/neuron/package.py @@ -123,7 +123,7 @@ class Neuron(Package): flags = '-O3 -qtune=qp -qarch=qp -q64 -qstrict -qnohot -g' if self.spec.satisfies('%pgi'): - flags += ' ' + self.compiler.pic_flag + flags += ' ' + self.compiler.cc_pic_flag return ['CFLAGS=%s' % flags, 'CXXFLAGS=%s' % flags] diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 71d2ec4a6b..7d71702de0 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -231,8 +231,8 @@ class Openblas(MakefilePackage): if '~shared' in self.spec: if '+pic' in self.spec: make_defs.extend([ - 'CFLAGS={0}'.format(self.compiler.pic_flag), - 'FFLAGS={0}'.format(self.compiler.pic_flag) + 'CFLAGS={0}'.format(self.compiler.cc_pic_flag), + 'FFLAGS={0}'.format(self.compiler.f77_pic_flag) ]) make_defs += ['NO_SHARED=1'] # fix missing _dggsvd_ and _sggsvd_ diff --git a/var/spack/repos/builtin/packages/otf2/package.py b/var/spack/repos/builtin/packages/otf2/package.py index a123f0e887..a2c197e98b 100644 --- a/var/spack/repos/builtin/packages/otf2/package.py +++ b/var/spack/repos/builtin/packages/otf2/package.py @@ -31,7 +31,7 @@ class Otf2(AutotoolsPackage): 'CXX={0}'.format(spack_cxx), 'F77={0}'.format(spack_f77), 'FC={0}'.format(spack_fc), - 'CFLAGS={0}'.format(self.compiler.pic_flag), - 'CXXFLAGS={0}'.format(self.compiler.pic_flag), - 'PYTHON_FOR_GENERATOR=:' + 'CFLAGS={0}'.format(self.compiler.cc_pic_flag), + 'CXXFLAGS={0}'.format(self.compiler.cxx_pic_flag), + 'PYTHON_FOR_GENERATOR=:', ] diff --git a/var/spack/repos/builtin/packages/parallel-netcdf/package.py b/var/spack/repos/builtin/packages/parallel-netcdf/package.py index 384717d05e..dc2f1b4ac3 100644 --- a/var/spack/repos/builtin/packages/parallel-netcdf/package.py +++ b/var/spack/repos/builtin/packages/parallel-netcdf/package.py @@ -96,8 +96,12 @@ class ParallelNetcdf(AutotoolsPackage): args += self.enable_or_disable('fortran') if '+pic' in self.spec: - args.extend(['{0}FLAGS={1}'.format(lang, self.compiler.pic_flag) - for lang in ['C', 'CXX', 'F', 'FC']]) + args.extend([ + 'CFLAGS=' + self.compiler.cc_pic_flag, + 'CXXFLAGS=' + self.compiler.cxx_pic_flag, + 'FFLAGS=' + self.compiler.f77_pic_flag, + 'FCFLAGS=' + self.compiler.fc_pic_flag, + ]) if self.version >= Version('1.8'): args.append('--enable-relax-coord-bound') diff --git a/var/spack/repos/builtin/packages/parmgridgen/package.py b/var/spack/repos/builtin/packages/parmgridgen/package.py index 95ab72060d..eccaec1263 100644 --- a/var/spack/repos/builtin/packages/parmgridgen/package.py +++ b/var/spack/repos/builtin/packages/parmgridgen/package.py @@ -28,8 +28,8 @@ class Parmgridgen(Package): def install(self, spec, prefix): make_opts = [ 'make=make', - 'COPTIONS={0}'.format(self.compiler.pic_flag), - 'LDOPTIONS={0}'.format(self.compiler.pic_flag), + 'COPTIONS={0}'.format(self.compiler.cc_pic_flag), + 'LDOPTIONS={0}'.format(self.compiler.cc_pic_flag), 'CC={0}'.format(self.compiler.cc), 'LD={0}'.format(self.compiler.cc), 'LIBDIR=-L../..', diff --git a/var/spack/repos/builtin/packages/parquet-cpp/package.py b/var/spack/repos/builtin/packages/parquet-cpp/package.py index 38e43f33d3..85222f83a2 100644 --- a/var/spack/repos/builtin/packages/parquet-cpp/package.py +++ b/var/spack/repos/builtin/packages/parquet-cpp/package.py @@ -36,6 +36,9 @@ class ParquetCpp(CMakePackage): def flag_handler(self, name, flags): flags = list(flags) - if '+pic' in self.spec and name in ('cflags', 'cxxflags'): - flags.append(self.compiler.pic_flag) + if '+pic' in self.spec: + if name == 'cflags': + flags.append(self.compiler.cc_pic_flag) + elif name == 'cxxflags': + flags.append(self.compiler.cxx_pic_flag) return (None, None, flags) diff --git a/var/spack/repos/builtin/packages/pdt/package.py b/var/spack/repos/builtin/packages/pdt/package.py index c2adfb831d..35164db1c5 100644 --- a/var/spack/repos/builtin/packages/pdt/package.py +++ b/var/spack/repos/builtin/packages/pdt/package.py @@ -53,7 +53,7 @@ class Pdt(AutotoolsPackage): raise InstallError('Unknown/unsupported compiler family') if '+pic' in spec: - options.append('-useropt=' + self.compiler.pic_flag) + options.append('-useropt=' + self.compiler.cxx_pic_flag) configure(*options) diff --git a/var/spack/repos/builtin/packages/perl/package.py b/var/spack/repos/builtin/packages/perl/package.py index 847bf83765..2841ab2713 100644 --- a/var/spack/repos/builtin/packages/perl/package.py +++ b/var/spack/repos/builtin/packages/perl/package.py @@ -131,7 +131,8 @@ class Perl(Package): # Perl doesn't use Autotools, it should subclass Package # https://github.com/spack/spack/pull/3081 and # https://github.com/spack/spack/pull/4416 if spec.satisfies('%intel'): - config_args.append('-Accflags={0}'.format(self.compiler.pic_flag)) + config_args.append('-Accflags={0}'.format( + self.compiler.cc_pic_flag)) if '+shared' in spec: config_args.append('-Duseshrplib') diff --git a/var/spack/repos/builtin/packages/py-llvmlite/package.py b/var/spack/repos/builtin/packages/py-llvmlite/package.py index c225e74354..e7e0712138 100644 --- a/var/spack/repos/builtin/packages/py-llvmlite/package.py +++ b/var/spack/repos/builtin/packages/py-llvmlite/package.py @@ -33,4 +33,5 @@ class PyLlvmlite(PythonPackage): def setup_build_environment(self, env): # Need to set PIC flag since this is linking statically with LLVM - env.set('CXX_FLTO_FLAGS', '-flto {0}'.format(self.compiler.pic_flag)) + env.set('CXX_FLTO_FLAGS', '-flto {0}'.format( + self.compiler.cxx_pic_flag)) diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index 3b675a02b6..97acde7b59 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -280,7 +280,7 @@ class Python(AutotoolsPackage): config_args.append('--without-ensurepip') if '+pic' in spec: - config_args.append('CFLAGS={0}'.format(self.compiler.pic_flag)) + config_args.append('CFLAGS={0}'.format(self.compiler.cc_pic_flag)) if spec.satisfies('@3.7:'): if '+ssl' in spec: diff --git a/var/spack/repos/builtin/packages/r/package.py b/var/spack/repos/builtin/packages/r/package.py index 1893aca9ac..7c6807e3e7 100644 --- a/var/spack/repos/builtin/packages/r/package.py +++ b/var/spack/repos/builtin/packages/r/package.py @@ -163,7 +163,8 @@ class R(AutotoolsPackage): # Set FPICFLAGS for compilers except 'gcc'. if self.compiler.name != 'gcc': - config_args.append('FPICFLAGS={0}'.format(self.compiler.pic_flag)) + config_args.append('FPICFLAGS={0}'.format( + self.compiler.cc_pic_flag)) return config_args diff --git a/var/spack/repos/builtin/packages/scorep/package.py b/var/spack/repos/builtin/packages/scorep/package.py index 96c3eae2e4..b26af4287d 100644 --- a/var/spack/repos/builtin/packages/scorep/package.py +++ b/var/spack/repos/builtin/packages/scorep/package.py @@ -106,8 +106,8 @@ class Scorep(AutotoolsPackage): config_args.append('--with-mpi=openmpi') config_args.extend([ - 'CFLAGS={0}'.format(self.compiler.pic_flag), - 'CXXFLAGS={0}'.format(self.compiler.pic_flag) + 'CFLAGS={0}'.format(self.compiler.cc_pic_flag), + 'CXXFLAGS={0}'.format(self.compiler.cxx_pic_flag) ]) if "+mpi" in spec: diff --git a/var/spack/repos/builtin/packages/scotch/package.py b/var/spack/repos/builtin/packages/scotch/package.py index 0a96559763..f2ba07a94b 100644 --- a/var/spack/repos/builtin/packages/scotch/package.py +++ b/var/spack/repos/builtin/packages/scotch/package.py @@ -117,7 +117,7 @@ class Scotch(Package): makefile_inc.extend([ 'LIB = .dylib', 'CLIBFLAGS = -dynamiclib {0}'.format( - self.compiler.pic_flag + self.compiler.cc_pic_flag ), 'RANLIB = echo', 'AR = $(CC)', @@ -126,12 +126,13 @@ class Scotch(Package): else: makefile_inc.extend([ 'LIB = .so', - 'CLIBFLAGS = -shared {0}'.format(self.compiler.pic_flag), + 'CLIBFLAGS = -shared {0}'.format( + self.compiler.cc_pic_flag), 'RANLIB = echo', 'AR = $(CC)', 'ARFLAGS = -shared $(LDFLAGS) -o' ]) - cflags.append(self.compiler.pic_flag) + cflags.append(self.compiler.cc_pic_flag) else: makefile_inc.extend([ 'LIB = .a', diff --git a/var/spack/repos/builtin/packages/shtools/package.py b/var/spack/repos/builtin/packages/shtools/package.py index 77871d7a36..dc0388939f 100644 --- a/var/spack/repos/builtin/packages/shtools/package.py +++ b/var/spack/repos/builtin/packages/shtools/package.py @@ -31,7 +31,7 @@ class Shtools(MakefilePackage): return [ "F95={0}".format(self.compiler.fc), ("F95FLAGS={0} -O3 -std=f2003 -ffast-math". - format(self.compiler.pic_flag)), + format(self.compiler.fc_pic_flag)), "OPENMPFLAGS={0}".format(self.compiler.openmp_flag), "BLAS={0}".format(spec['blas'].libs), "FFTW={0}".format(spec['fftw'].libs), diff --git a/var/spack/repos/builtin/packages/silo/package.py b/var/spack/repos/builtin/packages/silo/package.py index 98e8b4be15..9192937393 100644 --- a/var/spack/repos/builtin/packages/silo/package.py +++ b/var/spack/repos/builtin/packages/silo/package.py @@ -45,9 +45,14 @@ class Silo(AutotoolsPackage): if spec['hdf5'].satisfies('~shared'): flags.append('-ldl') flags.append(spec['readline'].libs.search_flags) - elif name in ('cflags', 'cxxflags', 'fcflags'): - if '+pic' in spec: - flags.append(self.compiler.pic_flag) + + if '+pic' in spec: + if name == 'cflags': + flags.append(self.compiler.cc_pic_flag) + elif name == 'cxxflags': + flags.append(self.compiler.cxx_pic_flag) + elif name == 'fcflags': + flags.append(self.compiler.fc_pic_flag) return (flags, None, None) @when('%clang@9:') diff --git a/var/spack/repos/builtin/packages/simmetrix-simmodsuite/package.py b/var/spack/repos/builtin/packages/simmetrix-simmodsuite/package.py index 75ec47b39b..7d38e267d7 100644 --- a/var/spack/repos/builtin/packages/simmetrix-simmodsuite/package.py +++ b/var/spack/repos/builtin/packages/simmetrix-simmodsuite/package.py @@ -236,7 +236,7 @@ class SimmetrixSimmodsuite(Package): "CXX=%s" % spec['mpi'].mpicxx, "PARALLEL=%s" % mpi_id, "PQUAL=-%s" % mpi_id, - "OPTFLAGS=-O2 -DNDEBUG " + self.compiler.pic_flag) + "OPTFLAGS=-O2 -DNDEBUG " + self.compiler.cc_pic_flag) libname = 'libSimPartitionWrapper-' + mpi_id + '.a' wrapperlibpath = join_path(workdir, 'lib', libname) install(wrapperlibpath, join_path(prefix.lib, self.oslib)) diff --git a/var/spack/repos/builtin/packages/snappy/package.py b/var/spack/repos/builtin/packages/snappy/package.py index 3516c53d1d..d5ade343f3 100644 --- a/var/spack/repos/builtin/packages/snappy/package.py +++ b/var/spack/repos/builtin/packages/snappy/package.py @@ -37,8 +37,11 @@ class Snappy(CMakePackage): def flag_handler(self, name, flags): flags = list(flags) - if '+pic' in self.spec and name in ('cflags', 'cxxflags'): - flags.append(self.compiler.pic_flag) + if '+pic' in self.spec: + if name == 'cflags': + flags.append(self.compiler.cc_pic_flag) + elif name == 'cxxflags': + flags.append(self.compiler.cxx_pic_flag) return (None, None, flags) @run_after('install') diff --git a/var/spack/repos/builtin/packages/sqlite/package.py b/var/spack/repos/builtin/packages/sqlite/package.py index 4e79463f36..531a9bc81d 100644 --- a/var/spack/repos/builtin/packages/sqlite/package.py +++ b/var/spack/repos/builtin/packages/sqlite/package.py @@ -122,6 +122,6 @@ class Sqlite(AutotoolsPackage): if '+functions' in self.spec: libraryname = 'libsqlitefunctions.' + dso_suffix cc = Executable(spack_cc) - cc(self.compiler.pic_flag, '-lm', '-shared', + cc(self.compiler.cc_pic_flag, '-lm', '-shared', 'extension-functions.c', '-o', libraryname) install(libraryname, self.prefix.lib) diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py index 88f5aa839c..39532db801 100644 --- a/var/spack/repos/builtin/packages/suite-sparse/package.py +++ b/var/spack/repos/builtin/packages/suite-sparse/package.py @@ -63,7 +63,8 @@ class SuiteSparse(Package): # logic in it. Any kind of customization will need to go through # filtering of that file - pic_flag = self.compiler.pic_flag if '+pic' in spec else '' + cc_pic_flag = self.compiler.cc_pic_flag if '+pic' in spec else '' + f77_pic_flag = self.compiler.f77_pic_flag if '+pic' in spec else '' make_args = [ # By default, the Makefile uses the Intel compilers if @@ -78,11 +79,11 @@ class SuiteSparse(Package): 'CUDA_PATH=%s' % (spec['cuda'].prefix if '+cuda' in spec else ''), 'CFOPENMP=%s' % (self.compiler.openmp_flag if '+openmp' in spec else ''), - 'CFLAGS=-O3 %s' % pic_flag, + 'CFLAGS=-O3 %s' % cc_pic_flag, # Both FFLAGS and F77FLAGS are used in SuiteSparse makefiles; # FFLAGS is used in CHOLMOD, F77FLAGS is used in AMD and UMFPACK. - 'FFLAGS=%s' % pic_flag, - 'F77FLAGS=%s' % pic_flag, + 'FFLAGS=%s' % f77_pic_flag, + 'F77FLAGS=%s' % f77_pic_flag, # use Spack's metis in CHOLMOD/Partition module, # otherwise internal Metis will be compiled 'MY_METIS_LIB=%s' % spec['metis'].libs.ld_flags, diff --git a/var/spack/repos/builtin/packages/sundials/package.py b/var/spack/repos/builtin/packages/sundials/package.py index a76b36eacb..104307fa19 100644 --- a/var/spack/repos/builtin/packages/sundials/package.py +++ b/var/spack/repos/builtin/packages/sundials/package.py @@ -211,7 +211,7 @@ class Sundials(CMakePackage): def on_off(varstr): return 'ON' if varstr in self.spec else 'OFF' - fortran_flag = self.compiler.pic_flag + fortran_flag = self.compiler.f77_pic_flag if (spec.satisfies('%clang platform=darwin')) and ('+fcmix' in spec): f77 = Executable(self.compiler.f77) libgfortran = LibraryList(f77('--print-file-name', diff --git a/var/spack/repos/builtin/packages/superlu/package.py b/var/spack/repos/builtin/packages/superlu/package.py index 14f9483945..bc1b383729 100644 --- a/var/spack/repos/builtin/packages/superlu/package.py +++ b/var/spack/repos/builtin/packages/superlu/package.py @@ -73,10 +73,10 @@ class Superlu(Package): if '+pic' in spec: config.extend([ # Use these lines instead when pic_flag capability arrives - 'CFLAGS = -O3 {0}'.format(self.compiler.pic_flag), - 'NOOPTS = {0}'.format(self.compiler.pic_flag), - 'FFLAGS = -O2 {0}'.format(self.compiler.pic_flag), - 'LOADOPTS = {0}'.format(self.compiler.pic_flag) + 'CFLAGS = -O3 {0}'.format(self.compiler.cc_pic_flag), + 'NOOPTS = {0}'.format(self.compiler.cc_pic_flag), + 'FFLAGS = -O2 {0}'.format(self.compiler.f77_pic_flag), + 'LOADOPTS = {0}'.format(self.compiler.cc_pic_flag) ]) else: config.extend([ diff --git a/var/spack/repos/builtin/packages/thrift/package.py b/var/spack/repos/builtin/packages/thrift/package.py index 92f77e0331..7e61860243 100644 --- a/var/spack/repos/builtin/packages/thrift/package.py +++ b/var/spack/repos/builtin/packages/thrift/package.py @@ -51,8 +51,8 @@ class Thrift(Package): def setup_build_environment(self, env): if '+pic' in self.spec: - env.append_flags('CFLAGS', self.compiler.pic_flag) - env.append_flags('CXXFLAGS', self.compiler.pic_flag) + env.append_flags('CFLAGS', self.compiler.cc_pic_flag) + env.append_flags('CXXFLAGS', self.compiler.cxx_pic_flag) def install(self, spec, prefix): env['PY_PREFIX'] = prefix diff --git a/var/spack/repos/builtin/packages/unrar/package.py b/var/spack/repos/builtin/packages/unrar/package.py index 6972aef3c9..9f8700c804 100644 --- a/var/spack/repos/builtin/packages/unrar/package.py +++ b/var/spack/repos/builtin/packages/unrar/package.py @@ -26,6 +26,6 @@ class Unrar(MakefilePackage): def edit(self, spec, prefix): makefile = FileFilter("makefile") makefile.filter( - "LIBFLAGS=-fPIC", "LIBFLAGS={0}".format(self.compiler.pic_flag) + "LIBFLAGS=-fPIC", "LIBFLAGS={0}".format(self.compiler.cc_pic_flag) ) makefile.filter("DESTDIR=/usr", "DESTDIR={0}".format(self.prefix)) diff --git a/var/spack/repos/builtin/packages/visit/package.py b/var/spack/repos/builtin/packages/visit/package.py index 2616b689e3..1ee2994c21 100644 --- a/var/spack/repos/builtin/packages/visit/package.py +++ b/var/spack/repos/builtin/packages/visit/package.py @@ -72,8 +72,8 @@ class Visit(CMakePackage): '-DVISIT_VTK_DIR:PATH=' + spec['vtk'].prefix, '-DVISIT_ZLIB_DIR:PATH=' + spec['zlib'].prefix, '-DVISIT_USE_GLEW=OFF', - '-DCMAKE_CXX_FLAGS=' + self.compiler.pic_flag, - '-DCMAKE_C_FLAGS=' + self.compiler.pic_flag, + '-DCMAKE_CXX_FLAGS=' + self.compiler.cxx_pic_flag, + '-DCMAKE_C_FLAGS=' + self.compiler.cc_pic_flag, ] if '+python' in spec: diff --git a/var/spack/repos/builtin/packages/voropp/package.py b/var/spack/repos/builtin/packages/voropp/package.py index 201c23de24..5dc7406afc 100644 --- a/var/spack/repos/builtin/packages/voropp/package.py +++ b/var/spack/repos/builtin/packages/voropp/package.py @@ -30,7 +30,7 @@ class Voropp(MakefilePackage): # CFLAGS=-Wall -ansi -pedantic -O3 cflags = '' if '+pic' in spec: - cflags += self.compiler.pic_flag + cflags += self.compiler.cc_pic_flag filter_file(r'CFLAGS=.*', 'CFLAGS={0}'.format(cflags), 'config.mk') diff --git a/var/spack/repos/builtin/packages/zlib/package.py b/var/spack/repos/builtin/packages/zlib/package.py index 82cdf73f25..4967bc0dbb 100644 --- a/var/spack/repos/builtin/packages/zlib/package.py +++ b/var/spack/repos/builtin/packages/zlib/package.py @@ -40,7 +40,7 @@ class Zlib(Package): def setup_build_environment(self, env): if '+pic' in self.spec: - env.append_flags('CFLAGS', self.compiler.pic_flag) + env.append_flags('CFLAGS', self.compiler.cc_pic_flag) if '+optimize' in self.spec: env.append_flags('CFLAGS', '-O2') diff --git a/var/spack/repos/builtin/packages/zoltan/package.py b/var/spack/repos/builtin/packages/zoltan/package.py index b832dbc0f8..615b65502a 100644 --- a/var/spack/repos/builtin/packages/zoltan/package.py +++ b/var/spack/repos/builtin/packages/zoltan/package.py @@ -95,7 +95,7 @@ class Zoltan(AutotoolsPackage): 'RANLIB=echo', '--with-ar=$(CXX) -shared $(LDFLAGS) -o' ]) - config_cflags.append(self.compiler.pic_flag) + config_cflags.append(self.compiler.cc_pic_flag) if spec.satisfies('%gcc'): config_args.append('--with-libs=-lgfortran') if spec.satisfies('%intel'): diff --git a/var/spack/repos/builtin/packages/zstd/package.py b/var/spack/repos/builtin/packages/zstd/package.py index 1557cc8a07..8cc37ab3d5 100644 --- a/var/spack/repos/builtin/packages/zstd/package.py +++ b/var/spack/repos/builtin/packages/zstd/package.py @@ -27,7 +27,7 @@ class Zstd(MakefilePackage): def setup_build_environment(self, env): if '+pic' in self.spec: - env.append_flags('CFLAGS', self.compiler.pic_flag) + env.append_flags('CFLAGS', self.compiler.cc_pic_flag) def build(self, spec, prefix): make('PREFIX={0}'.format(prefix)) |