ubuntu22.04编译PBRT-v4

3 篇文章 0 订阅
1 篇文章 0 订阅

CMake 阶段:

报错:

1. 执行Cmake

cmake ../

:
-- The CXX compiler identification is GNU 11.2.0
-- The C compiler identification is GNU 11.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Setting build type to 'Release' as none was specified.
-- Found Git: /usr/bin/git (found version "2.34.1")
-- OpenEXR at commit: 5cfb5dab6dfada731586b0281bdb15ee75e26782
-- OpenVDB at commit: 414bed84c2fc22e188eac7b611aa85c7edd7a5a9
-- Ptex at commit: 4cd8e9a6db2b06e478dfbbd8c26eb6df97f84483
-- double-conversion at commit: cc1f75a114aca8d2af69f73a5a959aecbab0e87a
-- filesystem at commit: c5f9de30142453eb3c6fe991e82dfc2583373116
-- glfw at commit: 4cb36872a5fe448c205d0b46f0e8c8b57530cfe0
-- libdeflate at commit: 1fd0bea6ca2073c68493632dafc4b1ddda1bcbc3
-- lodepng at commit: 8c6a9e30576f07bf470ad6f09458a2dcd7a6a84a
-- qoi at commit: 028c75fd26e5e0758c7c711216c00404994c1ad3
-- stb at commit: af1a5bc352164740c1cc1354942b1c6b72eacb8a
-- utf8proc at commit: 2484e2ed5e1d9c19edcccf392a7d9920ad90dfaf
-- zlib at commit: 54d591eabf9fe0e84c725638f8d5d8d202a093fa
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
CMake Error at /snap/cmake/1153/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY
  OPENGL_INCLUDE_DIR)
Call Stack (most recent call first):
  /snap/cmake/1153/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)
  /snap/cmake/1153/share/cmake-3.24/Modules/FindOpenGL.cmake:443 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:79 (find_package)


-- Configuring incomplete, errors occurred!

解决方法:

sudo apt-get install libgl1-mesa-dev

2. 再次 执行Cmake

cmake ../

-- OpenEXR at commit: 5cfb5dab6dfada731586b0281bdb15ee75e26782
-- OpenVDB at commit: 414bed84c2fc22e188eac7b611aa85c7edd7a5a9
-- Ptex at commit: 4cd8e9a6db2b06e478dfbbd8c26eb6df97f84483
-- double-conversion at commit: cc1f75a114aca8d2af69f73a5a959aecbab0e87a
-- filesystem at commit: c5f9de30142453eb3c6fe991e82dfc2583373116
-- glfw at commit: 4cb36872a5fe448c205d0b46f0e8c8b57530cfe0
-- libdeflate at commit: 1fd0bea6ca2073c68493632dafc4b1ddda1bcbc3
-- lodepng at commit: 8c6a9e30576f07bf470ad6f09458a2dcd7a6a84a
-- qoi at commit: 028c75fd26e5e0758c7c711216c00404994c1ad3
-- stb at commit: af1a5bc352164740c1cc1354942b1c6b72eacb8a
-- utf8proc at commit: 2484e2ed5e1d9c19edcccf392a7d9920ad90dfaf
-- zlib at commit: 54d591eabf9fe0e84c725638f8d5d8d202a093fa
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
CMake Warning (dev) at src/ext/libdeflate/CMakeLists.txt:12 (option):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, option is clearing the
  normal variable 'BUILD_SHARED_LIBS'.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Performing Test DEFLATE_LINT_WALL
-- Performing Test DEFLATE_LINT_WALL - Success
-- Performing Test DEFLATE_LINT_WUNDEF
-- Performing Test DEFLATE_LINT_WUNDEF - Success
-- Performing Test DEFLATE_LINT_PEDANTIC
-- Performing Test DEFLATE_LINT_PEDANTIC - Success
-- Performing Test DEFLATE_LINT_DECLARATION_AFTER_STATEMENT
-- Performing Test DEFLATE_LINT_DECLARATION_AFTER_STATEMENT - Success
-- Performing Test DEFLATE_LINT_MISSING_PROTOTYPES
-- Performing Test DEFLATE_LINT_MISSING_PROTOTYPES - Success
-- Performing Test DEFLATE_LINT_STRICT_PROTOTYPES
-- Performing Test DEFLATE_LINT_STRICT_PROTOTYPES - Success
-- Performing Test DEFLATE_LINT_VLA
-- Performing Test DEFLATE_LINT_VLA - Success
-- Performing Test DEFLATE_LINT_IMPLICIT_FALLTHROUGH
-- Performing Test DEFLATE_LINT_IMPLICIT_FALLTHROUGH - Success
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
-- Could NOT find Imath (missing: Imath_DIR)
-- Could NOT find IlmBase (missing: IlmBase_DIR)
-- Could NOT find OpenEXR (missing: OpenEXR_DIR)

-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2")
-- Could NOT find OpenEXR: Found unsuitable version "1.6.1", but required is at least "2.3" (found ILMBASE_INCLUDE_PATH-NOTFOUND)
-- OpenEXR not found; building it from scratch.
-- Configure ILMBASE Version: 2.5.3 Lib API: 25.0.2
-- Looking for include file ucontext.h
-- Looking for include file ucontext.h - found
-- Performing Test ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT
-- Performing Test ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT - Success
-- Looking for include file semaphore.h
-- Looking for include file semaphore.h - found
-- Looking for sem_init in pthread
-- Looking for sem_init in pthread - found
-- Configure OpenEXR Version: 2.5.3 Lib API: 25.0.2
-- Performing Test OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN
-- Performing Test OPENEXR_IMF_HAVE_SYSCONF_NPROCESSORS_ONLN - Success
-- Performing Test OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX
-- Performing Test OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX - Success
-- clang-format not found.
CMake Deprecation Warning at src/ext/ptex/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Including X11 support
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
CMake Error at src/ext/glfw/src/CMakeLists.txt:192 (message):
  RandR headers not found; install libxrandr development package


-- Configuring incomplete, errors occurred!
See also "/media/liusheng/Projects/projects/game_engines/pbrt/mmp/pbrt-v4/2022/20220818/build_ubuntu_22.04/CMakeFiles/CMakeOutput.log".

解决方法:

安装libxrandr-dev

apt-get install libxrandr-dev doxygen clang libopenexr-dev

3.

-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Including X11 support
CMake Error at src/ext/glfw/src/CMakeLists.txt:210 (message):
  Xcursor headers not found; install libxcursor development package

解决:

apt-get install libxcursor-dev

4.

CMake Error at src/ext/glfw/src/CMakeLists.txt:216 (message):
  XInput headers not found; install libxi development package

解决:

apt-get install libxi-dev

5.

-- Could NOT find OpenEXR (missing: OpenEXR_DIR)

下载,编译,安装

GitHub - AcademySoftwareFoundation/openexr: The OpenEXR project provides the specification and reference implementation of the EXR file format, the professional-grade image storage format of the motion picture industry.

6. 

-- clang-format not found.

apt-get install clang-format clang-tidy mtd-utils

7. 
-- Could NOT find Imath (missing: Imath_DIR)

下载,编译,安装

GitHub - AcademySoftwareFoundation/Imath: Imath is a C++ and python library of 2D and 3D vector, matrix, and math operations for computer graphics

8. 
-- Unable to find -lprofiler

apt-get install google-perftools libgoogle-perftools-dev

9.

-- CUDA not found

解决:

CMakeLists.txt, 21行加入:

set (CMAKE_CUDA_COMPILER $ENV{CUDA_HOME}/bin/nvcc)

#( PS : $ENV{CUDA_HOME}/bin)的值为/usr/local/cuda/bin)

/etc/profile:

export CUDA_HOME=/usr/local/cuda

export PATH=${CUDA_HOME}/bin:$PATH

10.

-- Check for working CUDA compiler: /usr/local/cuda/bin/nvcc - skipped

-- Detected CUDA Architecture: sm_61

12.

CMake Error at /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerId.cmake:726 (message):
  Compiling the CUDA compiler identification source file
  "CMakeCUDACompilerId.cu" failed.

  Compiler: /usr/local/cuda/bin/nvcc

  Build flags:

  Id flags: --keep;--keep-dir;tmp;-gencode=arch=compute_,code=sm_ -v

  The output was:

  1

  nvcc fatal : Unsupported gpu architecture 'compute_'

Call Stack (most recent call first):
  /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerId.cmake:6 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /usr/share/cmake-3.22/Modules/CMakeDetermineCompilerId.cmake:48 (__determine_compiler_id_test)
  /usr/share/cmake-3.22/Modules/CMakeDetermineCUDACompiler.cmake:298 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:216 (enable_language)


-- Configuring incomplete, errors occurred!

13.

CMake Error at /snap/cmake/1153/share/cmake-3.24/Modules/CMakeDetermineCUDACompiler.cmake:277 (message):

CMAKE_CUDA_ARCHITECTURES must be non-empty if set.

Call Stack (most recent call first):

CMakeLists.txt:194 (enable_language)

nvcc fatal : Option '--ptx (-ptx)' is not allowed when compiling for multiple GPU architectures

​ nvcc fatal   : Unsupported gpu architecture 'compute_sm_61'

解决:

CMakeLists.txt: Line 41

if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
   set(CMAKE_CUDA_ARCHITECTURES "61")
endif(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)

build目录下:

rm -rf * 全部删除

重新执行cmake .. 解决!

------------------------------------------------------------------------------------------------------------------------------

make -j8

通过:


[ 79%] Building CUDA object CMakeFiles/pbrt_lib.dir/src/pbrt/gpu/memory.cpp.o
[ 80%] Building CUDA object CMakeFiles/pbrt_lib.dir/src/pbrt/gpu/util.cpp.o
[ 80%] Building CXX object CMakeFiles/pbrt_lib.dir/src/ext/gtest/gtest-all.cc.o
[ 81%] Building CXX object CMakeFiles/pbrt_lib.dir/src/ext/lodepng/lodepng.cpp.o
[ 81%] Building CXX object CMakeFiles/pbrt_lib.dir/src/ext/rply/rply.cpp.o
[ 82%] Linking CUDA device code CMakeFiles/pbrt_lib.dir/cmake_device_link.o
nvlink warning : Skipping incompatible '/usr/lib/x86_64-linux-gnu/librt.a' when searching for -lrt
nvlink warning : Skipping incompatible '/lib/x86_64-linux-gnu/librt.a' when searching for -lrt
nvlink warning : Skipping incompatible '/usr/lib/x86_64-linux-gnu/libpthread.a' when searching for -lpthread
nvlink warning : Skipping incompatible '/lib/x86_64-linux-gnu/libpthread.a' when searching for -lpthread
nvlink warning : Skipping incompatible '/usr/lib/x86_64-linux-gnu/libdl.a' when searching for -ldl
nvlink warning : Skipping incompatible '/lib/x86_64-linux-gnu/libdl.a' when searching for -ldl
[ 82%] Linking CXX static library libpbrt_lib.a
[ 83%] Built target pbrt_lib
[ 83%] Building CXX object CMakeFiles/pbrt_exe.dir/src/pbrt/cmd/pbrt.cpp.o
[ 83%] Building CXX object CMakeFiles/imgtool.dir/src/pbrt/cmd/imgtool.cpp.o
[ 84%] Building CXX object CMakeFiles/pspec.dir/src/pbrt/cmd/pspec.cpp.o
[ 85%] Building CXX object CMakeFiles/plytool.dir/src/pbrt/cmd/plytool.cpp.o
[ 85%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/cmd/pbrt_test.cpp.o
[ 86%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/bsdfs_test.cpp.o
[ 86%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/filters_test.cpp.o
[ 87%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/lights_test.cpp.o
[ 87%] Linking CXX executable pspec
[ 87%] Linking CXX executable plytool
[ 87%] Linking CXX executable pbrt
[ 87%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/lightsamplers_test.cpp.o
[ 87%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/media_test.cpp.o
[ 88%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/parser_test.cpp.o
[ 88%] Built target pspec
[ 88%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/samplers_test.cpp.o
[ 88%] Built target plytool
[ 89%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/shapes_test.cpp.o
[ 89%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/cpu/integrators_test.cpp.o
[ 89%] Built target pbrt_exe
[ 90%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/args_test.cpp.o
[ 90%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/buffercache_test.cpp.o
[ 90%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/color_test.cpp.o
[ 91%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/containers_test.cpp.o
[ 91%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/file_test.cpp.o
[ 92%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/float_test.cpp.o
[ 92%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/hash_test.cpp.o
[ 93%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/image_test.cpp.o
[ 93%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/math_test.cpp.o
[ 94%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/parallel_test.cpp.o
[ 94%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/print_test.cpp.o
[ 94%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/pstd_test.cpp.o
[ 95%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/rng_test.cpp.o
[ 95%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/sampling_test.cpp.o
[ 96%] Linking CXX executable imgtool
[ 97%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/spectrum_test.cpp.o
[ 97%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/splines_test.cpp.o
[ 97%] Built target imgtool
[ 98%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/string_test.cpp.o
[ 98%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/taggedptr_test.cpp.o
[ 98%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/transform_test.cpp.o
[100%] Building CXX object CMakeFiles/pbrt_test.dir/src/pbrt/util/vecmath_test.cpp.o
[100%] Linking CXX executable pbrt_test
[100%] Built target pbrt_test

二.  警告:

1. 

CMake Warning (dev) at src/ext/libdeflate/CMakeLists.txt:12 (option):
  Policy CMP0077 is not set: option() honors normal variables.  Run "cmake
  --help-policy CMP0077" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

  For compatibility with older versions of CMake, option is clearing the
  normal variable 'BUILD_SHARED_LIBS'.
This warning is for project developers.  Use -Wno-dev to suppress it.

解决:CMakeLists.txt: Line 8

set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)

How to force cmake to use the new version of CMP0077 (allow options to be set from variables) - Stack Overflow

Line 10

if(POLICY CMP0077)
   cmake_policy(SET CMP0077 NEW)
endif()

解决cmake Policy CMP0057 is not set: Support new IN_LIST if() operator_policy cmp0148 is not set_Woosual的博客-CSDN博客

2. 

CMake Deprecation Warning at src/ext/ptex/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

解决:

把 cmake_minimum_required(VERSION 2.8)) 里面的版本写高一点,比如改成, cmake_minimum_required(VERSION 3.5.1)

3. 

CMake Warning (dev) in CMakeLists.txt:
  Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
  empty CUDA_ARCHITECTURES not allowed.  Run "cmake --help-policy CMP0104"
  for policy details.  Use the cmake_policy command to set the policy and
  suppress this warning.

  CUDA_ARCHITECTURES is empty for target "optix.cu".
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
  empty CUDA_ARCHITECTURES not allowed.  Run "cmake --help-policy CMP0104"
  for policy details.  Use the cmake_policy command to set the policy and
  suppress this warning.

  CUDA_ARCHITECTURES is empty for target "pbrt_lib".
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
  empty CUDA_ARCHITECTURES not allowed.  Run "cmake --help-policy CMP0104"
  for policy details.  Use the cmake_policy command to set the policy and
  suppress this warning.

  CUDA_ARCHITECTURES is empty for target "pbrt_lib".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
-- Build files have been written to: /media/liusheng/Projects/project/game_engines/pbrt/github

解决:

CMakeLists.txt: Line 41

if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
   set(CMAKE_CUDA_ARCHITECTURES "61")
endif(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)

4.


CMake Warning at CMakeLists.txt:186 (message):
  Found CUDA but PBRT_OPTIX7_PATH is not set.  Disabling GPU compilation.

解决:

/etc/profile:

export PBRT_OPTIX7_PATH=/opt/nvidia/optix/NVIDIA-OptiX-SDK-7.5.0-linux64-x86_64

export PATH=${PBRT_OPTIX7_PATH}:${CUDA_HOME}/bin:$PATH

CMakeLists.txt: Line 20

if (CMAKE_SYSTEM_NAME STREQUAL Windows)
  set (PBRT_OPTIX7_PATH $ENV{OPTIX7_PATH})
elseif (CMAKE_SYSTEM_NAME STREQUAL Linux)
  set (PBRT_OPTIX7_PATH $ENV{PBRT_OPTIX7_PATH})

5.

CMake Warning at cmake/FindOpenEXR.cmake:47 (find_package):
  Could not find a configuration file for package "OpenEXR" that is
  compatible with requested version "2.3".

  The following configuration files were considered but not accepted:

    /usr/local/lib/cmake/OpenEXR/OpenEXRConfig.cmake, version: 3.2.0

Call Stack (most recent call first):
  src/ext/CMakeLists.txt:60 (find_package)


-- Could NOT find OpenEXR (missing: ILMBASE_INCLUDE_PATH OPENEXR_ILMIMF_LIBRARY OPENEXR_HALF_LIBRARY) (found suitable version "3.2.0", minimum required is "2.3")
-- OpenEXR not found; building it from scratch.

6.

CMake Warning (dev) at CMakeLists.txt:186 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake
  --help-policy CMP0146" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

解决:

CMakeLists.txt: Line 18

if(POLICY CMP0146)
   cmake_policy(SET CMP0146 OLD)
endif()

7.

CMake Warning at cmake/FindOpenEXR.cmake:47 (find_package):
  Could not find a configuration file for package "OpenEXR" that is
  compatible with requested version "2.3".

  The following configuration files were considered but not accepted:

    /usr/local/lib/cmake/OpenEXR/OpenEXRConfig.cmake, version: 3.2.0

Call Stack (most recent call first):
  src/ext/CMakeLists.txt:60 (find_package)

可直接忽略,如果系统中安装的不是要求的版本,他会从github上自己下载对应的版本去调用.

不要更改src/ext/CMakeLists.txt里面要求的版本号,编译会报错.

Make 阶段:

1. 

[ 13%] Building CUDA object CMakeFiles/optix.cu.dir/src/pbrt/gpu/optix.ptx
[ 12%] Generating rgbspectrum_aces.cpp
Optimizing ACES2065_1 spectra...
nvcc fatal   : Option '--ptx (-ptx)' is not allowed when compiling for multiple GPU architectures
make[2]: *** [CMakeFiles/optix.cu.dir/build.make:77:CMakeFiles/optix.cu.dir/src/pbrt/gpu/optix.ptx] 错误 1
make[1]: *** [CMakeFiles/Makefile2:737:CMakeFiles/optix.cu.dir/all] 错误 2
make[1]: *** 正在等待未完成的任务....

[ 33%] Building CUDA object CMakeFiles/pbrt_lib.dir/src/pbrt/wavefront/samples.cpp.o
In file included from /media/liusheng/Projects/project/game_engines/pbrt/github/mmp/pbrt-v4/2023/20230717_clone/src/pbrt/gpu/aggregate.h:11,
                 from /media/liusheng/Projects/project/game_engines/pbrt/github/mmp/pbrt-v4/2023/20230717_clone/src/pbrt/wavefront/integrator.cpp:12:
/media/liusheng/Projects/project/game_engines/pbrt/github/mmp/pbrt-v4/2023/20230717_clone/src/pbrt/gpu/optix.h:19:10: fatal error: optix.h: 没有那个文件或目录
   19 | #include <optix.h>
      |          ^~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/pbrt_lib.dir/build.make:1095:CMakeFiles/pbrt_lib.dir/src/pbrt/wavefront/integrator.cpp.o] 错误 1
make[2]: *** 正在等待未完成的任务....
make[1]: *** [CMakeFiles/Makefile2:817:CMakeFiles/pbrt_lib.dir/all] 错误 2
make: *** [Makefile:146:all] 错误 2

解决:

根目录CMakeLists.txt 里面加入:

include_directories(${PBRT_OPTIX7_PATH}/include)

或者
include_directories("/opt/nvidia/optix/NVIDIA-OptiX-SDK-7.7.0-linux64-x86_64/include")

重新执行CMake-->Make

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值