Adding pic_flag property to compilers#2375
Merged
tgamblin merged 1 commit intospack:developfrom Nov 24, 2016
Merged
Conversation
Different compilers have different flags for PIC (position-independent code). This patch provides a common ground to accessing it inside specs. See discussions in spack#508 and spack#2373. This patch does not address the issue of mixed compilers as mentioned in spack#508.
Contributor
Author
|
davydden
approved these changes
Nov 21, 2016
alalazo
approved these changes
Nov 22, 2016
Contributor
Author
|
After this PR is merged in some form, here is a list of packages that may require updating: $ git grep -i -- -fpic
var/spack/repos/builtin/packages/adios/package.py: extra_args.append("CFLAGS=-fPIC")
var/spack/repos/builtin/packages/arpack/package.py: makefile.filter('^FFLAGS.*', 'FFLAGS = -O2 -g -fPIC')
var/spack/repos/builtin/packages/atlas/package.py: # TODO: for non GNU add '-Fa', 'alg', '-fPIC' ?
var/spack/repos/builtin/packages/cantera/package.py: depends_on('sundials', when='+sundials') # must be compiled with -fPIC
var/spack/repos/builtin/packages/cantera/package.py: 'cc_flags=-fPIC',
var/spack/repos/builtin/packages/gcc/piclibs.patch:+CFLAGS = @CFLAGS@ -fPIC
var/spack/repos/builtin/packages/gcc/piclibs.patch:+CPPFLAGS = @CPPFLAGS@ -fPIC
var/spack/repos/builtin/packages/gcc/piclibs.patch:+DEFS = @DEFS@ -fPIC
var/spack/repos/builtin/packages/gcc/piclibs.patch:+FCFLAGS = @FCFLAGS@ -fPIC
var/spack/repos/builtin/packages/gcc/piclibs.patch:+CFLAGS = @CFLAGS@ -fPIC
var/spack/repos/builtin/packages/gcc/piclibs.patch:+CPPFLAGS = @CPPFLAGS@ -fPIC
var/spack/repos/builtin/packages/gcc/piclibs.patch:+DEFS = @DEFS@ -fPIC
var/spack/repos/builtin/packages/grackle/Make.mach.template:MACH_DEFINES = -DLINUX -DH5_USE_16_API -fPIC
var/spack/repos/builtin/packages/hdf/package.py: 'CFLAGS=-fPIC',
var/spack/repos/builtin/packages/metis/package.py: options = ['COPTIONS=-fPIC']
var/spack/repos/builtin/packages/metis/package.py: shared_flags = ['-fPIC', '-shared']
var/spack/repos/builtin/packages/mumps/package.py: # when building shared libs need -fPIC, otherwise
var/spack/repos/builtin/packages/mumps/package.py: # can not be used when making a shared object; recompile with -fPIC
var/spack/repos/builtin/packages/mumps/package.py: fpic = '-fPIC' if '+shared' in self.spec else ''
var/spack/repos/builtin/packages/netlib-scalapack/package.py: description='Build with -fpic compiler option'
var/spack/repos/builtin/packages/netlib-scalapack/package.py: "-DCMAKE_C_FLAGS=-fPIC",
var/spack/repos/builtin/packages/netlib-scalapack/package.py: "-DCMAKE_Fortran_FLAGS=-fPIC"
var/spack/repos/builtin/packages/openblas/package.py: make_defs.extend(['CFLAGS=-fPIC', 'FFLAGS=-fPIC'])
var/spack/repos/builtin/packages/otf2/package.py: "CFLAGS=-fPIC",
var/spack/repos/builtin/packages/otf2/package.py: "CXXFLAGS=-fPIC"]
var/spack/repos/builtin/packages/parallel-netcdf/package.py: args.extend(['CFLAGS=-fPIC', 'CXXFLAGS=-fPIC', 'FFLAGS=-fPIC'])
var/spack/repos/builtin/packages/parmgridgen/package.py: 'COPTIONS=-fPIC',
var/spack/repos/builtin/packages/parmgridgen/package.py: 'LDOPTIONS=-fPIC',
var/spack/repos/builtin/packages/scorep/package.py: "CFLAGS=-fPIC",
var/spack/repos/builtin/packages/scorep/package.py: "CXXFLAGS=-fPIC"]
var/spack/repos/builtin/packages/scotch/package.py: 'CLIBFLAGS = -shared -fPIC',
var/spack/repos/builtin/packages/scotch/package.py: cflags.append('-fPIC')
var/spack/repos/builtin/packages/suite-sparse/package.py: make_args.extend(['CFLAGS=-fPIC', 'FFLAGS=-fPIC'])
var/spack/repos/builtin/packages/sundials/package.py: '-DCMAKE_C_FLAGS=-fPIC',
var/spack/repos/builtin/packages/sundials/package.py: '-DCMAKE_Fortran_FLAGS=-fPIC',
var/spack/repos/builtin/packages/superlu-dist/package.py: 'CFLAGS = -fPIC -std=c99 -O2 -I%s -I%s' % (
var/spack/repos/builtin/packages/superlu-dist/package.py: 'NOOPTS = -fPIC -std=c99',
var/spack/repos/builtin/packages/trilinos/package.py: # Everything should be compiled with -fpic
var/spack/repos/builtin/packages/wannier90/make.sys:FCOPTS=-O2 -fpic
var/spack/repos/builtin/packages/wannier90/make.sys:LDOPTS=-O2 -fpic
var/spack/repos/builtin/packages/zoltan/package.py: config_cflags.append('-fPIC') |
This was referenced Dec 2, 2016
citibeth
pushed a commit
to citibeth/spack
that referenced
this pull request
Dec 4, 2016
Different compilers have different flags for PIC (position-independent code). This patch provides a common ground to accessing it inside specs. See discussions in spack#508 and spack#2373. This patch does not address the issue of mixed compilers as mentioned in spack#508.
citibeth
pushed a commit
to citibeth/spack
that referenced
this pull request
Dec 4, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Different compilers have different flags for PIC (position-independent
code). This patch provides a common ground to accessing it inside specs.
See discussions in #508 and #2373. This patch does not address the issue
of mixed compilers as mentioned in #508.