diff --git a/cmake/FindOptiX.cmake b/cmake/FindOptiX.cmake index 0481669..298270f 100644 --- a/cmake/FindOptiX.cmake +++ b/cmake/FindOptiX.cmake @@ -1,5 +1,5 @@ # -# Copyright (c) 2018 NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -31,11 +31,18 @@ # Our initial guess will be within the SDK. set(OptiX_INSTALL_DIR "${CMAKE_SOURCE_DIR}/redner-dependencies/optix" CACHE PATH "Path to OptiX installed location.") -# The distribution contains both 32 and 64 bit libraries. Adjust the library +# The distribution contains only 64 bit libraries. Error when we have been mis-configured. +if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) + if(WIN32) + message(SEND_ERROR "Make sure when selecting the generator, you select one with Win64 or x64.") + endif() + message(FATAL_ERROR "OptiX only supports builds configured for 64 bits.") +endif() + # search path based on the bit-ness of the build. (i.e. 64: bin64, lib64; 32: # bin, lib). Note that on Mac, the OptiX library is a universal binary, so we # only need to look in lib and not lib64 for 64 bit builds. -if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT APPLE) +if(NOT APPLE) set(bit_dest "64") else() set(bit_dest "") @@ -62,9 +69,9 @@ macro(OPTIX_find_api_library name version) endif() endmacro() -OPTIX_find_api_library(optix 51) -OPTIX_find_api_library(optixu 1) -OPTIX_find_api_library(optix_prime 1) +OPTIX_find_api_library(optix 6.5.0) +OPTIX_find_api_library(optixu 6.5.0) +OPTIX_find_api_library(optix_prime 6.5.0) # Include find_path(OptiX_INCLUDE @@ -77,9 +84,12 @@ find_path(OptiX_INCLUDE ) # Check to make sure we found what we were looking for -function(OptiX_report_error error_message required) +function(OptiX_report_error error_message required component ) + if(DEFINED OptiX_FIND_REQUIRED_${component} AND NOT OptiX_FIND_REQUIRED_${component}) + set(required FALSE) + endif() if(OptiX_FIND_REQUIRED AND required) - message(FATAL_ERROR "${error_message}") + message(FATAL_ERROR "${error_message} Please locate before proceeding.") else() if(NOT OptiX_FIND_QUIETLY) message(STATUS "${error_message}") @@ -87,14 +97,14 @@ function(OptiX_report_error error_message required) endif() endfunction() -#if(NOT optix_LIBRARY) -# OptiX_report_error("optix library not found. Please locate before proceeding." TRUE) -#endif() +if(NOT optix_LIBRARY) + OptiX_report_error("optix library not found." TRUE libraries ) +endif() if(NOT OptiX_INCLUDE) - OptiX_report_error("OptiX headers (optix.h and friends) not found. Please locate before proceeding." TRUE) + OptiX_report_error("OptiX headers (optix.h and friends) not found." TRUE headers ) endif() if(NOT optix_prime_LIBRARY) - OptiX_report_error("optix Prime library not found. Please locate before proceeding." FALSE) + OptiX_report_error("optix Prime library not found." TRUE libraries ) endif() # Macro for setting up dummy targets diff --git a/redner-dependencies b/redner-dependencies index 7d8e73e..04e911f 160000 --- a/redner-dependencies +++ b/redner-dependencies @@ -1 +1 @@ -Subproject commit 7d8e73ebfc43a2642c5c56fd41553ae278f76e92 +Subproject commit 04e911f980e86cc64bd18180afd4e5ec6a8aab01 diff --git a/setup.py b/setup.py index fb2893f..c6eb959 100644 --- a/setup.py +++ b/setup.py @@ -124,13 +124,13 @@ def build_extension(self, ext): dynamic_libraries.append('redner-dependencies/embree/lib-linux/libtbb.so.2') dynamic_libraries.append('redner-dependencies/embree/lib-linux/libtbbmalloc.so.2') if build_with_cuda: - dynamic_libraries.append('redner-dependencies/optix/lib64/liboptix_prime.so.1') + dynamic_libraries.append('redner-dependencies/optix/lib64/liboptix_prime.so.6.5.0') elif sys.platform == 'win32': dynamic_libraries.append('redner-dependencies/embree/bin/embree3.dll') dynamic_libraries.append('redner-dependencies/embree/bin/tbb.dll') dynamic_libraries.append('redner-dependencies/embree/bin/tbbmalloc.dll') if build_with_cuda: - dynamic_libraries.append('redner-dependencies/optix/bin64/optix_prime.1.dll') + dynamic_libraries.append('redner-dependencies/optix/bin64/optix_prime.6.5.0.dll') project_name = 'redner' if 'PROJECT_NAME' in os.environ: