Compilation issues with new model loader
Closed this issue · 6 comments
I have an issue when compiling Gem under MacOS, probably due to the recently simplification of the model loader code. (Assimp is installed).
In file included from model.cpp:18:
../../src/plugins/modelloader.h:173:2: warning: remove obsolete genTexture_Linear [-W#warnings]
#warning remove obsolete genTexture_Linear
^
../../src/plugins/modelloader.h:185:2: warning: remove obsolete genTexture_Spheremap [-W#warnings]
#warning remove obsolete genTexture_Spheremap
^
../../src/plugins/modelloader.h:222:2: warning: remove obsolete render_material [-W#warnings]
#warning remove obsolete render_material
^
model.cpp:250:7: error: expected member name or ';' after declaration specifiers
, texType(LINEAR)
^
model.cpp:249:17: error: expected '('
, texScale{1.0, 1.0}
^
model.cpp:249:26: error: expected ';' after expression
, texScale{1.0, 1.0}
^
;
model.cpp:249:18: warning: left operand of comma operator has no effect [-Wunused-value]
, texScale{1.0, 1.0}
^~~
model.cpp:249:23: warning: expression result unused [-Wunused-value]
, texScale{1.0, 1.0}
^~~
model.cpp:279:26: error: no member named 'bbox' in 'gem::modelGL::PIMPL'
bbox_t bb = m_pimpl->bbox();
~~~~~~~ ^
model.cpp:300:14: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
for (auto&m: m_pimpl->mesh) {
^
model.cpp:300:20: warning: range-based for loop is a C++11 extension [-Wc++11-extensions]
for (auto&m: m_pimpl->mesh) {
^
model.cpp:340:11: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
for(auto n: meshes) {
^
model.cpp:340:17: warning: range-based for loop is a C++11 extension [-Wc++11-extensions]
for(auto n: meshes) {
^
model.cpp:343:15: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
const auto &m = m_pimpl->mesh[n];
^
model.cpp:376:11: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
for(auto n: meshes) {
^
model.cpp:376:17: warning: range-based for loop is a C++11 extension [-Wc++11-extensions]
for(auto n: meshes) {
^
model.cpp:378:15: warning: 'auto' type specifier is a C++11 extension [-Wc++11-extensions]
const auto&m = m_pimpl->mesh[n];
^
13 warnings and 4 errors generated.
make[2]: *** [libGem_la-model.lo] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
which compiler version is this?
the error comes from using some modern C++ features.
hmm, i've tried compiling Gem on a OS X 10.11 ("El Capitan") machine, and there are no such problems (there are other problems, and i guess most of them come from th efact that this is a pristine VM with only a minimal set of dependencies installed, among them very outdated autotools (so I had to run make dist
on my linux box and build from that source-tarball, rather than directly from the git repository. and ObjectiveC(++) code doesn't link at all).
in any case the src/Gem/model.cpp
(and src/Geos/model.cpp
) builds fine
$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
also note that configure automatically enabled C++11 mode explicitly (the compiler is called as CXX = g++ -std=gnu++11
)
$ cd Gem/src/Gem/
$ touch model.cpp
$ make
/Library/Developer/CommandLineTools/usr/bin/make all-am
/bin/sh ../../libtool --tag=CXX --mode=compile g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I../../src -I../../src -DGEM_INTERNAL -DPD -I/Applications/Pd-0.54-1.app/Contents/Resources/src -g -O2 -Os -ffast-math -mmmx -fpascal-strings -MT libGem_la-model.lo -MD -MP -MF .deps/libGem_la-model.Tpo -c -o libGem_la-model.lo `test -f 'model.cpp' || echo './'`model.cpp
libtool: compile: g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I../../src -I../../src -DGEM_INTERNAL -DPD -I/Applications/Pd-0.54-1.app/Contents/Resources/src -g -O2 -Os -ffast-math -mmmx -fpascal-strings -MT libGem_la-model.lo -MD -MP -MF .deps/libGem_la-model.Tpo -c model.cpp -fno-common -DPIC -o .libs/libGem_la-model.o
In file included from model.cpp:18:
../../src/plugins/modelloader.h:173:2: warning: remove obsolete genTexture_Linear [-W#warnings]
#warning remove obsolete genTexture_Linear
^
../../src/plugins/modelloader.h:185:2: warning: remove obsolete genTexture_Spheremap [-W#warnings]
#warning remove obsolete genTexture_Spheremap
^
../../src/plugins/modelloader.h:222:2: warning: remove obsolete render_material [-W#warnings]
#warning remove obsolete render_material
^
3 warnings generated.
libtool: compile: g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I../../src -I../../src -DGEM_INTERNAL -DPD -I/Applications/Pd-0.54-1.app/Contents/Resources/src -g -O2 -Os -ffast-math -mmmx -fpascal-strings -MT libGem_la-model.lo -MD -MP -MF .deps/libGem_la-model.Tpo -c model.cpp -o libGem_la-model.o >/dev/null 2>&1
mv -f .deps/libGem_la-model.Tpo .deps/libGem_la-model.Plo
/bin/sh ../../libtool --tag=CXX --mode=link g++ -std=gnu++11 -DPD -I/Applications/Pd-0.54-1.app/Contents/Resources/src -g -O2 -Os -ffast-math -mmmx -fpascal-strings -o libGem.la libGem_la-glew.lo libGem_la-Cache.lo libGem_la-ContextData.lo libGem_la-Dylib.lo libGem_la-Event.lo libGem_la-Exception.lo libGem_la-Files.lo libGem_la-GLStack.lo libGem_la-Image.lo libGem_la-ImageLoad.lo libGem_la-ImageSave.lo libGem_la-PixConvert.lo libGem_la-PixConvertAltivec.lo libGem_la-PixConvertSSE2.lo libGem_la-Loaders.lo libGem_la-Manager.lo libGem_la-model.lo libGem_la-PBuffer.lo libGem_la-Properties.lo libGem_la-Rectangle.lo libGem_la-Settings.lo libGem_la-Setup.lo libGem_la-State.lo libGem_la-VertexBuffer.lo -L/Applications/Pd-0.54-1.app/Contents/Resources/bin -ldl -lz -lm
libtool: link: rm -fr .libs/libGem.a .libs/libGem.la
libtool: link: ar cr .libs/libGem.a .libs/libGem_la-glew.o .libs/libGem_la-Cache.o .libs/libGem_la-ContextData.o .libs/libGem_la-Dylib.o .libs/libGem_la-Event.o .libs/libGem_la-Exception.o .libs/libGem_la-Files.o .libs/libGem_la-GLStack.o .libs/libGem_la-Image.o .libs/libGem_la-ImageLoad.o .libs/libGem_la-ImageSave.o .libs/libGem_la-PixConvert.o .libs/libGem_la-PixConvertAltivec.o .libs/libGem_la-PixConvertSSE2.o .libs/libGem_la-Loaders.o .libs/libGem_la-Manager.o .libs/libGem_la-model.o .libs/libGem_la-PBuffer.o .libs/libGem_la-Properties.o .libs/libGem_la-Rectangle.o .libs/libGem_la-Settings.o .libs/libGem_la-Setup.o .libs/libGem_la-State.o .libs/libGem_la-VertexBuffer.o
libtool: link: ranlib .libs/libGem.a
libtool: link: ( cd ".libs" && rm -f "libGem.la" && ln -s "../libGem.la" "libGem.la" )
Thanks, I updated Command line tool, but this time it's gem_imageIO_la-imageIO.lo that is causing an error.
/bin/sh ../../libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../src -I../../src/Gem -I../../src -fobjc-arc -DPD -I/Applications/Pd-0.54-1.app/Contents/Resources/src -g -O2 -MT gem_imageIO_la-imageIO.lo -MD -MP -MF .deps/gem_imageIO_la-imageIO.Tpo -c -o gem_imageIO_la-imageIO.lo `test -f 'imageIO.mm' || echo './'`imageIO.mm
libtool: compile: unable to infer tagged configuration
libtool: error: specify a tag with '--tag'
make[2]: *** [gem_imageIO_la-imageIO.lo] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1
- a build error with
imageIO
seems to be quite unrelated to "Compilation issues with new model loader", so seems to be somewhat off-topic :-) - yes, i had this problem on my "El Capitan" VM as well (but since you were complaining about model-related problems, i did not further investigate)
the big question however, is:
- have you been able to build Gem on that machine previously? (that is: before the model-changes; but apparently after additions like
imageIO
) - if so, could you
git bisect
to find out where an incompatible change was introduced?
another quick guess: afaict the error comes from an outdated libtool
binary that does not have ObjectiveC++ support (and therefore fails to guess the correct compiler).
probably you have to update your libtool
and automake
installations (via brew
).
this is plain conjecture.
i think i'm going to close this, as i'm not able to reproduce it (and Gem builds fine on my CI)