Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenVDB does not compile with GCC 6.1.1 #70

Closed
malaterre opened this issue Jul 19, 2016 · 6 comments
Closed

OpenVDB does not compile with GCC 6.1.1 #70

malaterre opened this issue Jul 19, 2016 · 6 comments

Comments

@malaterre
Copy link
Contributor

Relevant log:

Relevant part (hopefully):

g++ -c -DOPENVDB_PRIVATE -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fvisibility=hidden -fvisibility-inlines-hidden -pthread -g -I . -I .. -isystem /usr/include -isystem /usr/include/OpenEXR -isystem /usr/include -isystem /usr/include -isystem /usr/include -DOPENVDB_USE_BLOSC -DOPENVDB_USE_LOG4CPLUS -DOPENVDB_USE_GLFW_3 -fPIC -o Grid.o Grid.cc
In file included from /usr/include/c++/6/ext/string_conversions.h:41:0,
from /usr/include/c++/6/bits/basic_string.h:5402,
from /usr/include/c++/6/string:52,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from Grid.h:34,
from Grid.cc:31:
/usr/include/c++/6/cstdlib:75:25: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^
compilation terminated.
make[2]: *** [Grid.o] Error 1

@malaterre
Copy link
Contributor Author

The issue is given in details at: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70129

@malaterre
Copy link
Contributor Author

Proper fix would be to avoid using '-isystem /usr/include' in the Makefiles

@aditiapratama
Copy link

hi @malaterre, have you succeed build it using gcc 6.1.1? any workaround? I don't know how to fix it by avoid using -isystem /usr/include

@aditiapratama
Copy link

Okay, avoiding use /usr/include did the trick for me but still fail when building vdb_print, etc. Here's the log

make lib install
make: Nothing to be done for 'lib'.
Building vdb_print because of libopenvdb.so.3.2.0 main.cc
g++ -std=c++0x -pthread -O3 -DNDEBUG -I . -I .. -isystem /usr/include/boost -isystem /opt/lib/openexr/include -isystem /usr/include/tbb -isystem /opt/lib/blosc/include -isystem /usr/include/log4cplus -DOPENVDB_USE_BLOSC -DOPENVDB_USE_LOG4CPLUS -DOPENVDB_USE_GLFW_3 -o vdb_print cmd/openvdb_print/main.cc -I . \
    -Wl,-rpath,/opt/lib/openvdb/lib -L/home/aditia/src/blender-deps/openvdb-master/openvdb libopenvdb.so.3.2.0 \
    -ldl -lm -lz -Wl,-rpath,/opt/lib/openexr/lib -L/opt/lib/openexr/lib -lHalf -Wl,-rpath,/usr/lib64 -L/usr/lib64 -ltbb -Wl,-rpath,/usr/lib64 -L/usr/lib64 -lboost_iostreams -lboost_system  -Wl,-rpath,/opt/lib/blosc/lib -L/opt/lib/blosc/lib -lblosc -lz -Wl,-rpath,/usr/lib64 -L/usr/lib64 -llog4cplus -Wl,-rpath,/usr/lib64 -L/usr/lib64 -lrt -ljemalloc
/usr/bin/ld: vdb_print: hidden symbol `__cpu_model' in /usr/lib/gcc/x86_64-redhat-linux/6.1.1/libgcc.a(cpuinfo.o) is referenced by DSO
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
Makefile:735: recipe for target 'vdb_print' failed
make: *** [vdb_print] Error 1

danrbailey pushed a commit to dneg/openvdb that referenced this issue Oct 31, 2016
…ion#70)

Change iterator loops to range based loops and further migration of lib and unit test code to C++11.
@phcerdan
Copy link

phcerdan commented Jul 7, 2019

This is a duplicate of #144

In short:
Set CMake option to not use isystem for imported targets:

cmake ../src -DCMAKE_NO_SYSTEM_FROM_IMPORTED:BOOL=TRUE 

@malaterre
Copy link
Contributor Author

Just for reference, the original post was using the Makefile based build system. I'll switch to cmake for Debian package. Thanks for help !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants