summaryrefslogtreecommitdiff
path: root/lib/spack/env
AgeCommit message (Collapse)AuthorFilesLines
2023-06-18cc: Ensure that user-specified flags take precedence over others (#37376)Andrey Parfenov1-184/+234
Spack flags supplied by users should supersede flags from package build systems and other places in Spack. However, Spack currently adds user-supplied flags to the beginning of the compile line, which means that in some cases build system flags will supersede user-supplied ones. The right place to add a flag to ensure it has highest precedence for the compiler really depends on the type of flag. For example, search paths like `-L` and `-I` are examined in order, so adding them first is highest precedence. Compilers take the *last* occurrence of optimization flags like `-O2`, so those should be placed *after* other such flags. Shim libraries with `-l` should go *before* other libraries on the command line, so we want user-supplied libs to go first, etc. `lib/spack/env/cc` already knows how to split arguments into categories like `libs_list`, `rpath_dirs_list`, etc., so we can leverage that functionality to merge user flags into the arg list correctly. The general rules for injected flags are: 1. All `-L`, `-I`, `-isystem`, `-l`, and `*-rpath` flags from `spack_flags_*` to appear before their regular counterparts. 2. All other flags ordered with the ones from flags after their regular counterparts, i.e. `other_flags` before `spack_flags_other_flags` - [x] Generalize argument categorization into its own function in the `cc` shell script - [x] Apply the same splitting logic to injected flags and flags from the original compile line. - [x] Use the resulting flag lists to merge user- and build-system-supplied flags by category. - [x] Add tests. Signed-off-by: Andrey Parfenov <andrey.parfenov@intel.com> Co-authored-by: iermolae <igor.ermolaev@intel.com>
2023-05-05cc: deal with -Wl,-rpath= without value, deal with NAG (#37215)Harmen Stoppels1-5/+14
Spack never parsed `nagfor` linker arguments put on the compiler line: ``` nagfor -Wl,-Wl,,-rpath,,/path ```` so, let's continue not attempting to parse that.
2023-03-31compiler wrapper: fix -Xlinker parsing (#35929)Harmen Stoppels1-35/+76
* compiler wrapper: fix -Xlinker parsing * handle the case of -rpath without value; avoid that we drop the flag * also handle the -Xlinker -rpath -Xlinker without further args case... * fix test * get rid of global $rp var, reduce branching
2023-03-08compiler wrapper: parse Wl and Xlinker properly (#35912)Harmen Stoppels1-48/+45
Two fixes: 1. `-Wl,a,b,c,d` is a comma separated list of linker arguments, we incorrectly assume key/value pairs, which runs into issues with for example `-Wl,--enable-new-dtags,-rpath,/x` 2. `-Xlinker,xxx` is not a think, so it shouldn't be parsed.
2023-01-18license year bump (#34921)Harmen Stoppels1-1/+1
* license bump year * fix black issues of modified files * mypy * fix 2021 -> 2023
2022-11-23Control Werror by converting to Wno-error (#30882)Tom Scogland1-0/+41
Using `-Werror` is good practice for development and testing, but causes us a great deal of heartburn supporting multiple compiler versions, especially as newer compiler versions add warnings for released packages. This PR adds support for suppressing `-Werror` through spack's compiler wrappers. There are currently three modes for the `flags:keep_werror` setting: * `none`: (default) cancel all `-Werror`, `-Werror=*` and `-Werror-*` flags by converting them to `-Wno-error[=]*` flags * `specific`: preserve explicitly selected warnings as errors, such as `-Werror=format-truncation`, but reverse the blanket `-Werror` * `all`: keeps all `-Werror` flags These can be set globally in config.yaml, through the config command-line flags, or overridden by a particular package (some packages use Werror as a proxy for determining support for other compiler features). We chose to use this approach because: 1. removing `-Werror` flags entirely broke *many* build systems, especially autoconf based ones, because of things like checking `-Werror=feature` and making the assumption that if that did not error other flags related to that feature would also work 2. Attempting to preserve `-Werror` in some phases but not others caused similar issues 3. The per-package setting came about because some packages, even with all these protections, still use `-Werror` unsafely. Currently there are roughly 3 such packages known.
2022-11-04Cray support: use linux platform for newer craype versions (#29392)Greg Becker4-4/+7
Newer versions of the CrayPE for EX systems have standalone compiler executables for CCE and compiler wrappers for Cray MPICH. With those, we can treat the cray systems as part of the linux platform rather than having a separate cray platform. This PR: - [x] Changes cray platform detection to ignore EX systems with Craype version 21.10 or later - [x] Changes the cce compiler to be detectable via paths - [x] Changes the spack compiler wrapper to understand the executable names for the standalone cce compiler (`craycc`, `crayCC`, `crayftn`).
2022-05-26Revert "strip -Werror: all specific or none (#30284)" (#30878)Scott Wittenburg1-25/+1
This reverts commit 330832c22cfa59554f6681a570bdec24ca46e79b.
2022-05-24strip -Werror: all specific or none (#30284)Tom Scogland1-1/+25
Add a config option to strip `-Werror*` or `-Werror=*` from compile lines everywhere. ```yaml config: keep_werror: false ``` By default, we strip all `-Werror` arguments out of compile lines, to avoid unwanted failures when upgrading compilers. You can re-enable `-Werror` in your builds if you really want to, with either: ```yaml config: keep_werror: all ``` or to keep *just* specific `-Werror=XXX` args: ```yaml config: keep_werror: specific ``` This should make swapping in newer versions of compilers much smoother when maintainers have decided to enable `-Werror` by default.
2022-05-18Compiler wrapper: fix globbing and debug out.log bell chars (#30699)Harmen Stoppels1-2/+4
* Disable globbing * Split on bell char when dumping cmd to out.log
2022-03-17Adding basic Windows features (#21259)Ben Cowan1-1/+1
* Snapshot of some MSVC infrastructure added during experiments a while ago. Rebasing from spack/develop. * Added platform and OS definitions for Windows. * Updated Windows platform file to conform to new archspec use. * Added Windows as a platform; introduced some debugging code. * Added type annotations. * Fixed copyright. * Removed print statements. * Ensure `spack arch` returns correctly on Windows (#21428) * Correctly identify windows as 'windows-Windows10-AMD64'
2022-03-03rocmcc compiler: initial commit based on aocc and clang (#28575)Greg Becker4-4/+7
* rocmcc compiler: initial commit based on aocc and clang Co-authored-by: luker <luke.roskop@hpe.com> Co-authored-by: Tom Scogland <scogland1@llnl.gov>
2022-01-14Update copyright year to 2022Todd Gamblin1-1/+1
2021-12-02Support packages which need to explicitly refer to dpcpp by name (#27168)Peter Scheibel2-1/+2
* Hack to support packages which need to explicitly refer to dpcpp by name * cc script needs to know about dpcpp
2021-10-04cc: make error messages more clearTodd Gamblin1-6/+7
- [x] Our wrapper error messages are sometimes hard to differentiate from other build output, so prefix all errors from `die()` with '[spack cc] ERROR:' - [x] The error we raise when running, say, `fc` without a Fortran compiler was not clear enough. Clarify the message and the comment.
2021-10-04cc: convert compiler wrapper to posix shellTodd Gamblin1-212/+351
This converts everything in cc to POSIX sh, except for the parts currently handled with bash arrays. Tests are still passing. This version tries to be as straightforward as possible. Specifically, most conversions are kept simple -- convert ifs to ifs, handle indirect expansion the way we do in `setup-env.sh`, only mess with the logic in `cc`, and don't mess with the python code at all. The big refactor is for arrays. We can't rely on bash's nice arrays and be ignorant of separators anymore. So: 1. To avoid complicated separator logic, there are three types of lists. They are: * `$lsep`-separated lists, which end with `_list`. `lsep` is customizable, but we picked `^G` (alarm bell) for `$lsep` because it's ASCII and it's unlikely that it would actually appear in any arguments. If we need to get fancier (and I will lose faith in the world if we do) then we could consider XON or XOFF. * `:`-separated directory lists, which end with `_dirs`, `_DIRS`, `PATH`, or `PATHS` * Whitespace-separated lists (like flags), which can have any other name. Whitespace and colon-separated lists come with the territory with PATHs from env vars and lists of flags. `^G` separated lists are what we use for most internal variables, b/c it's more likely to work. 2. To avoid subshells, use a bunch of functions that do dirty `eval` stuff instead. This adds 3 functions to deal with lists: * `append LISTNAME ELEMENT [SEP]` will put `ELEMENT` at the end of the list called `LISTNAME`. You can optionally say what separator you expect to use. Note that we are taking advantage of everything being global and passing lists by name. * `prepend LISTNAME ELEMENT [SEP]` like append, but puts `ELEMENT` at the start of `LISTNAME` * `extend LISTNAME1 LISTNAME2 [PREFIX]` appends everything in LISTNAME2 to LISTNAME1, and optionally prepends `PREFIX` to every element (this is useful for things like `-I`, `-isystem `, etc. * `preextend LISTNAME1 LISTNAME2 [PREFIX]` prepends everything in LISTNAME2 to LISTNAME1 in order, and optionally prepends `PREFIX` to every element. The routines determine the separator for each argument by its name, so we don't have to pass around separators everywhere. Amazingly, as long as you do not expand variables' values within an `eval` environment, you can do all this and still preserve quoting. When iterating over lists, the user of this API still has to set and unset `IFS` properly. We ended up having to ignore shellcheck SC2034 (unused variable), because using evals all over the place means that shellcheck doesn't notice that our list variables are actually used. So far this is looking pretty good. I took the most complex unit test I could find (which runs a sample link line) and ran the same command line 200 times in a shell script. Times are roughly as follows: For this invocation: ```console $ bash -c 'time (for i in `seq 1 200`; do ~/test_cc.sh > /dev/null; done)' ``` I get the following performance numbers (the listed shells are what I put in `cc`'s shebang): **Original** * Old version of `cc` with arrays and `bash v3.2.57` (macOS builtin): `4.462s` (`.022s` / call) * Old version of `cc` with arrays and `bash v5.1.8` (Homebrew): `3.267s` (`.016s` / call) **Using many subshells (#26408)** * with `bash v3.2.57`: `25.302s` (`.127s` / call) * with `bash v5.1.8`: `27.801s` (`.139s` / call) * with `dash`: `15.302s` (`.077s` / call) This version didn't seem to work with zsh. **This PR (no subshells)** * with `bash v3.2.57`: `4.973s` (`.025s` / call) * with `bash v5.1.8`: `4.984s` (`.025s` / call) * with `zsh`: `2.995s` (`.015s` / call) * with `dash`: `1.890s` (`.0095s` / call) Dash, with the new posix design, is easily the winner. So there are several interesting things to note here: 1. Running the posix version in `bash` is slower than using `bash` arrays. That is to be expected because it's doing a bunch of string processing where it likely did not have to before, at least in `bash`. 2. `zsh`, at least on macOS, is significantly faster than the ancient `bash` they ship with the system. Using `zsh` with the new version also makes the posix wrappers faster than `develop`. So it's worth preferring `zsh` if we have it. I suppose we should also try this with newer `bash` on Linux. 3. `bash v5.1.8` seems to be significantly faster than the old system `bash v3.2.57` for arrays. For straight POSIX stuff, it's a little slower. It did not seem to matter whether `--posix` was used. 4. `dash` is way faster than `bash` or `zsh`, so the real payoff just comes from being able to use it. I am not sure if that is mostly startup time, but it's significant. `dash` is ~2.4x faster than the original `bash` with arrays. So, doing a lot of string stuff is slower than arrays, but converting to posix seems worth it to be able to exploit `dash`. - [x] Convert all but array-related portions to sh - [x] Fix basic shellcheck issues. - [x] Convert arrays to use a few convenience functions: `append` and `extend` - [x] Get `cc` tests passing. - [x] Add `cc` tests where needed passing. - [x] Benchmarking. Co-authored-by: Tom Scogland <scogland1@llnl.gov> Co-authored-by: Danny McClanahan <1305167+cosmicexplorer@users.noreply.github.com>
2021-09-16cc: Use parameter expansion instead of basename (#24509)Michael Kuhn1-1/+1
While debugging #24508, I noticed that we call `basename` in `cc`. The same can be achieved by using Bash's parameter expansion, saving one external process per call. Parameter expansion cannot replace basename for directories in some cases, but is guaranteed to work for executables.
2021-09-08lib/spack/env/cc: tolerate trailing / in elements of $PATH (#25733)bernhardkaindl1-1/+4
Fixes removal of SPACK_ENV_PATH from PATH in the presence of trailing slashes in the elements of PATH: The compiler wrapper has to ensure that it is not called nested like it would happen when gcc's collect2 uses PATH to call the linker ld, or else the compilation fails. To prevent nested calls, the compiler wrapper removes the elements of SPACK_ENV_PATH from PATH. Sadly, the autotest framework appends a slash to each element of PATH when adding AUTOTEST_PATH to the PATH for the tests, and some tests like those of GNU bison run cc inside the test. Thus, ensure that PATH cleanup works even with trailing slashes. This fixes the autotest suite of bison, compiling hundreds of bison-generated test cases in a autotest-generated testsuite. Co-authored-by: Harmen Stoppels <harmenstoppels@gmail.com>
2021-08-27Add ld.gold and ld.lld compiler wrapper (#25626)Jordan Galby3-1/+3
The gcc compiler can be configured to use `ld.gold` by default. It will then call `ld.gold` explicitly when linking. When so, spack need to have a ld.gold wrapper in PATH to inject rpaths link flags etc... Also I wouldn't be surprised to see some package calling `ld.gold` directly. As for ld.gold, the argument could be made that we want to support any package that could call ld.lld.
2021-07-09debug: initial global debug flag support (#24285)Vanessasaurus1-0/+42
The developer can export environment variables that are seen by the compiler wrapper to then add the flags
2021-05-13cc: change mode to ccld for loopopt edit (#23482)Frank Willmore1-3/+5
For configure (e.g. for hdf5) to pass, this option needs to be pulled out when invoked in ccld mode. I thought it had fixed the issue but I still saw it after that. After some digging, my guess is that I was able to get hdf5 to build with ifort instead of ifx. Lot of overlapping changes occurring at the time, as it were. There are still outstanding issues building hdf5 with ifx, and Intel is looking into what appears to be a compiler bug, but this manifests during build and is likely a separate issue. I have verified that the making the edit in 'ccld' mode removes the -loopopt=0 and enables hdf5 to pass configure. It should be fine to make the edit in 'ld' mode as well, but I have not tested that and didn't include an -or- condition for it.
2021-04-01bugfix: compiler wrappers should handle extra spaces between arguments (#22725)Elizabeth Fischer1-1/+9
In the face of two consecutive spaces in the command line, the compiler wrapper would skip all remaining arguments, causing problems building py-scipy with Intel compiler. This PR solves the problem. * Fixed compiler wrapper in the face of extra spaces between arguments Co-authored-by: Elizabeth Fischer <elizabeth.fischer@alaska.edu>
2021-03-31hotfix: make ifx work with autoconf <= 2.69 in Spack (#22683)Todd Gamblin1-0/+8
Autoconf before 2.70 will erroneously pass ifx's -loopopt argument to the linker, requiring all packages to use autoconf 2.70 or newer to use ifx. This is a hotfix enabling ifx to be used in Spack. Instead of bothering to upgrade autoconf for every package, we'll just strip out the problematic flag if we're in `ld` mode. - [x] Add a conditional to the `cc` wrapper to skip `-loopopt` in `ld` mode. This can probably be generalized in the future to strip more things (e.g., via an environment variable we can constrol from Spack) but it's good enough for now. - [x] Add a test ensuring that `-loopopt` arguments are stripped in link mode, but not in compile mode.
2021-03-18Tab to spaces (#22362)Harmen Stoppels1-2/+2
2021-03-17Fix indentation compiler wrapper issue (#22352)Harmen Stoppels1-1/+1
2021-02-10Fix: Add a space between -isystem and the directory (#21599)Scott McMillan1-3/+3
Some compilers, such as the NV compilers, do not recognize -isystem dir when specified without a space. Works: -isystem ../include Does not work: -isystem../include This PR updates the compiler wrapper to include the space with -isystem.
2021-01-02copyrights: update all files with license headers for 2021Todd Gamblin1-1/+1
- [x] add `concretize.lp`, `spack.yaml`, etc. to licensed files - [x] update all licensed files to say 2013-2021 using `spack license update-copyright-year` - [x] appease mypy with some additions to package.py that needed for oneapi.py
2020-12-07Compiler wrapper linting (#20249)Harmen Stoppels1-4/+4
* Fix duplicate entries in case * make sure the arg is not interpreted as two items in a list * use -n over ! -z
2020-12-04Also allow --rpath as rpath linker flags (#18473)Harmen Stoppels1-2/+8
2020-11-17Support parallel environment builds (#18131)Tamara Dahlgren1-1/+1
As of #13100, Spack installs the dependencies of a _single_ spec in parallel. Environments, when installed, can only get parallelism from each individual spec, as they're installed in order. This PR makes entire environments build in parallel by extending Spack's package installer to accept multiple root specs. The install command and Environment class have been updated to use the new parallel install method. The specs and kwargs for each *uninstalled* package (when not force-replacing installations) of an environment are collected, passed to the `PackageInstaller`, and processed using a single build queue. This introduces a `BuildRequest` class to track install arguments, and it significantly cleans up the code used to track package ids during installation. Package ids in the build queue are now just DAG hashes as you would expect, Other tasks: - [x] Finish updating the unit tests based on `PackageInstaller`'s use of `BuildRequest` and the associated changes - [x] Change `environment.py`'s `install_all` to use the `PackageInstaller` directly - [x] Change the `install` command to leverage the new installation process for multiple specs - [x] Change install output messages for external packages, e.g.: `[+] /usr` -> `[+] /usr (external bzip2-1.0.8-<dag-hash>` - [x] Fix incomplete environment install's view setup/update and not confirming all packages are installed (?) - [x] Ensure externally installed package dependencies are properly accounted for in remaining build tasks - [x] Add tests for coverage (if insufficient and can identity the appropriate, uncovered non-comment lines) - [x] Add documentation - [x] Resolve multi-compiler environment install issues - [x] Fix issue with environment installation reporting (restore CDash/JUnit reports)
2020-10-29Oneapi add compiler (#19330)Frank Willmore4-3/+6
* enable flatcc to be built with gcc/9.X.X * add static option for building libyogrt * cleanup * Initial working version * rework new oneapi wrappers * tested and removed my initials from source * cleanup * Update __init__.py * remove whitespace * working now with mods for testing, detection. Detection for oneapi is working, but entry needs to be modified to add link path for libimf.so. Cleared cruft for old Intel versions * fixed some formatting * cleanup * flake8 cleanup * flake8 * fixed syntax of compiler version detection tests * fixed syntax of compiler version detection tests modified: detection.py * fix typo * fixes for compilers tests * remove erroneous tests for outdated -std= flags, remove ifx version check (output won't parse) Co-authored-by: Frank Willmore <willmore@anl.gov>
2020-10-20Adding AOCC compiler to SPACK community (#19345)GaneshPrasadMA4-1/+4
* Adding AOCC compiler to SPACK community The AOCC compiler system offers a high level of advanced optimizations, multi-threading and processor support that includes global optimization, vectorization, inter-procedural analyses, loop transformations, and code generation. AMD also provides highly optimized libraries, which extract the optimal performance from each x86 processor core when utilized. The AOCC Compiler Suite simplifies and accelerates development and tuning for x86 applications. * Added unit tests for detection and flags for AOCC * Addressed reviewers comments w.r.t version checks and url,checksum related line lengths Co-authored-by: Test User <spack@example.com>
2020-10-16New compiler: nvhpc (NVIDIA HPC SDK) (#19294)Scott McMillan4-3/+6
* Add nvhpc compiler definition: "spack compiler add" will now look for instances of the NVIDIA HPC SDK compiler executables (nvc, nvc++, nvfortran) in supplied paths * Add the nvhpc package which installs the nvhpc compiler * Add testing for nvhpc detection and C++-standard/pic flags Co-authored-by: Scott McMillan <smcmillan@nvidia.com>
2020-04-21compiler wrappers: don't override -isystem with -I (#16077)Andrew W Elble1-14/+34
If the Spack compiler wrapper encounters any "-isystem" option, then when adding include directories for Spack dependencies, Spack will use "-isystem" instead of "-I". This prevents Spack-generated "-I" options from overriding the "-isystem" options generated by the build system. To ensure that build-system "-isystem" directories are searched first, Spack places all of its inserted "-isystem" directories after. The new ordering of -isystem includes is: * -isystem from build system (not system directories) * -isystem from Spack * -isystem from build system (for directories like /usr/include) The prior order of "-I" arguments is preserved (although as of this commit Spack no longer generates -I if -isystem is detected): * -I from build system (not system directories) * -I from Spack (only if there are no "-isystem" options) * -I from build system (for directories like /usr/include)
2020-03-03Fix FCFLAGS handling for Autotools packages (#14788)Sergey Kosukhin1-1/+1
Spack's fflags are meant for both f77 and fc. Therefore, they must be passed as FFLAGS and FCFLAGS to the configure scripts of Autotools-based packages.
2019-12-30copyright: update copyright dates for 2020 (#14328)Todd Gamblin1-1/+1
2019-10-23Users can configure use of RPATH or RUNPATH (#9168)Massimiliano Culpo1-1/+33
Add a new entry in `config.yaml`: config: shared_linking: 'rpath' If this variable is set to `rpath` (the default) Spack will set RPATH in ELF binaries. If set to `runpath` it will set RUNPATH. Details: * Spack cc wrapper explicitly adds `--disable-new-dtags` when linking * cc wrapper also strips `--enable-new-dtags` from the compile line when disabling (and vice versa) * We specifically do *not* add any dtags flags on macOS, which uses Mach-O binaries, not ELF, so there's no RUNPATH)
2019-09-20targets: Spack targets can now be fine-grained microarchitecturesMassimiliano Culpo1-1/+1
Spack can now: - label ppc64, ppc64le, x86_64, etc. builds with specific microarchitecture-specific names, like 'haswell', 'skylake' or 'icelake'. - detect the host architecture of a machine from /proc/cpuinfo or similar tools. - Understand which microarchitectures are compatible with which (for binary reuse) - Understand which compiler flags are needed (for GCC, so far) to build binaries for particular microarchitectures. All of this is managed through a JSON file (microarchitectures.json) that contains detailed auto-detection, compiler flag, and compatibility information for specific microarchitecture targets. The `llnl.util.cpu` module implements a library that allows detection and comparison of microarchitectures based on the data in this file. The `target` part of Spack specs is now essentially a Microarchitecture object, and Specs' targets can be compared for compatibility as well. This allows us to label optimized binary packages at a granularity that enables them to be reused on compatible machines. Previously, we only knew that a package was built for x86_64, NOT which x86_64 machines it was usable on. Currently this feature supports Intel, Power, and AMD chips. Support for ARM is forthcoming. Specifics: - Add microarchitectures.json with descriptions of architectures - Relaxed semantic of compiler's "target" attribute. Before this change the semantic to check if a compiler could be viable for a given target was exact match. This made sense as the finest granularity of targets was architecture families. As now we can target micro-architectures, this commit changes the semantic by interpreting as the architecture family what is stored in the compiler's "target" attribute. A compiler is then a viable choice if the target being concretized belongs to the same family. Similarly when a new compiler is detected the architecture family is stored in the "target" attribute. - Make Spack's `cc` compiler wrapper inject target-specific flags on the command line - Architecture concretization updated to use the same algorithm as compiler concretization - Micro-architecture features, vendor, generation etc. are included in the package hash. Generic architectures, such as x86_64 or ppc64, are still dumped using the name only. - If the compiler for a target is not supported exit with an intelligible error message. If the compiler support is unknown don't try to use optimization flags. - Support and define feature aliases (e.g., sse3 -> ssse3) in microarchitectures.json and on Microarchitecture objects. Feature aliases are defined in targets.json and map a name (the "alias") to a list of rules that must be met for the test to be successful. The rules that are available can be extended later using a decorator. - Implement subset semantics for comparing microarchitectures (treat microarchitectures as a partial order, i.e. (a < b), (a == b) and (b < a) can all be false. - Implement logic to automatically demote the default target if the compiler being used is too old to optimize for it. Updated docs to make this behavior explicit. This avoids surprising the user if the default compiler is older than the host architecture. This commit adds unit tests to verify the semantics of target ranges and target lists in constraints. The implementation to allow target ranges and lists is minimal and doesn't add any new type. A more careful refactor that takes into account the type system might be due later. Co-authored-by: Gregory Becker <becker33.llnl.gov>
2019-09-20targets: first pass at target detection for linuxGregory Becker1-1/+3
Add llnl.util.cpu_name, with initial support for detecting different microarchitectures on Linux. This also adds preliminary changes for compiler support and variants to control the optimizatoin levels by target. This does not yet include translations of targets to particular compilers; that is left to another PR. Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
2019-08-24Add implicit rpaths to compiler detection (#7153)Ben Boeckel1-0/+6
Uses code from CMake to detect implicit link paths from compilers System paths are filtered out of implicit link paths Implicit link paths added to compiler config and object under `implicit_rpaths` Implicit link paths added as rpaths to compile line through env/cc wrapper Authored by: "Ben Boeckel <ben.boeckel@kitware.com>" Co-authored by: "Peter Scheibel <scheibel1@llnl.gov>" Co-authored by: "Gregory Becker <becker33@llnl.gov>"
2019-05-21Add Fujitsu compiler to Spack. (#11287)t-karatsu4-4/+7
* Add Fujitsu compiler to Spack. * Fixes for flake8 * Chenges location of FCC to subdirectory called case-insensitive * Add compiler tests for Fujitsu compiler * Modify the logic of taking compiler version for new version of Fujitsu compiler
2019-05-04Binary caches on MacOS - allow expanded RPATHs (#11345)Patrick Gartung1-0/+11
Fixes #11335 Update the Spack compiler wrappers to add the headerpad_max_install_names linker flag on MacOS. This allows the install_name_tool to rewrite the RPATH entry of the binary to be longer if needed. This is primarily useful for creating and distributing binary caches of packages (i.e. using the "spack buildcache" command); binary caches created on MacOS before this commit may not successfully relocate (if the target root path is larger).
2019-04-17Add ftn to lib/spack/env (#11180)Satish Balay1-0/+1
Fixes #11070 #11010 Spack attempts to intercede on behalf of all compiler invocations for a build. This involves adding its wrappers to PATH. Cray systems include a "ftn" executable and Spack was only redirecting this call when the Spec was built with cce. This updates the compiler wrappers to add "ftn" in all cases.
2019-04-09Typo: Unkown -> Unknown (#11150)George Hartzell1-1/+1
2019-02-26Use Package.headers for -I options (#10623)Massimiliano Culpo1-4/+4
This restores the use of Package.headers when computing -I options for building a package that was added in #8136 and reverted in #10604. #8136 used utility logic that located all header files in an installation prefix, and calculated the -I options as the immediate roots containing those header files. In some cases, for a package containing a directory structure like prefix/ include/ ex1.h subdir/ ex2.h dependents may expect to include ex2.h relative to 'include', and adding 'prefix/include/subdir' as a -I was causing errors, in particular if ex2.h has the same name as a system header. This updates header utility logic to by default return the base "include" directory when it exists, rather than subdirectories. It also makes it possible for package implementers to override Package.headers to return the subdirectory when it is required (for example with libxml2).
2019-02-14Removed pkg.headers.directories from the include list (#10604)Massimiliano Culpo1-9/+7
fixes #10601 Due to a bug this attribute is wrong for packages that use directories as namespaces. For instance it will add "<boost-prefix>/include/boost" instead of "<boost-prefix>/include" to the include path. As a minor addition a few loops in the compiler wrappers have been simplified.
2019-02-13Dynamic library/include paths (#8136)Peter Scheibel1-47/+22
Fixes #7855 Closes #8070 Closes #2645 When searching for library directories (e.g. to add "-L" arguments to the compiler wrapper) Spack was only trying the "lib/" and "lib64/" directories for each dependency install prefix; this missed cases where packages would install libraries to subdirectories and also was not customizable. This PR makes use of the ".headers" and ".libs" properties for more-advanced location of header/library directories. Since packages can override the default behavior of ".headers" and ".libs", it also allows package writers to customize. The following environment variables which used to be set by Spack for a package build have been removed: * Remove SPACK_PREFIX and SPACK_DEPENDENCIES environment variables as they are no-longer used * Remove SPACK_INSTALL environment variable: it was not used before this PR
2019-01-12cc: clean up cray compilers, fix issues with case-insensitive filesystems ↵Adam J. Stewart7-4/+1
(#10323) * Remove Cray CC compilers causing problems on case-insensitive filesystems * cray -> cce * Ensure that compiler-specific directory comes first in build-env * Point to compiler-specific symlinks
2019-01-08Armcompiler (#9840)Srinath Vadlamani4-3/+6
* Initial compiler support * added arm.py * Changed licence to Arm suggested header * Changed licence to the same as clang.py Main author of file is Nick Forrington <Nick.Forrington@arm.com> Minor changes by Srinath Vadlamani <srinath.vadlamani@arm.com> * compilers: add arm compiler detection to Spack - added arm.py with support for detecting `armclang` and `armflang` Co-authored-by: Srinath Vadlamani <srinath.vadlamani@arm.com> * Changed to using get get_compiler_version * linking to general cc for arm compiler * For arm compiler add CFLAGS to use compiler-rt rtlib. * Escape for special characters in rexep * Cleaned up for Flake8 to pass. * libcompiler-rt should be part of the LDFLAGS not CFLAGS * fixed m4 when using clang to used LDFLAGS. Fixed comments for arm.py to display compiler --version output with # NOAQ for flakes pass. * added arm compilers * proper linked names
2019-01-01copyright: update license headers for 2013-2019 copyright.Todd Gamblin1-1/+1