Feedback

What's your question?

By: [ Editor ] Asked from United Kingdom

Compiling Shake plugins on newer Linux distributions

I've had a bit of a problem for a while - we're currently OSX-based, and I've got a number of Shake plugins that I've written, all of which work fine (well, apart from the odd bug here and there) on OSX.

We're now in the process of slowly moving over to Linux, and I've been working on getting the plugins compiled for that.

We're using Centos 5.3 here.

My problem comes when I try to compile them - Shake recommends using GCC 4.0.0 for compiling, but Centos 5.3 only comes with 3.4.6 and 4.1.2 installed.

When I try to compile using 3.4.6, I get:

$ /usr/bin/g++34 -o ColourTransform.so -shared source/colourTransformNode.os source/colourTransformPlugin.os -L/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/lib -lnrfx_lx -lnrcc_lx -lnrui_lx -lnrgl_lx -lm -lpthread -ldl -lstdc++
/usr/bin/ld: skipping incompatible  /mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/lib/libnrfx_lx.so when searching for -lnrfx_lx
/usr/bin/ld: cannot find -lnrfx_lx

And when I try to compile using 4.1.2, I get:

$ /usr/bin/g++ -o source/colourTransformNode.os -c -Wno-deprecated -fomit-frame-pointer -D_REENTRANT -D__SMP__ -D_FILE_OFFSET_BITS=64 -DNDEBUG -pipe -m32 -O2 -I/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc -I/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrfx -I/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrgl -I/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrui -I/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrux -Isource -fPIC source/colourTransformNode.cpp
/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc/NRiHashTable.h:261: error: non-template ‘Entry’ used as template
/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc/NRiHashTable.h:261: note: use ‘NRiHashTable<T>::template Entry’ to indicate that it is a template
/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc/NRiHashTable.h: In member function ‘void NRiHashIterator<T>::reset()’:
/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc/NRiHashTable.h:281: error: ‘e’ was not declared in this scope
/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc/NRiHashTable.h: In member function ‘void NRiHashIterator<T>::next()’:
/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc/NRiHashTable.h:290: error: ‘e’ was not declared in this scope
/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc/NRiHashTable.h: In member function ‘bool NRiHashIterator<T>::valid() const’:
/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc/NRiHashTable.h:297: error: ‘e’ was not declared in this scope
/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc/NRiHashTable.h: In member function ‘const NRiName& NRiHashIterator<T>::key() const’:
/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc/NRiHashTable.h:303: error: ‘e’ was not declared in this scope
/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc/NRiHashTable.h: In member function ‘T NRiHashIterator<T>::value() const’:
/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc/NRiHashTable.h:309: error: ‘e’ was not declared in this scope

I've spent a lot of time trying to get GCC 4.0.0 installed, but this is proving very difficult, and the systems people who I've spoken to have said that this would be very difficult to manage.

Any solutions?

Add comment viewed 273 times Latest activity 7 months ago

or Cancel

2 answers

  • 0

hugh_gid [ Editor ]

Okay, so I posted the question above already knowing the answer, but I thought it would be good to have the solution on here:

Solution comes courtesy of Tom Parker, whose email address I won't be posting on here, as he doesn't know that I'm passing his solution on (yet)


The 4.1.2 issue looks like http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29469 which is fixed for 4.3 and 4.4 (not sure which of the 4.3.x offhand, but certainly the latest). Bug crept in somewhere in the 4.1 development phase, hence why 4.0 works. There appears to be some ambiguity regarding part of the C++ standards, which has now been resolved by the relevant committee.... As a workaround, doing the hint suggested in the error messages

/mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/sdk/include/nrcc/NRiHashTable.h:261: note: use 'NRiHashTable<T>::template Entry' to indicate that it is a template

should fix things i.e. change the line which I think says "Entry e" to "NRiHashTable::template Entry e" should work.

The 3.4 error issue is

/usr/bin/ld: skipping incompatible /mount/nvizible_applications/centos.linux.x86_64/shake/shake.4.10.0606/lib/libnrfx_lx.so when searching for -lnrfx_lx

"skipping incompatible" means "not for this architecture" i.e. that's a 32-bit library when you're compiling for 64-bit. Would suggest adding "-m32" to your SConstruct file to compile for 32-bit. You'll need also to clean the build (and thus remove all the 64-bit object files) and make sure the machine has the compatibility libraries for doing 32-bit stuff on a 64-bit machine (think they're the series of packages called compat-* on Centos) before continuing.

Hopefully that should solve the issues :-)


I found that just adding -m32 to my link command, and using 3.4.6 solved my problem. Thanks Tom, and I hope other people find this useful.

or Cancel
  • 1

piotr_44

is 3.4.6 ABI compatible with 4.0?

NN comments
hugh_gid
-

Apparently so. I’m told (by the same person who assisted me above) that there was a major change between 3.3 and 3.4. 3.4 onwards should, apparently be compatible.

hugh_gid
-

My plugins compiled under 3.4 work just fine with shake 4.0

or Cancel