Script not propagating CMAKE flags to llvm build
I'm building on a system using modules. When I call CMake for paraview-superbuild I use the following syntax:
CC=mpicc CXX=mpicxx FC=mpif90 cmake [blah blah blah]
This is then populating my compilers based on the module loaded: gcc 7.2.0
However, the build fails during the cmake call to build llvm as follows:
[ 40%] Performing configure step for 'llvm'
cd [path]/superbuild/llvm/build && [path]/cmake-3.9.6-Linux-x86_64/bin/cmake -P [path]/superbuild/sb-llvm-configure.cmake
Not searching for unused variables given on the command line.
Re-run cmake no build system arguments
-- The CXX compiler identification is GNU 4.4.7
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- broken
CMake Error at [path]/cmake-3.9.6-Linux-x86_64/share/cmake-3.9/Modules/CMakeTestCXXCompiler.cmake:44 (message):
The C++ compiler "/usr/bin/c++" is not able to compile a simple test
program.
It fails with the following output:
Change Dir: [path]/superbuild/llvm/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTC_0ede1/fast"
gmake[3]: Entering directory
`[path]/superbuild/llvm/build/CMakeFiles/CMakeTmp'
/usr/bin/gmake -f CMakeFiles/cmTC_0ede1.dir/build.make
CMakeFiles/cmTC_0ede1.dir/build
gmake[4]: Entering directory
`[path]/superbuild/llvm/build/CMakeFiles/CMakeTmp'
Building CXX object CMakeFiles/cmTC_0ede1.dir/testCXXCompiler.cxx.o
/usr/bin/c++ -fPIC -std=c++11 -o
CMakeFiles/cmTC_0ede1.dir/testCXXCompiler.cxx.o -c
[path]/superbuild/llvm/build/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
cc1plus: error: unrecognized command line option "-std=c++11"
Which is pulling the compiler from /urs/bin and not my specified directory. It would be a nice fix to have the cmake variable propagate to other cmake calls in the build script. A quick work around for this is to provide a system llvm, but that kind of defeats the purpose of having this handy superbuild script.