Having trouble with CMAKE on OptiX 7.1 installing

Hi,

OptiX 7.1.0 works great with my application. But now I wanted to checkout the new curve primitives (optixHair sample) but I have trouble setting up the samples project.
I followed the steps in INSTALL-WIN.txt;
In CMAKE I used a copy of the contents in “C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.1.0\SDK” as source.
And added a “build” folder into that directory.

CUDA 11.0 was correctly found; also VS 2015 64bit (to force the use of v140 toolset);
OptiX_DIR was not found even after I added it there; which specific folder is required there?

CMAKE OutPut:

Selecting Windows SDK version 10.0.14393.0 to target Windows 10.0.19041.
The C compiler identification is MSVC 19.0.24218.2
The CXX compiler identification is MSVC 19.0.24218.2
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Detecting C compile features
Detecting C compile features - done
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe
Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/x86_amd64/cl.exe -- works
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Detecting CXX compile features
Detecting CXX compile features - done
CMake Error at CMakeLists.txt:132 (include):
  include could not find load file:

    Macros


CMake Error at CMakeLists.txt:134 (include):
  include could not find load file:

    CompilerInfo


CMake Error at CMakeLists.txt:136 (include):
  include could not find load file:

    ConfigCompilerFlags


Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.0 (found suitable version "11.0", minimum required is "5.0") 
CMake Error at CMakeLists.txt:235 (find_package):
  By not providing "FindOptiX.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "OptiX", but
  CMake did not find one.

  Could not find a package configuration file provided by "OptiX" with any of
  the following names:

    OptiXConfig.cmake
    optix-config.cmake

  Add the installation prefix of "OptiX" to CMAKE_PREFIX_PATH or set
  "OptiX_DIR" to a directory containing one of the above files.  If "OptiX"
  provides a separate development package or SDK, be sure it has been
  installed.


Configuring incomplete, errors occurred!

I nowhere found the files OptiXConfig.cmake and optix-config.cmake
There is also no field “CMAKE_PREFIX_PATH”.
Changing the folder in “OptiX_DIR” also does not give any other result. Which exact folder is required there? I tried these folders:
C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.1.0\SDK
C:/ProgramData/NVIDIA Corporation/OptiX SDK 7.1.0\include
C:\ProgramData\NVIDIA Corporation\OptiX SDK 7.1.0
#my custom path#\OptiX7_1

Thank you!


Btw, the link in CMakeLists.txt https://devtalk.nvidia.com/default/board/90/
does not link to this forum here, instead it says: “Sorry, this page may have moved, doesn’t exist or is private.”

My System: OptiX 7.1.0 SDK CUDA 11.0.1 GTX 1050 2GB Win10PRO 64bit (version 2004; build 19041.264) device driver: 451.48 VS2019 v16.6.3 (toolkit v140 of VS2015) MDL SDK 2020.0.1
(no difference after updating VS2019 v16.6.2 to VS2019 v16.6.3)
CMAKE v3.14.4

I see no issues configuring the OptiX 7.1.0 examples using CMake 3.17.3 for either MSVS 2019 or MSVS 2017 and CUDA 10.2. Building the generated solutions in release or debug worked without failures.

Your CMake output says it cannot find the Macros.cmake file, but that lies inside the OptiX SDK 7.1.0\SDK\CMake folder which is added to the CMAKE_MODULE_PATH in line 109 of the examples’ root OptiX SDK 7.1.0\SDK\CMakeLists.txt.
All following errors are irrelevant after that.
I would assume there is either an issue with your build target folder location or the CMake version.

Note that the new optixDenoiser examples is missing inside the OptiX SDK 7.1.0\SDK\CMakeLists.txt. I added it locally in line 381.

For comparison I have OptiX 7.1.0 installed in C:\sdk\OptiX SDK 7.1.0.
I used these as source and target folders for the MSVS 2019 compiler inside the CMake 3.17.3 GUI. Similarly for MSVS 2017.
C:/sdk/OptiX SDK 7.1.0/SDK
C:/sdk/OptiX SDK 7.1.0/SDK/msvs2019

That should work out of the box. Do not use any other CMakeLists.txt inside the individual examples as root. That will miss the necessary setup.

Thank you!
Now it works. CMAKE was not the reason. I simply copied the contents of the SDK sub-folder only and not the full content.
I missed the “…” specified at the end of the “OptiX install dir” field
Now with the full folder content the project was successfully built. Last time I did this obviously was too long ago, I simply did not remember it. Sorry.

I think you meant line 381 (not 318). Adding it there works for me.

Thank you!

Oh, yes, that as a typo. It’s in line 381. I’ll edit it above.