System:
OS: OpenSuse 42.3
GPU: Quadro M5000M
Driver: 418.30
RAM: 32G
CPU: Intel(R) Core™ i7-6920HQ CPU @ 2.90GHz
OptiX: 6.0.0
CUDA: 10.0
NVCC Build Settings: -m64 --use_fast_math -arch=sm_30 -DNVCC
Hi!
Recently, I’ve been updating our build system and in the process, I rewrote the linking of OptiX into our project. I’m using custom build targets for OptiX -
add_library(OptiX::IncludeOnly INTERFACE IMPORTED)
set_target_properties(OptiX::IncludeOnly PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${CUDA_TOOLKIT_INCLUDE}
)
add_library(OptiX::Sutil SHARED IMPORTED)
set_target_properties(OptiX::Sutil PROPERTIES
IMPORTED_LOCATION ${_IMPORT_PREFIX}/SDK-precompiled-samples/libsutil.so
INTERFACE_INCLUDE_DIRECTORIES ${_IMPORT_PREFIX}/SDK/sutil/
)
add_library(OptiX::SutilSDK SHARED IMPORTED)
set_target_properties(OptiX::SutilSDK PROPERTIES
IMPORTED_LOCATION ${_IMPORT_PREFIX}/SDK-precompiled-samples/libsutil_sdk.so
INTERFACE_INCLUDE_DIRECTORIES ${_IMPORT_PREFIX}/SDK/sutil/
)
add_library(OptiX::Cudnn SHARED IMPORTED)
set_target_properties(OptiX::Cudnn PROPERTIES
IMPORTED_LOCATION ${_IMPORT_PREFIX}/lib64/libcudnn.so
INTERFACE_INCLUDE_DIRECTORIES ${_IMPORT_PREFIX}/include
)
add_library(OptiX::Denoiser SHARED IMPORTED)
set_target_properties(OptiX::Denoiser PROPERTIES
IMPORTED_LOCATION ${_IMPORT_PREFIX}/lib64/liboptix_denoiser.so
INTERFACE_INCLUDE_DIRECTORIES ${_IMPORT_PREFIX}/include
)
add_library(OptiX::Prime SHARED IMPORTED)
set_target_properties(OptiX::Prime PROPERTIES
IMPORTED_LOCATION ${_IMPORT_PREFIX}/lib64/liboptix_prime.so
INTERFACE_INCLUDE_DIRECTORIES ${_IMPORT_PREFIX}/include
)
add_library(OptiX::Main SHARED IMPORTED)
set_target_properties(OptiX::Main PROPERTIES
IMPORTED_LOCATION ${_IMPORT_PREFIX}/lib64/liboptix.so
INTERFACE_INCLUDE_DIRECTORIES ${_IMPORT_PREFIX}/include
)
add_library(OptiX::OptixU SHARED IMPORTED)
set_target_properties(OptiX::OptixU PROPERTIES
IMPORTED_LOCATION ${_IMPORT_PREFIX}/lib64/liboptixu.so
INTERFACE_INCLUDE_DIRECTORIES ${_IMPORT_PREFIX}/include
)
Now I have the problem that fminf, fmaxf, copysignf are clashing with other math function on the OS.
In file included from /home/VIRES/ViresDependencies/OptiX/NVIDIA-OptiX-SDK-6.0.0-linux64/include/optix_world.h:70:0,
from /home/VIRES/VIG_cmake/VIG/VigFramework/inc/VigFramework/ShmLayoutOptiX.h:80,
from /home/VIRES/VIG_cmake/VIG/VigFramework/inc/VigFramework/RDBInterface.h:14,
from /home/VIRES/VIG_cmake/VIG/VigApplications/vigcar/src/VCarHDRRenderer.h:10,
from /home/VIRES/VIG_cmake/VIG/VigApplications/Showroom/src/ViewerWidget.h:19,
from /home/VIRES/VIG_cmake/VIG/VigApplications/Showroom/src/dialogs/DialogShowroom.h:16,
from /home/VIRES/VIG_cmake/VIG/VigApplications/Showroom/src/dialogs/DialogShowroom.cpp:1:
/home/VIRES/ViresDependencies/OptiX/NVIDIA-OptiX-SDK-6.0.0-linux64/include/optixu/optixu_math_namespace.h: In function ‘float copysignf(float, float)’:
/home/VIRES/ViresDependencies/OptiX/NVIDIA-OptiX-SDK-6.0.0-linux64/include/optixu/optixu_math_namespace.h:183:63: error: declaration of ‘float copysignf(float, float)’ has a different exception specifier
OPTIXU_INLINE float copysignf(const float dst, const float src)
In file included from /home/VIRES/ViresDependencies/OptiX/NVIDIA-OptiX-SDK-6.0.0-linux64/include/optix_world.h:70:0,
from /home/VIRES/VIG_cmake/VIG/VigFramework/inc/VigFramework/ShmLayoutOptiX.h:80,
from /home/VIRES/VIG_cmake/VIG/VigFramework/inc/VigFramework/RDBInterface.h:14,
from /home/VIRES/VIG_cmake/VIG/VigApplications/vigcar/src/VCarHDRRenderer.h:10,
from /home/VIRES/VIG_cmake/VIG/VigApplications/Showroom/src/ViewerWidget.h:19,
from /home/VIRES/VIG_cmake/VIG/VigApplications/Showroom/src/dialogs/DialogShowroom.h:16,
from /home/VIRES/VIG_cmake/VIG/VigApplications/Showroom/src/dialogs/DialogShowroom.cpp:1:
/home/VIRES/ViresDependencies/OptiX/NVIDIA-OptiX-SDK-6.0.0-linux64/include/optixu/optixu_math_namespace.h: In function ‘float fmaxf(float, float)’:
/home/VIRES/ViresDependencies/OptiX/NVIDIA-OptiX-SDK-6.0.0-linux64/include/optixu/optixu_math_namespace.h:177:55: error: declaration of ‘float fmaxf(float, float)’ has a different exception specifier
OPTIXU_INLINE float fmaxf(const float a, const float b)
^
In file included from /usr/include/c++/4.8/cmath:44:0,
from /home/VIRES/ViresDependencies/OpenSceneGraph/OpenSceneGraph-3.6.3/include/osg/Math:17,
from /home/VIRES/ViresDependencies/OpenSceneGraph/OpenSceneGraph-3.6.3/include/osg/Vec2f:17,
from /home/VIRES/ViresDependencies/OpenSceneGraph/OpenSceneGraph-3.6.3/include/osg/Vec2d:17,
from /home/VIRES/ViresDependencies/OpenSceneGraph/OpenSceneGraph-3.6.3/include/osg/Vec3d:17,
from /home/VIRES/ViresDependencies/OpenSceneGraph/OpenSceneGraph-3.6.3/include/osg/Matrixd:18,
from /home/VIRES/ViresDependencies/OpenSceneGraph/OpenSceneGraph-3.6.3/include/osg/Matrix:18,
from /home/VIRES/ViresDependencies/OpenSceneGraph/OpenSceneGraph-3.6.3/include/osgGA/GUIEventAdapter:18,
from /home/VIRES/VIG_cmake/VIG/VigFramework/inc/VigFramework/VIGCommon.h:14,
from /home/VIRES/VIG_cmake/VIG/VigFramework/inc/VigFramework/IGComponent.h:6,
from /home/VIRES/VIG_cmake/VIG/VigApplications/Showroom/src/Showroom.h:4,
from /home/VIRES/VIG_cmake/VIG/VigApplications/Showroom/src/ShowroomController.h:4,
from /home/VIRES/VIG_cmake/VIG/VigApplications/Showroom/src/dialogs/DialogShowroom.h:14,
from /home/VIRES/VIG_cmake/VIG/VigApplications/Showroom/src/dialogs/DialogShowroom.cpp:1:
/usr/include/bits/mathcalls.h:348:1: error: from previous declaration ‘float fmaxf(float, float) throw ()’
__MATHCALLX (fmax,, (_Mdouble_ __x, _Mdouble_ __y), (__const__));
I could fix the problem by removing the 3 functions from optixu_math_namespace.h, but I’m seriously wondering if this is the right approach. I saw some other oprojects having the same issue - Ignition Rendering: Ignition Rendering - but this does not look like a proper fix to me. It would be great to see a suggestion from the OptiX comunity and the NVIDIA guys :)
Thanks a lot!
Jakub