[Bf-cycles] Compile error related to VLOG / C++11

Paul Melis paul.melis at surfsara.nl
Wed Jun 28 16:00:40 CEST 2017


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 
cd /home/paulm/c/cycles-release/src/device && 
/hpc/sw/clang-3.6.2/bin/clang++   -DBOOST_ALL_NO_LIB 
-DWITH_OPENCL -Wall -Wno-sign-compare -fno-strict-aliasing -ffast-math 
-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/c/cycles-git/src/device/../../../extern/clew/include    -o 
CMakeFiles/cycles_device.dir/opencl/opencl_util.cpp.o -c 
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 
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/clew/.    -o 
CMakeFiles/extern_clew.dir/src/clew.c.o   -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?



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