[Bf-cycles] Compile error related to VLOG / C++11
Paul Melis
paul.melis at surfsara.nl
Wed Jun 28 16:00:40 CEST 2017
Hi,
I've been trying to build cycles (standalone version) on one of our
systems and I keep running into an error that I don't see when compiling
on my normal workstation:
[ 27%] Built target cycles_render
[ 29%] Built target extern_cuew
[ 30%] Built target extern_clew
[ 33%] Built target cycles_graph
[ 34%] Building CXX object
src/device/CMakeFiles/cycles_device.dir/opencl/opencl_util.cpp.o
cd /home/paulm/c/cycles-release/src/device &&
/hpc/sw/clang-3.6.2/bin/clang++ -DBOOST_ALL_NO_LIB
-DCCL_NAMESPACE_BEGIN="namespace ccl {" -DCCL_NAMESPACE_END=}
-DCYCLES_TR1_UNORDERED_MAP -DNDEBUG -DWITH_CUDA -DWITH_CUDA_DYNLOAD
-DWITH_CYCLES_STANDALONE_GUI -DWITH_KERNEL_AVX -DWITH_KERNEL_AVX2
-DWITH_KERNEL_SSE2 -DWITH_KERNEL_SSE3 -DWITH_KERNEL_SSE41 -DWITH_MULTI
-DWITH_OPENCL -Wall -Wno-sign-compare -fno-strict-aliasing -ffast-math
-fno-finite-math-only
-I/home/paulm/c/cycles-git/third_party/cuew/include
-I/home/paulm/c/cycles-git/third_party/clew/include -isystem
/hpc/sw/boost-1.59.0-gnu/include -isystem
/home/paulm/software/openimageio-20160310/include -isystem
/home/paulm/software/openimageio-20160310/include/OpenImageIO -isystem
/home/paulm/software/openexr-2.2.0/include
-I/home/paulm/c/cycles-git/src/../third_party/atomic
-I/home/paulm/c/cycles-git/src/device/..
-I/home/paulm/c/cycles-git/src/device/../../glew-mx
-I/home/paulm/c/cycles-git/src/device/../../../extern/cuew/include
-isystem
/home/paulm/c/cycles-git/src/device/../../../extern/clew/include -o
CMakeFiles/cycles_device.dir/opencl/opencl_util.cpp.o -c
/home/paulm/c/cycles-git/src/device/opencl/opencl_util.cpp
/home/paulm/c/cycles-git/src/device/opencl/opencl_util.cpp:287:11:
error: invalid operands to binary expression ('ccl::StubStream' and
'string' (aka 'basic_string<char>'))
VLOG(2) << msg;
~~~~~~~ ^ ~~~
The compiler suite used here is a bit old, the above error is with clang
3.6.2, but I also get it with Intel ICC 15 and GCC 5.2.0. It seems the
error goes away when using -std=c++11 for this file, but this introduces
issues for other files, e.g.
[paulm at int2 cycles-release]$ make VERBOSE=1
...
[ 1%] Building C object
third_party/clew/CMakeFiles/extern_clew.dir/src/clew.c.o
cd /home/paulm/c/cycles-release/third_party/clew &&
/hpc/sw/clang-3.6.2/bin/clang -DCL_USE_DEPRECATED_OPENCL_1_1_APIS
-DNDEBUG -std=c++11 -Wall -Wno-sign-compare -fno-strict-aliasing
-I/home/paulm/c/cycles-git/third_party/cuew/include
-I/home/paulm/c/cycles-git/third_party/clew/include
-I/home/paulm/c/cycles-git/third_party/clew/. -o
CMakeFiles/extern_clew.dir/src/clew.c.o -c
/home/paulm/c/cycles-git/third_party/clew/src/clew.c
error: invalid argument '-std=c++11' not allowed with 'C/ObjC'
Apparently, CMAKE_CXX_FLAGS is used for C files as well, which clang
doesn't like for -std=c++11.
On my workstation I have GCC 7.1, which seems to have C++11 enabled by
default (without a switch). So before I dig in any further, should the
cycles code compile without C++11 mode or is it mandatory?
Regards,
Paul
--
Paul Melis
| Visualization group leader & developer | SURFsara |
| Science Park 140 | 1098 XG Amsterdam |
| T 020 800 1312 | paul.melis at surfsara.nl | www.surfsara.nl |
More information about the Bf-cycles
mailing list