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

Linux: undefined symbol problem when loading hdCycles.so #3

Closed
sherholz opened this issue Aug 19, 2020 · 1 comment · Fixed by #5
Closed

Linux: undefined symbol problem when loading hdCycles.so #3

sherholz opened this issue Aug 19, 2020 · 1 comment · Fixed by #5
Labels
build Issues around building

Comments

@sherholz
Copy link
Contributor

Hi,

I am trying to run hdCycles under Ubuntu20.04 with USD20.08 and the current version of cycles (master branch).
Everything compiles without any problems but when I try to activate hdCycles in usdview I get the following error:

'Failed to load plugin 'hdCycles': /home/sherholz/USD20.08-local/plugin/usd/hdCycles.so: undefined symbol: _ZN3ccl9BVHParams15best_bvh_layoutENS_15KernelBVHLayoutEi in '/home/sherholz/USD20.08-local/plugin/usd/hdCycles.so''

As described in the documentation I compiled cycles with the:

-DCMAKE_POSITION_INDEPENDENT_CODE=ON

option turned on.
Plotting the linking command for hdCycles it looks like the corresponding cycles libraries are linked correctly:

[ 72%] Linking CXX shared library hdCycles.so
cd /home/sherholz/Develop/hdcycles/build/plugin/hdCycles && /usr/bin/cmake -E cmake_link_script CMakeFiles/hdCycles.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -std=c++11 -Wall -Wno-deprecated -Wno-deprecated-declarations -Wno-unused-local-typedefs -O3 -DNDEBUG -shared -Wl,-soname,hdCycles.so -o hdCycles.so CMakeFiles/hdCycles.dir/Mikktspace/mikktspace.c.o CMakeFiles/hdCycles.dir/basisCurves.cpp.o CMakeFiles/hdCycles.dir/camera.cpp.o CMakeFiles/hdCycles.dir/instancer.cpp.o CMakeFiles/hdCycles.dir/light.cpp.o CMakeFiles/hdCycles.dir/material.cpp.o CMakeFiles/hdCycles.dir/mesh.cpp.o CMakeFiles/hdCycles.dir/points.cpp.o CMakeFiles/hdCycles.dir/renderDelegate.cpp.o CMakeFiles/hdCycles.dir/rendererPlugin.cpp.o CMakeFiles/hdCycles.dir/renderPass.cpp.o CMakeFiles/hdCycles.dir/renderParam.cpp.o CMakeFiles/hdCycles.dir/config.cpp.o CMakeFiles/hdCycles.dir/renderBuffer.cpp.o CMakeFiles/hdCycles.dir/utils.cpp.o -Wl,-rpath,/home/sherholz/USD20.08-local/lib::::::::::::::::::...
...
...
/home/sherholz/Develop/cycles/build/lib/libcycles_bvh.a /home/sherholz/Develop/cycles/build/lib/libcycles_device.a /home/sherholz/Develop/cycles/build/lib/libcycles_graph.a /home/sherholz/Develop/cycles/build/lib/libcycles_kernel.a /home/sherholz/Develop/cycles/build/lib/libcycles_render.a /home/sherholz/Develop/cycles/build/lib/libcycles_subd.a /home/sherholz/Develop/cycles/build/lib/libcycles_util.a /home/sherholz/Develop/cycles/build/lib/libextern_clew.a /home/sherholz/Develop/cycles/build/lib/libextern_cuew.a /home/sherholz/Develop/cycles/build/lib/libextern_numaapi.a
...
...

Any ideas or am I missing something essential?

@sherholz
Copy link
Contributor Author

Hi,
I solved the problem by rearranging the order in which the cycles libraries are linked in.
The cycles_bvh library was linked first but the functions provided by it are used by a later library (i.e., cycles_render).

I filed a pull request with a patch for that problem (#5)

@bfloch bfloch added the build Issues around building label Aug 21, 2020
@Vochsel Vochsel closed this as completed in #5 Sep 1, 2020
Vochsel added a commit that referenced this issue Sep 1, 2020
Fixing the undefined symbol problem under Linux (gcc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues around building
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants