Closed LivelyLiz closed 2 years ago
FWIW, I recently had a similar issue where owl just wouldn't recognize the build type being set at all. At that time I was in a hurry though and couldn't really investigate what was going on.
I wonder if this is related to the language no longer being C CXX
in cmake, but CUDA
. I believe that the behavior changed around the time when we switched the language settings in cmake, but haven't gotten around to investigate any further. (I was able to work my way around by setting host compiler flags through CUDA_NVCC_FLAGS
then.)
You could maybe check for the compiler flags being set using make VERBOSE=1
when the APIContext.cpp
is built, if you wanted to do some more digging. In Release
mode I'd also expect flags like -O3
ending up on the command line.
I don't know what I did differently this time or if I didn't save my changes to the CMakeLists.txt or something but most of the info output is gone now with setting Cmake to Release mode (sorry about that)... The only thing that remains is the output informing about deleting objects. Looking into APIContext.cpp
, line 63 and 64, this output is not affected by any flag, it's just plain std::cout
instead of using the LOG
macro which checks if logging is active. Don't know if this is intended or not but it seems a bit weird. If it is intended, you can consider the issue closed.
PS. The flag gets set
[ 12%] Building CXX object deps/build/owl/CMakeFiles/owl_static.dir/APIContext.cpp.o
cd <project path>/build/deps/build/owl && /usr/bin/c++
-I/usr/local/cuda-11.4/include -Ihome/Programs/NVIDIA-OptiX-SDK-7.3.0-linux64-x86_64/include
-I<project path>/build/_deps/owl-src/owl/include
-I<project path>/build/_deps/owl-src
-I<project path>/build/_deps/owl-src/owl
--std=c++11 -O3 -DNDEBUG -fPIC -std=c++11 -o CMakeFiles/owl_static.dir/APIContext.cpp.o
-c <project path>/build/_deps/owl-src/owl/APIContext.cpp
The latter is clearly a bug (well, more 'lazyness', i guess); in release mode there shouldn't be any outputs on the console. If anybody can reproduce a case where dbg outputs get unintendedly turned on in release mode please share - that would be very important to track down.
Just fixing this in release-1.1 branch; not that the push will automatically close this issue once it happens - please feel free to reopen if any more of these issues appear... i'd certainly like to get them all.
Is there a way to disable the console output? I tried some things but they didn't work as I hoped. I describe my approach below (TL;DR I tried setting
CMAKE_BUILD_TYPE=Release
andNDEBUG
but still have logging output)What I did: I made a project with Owl as dependency via CPM. Currently I am toying around a bit to get my project find Cuda, Optix and Owl, so I used a modified sample s01 as project base to load a model (consisting of a lot of meshes), render an image then close the program. However, when the program closes it spams the console with a warning (?)
and a list consisting of all 265 things that probably should have been released and then a message
for each of those 265 things again.
In the source code (
context.h
), I found that the logging happens in the context and should be disabled whenNDEBUG
is defined, which is usually the case when using cmake with the-DCMAKE_BUILD_TYPE=Release
flag. But neither using this flag, nor settingNDEBUG
explicitly disables the logging for my project. CPM only downloads the source, I add owl in the way described in the README, so CPM shouldn't be the problem here.I use Ubuntu 20.04, g++ 9.3.0 and the latest commit from the master branch of owl. For reference, this is how I add owl to my project
and I call cmake with
cmake -DOptiX_INSTALL_DIR=$HOME/Programs/NVIDIA-OptiX-SDK-7.3.0-linux64-x86_64 -DCMAKE_BUILD_TYPE=Release ..