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

Build error #1

Open
pkestene opened this issue Apr 11, 2023 · 2 comments
Open

Build error #1

pkestene opened this issue Apr 11, 2023 · 2 comments

Comments

@pkestene
Copy link

Hi,

here are two minor build issues that seem to be related with compiler version (I'm using gnu 11 on my host, and cuda 12), and those minor issues can be fixed easily

  • function saturate
-- Generating /home/kestenerp/install/nvidia/optix/github/owlExaBrick_pk/_build/cuda-12.1-optix-7.0/submodules/owl/owl/CMakeFiles/owl_static.dir//./owl_static_generated_UserGeom.cu.o
/usr/local/cuda-12.1/bin/nvcc /home/kestenerp/install/nvidia/optix/github/owlExaBrick_pk/submodules/owl/owl/UserGeom.cu -dc -o /home/kestenerp/install/nvidia/optix/github/owlExaBrick_pk/_build/cuda-12.1-optix-7.0/submodules/owl/owl/CMakeFiles/owl_static.dir//./owl_static_generated_UserGeom.cu.o -ccbin /usr/bin/cc -m64 --std c++11 -Xcompiler ,\"-g\" --compiler-options -fPIC -DNVCC -I/home/kestenerp/install/nvidia/optix/github/owlExaBrick_pk/submodules/owl/owl/include -I/home/kestenerp/install/nvidia/optix/github/owlExaBrick_pk/submodules/owl/owl -I/usr/local/cuda-12.1/include -I/home/kestenerp/local/optix-7.0.0/NVIDIA-OptiX-SDK-7.0.0-linux64/include -I/home/kestenerp/install/nvidia/optix/github/owlExaBrick_pk/submodules/owl
/home/kestenerp/install/nvidia/optix/github/owlExaBrick_pk/submodules/owl/owl/include/owl/common/owl-common.h(154): error: the global scope has no "saturate"
      using ::saturate;
              ^

I saw that this has already been fixed in upstream owl (October 2022, owl-project/owl@ef3f473). Currently, updating the owl submodule brings other build issues related to optix version (that be dealt in a separated issue)

  • the second minor problem is just a missing include, and replacing strtok by std::strtok it builds fine.
/home/kestenerp/install/nvidia/optix/github/owlExaBrick_pk/exa/Config.cpp: In static member function ‘static exa::Config::SP exa::Config::parseConfigFile(const string&)’:
/home/kestenerp/install/nvidia/optix/github/owlExaBrick_pk/exa/Config.cpp:73:19: error: ‘strtok’ was not declared in this scope; did you mean ‘strtoq’?
   73 |       char *tok = strtok(line," \t\n\r");
      |                   ^~~~~~
      |                   strtoq
@ingowald
Copy link
Contributor

Leaving @szellmann to deal with the code itself, but one question: "std::strtok" doesn't sound right !? strtok is a posix C function, it shouldn't even know what a namespace is!?!? Might need to include string.h to get it, but it should never be in a std:: namespace? confused :)

@pkestene
Copy link
Author

pkestene commented Apr 11, 2023

I think you need to either include <string.h> (C header, fine using strtok) or either include <cstring> (which brings back into std namespace the c function, and in that case, the full name is std::strtok).

I was suggesting to include <cstring>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants