RenderKit / ospray

An Open, Scalable, Portable, Ray Tracing Based Rendering Engine for High-Fidelity Visualization
http://ospray.org
Apache License 2.0
997 stars 182 forks source link

CMake ADD_LIBRARY issue #402

Closed RomboDev closed 4 years ago

RomboDev commented 4 years ago

Hi there ! I keep having this issue with CMake (3.10.2) while trying to compile ospray ..

"You have called ADD_LIBRARY for library ospray_module_ispc without any source files. This typically indicates a problem with your CMakeLists.txt file"

ISPC version is the latest 1.12.0 and is set manually with ISPC_EXECUTABLE CMake entry. Compilation goes well. But then starting the opsExamples app I get ..

"#ospray: INITIALIZATION ERROR --> could not open module lib ospray_module_ispc: libospray_module_ispc.so: cannot open shared object file: No such file or directory"

However all libraries are there and by 'ldd' them I see no missing deps.

This was by compiling everything from scratch on Linux-Ubuntu 18.04.3.

Then I tried the superbuild but with the same exact results both in the CMake configure and ospray run.

jeffamstutz commented 4 years ago

Hi,

This isn't a problem, I think CMake 3.10 reports this incorrectly and can be ignored. We can look into silencing the warning though.

OSPRay dynamically loads which backend it intends on using at runtime, so libospray_module_ispc.so itself will need to be on your LD_LIBRARY_PATH (including its dependencies). Thus the initialization error is that dlopen() didn't find the ispc module library. If you set LD_LIBRARY_PATH, does it work for you?

RomboDev commented 4 years ago

Yeah sorry.

I had setup the folder structure like in the precompiled assets I initially downloaded and there it was working without the LD_LIBRARY_PATH so I thought you were setting some relative path from the compiler and then forgot to set up the environment properly.

Now all works. Thanks a bunch !