RenderKit / oidn

Intel® Open Image Denoise library
https://www.openimagedenoise.org/
Apache License 2.0
1.77k stars 164 forks source link

oidn fails to build due to linking issue on linux #77

Closed david-geiger closed 4 years ago

david-geiger commented 4 years ago

Hi,

I tried to compile oidn 1.2.0 on Mageia linux but it fails to build due to a linking issue:

localcore/output_reorder.dev_avx512skx.o localcore/output_reorder.dev_avx512knl.o libcommon.a libdnnl_common.a libdnnl_cpu.a libdnnl_common.a -lpthread -ltbb -ltbbmalloc /usr/bin/ld: libdnnl_cpu.a(jitprofiling.c.o): in function loadiJIT_Funcs': /home/iurt/rpmbuild/BUILD/oidn-1.2.0/mkl-dnn/src/cpu/jit_utils/jitprofiling/jitprofiling.c:178: undefined reference todlclose' /usr/bin/ld: /home/iurt/rpmbuild/BUILD/oidn-1.2.0/mkl-dnn/src/cpu/jit_utils/jitprofiling/jitprofiling.c:233: undefined reference to dlopen' /usr/bin/ld: /home/iurt/rpmbuild/BUILD/oidn-1.2.0/mkl-dnn/src/cpu/jit_utils/jitprofiling/jitprofiling.c:258: undefined reference todlsym' /usr/bin/ld: /home/iurt/rpmbuild/BUILD/oidn-1.2.0/mkl-dnn/src/cpu/jit_utils/jitprofiling/jitprofiling.c:269: undefined reference to dlsym' /usr/bin/ld: /home/iurt/rpmbuild/BUILD/oidn-1.2.0/mkl-dnn/src/cpu/jit_utils/jitprofiling/jitprofiling.c:242: undefined reference todlopen' collect2: error: ld returned 1 exit status

Full build log: build.0.20200601084908.log

Regards, David

david-geiger commented 4 years ago

Seems that 'list(APPEND EXTRA_SHARED_LIBS "${CMAKE_DL_LIBS}")' in mkl-dnn/src/CMakeLists.txt doesq not work as it should.

david-geiger commented 4 years ago

Ok this patch fixes underlinking build issue:

--- a/cmake/oidn_dnnl.cmake +++ b/cmake/oidn_dnnl.cmake @@ -52,7 +52,7 @@ if(WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Intel") endif() target_compile_options(dnnl_common PRIVATE ${DNNL_COMPILE_OPTIONS})

-target_link_libraries(dnnl_common PUBLIC ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES}) +target_link_libraries(dnnl_common PUBLIC ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} ${TBB_LIBRARIES})

atafra commented 4 years ago

Hi! Thanks for reporting the issue and the patch! This is actually already fixed in the devel branch in a platform-independent way. Sorry for the delayed response. The CMake files in the mkl-dnn directory are not used by OIDN.