You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is a guess, but it's possible you're setting the C++
compiler to clang++, but not setting the C compiler to clang.
This appears to be the case.
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
And on the system that I'm working on, the various c and c++ paths look like this.
$ for p in gcc g++ llvm-gcc-4.2 llvm-g++-4.2 /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 /usr/llvm-gcc-4.2/bin/llvm-g++-4.2 clang clang++ cc c++; do ls -l which $p; done
lrwxr-xr-x 1 root wheel 12 Oct 16 13:44 /usr/bin/gcc -> llvm-gcc-4.2
lrwxr-xr-x 1 root wheel 12 Oct 16 13:44 /usr/bin/g++ -> llvm-g++-4.2
lrwxr-xr-x 1 root wheel 32 Oct 16 13:44 /usr/bin/llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2
lrwxr-xr-x 1 root wheel 32 Oct 16 13:44 /usr/bin/llvm-g++-4.2 -> ../llvm-gcc-4.2/bin/llvm-g++-4.2
-rwxr-xr-x 1 root wheel 117168 Oct 16 13:44 /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
-rwxr-xr-x 1 root wheel 117168 Oct 16 13:44 /usr/llvm-gcc-4.2/bin/llvm-g++-4.2
-rwxr-xr-x 1 root wheel 21622640 Oct 16 13:44 /usr/bin/clang
lrwxr-xr-x 1 root wheel 5 Oct 16 13:44 /usr/bin/clang++ -> clang
lrwxr-xr-x 1 root wheel 5 Oct 16 13:44 /usr/bin/cc -> clang
lrwxr-xr-x 1 root wheel 7 Oct 16 13:44 /usr/bin/c++ -> clang++
We see that the "C" compiler choice resolves to /usr/bin/gcc (/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2) and the "CXX" compiler resolves to /usr/bin/c++ (clang++).
The question is: what cmake incantation do I need to work around this issue? For example, I'd like to set CC to 'clang'.
Add
because it expects a reference and receives a non-l-value.
For example, given:
int foo(int &);
template<int x> void b() { foo(x); }
clang will now print "expects an l-value for 1st argument" instead of
"no known conversion from 'int' to 'int &' for 1st argument". The change
in wording (and associated code to detect the case) was prompted by
comment #5 in PR3104, and should be the last bit of work needed for the
bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158691 91177308-0d34-0410-b5e6-96231b3b80d8
Reverted to cmake 2.8.6, ran the usual cmake and make steps and ran into this:
[ 5%] Building C object lib/Support/CMakeFiles/LLVMSupport.dir/regerror.c.o
cc1: error: unrecognized command line option "-Wcovered-switch-default"
make[2]: *** [lib/Support/CMakeFiles/LLVMSupport.dir/regcomp.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc1: error: unrecognized command line option "-Wcovered-switch-default"
make[2]: *** [lib/Support/CMakeFiles/LLVMSupport.dir/regerror.c.o] Error 1
This failure is reminiscent of a problem recently reported to clang-dev:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-October/024748.html
which resulted in this reply:
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2012-October/024753.html
which states:
this is a guess, but it's possible you're setting the C++
compiler to clang++, but not setting the C compiler to clang.
This appears to be the case.
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
And on the system that I'm working on, the various c and c++ paths look like this.
$ for p in gcc g++ llvm-gcc-4.2 llvm-g++-4.2 /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2 /usr/llvm-gcc-4.2/bin/llvm-g++-4.2 clang clang++ cc c++; do ls -l
which $p
; donelrwxr-xr-x 1 root wheel 12 Oct 16 13:44 /usr/bin/gcc -> llvm-gcc-4.2
lrwxr-xr-x 1 root wheel 12 Oct 16 13:44 /usr/bin/g++ -> llvm-g++-4.2
lrwxr-xr-x 1 root wheel 32 Oct 16 13:44 /usr/bin/llvm-gcc-4.2 -> ../llvm-gcc-4.2/bin/llvm-gcc-4.2
lrwxr-xr-x 1 root wheel 32 Oct 16 13:44 /usr/bin/llvm-g++-4.2 -> ../llvm-gcc-4.2/bin/llvm-g++-4.2
-rwxr-xr-x 1 root wheel 117168 Oct 16 13:44 /usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
-rwxr-xr-x 1 root wheel 117168 Oct 16 13:44 /usr/llvm-gcc-4.2/bin/llvm-g++-4.2
-rwxr-xr-x 1 root wheel 21622640 Oct 16 13:44 /usr/bin/clang
lrwxr-xr-x 1 root wheel 5 Oct 16 13:44 /usr/bin/clang++ -> clang
lrwxr-xr-x 1 root wheel 5 Oct 16 13:44 /usr/bin/cc -> clang
lrwxr-xr-x 1 root wheel 7 Oct 16 13:44 /usr/bin/c++ -> clang++
We see that the "C" compiler choice resolves to /usr/bin/gcc (/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2) and the "CXX" compiler resolves to /usr/bin/c++ (clang++).
The question is: what cmake incantation do I need to work around this issue? For example, I'd like to set CC to 'clang'.
Add
Subtasks
Add
Related issues
Issue #
Delay: days Cancel
History
#1
Updated by Gary Funck 3 months ago
Comment
Gary Funck wrote:
I think that I found the answer here:
http://www.cmake.org/Wiki/CMake_Useful_Variables
I can set the CC and CXX environment variables when running cmake. Will try that.
The text was updated successfully, but these errors were encountered: