Open legordian opened 10 years ago
Commented by legordian on 2013-01-23 19:11 UTC what about:
> export CC=/usr/bin/clang
> export CXX=/usr/bin/clang++
> cmake .. && make
That should do the trick, shouldn't it?
Commented by bgrube on 2013-01-23 19:35 UTC This may be a quick-n-dirty solution. However one might want to set different compiler switches depending on the used compiler. I'll have to try.
Commented by legordian on 2013-01-23 20:06 UTC Concerning compiler switches, there are solutions.
Commented by bgrube on 2013-01-23 20:15 UTC I was actually trying to use CMake Toolchain files. What is described at http://qmcpack.cmscc.org/getting-started/using-cmake-toolchain-file and http://code.google.com/p/qmcpack/wiki/CMakeToolchain sounds at least interesting.
Commented by sebastianuhl on 2013-10-12 15:47 UTC
This issue just became a bit more urgent with Apple removing gcc from Xcode 5. gcc
/g++
appears to be a wrapper for clang
/clang++
, I still have llvm-gcc
and llvm-g++
(probably not yet removed from one of the older Xcode versions) as a loophole for the moment though.
Concerning the compilation with clang, while the compilation of the llvm
branch continues further than the one of the master
branch, it complains for unused functions inside BOOST a bit further on:
[ 12%] Building CXX object utilities/test/CMakeFiles/testLibppFunctions.dir/testLibppFunctions.cc.o
In file included from /Users/sebastian/Desktop/temp/code/utilities/test/testLibppFunctions.cc:45:
In file included from /Users/sebastian/Desktop/temp/code/utilities/spinUtils.hpp:46:
In file included from /Users/sebastian/Desktop/temp/code/utilities/mathUtils.hpp:43:
In file included from /Users/sebastian/Documents/COMPASS/Software/boost/boost_1_52_0/include/boost/numeric/ublas/matrix.hpp:16:
In file included from /Users/sebastian/Documents/COMPASS/Software/boost/boost_1_52_0/include/boost/numeric/ublas/vector.hpp:19:
In file included from /Users/sebastian/Documents/COMPASS/Software/boost/boost_1_52_0/include/boost/numeric/ublas/storage.hpp:26:
/Users/sebastian/Documents/COMPASS/Software/boost/boost_1_52_0/include/boost/numeric/ublas/traits.hpp:45:27: error: unused function 'boost_numeric_ublas_abs' [-Werror,-Wunused-function]
template<> unsigned int boost_numeric_ublas_abs (const unsigned int& t) {
^
/Users/sebastian/Documents/COMPASS/Software/boost/boost_1_52_0/include/boost/numeric/ublas/traits.hpp:49:28: error: unused function 'boost_numeric_ublas_abs' [-Werror,-Wunused-function]
template<> unsigned long boost_numeric_ublas_abs (const unsigned long& t) {
^
2 errors generated.
make[2]: *** [utilities/test/CMakeFiles/testLibppFunctions.dir/testLibppFunctions.cc.o] Error 1
make[1]: *** [utilities/test/CMakeFiles/testLibppFunctions.dir/all] Error 2
make: *** [all] Error 2
(not only for the file mentioned above).
Commented by bgrube on 2014-01-10 17:48 UTC So, I made at least some progress on this issue: With [09f16c] the compilation works at least under
At the moment the way to switch from gcc and clang is to execute
export CC=`which clang`
export CXX=`which clang++`
before running CMake.
Reported by bgrube on 2013-01-23 19:08 UTC Implement procedure to switch from default gcc to LLVM compiler; preferably via command-line argument or environment variable.