Comments (14)
I think the cause of the problem is that either Spack was broken when you first checked it out and it has been fixed since then, or you didn't have a C++ compiler when you first checked Spack out and have installed one since then. Spack isn't yet smart enough to look for missing compilers after the fact.
from spack.
Thank you, @adamjstewart . Readding compiler via spack compiler find
after removing ~/.spack/compilers.yaml
and ~/.spack/<OS>/compilers.yaml
works for me!
# rm -rf ~/.spack/compilers.yaml; rm -rf ~/.spack/linux/compilers.yaml; bin/spack compiler find
==> Added 1 new compiler to /root/.spack/linux/compilers.yaml
[email protected]
# bin/spack compiler info [email protected]
[email protected]:
paths:
cc = /usr/bin/gcc
cxx = /usr/bin/g++
f77 = /usr/bin/gfortran
fc = /usr/bin/gfortran
modules = []
operating system = centos7
from spack.
The links point at cc because that's the compiler wrapper that inserts RPATHs:
http://scalability-llnl.github.io/spack/packaging_guide.html#the-install-environment
lib/spack/env is put first in your path during a build to control the environment, but the error messages aren't that great, and I have not tested much on ubuntu (though apparently I should -- maybe travis is a good place to do this).
Have you looked at ~/.spackconfig to see whether your compilers are set up correctly? By default Spack will use the latest gcc to build, so if that is not set properly (e.g. if it has "None" for cc or c++) things will break.
from spack.
I have the following in my .spackconfig file:
[compiler "[email protected]"]
cc = /usr/bin/gcc
cxx = None
f77 = /usr/bin/gfortran
fc = /usr/bin/gfortran
It seems Ubuntu sets the variables g++
, c++
, and cpp
, but not cxx
.
from spack.
Is there a /usr/bin/g++? If so can you send the output of gcc -dumpversion AND g++ -dumpversion?
The autodetection in Spack is done via per-compiler classes. Look at lib/spack/spack/compilers/.py, each of which extends Compiler in lib/spack/spack/compiler.py. Compiler detection is done by searching your PATH in parallel and locating all the executables with names like gcc, g++*. It then detects the version of each and groups them by version -- it looks like there was something wrong when it ran g++, OR it didn't match the others.
from spack.
Yes, there is:
ls /usr/bin/g++
lrwxrwxrwx 1 root root 7 Apr 7 2014 /usr/bin/g++ -> g++-4.8
Both gcc -dumpversion and g++ -dumpversion return 4.8. cc, gfortran, cpp, and c++ also return 4.8.
from spack.
I'll have to find an ubuntu machine to test on sometime soon. In the meantime, if you add back /usr/bin/g++ for cxx, then things should work better for you. Spack should really warn if it doesn't find some of the compilers.
from spack.
In lib/spack/spack/compilers/__init__.py
, in line 181, there is a check:
if not all(n in items for n in _required_instance_vars):
raise InvalidCompilerConfigurationError(cspec)
Even though cxx
is set to None
, this check does not raise an exception because items
does have cxx
as a key. _required_instance_vars
is a list with ['cc','cxx','f77','fc']
, while items
is a dictionary.
from spack.
Does that fix it for you? If so can you send a PR? I can put the change in as well but I cannot verify it right now.
from spack.
My first fix was to create a symbolic link /usr/bin/cxx
-> /usr/bin/cpp
in the command line. It seems Ubuntu does not have a cxx
symbolic link by default.
My second fix (and the more generic one) was to modify _required_instance_vars
(in lib/spack/spack/compilers/__init__.py
) to include cpp
rather than cxx
, and to change the Compiler attribute self.cxx
to self.cpp
to match the variable in _required_instance_vars
.
I do not know if you wish to change the cxx
variable to cpp
, but if you do, I can send a PR.
from spack.
Does this bug still occur? Specifically, the part about Spack not picking up g++
on Ubuntu. It seems like all of the other bugs mentioned in this issue stem from that fact.
from spack.
I added some compiler checks to the Travis CI output, and indeed at least on the Travis Ubuntu distro, cxx is found properly. Closing for now -- please reopen if this happens again.
from spack.
Hi. This happens agin on Cent OS 7. spack fails to identify g++
shipped with the OS, which leads to configuration failure during [email protected] installation.
bin/spack compiler info [email protected]
[email protected]:
paths:
cc = /usr/bin/gcc
cxx = None
f77 = /usr/bin/gfortran
fc = /usr/bin/gfortran
modules = []
operating system = centos7
ls /usr/bin/g++
/usr/bin/g++
from spack.
@weijianwen Do you have a /usr/bin/g++
? If you delete ~/.spack/compilers.yaml
and/or ~/.spack/<OS>/compilers.yaml
and run spack compiler find
, does it pick it up the second time?
from spack.
Related Issues (20)
- Installation issue: LAMMPS +kokkos+rocm+kspace does not use hipFFT For GPU HOT 2
- Spack errors out when py-webcolors package is loaded HOT 4
- Re-concretizing and installing partially built environments sometimes leads to strange errors
- setting config options is sensitive to order?
- Installation issue: parallel-hashmap HOT 1
- Installation issue: libunwind HOT 3
- Duplicate package in PYTHONPATH HOT 5
- Installation issue: hdf5
- Concretizer: spack uses rng to determine which externals to install
- CDash deficiencies and improvement suggestions HOT 1
- Installation issue: VTK HOT 4
- Installation issue: [email protected]
- Fail to concretize: NCL HOT 2
- update cln package to 1.3.7
- Installation issue: harfbuzz-9.0.0-un3wejka6frj7atcp3h3jrwfeukoip2z HOT 1
- default_args(when) and when have different behavior HOT 1
- `cmake` build error HOT 7
- Non ASCII characters can cause errors when reading packages
- Installation issue: librsvg
- Spack calls "/usr/bin/lldb-dap-18 --version", hangs and fails to timeout. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spack.