diff --git a/CHANGELOG.md b/CHANGELOG.md index 37423682b8..4dcae8fd4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Version History --------------- +### Changes in v1.3.1: + +- Improved robustness of OSPRay CMake find_package config + - Fixed bugs related to CMake configuration when using + the OSPRay SDK from an install +- Fixed issue with Embree library when installing with + `OSPRAY_INSTALL_DEPENDENCIES` enabled + ### Changes in v1.3.0: - New MPI distributed device to support MPI distributed applications diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f5a12e02a..68b2425dfa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OSPCOMMON_DIR}/cmake) ############################################################## INCLUDE(macros) +INCLUDE(ospray_macros) INCLUDE(ospray_options) INCLUDE(ispc) diff --git a/README.md b/README.md index c953a4b7c2..e7468473c5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ OSPRay ====== -This is release v1.3.0 of OSPRay. For changes and new features see the +This is release v1.3.1 of OSPRay. For changes and new features see the [changelog](CHANGELOG.md). Also visit http://www.ospray.org for more information. @@ -76,7 +76,7 @@ before you can build OSPRay you need the following prerequisites: for ISPC in the `PATH` and in the directory right "next to" the checked-out OSPRay sources.[^1] Alternatively set the CMake variable `ISPC_EXECUTABLE` to the location of the ISPC compiler. -- Per default OSPRay uses the [IntelĀ® Threading Building +- Per default OSPRay uses the IntelĀ® [Threading Building Blocks](https://www.threadingbuildingblocks.org/) (TBB) as tasking system, which we recommend for performance and flexibility reasons. Alternatively you can set CMake variable `OSPRAY_TASKING_SYSTEM` to diff --git a/cmake/configure_embree.cmake b/cmake/configure_embree.cmake index 0f39d30da7..c15a45fbd6 100644 --- a/cmake/configure_embree.cmake +++ b/cmake/configure_embree.cmake @@ -14,85 +14,12 @@ ## limitations under the License. ## ## ======================================================================== ## -SET(EMBREE_VERSION_REQUIRED 2.13.0) # Find existing Embree on the machine ####################################### -FIND_PACKAGE(embree ${EMBREE_VERSION_REQUIRED} QUIET) -IF(NOT DEFINED EMBREE_INCLUDE_DIRS) - MESSAGE(FATAL_ERROR - "We did not find Embree installed on your system. OSPRay requires an" - " Embree installation >= v${EMBREE_VERSION_REQUIRED}, please download" - " and extract Embree or compile Embree from source, then set the" - " 'embree_DIR' variable to /lib/cmake/embree-.") -ENDIF() - -# Check for required Embree features ####################################### - -OSPRAY_CHECK_EMBREE_FEATURE(ISPC_SUPPORT ISPC) -OSPRAY_CHECK_EMBREE_FEATURE(INTERSECTION_FILTER "intersection filter") -OSPRAY_CHECK_EMBREE_FEATURE(INTERSECTION_FILTER_RESTORE "intersection filter") -OSPRAY_CHECK_EMBREE_FEATURE(GEOMETRY_TRIANGLES "triangle geometries") -OSPRAY_CHECK_EMBREE_FEATURE(GEOMETRY_USER "user geometries") -OSPRAY_CHECK_EMBREE_FEATURE(RAY_PACKETS "ray packets") -OSPRAY_CHECK_EMBREE_FEATURE(BACKFACE_CULLING "backface culling" OFF) - -# remove Embree's TBB libs (not needed, cyclic rpath) -SET(EMBREE_LIBRARIES ${EMBREE_LIBRARY}) - -IF (EMBREE_MAX_ISA STREQUAL "NONE") - SET(EMBREE_ISA_SUPPORTS_SSE2 ${EMBREE_ISA_SSE2}) - SET(EMBREE_ISA_SUPPORTS_SSE4 ${EMBREE_ISA_SSE42}) - SET(EMBREE_ISA_SUPPORTS_AVX ${EMBREE_ISA_AVX}) - SET(EMBREE_ISA_SUPPORTS_AVX2 ${EMBREE_ISA_AVX2}) - SET(EMBREE_ISA_SUPPORTS_AVX512KNL ${EMBREE_ISA_AVX512KNL}) - SET(EMBREE_ISA_SUPPORTS_AVX512SKX ${EMBREE_ISA_AVX512SKX}) -ELSE() - SET(EMBREE_ISA_SUPPORTS_SSE2 FALSE) - SET(EMBREE_ISA_SUPPORTS_SSE4 FALSE) - SET(EMBREE_ISA_SUPPORTS_AVX FALSE) - SET(EMBREE_ISA_SUPPORTS_AVX2 FALSE) - SET(EMBREE_ISA_SUPPORTS_AVX512KNL FALSE) - SET(EMBREE_ISA_SUPPORTS_AVX512SKX FALSE) - - IF (EMBREE_MAX_ISA STREQUAL "SSE2") - SET(EMBREE_ISA_SUPPORTS_SSE2 TRUE) - ELSEIF (EMBREE_MAX_ISA MATCHES "SSE4\\.[12]$") - SET(EMBREE_ISA_SUPPORTS_SSE2 TRUE) - SET(EMBREE_ISA_SUPPORTS_SSE4 TRUE) - ELSEIF (EMBREE_MAX_ISA STREQUAL "AVX") - SET(EMBREE_ISA_SUPPORTS_SSE2 TRUE) - SET(EMBREE_ISA_SUPPORTS_SSE4 TRUE) - SET(EMBREE_ISA_SUPPORTS_AVX TRUE) - ELSEIF (EMBREE_MAX_ISA STREQUAL "AVX2") - SET(EMBREE_ISA_SUPPORTS_SSE2 TRUE) - SET(EMBREE_ISA_SUPPORTS_SSE4 TRUE) - SET(EMBREE_ISA_SUPPORTS_AVX TRUE) - SET(EMBREE_ISA_SUPPORTS_AVX2 TRUE) - ELSEIF (EMBREE_MAX_ISA STREQUAL "AVX512KNL") - SET(EMBREE_ISA_SUPPORTS_SSE2 TRUE) - SET(EMBREE_ISA_SUPPORTS_SSE4 TRUE) - SET(EMBREE_ISA_SUPPORTS_AVX TRUE) - SET(EMBREE_ISA_SUPPORTS_AVX2 TRUE) - SET(EMBREE_ISA_SUPPORTS_AVX512KNL TRUE) - ELSEIF (EMBREE_MAX_ISA STREQUAL "AVX512SKX") - SET(EMBREE_ISA_SUPPORTS_SSE2 TRUE) - SET(EMBREE_ISA_SUPPORTS_SSE4 TRUE) - SET(EMBREE_ISA_SUPPORTS_AVX TRUE) - SET(EMBREE_ISA_SUPPORTS_AVX2 TRUE) - SET(EMBREE_ISA_SUPPORTS_AVX512KNL TRUE) - SET(EMBREE_ISA_SUPPORTS_AVX512SKX TRUE) - ENDIF() -ENDIF() - -IF (NOT (EMBREE_ISA_SUPPORTS_SSE4 - OR EMBREE_ISA_SUPPORTS_AVX - OR EMBREE_ISA_SUPPORTS_AVX2 - OR EMBREE_ISA_SUPPORTS_AVX512KNL - OR EMBREE_ISA_SUPPORTS_AVX512SKX)) - MESSAGE(FATAL_ERROR - "Your Embree build needs to support at least one ISA >= SSE4.1!") -ENDIF() +ospray_find_embree(${EMBREE_VERSION_REQUIRED}) +ospray_verify_embree_features() +ospray_determine_embree_isa_support() # Configure OSPRay ISA last after we've detected what we got w/ Embree -OSPRAY_CONFIGURE_ISPC_ISA() +ospray_configure_ispc_isa() diff --git a/cmake/ospray_cmake_config.cmake b/cmake/ospray_cmake_config.cmake index 6ef2e40e10..36e6706e97 100644 --- a/cmake/ospray_cmake_config.cmake +++ b/cmake/ospray_cmake_config.cmake @@ -27,39 +27,59 @@ INSTALL(FILES ${CMAKE_BINARY_DIR}/ospray/version.h ) # CMake config module -SET(ospray_MODULE_CONFIG_INPUT_DIR ${CMAKE_SOURCE_DIR}/cmake/ospray_cmake_config) -SET(ospray_MODULE_CONFIG_OUTPUT_DIR ${CMAKE_BINARY_DIR}/cmake) +SET(OSPRAY_MODULE_CONFIG_INPUT_DIR ${CMAKE_SOURCE_DIR}/cmake/ospray_cmake_config) +SET(OSPRAY_MODULE_CONFIG_OUTPUT_DIR ${CMAKE_BINARY_DIR}/cmake) -SET(ospray_MODULE_FILES +SET(OSPRAY_MODULE_FILES osprayConfig.cmake osprayConfigVersion.cmake osprayUse.cmake ) -FOREACH(ospray_MODULE_FILENAME ${ospray_MODULE_FILES}) - LIST(APPEND ospray_MODULE_INSTALL_FILES - ${ospray_MODULE_CONFIG_OUTPUT_DIR}/${ospray_MODULE_FILENAME} +SET(OSPRAY_CMAKECONFIG_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/ospray-${OSPRAY_VERSION}") + +## find relative path to make package relocatable +# this is a bit involved to handle these cases: +# - CMAKE_INSTALL_LIBDIR is overridden by the user +# - CMAKE_INSTALL_LIBDIR contains multiple levels for Debian multiarch support +IF (IS_ABSOLUTE "${CMAKE_INSTALL_PREFIX}") + SET(ABS_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") +ELSE() + GET_FILENAME_COMPONENT(ABS_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}" ABSOLUTE) +ENDIF() + +IF (IS_ABSOLUTE "${OSPRAY_CMAKECONFIG_DIR}") + MESSAGE(WARNING "CMAKE_INSTALL_LIBDIR needs to be a relative path!") + SET(ABS_CMAKECONFIG_DIR "${OSPRAY_CMAKECONFIG_DIR}") +ELSE() + SET(ABS_CMAKECONFIG_DIR "${ABS_INSTALL_PREFIX}/${OSPRAY_CMAKECONFIG_DIR}") +ENDIF() + +FILE(RELATIVE_PATH OSPRAY_RELATIV_ROOT_DIR "${ABS_CMAKECONFIG_DIR}" "${ABS_INSTALL_PREFIX}" ) + + +FOREACH(MODULE_FILE ${OSPRAY_MODULE_FILES}) + LIST(APPEND OSPRAY_MODULE_INSTALL_FILES + ${OSPRAY_MODULE_CONFIG_OUTPUT_DIR}/${MODULE_FILE} ) CONFIGURE_FILE( - ${ospray_MODULE_CONFIG_INPUT_DIR}/${ospray_MODULE_FILENAME}.in - ${ospray_MODULE_CONFIG_OUTPUT_DIR}/${ospray_MODULE_FILENAME} + ${OSPRAY_MODULE_CONFIG_INPUT_DIR}/${MODULE_FILE}.in + ${OSPRAY_MODULE_CONFIG_OUTPUT_DIR}/${MODULE_FILE} @ONLY ) -ENDFOREACH(ospray_MODULE_FILENAME ${ospray_MODULE_FILES}) - -LIST(APPEND ospray_MODULE_INSTALL_FILES - ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/FindTBB.cmake -) +ENDFOREACH() INSTALL(FILES - ${ospray_MODULE_INSTALL_FILES} + ${OSPRAY_MODULE_INSTALL_FILES} + ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/FindTBB.cmake ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/clang.cmake ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/icc.cmake ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/ispc.cmake ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/gcc.cmake ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/msvc.cmake ${CMAKE_SOURCE_DIR}/components/ospcommon/cmake/macros.cmake#NOTE(jda) - hack! - DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ospray-${OSPRAY_VERSION}" + ${CMAKE_SOURCE_DIR}/cmake/ospray_macros.cmake + DESTINATION ${OSPRAY_CMAKECONFIG_DIR} COMPONENT devel ) diff --git a/cmake/ospray_cmake_config/osprayConfig.cmake.in b/cmake/ospray_cmake_config/osprayConfig.cmake.in index 383c8a96a6..462e5e82ed 100644 --- a/cmake/ospray_cmake_config/osprayConfig.cmake.in +++ b/cmake/ospray_cmake_config/osprayConfig.cmake.in @@ -14,7 +14,7 @@ ## limitations under the License. ## ## ======================================================================== ## -# Called if we failed to find ospray or any of it's required dependencies, +# Called if we failed to find OSPRay or any of it's required dependencies, # unsets all public (designed to be used externally) variables and reports # error message at priority depending upon [REQUIRED/QUIET/] argument. macro(OSPRAY_REPORT_NOT_FOUND REASON_MSG) @@ -27,20 +27,21 @@ macro(OSPRAY_REPORT_NOT_FOUND REASON_MSG) # Note _FIND_[REQUIRED/QUIETLY] variables defined by FindPackage() # use the camelcase library name, not uppercase. - if(OSPRAY_FIND_QUIETLY) - message(STATUS "Failed to find ospray - " ${REASON_MSG} ${ARGN}) - else(OSPRAY_FIND_REQUIRED) - message(FATAL_ERROR "Failed to find ospray - " ${REASON_MSG} ${ARGN}) + if (OSPRAY_FIND_QUIETLY) + set(MSG_TYPE STATUS) + elseif(OSPRAY_FIND_REQUIRED) + set(MSG_TYPE FATAL_ERROR) else() # Neither QUIETLY nor REQUIRED, use SEND_ERROR which emits an error # that prevents generation, but continues configuration. - message(SEND_ERROR "Failed to find ospray - " ${REASON_MSG} ${ARGN}) + set(MSG_TYPE SEND_ERROR) endif() + message(${MSG_TYPE} "Failed to find OSPRay - " ${REASON_MSG} ${ARGN}) return() -endmacro(OSPRAY_REPORT_NOT_FOUND) +endmacro() ############################################################################### -# Attempt to find ospray +# Attempt to find OSPRay # Get the (current, i.e. installed) directory containing this file. set(CURRENT_CONFIG_INSTALL_DIR ${CMAKE_CURRENT_LIST_DIR}) @@ -51,43 +52,43 @@ set(CURRENT_CONFIG_INSTALL_DIR ${CMAKE_CURRENT_LIST_DIR}) set(OSPRAY_CALLERS_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}) # Reset CMake module path to the installation directory of this script, -# thus we will use the FindPackage() scripts shipped with ospray to find -# ospray's dependencies, even if the user has equivalently named FindPackage() +# thus we will use the FindPackage() scripts shipped with OSPRay to find +# OSPRay's dependencies, even if the user has equivalently named FindPackage() # scripts in their project. set(CMAKE_MODULE_PATH ${CURRENT_CONFIG_INSTALL_DIR}) # Build the absolute root install directory as a relative path (determined when -# ospray was configured & built) from the current install directory for this -# this file. This allows for the install tree to be relocated, after ospray +# OSPRay was configured & built) from the current install directory for this +# this file. This allows for the install tree to be relocated, after OSPRay # was built, outside of CMake. get_filename_component(CURRENT_ROOT_INSTALL_DIR - ${CURRENT_CONFIG_INSTALL_DIR}/../../../ ABSOLUTE + ${CURRENT_CONFIG_INSTALL_DIR}/@OSPRAY_RELATIV_ROOT_DIR@ ABSOLUTE ) -if(NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR}) +if (NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR}) OSPRAY_REPORT_NOT_FOUND( - "ospray install root: ${CURRENT_ROOT_INSTALL_DIR}, " + "OSPRay install root: ${CURRENT_ROOT_INSTALL_DIR}, " "determined from relative path from osprayConfig.cmake install location: " "${CURRENT_CONFIG_INSTALL_DIR}, does not exist. Either the install " "directory was deleted, or the install tree was only partially relocated " - "outside of CMake after ospray was built.") -endif(NOT EXISTS ${CURRENT_ROOT_INSTALL_DIR}) + "outside of CMake after OSPRay was built.") +endif() set(OSPRAY_ROOT ${CURRENT_ROOT_INSTALL_DIR}) -# Set the include directories for ospray (itself). +# Set the include directories for OSPRay (itself). set(OSPRAY_INCLUDE_DIR "${OSPRAY_ROOT}/include") -if(NOT EXISTS ${OSPRAY_INCLUDE_DIR}/ospray/version.h) +if (NOT EXISTS ${OSPRAY_INCLUDE_DIR}/ospray/version.h) OSPRAY_REPORT_NOT_FOUND( - "ospray install root: ${OSPRAY_ROOT}, " + "OSPRay install root: ${OSPRAY_ROOT}, " "determined from relative path from osprayConfg.cmake install location: " - "${CURRENT_CONFIG_INSTALL_DIR}, does not contain ospray headers. " + "${CURRENT_CONFIG_INSTALL_DIR}, does not contain OSPRay headers. " "Either the install directory was deleted, or the install tree was only " - "partially relocated outside of CMake after ospray was built.") -endif(NOT EXISTS ${OSPRAY_INCLUDE_DIR}/ospray/version.h) + "partially relocated outside of CMake after OSPRay was built.") +endif() # Append the include directories for all (potentially optional) dependencies -# with which ospray was compiled, the libraries themselves come in via +# with which OSPRay was compiled, the libraries themselves come in via # osprayTargets-.cmake as link libraries for ospray target. set(OSPRAY_INCLUDE_DIRS ${OSPRAY_INCLUDE_DIR} @@ -95,41 +96,56 @@ set(OSPRAY_INCLUDE_DIRS ${OSPRAY_INCLUDE_DIR}/ospray/SDK ) - ############################################################################### -# ospray build configuration - +# OSPRay build configuration set(OSPRAY_VERSION @OSPRAY_VERSION@) set(OSPRAY_SOVERSION @OSPRAY_SOVERSION@) +set(OSPRAY_BUILD_DEBUG @OSPRAY_BUILD_DEBUG@) +set(OSPRAY_BUILD_RELWITHDEBINFO @OSPRAY_BUILD_RELWITHDEBINFO@) +set(OSPRAY_BUILD_RELEASE @OSPRAY_BUILD_RELEASE@) + set(OSPRAY_COMPILER_ICC @OSPRAY_COMPILER_ICC@) set(OSPRAY_COMPILER_GCC @OSPRAY_COMPILER_GCC@) set(OSPRAY_COMPILER_CLANG @OSPRAY_COMPILER_CLANG@) set(OSPRAY_COMPILER_MSVC @OSPRAY_COMPILER_MSVC@) set(OSPRAY_TASKING_TBB @OSPRAY_TASKING_TBB@) -set(OSPRAY_ISPC_TARGET_LIST @OSPRAY_ISPC_TARGET_LIST@) +set(OSPRAY_TASKING_CILK @OSPRAY_TASKING_CILK@) +set(OSPRAY_TASKING_OPENMP @OSPRAY_TASKING_OPENMP@) +set(OSPRAY_TASKING_INTERNAL @OSPRAY_TASKING_INTERNAL@) +set(OSPRAY_TASKING_LIBDISPATCH @OSPRAY_TASKING_LIBDISPATCH@) +set(OSPRAY_TASKING_DEBUG @OSPRAY_TASKING_DEBUG@) +set(OSPRAY_ISPC_TARGET_LIST @OSPRAY_ISPC_TARGET_LIST@) set(OSPRAY_MPI_ENABLED @OSPRAY_MODULE_MPI@) +set(OSPRAY_TILE_SIZE @OSPRAY_TILE_SIZE@) +set(OSPRAY_PIXELS_PER_JOB @OSPRAY_PIXELS_PER_JOB@) + +set(EMBREE_VERSION_REQUIRED @EMBREE_VERSION_REQUIRED@) + ############################################################################### -# ospray dependencies +# OSPRay dependencies # Save state set(OSPRAY_CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}) set(OSPRAY_CURRENT_CONFIG_INSTALL_DIR ${CURRENT_CONFIG_INSTALL_DIR}) set(OSPRAY_CURRENT_ROOT_INSTALL_DIR ${CURRENT_ROOT_INSTALL_DIR}) +# Include macros for finding embree +include(ospray_macros) + # NOTE(jda) - Here is where find_package(...) is automatically called for -# any ospray dependencies. A list of libs should be constructed +# any OSPRay dependencies. A list of libs should be constructed # and added to the OSPRAY_LIBRARIES variable below. if (OSPRAY_TASKING_TBB) # Find tbb find_package(TBB) - if(":${TBB_LIBRARY}" STREQUAL ":") - message(FATAL_ERROR "Missing required optional OSPRay dependency " + if (":${TBB_LIBRARY}" STREQUAL ":") + message(FATAL_ERROR "Missing required OSPRay dependency " "TBB, please set TBB_ROOT to the root of your TBB install.") else() message(STATUS "Found required OSPRay dependency: TBB in ${TBB_INCLUDE_DIRS}") @@ -137,22 +153,30 @@ if (OSPRAY_TASKING_TBB) add_definitions(-DOSPRAY_TASKING_TBB) list(APPEND OSPRAY_DEPENDENCIES ${TBB_LIBRARIES}) -endif() - -if (OSPRAY_TASKING_CILK) +elseif (OSPRAY_TASKING_CILK) add_definitions(-DOSPRAY_TASKING_CILK) +elseif (OSPRAY_TASKING_OPENMP) + add_definitions(-DOSPRAY_TASKING_OPENMP) +elseif (OSPRAY_TASKING_INTERNAL) + add_definitions(-DOSPRAY_TASKING_INTERNAL) +elseif (OSPRAY_TASKING_LIBDISPATCH) + add_definitions(-DOSPRAY_TASKING_LIBDISPATCH) +else() + add_definitions(-DOSPRAY_TASKING_DEBUG) endif() -IF(WIN32) - SET(LIBRARY_PATH_PREFIX ${OSPRAY_ROOT}/@CMAKE_INSTALL_LIBDIR@/${CMAKE_IMPORT_LIBRARY_PREFIX}) - SET(LIBRARY_SUFFIX ${CMAKE_IMPORT_LIBRARY_SUFFIX}) -ELSE() - SET(LIBRARY_PATH_PREFIX ${OSPRAY_ROOT}/@CMAKE_INSTALL_LIBDIR@/${CMAKE_SHARED_LIBRARY_PREFIX}) - SET(LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) -ENDIF() +if (WIN32) + set(LIBRARY_PATH_PREFIX ${OSPRAY_ROOT}/@CMAKE_INSTALL_LIBDIR@/${CMAKE_IMPORT_LIBRARY_PREFIX}) + set(LIBRARY_SUFFIX ${CMAKE_IMPORT_LIBRARY_SUFFIX}) +else() + set(LIBRARY_PATH_PREFIX ${OSPRAY_ROOT}/@CMAKE_INSTALL_LIBDIR@/${CMAKE_SHARED_LIBRARY_PREFIX}) + set(LIBRARY_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) +endif() # Find existing Embree on the machine -find_package(embree @EMBREE_VERSION_REQUIRED@ REQUIRED) +ospray_find_embree(${EMBREE_VERSION_REQUIRED}) +ospray_verify_embree_features() + list(APPEND OSPRAY_INCLUDE_DIRS ${EMBREE_INCLUDE_DIRS}) # Restore state @@ -162,27 +186,22 @@ set(CURRENT_ROOT_INSTALL_DIR ${OSPRAY_CURRENT_ROOT_INSTALL_DIR}) ############################################################################### -# Finish ospray +# Finish OSPRay # Remove duplicate entries from OSPRAY_INCLUDE_DIRS list(REMOVE_DUPLICATES OSPRAY_INCLUDE_DIRS) +set(OSPRAY_LIBRARY ${LIBRARY_PATH_PREFIX}ospray${LIBRARY_SUFFIX}) +set(OSPRAY_COMMON_LIBRARY ${LIBRARY_PATH_PREFIX}ospray_common${LIBRARY_SUFFIX}) + # Set expected OSPRAY_LIBRARIES variable for FindPackage(). set(OSPRAY_LIBRARIES ${OSPRAY_DEPENDENCIES} ${EMBREE_LIBRARY} - ${LIBRARY_PATH_PREFIX}ospray${LIBRARY_SUFFIX} - ${LIBRARY_PATH_PREFIX}ospray_common${LIBRARY_SUFFIX} + ${OSPRAY_LIBRARY} + ${OSPRAY_COMMON_LIBRARY} ) -if(OSPRAY_MPI_ENABLED) - set(OSPRAY_LIBRARIES - ${OSPRAY_LIBRARIES} - ${LIBRARY_PATH_PREFIX}ospray_mpi_common${LIBRARY_SUFFIX} - ${LIBRARY_PATH_PREFIX}ospray_mpi_maml${LIBRARY_SUFFIX} - ) -endif() - # Reset CMake module path to its state when this script was called. set(CMAKE_MODULE_PATH ${OSPRAY_CALLERS_CMAKE_MODULE_PATH}) @@ -194,5 +213,5 @@ set(OSPRAY_USE_FILE ${OSPRAY_CMAKE_ROOT}/osprayUse.cmake) # OSPRAY_REPORT_NOT_FOUND() aborts, so if we made it this far, # we have found ospray and all required dependencies. include(FindPackageMessage) -find_package_MESSAGE(ospray "Found ospray: ${OSPRAY_LIBRARIES}" +find_package_MESSAGE(ospray "Found OSPRay: ${OSPRAY_LIBRARY}" "[${OSPRAY_INCLUDE_DIRS}]") diff --git a/cmake/ospray_cmake_config/osprayConfigVersion.cmake.in b/cmake/ospray_cmake_config/osprayConfigVersion.cmake.in index 03c65be345..8ee6aea601 100644 --- a/cmake/ospray_cmake_config/osprayConfigVersion.cmake.in +++ b/cmake/ospray_cmake_config/osprayConfigVersion.cmake.in @@ -15,13 +15,20 @@ ## ======================================================================== ## set(PACKAGE_VERSION "@OSPRAY_VERSION@") +set(PACKAGE_VERSION_MAJOR "@OSPRAY_VERSION_MAJOR@") # Check whether the requested PACKAGE_FIND_VERSION is compatible -if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") +if (PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") + # Major version needs to be the same + if (PACKAGE_FIND_VERSION_MAJOR STREQUAL PACKAGE_VERSION_MAJOR) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else() + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif() + + if (PACKAGE_VERSION VERSION_EQUAL PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_EXACT TRUE) endif() endif() diff --git a/cmake/ospray_cmake_config/osprayUse.cmake.in b/cmake/ospray_cmake_config/osprayUse.cmake.in index 84287d10e0..9ad3d6efb4 100644 --- a/cmake/ospray_cmake_config/osprayUse.cmake.in +++ b/cmake/ospray_cmake_config/osprayUse.cmake.in @@ -22,5 +22,9 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${OSPRAY_CMAKE_ROOT}) -include(${OSPRAY_CMAKE_ROOT}/ispc.cmake) -include(${OSPRAY_CMAKE_ROOT}/macros.cmake) +include(macros) +include(ispc) + +message(STATUS "Using found OSPRay ISA targets: ${OSPRAY_ISPC_TARGET_LIST}") + +include_directories_ispc(${OSPRAY_INCLUDE_DIRS}) \ No newline at end of file diff --git a/cmake/ospray_macros.cmake b/cmake/ospray_macros.cmake new file mode 100644 index 0000000000..43d3f56d0d --- /dev/null +++ b/cmake/ospray_macros.cmake @@ -0,0 +1,118 @@ +## ======================================================================== ## +## Copyright 2009-2017 Intel Corporation ## +## ## +## Licensed under the Apache License, Version 2.0 (the "License"); ## +## you may not use this file except in compliance with the License. ## +## You may obtain a copy of the License at ## +## ## +## http://www.apache.org/licenses/LICENSE-2.0 ## +## ## +## Unless required by applicable law or agreed to in writing, software ## +## distributed under the License is distributed on an "AS IS" BASIS, ## +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## +## See the License for the specific language governing permissions and ## +## limitations under the License. ## +## ======================================================================== ## + +function(ospray_check_embree_feature FEATURE DESCRIPTION) + set(FEATURE EMBREE_${FEATURE}) + if(NOT ${ARGN}) + if (${FEATURE}) + message(FATAL_ERROR "OSPRay requires Embree to be compiled " + "without ${DESCRIPTION} (${FEATURE}=OFF).") + endif() + else() + if (NOT ${FEATURE}) + message(FATAL_ERROR "OSPRay requires Embree to be compiled " + "with support for ${DESCRIPTION} (${FEATURE}=ON).") + endif() + endif() +endfunction() + +function(ospray_verify_embree_features) + ospray_check_embree_feature(ISPC_SUPPORT ISPC) + ospray_check_embree_feature(INTERSECTION_FILTER "intersection filter") + ospray_check_embree_feature(INTERSECTION_FILTER_RESTORE "intersection filter") + ospray_check_embree_feature(GEOMETRY_TRIANGLES "triangle geometries") + ospray_check_embree_feature(GEOMETRY_USER "user geometries") + ospray_check_embree_feature(RAY_PACKETS "ray packets") + ospray_check_embree_feature(BACKFACE_CULLING "backface culling" OFF) +endfunction() + +macro(ospray_find_embree EMBREE_VERSION_REQUIRED) + find_package(embree ${EMBREE_VERSION_REQUIRED} QUIET) + if(NOT DEFINED EMBREE_INCLUDE_DIRS) + message(FATAL_ERROR + "We did not find Embree installed on your system. OSPRay requires" + " an Embree installation >= v${EMBREE_VERSION_REQUIRED}, please" + " download and extract Embree or compile Embree from source, then" + " set the 'embree_DIR' variable to" + " /lib/cmake/embree-.") + else() + message(STATUS "Found Embree v${EMBREE_VERSION}: ${EMBREE_LIBRARY}") + endif() + + # workaround issue in Embree v2.15.0-v2.16.4 + # where embree-config.cmake returned the symlink in EMBREE_LIBRARY + if (IS_SYMLINK ${EMBREE_LIBRARY}) + get_filename_component(EMBREE_LIBRARY ${EMBREE_LIBRARY} REALPATH) + endif() + + set(EMBREE_LIBRARIES ${EMBREE_LIBRARY}) +endmacro() + +macro(ospray_determine_embree_isa_support) + if (EMBREE_MAX_ISA STREQUAL "NONE") + set(EMBREE_ISA_SUPPORTS_SSE2 ${EMBREE_ISA_SSE2}) + set(EMBREE_ISA_SUPPORTS_SSE4 ${EMBREE_ISA_SSE42}) + set(EMBREE_ISA_SUPPORTS_AVX ${EMBREE_ISA_AVX}) + set(EMBREE_ISA_SUPPORTS_AVX2 ${EMBREE_ISA_AVX2}) + set(EMBREE_ISA_SUPPORTS_AVX512KNL ${EMBREE_ISA_AVX512KNL}) + set(EMBREE_ISA_SUPPORTS_AVX512SKX ${EMBREE_ISA_AVX512SKX}) + else() + set(EMBREE_ISA_SUPPORTS_SSE2 FALSE) + set(EMBREE_ISA_SUPPORTS_SSE4 FALSE) + set(EMBREE_ISA_SUPPORTS_AVX FALSE) + set(EMBREE_ISA_SUPPORTS_AVX2 FALSE) + set(EMBREE_ISA_SUPPORTS_AVX512KNL FALSE) + set(EMBREE_ISA_SUPPORTS_AVX512SKX FALSE) + + if (EMBREE_MAX_ISA STREQUAL "SSE2") + set(EMBREE_ISA_SUPPORTS_SSE2 TRUE) + elseif (EMBREE_MAX_ISA MATCHES "SSE4\\.[12]$") + set(EMBREE_ISA_SUPPORTS_SSE2 TRUE) + set(EMBREE_ISA_SUPPORTS_SSE4 TRUE) + elseif (EMBREE_MAX_ISA STREQUAL "AVX") + set(EMBREE_ISA_SUPPORTS_SSE2 TRUE) + set(EMBREE_ISA_SUPPORTS_SSE4 TRUE) + set(EMBREE_ISA_SUPPORTS_AVX TRUE) + elseif (EMBREE_MAX_ISA STREQUAL "AVX2") + set(EMBREE_ISA_SUPPORTS_SSE2 TRUE) + set(EMBREE_ISA_SUPPORTS_SSE4 TRUE) + set(EMBREE_ISA_SUPPORTS_AVX TRUE) + set(EMBREE_ISA_SUPPORTS_AVX2 TRUE) + elseif (EMBREE_MAX_ISA STREQUAL "AVX512KNL") + set(EMBREE_ISA_SUPPORTS_SSE2 TRUE) + set(EMBREE_ISA_SUPPORTS_SSE4 TRUE) + set(EMBREE_ISA_SUPPORTS_AVX TRUE) + set(EMBREE_ISA_SUPPORTS_AVX2 TRUE) + set(EMBREE_ISA_SUPPORTS_AVX512KNL TRUE) + elseif (EMBREE_MAX_ISA STREQUAL "AVX512SKX") + set(EMBREE_ISA_SUPPORTS_SSE2 TRUE) + set(EMBREE_ISA_SUPPORTS_SSE4 TRUE) + set(EMBREE_ISA_SUPPORTS_AVX TRUE) + set(EMBREE_ISA_SUPPORTS_AVX2 TRUE) + set(EMBREE_ISA_SUPPORTS_AVX512KNL TRUE) + set(EMBREE_ISA_SUPPORTS_AVX512SKX TRUE) + endif() + endif() + + if (NOT (EMBREE_ISA_SUPPORTS_SSE4 + OR EMBREE_ISA_SUPPORTS_AVX + OR EMBREE_ISA_SUPPORTS_AVX2 + OR EMBREE_ISA_SUPPORTS_AVX512KNL + OR EMBREE_ISA_SUPPORTS_AVX512SKX)) + message(FATAL_ERROR + "Your Embree build needs to support at least one ISA >= SSE4.1!") + endif() +endmacro() diff --git a/cmake/ospray_options.cmake b/cmake/ospray_options.cmake index b0f346c832..3c884f57e1 100644 --- a/cmake/ospray_options.cmake +++ b/cmake/ospray_options.cmake @@ -20,7 +20,7 @@ SET(OSPRAY_VERSION_MAJOR 1) SET(OSPRAY_VERSION_MINOR 3) -SET(OSPRAY_VERSION_PATCH 0) +SET(OSPRAY_VERSION_PATCH 1) SET(OSPRAY_VERSION_GITHASH 0) IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) FIND_PACKAGE(Git) @@ -31,9 +31,11 @@ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) OUTPUT_VARIABLE "OSPRAY_VERSION_GITHASH" ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) - ENDIF() + ENDIF() ENDIF() +SET(EMBREE_VERSION_REQUIRED 2.13.0) + OPTION(OSPRAY_ENABLE_TESTING OFF) IF (OSPRAY_ENABLE_TESTING) @@ -61,17 +63,17 @@ ELSE() ENDIF() IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug") - SET(OSPRAY_DEBUG_BUILD ON ) - SET(OSPRAY_RELWITHDEBINFO_BUILD OFF) - SET(OSPRAY_RELEASE_BUILD OFF) + SET(OSPRAY_BUILD_DEBUG TRUE ) + SET(OSPRAY_BUILD_RELWITHDEBINFO FALSE) + SET(OSPRAY_BUILD_RELEASE FALSE) ELSEIF("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") - SET(OSPRAY_DEBUG_BUILD OFF) - SET(OSPRAY_RELWITHDEBINFO_BUILD ON ) - SET(OSPRAY_RELEASE_BUILD OFF) + SET(OSPRAY_BUILD_DEBUG FALSE) + SET(OSPRAY_BUILD_RELWITHDEBINFO TRUE ) + SET(OSPRAY_BUILD_RELEASE FALSE) ELSE()# Release - SET(OSPRAY_DEBUG_BUILD OFF) - SET(OSPRAY_RELWITHDEBINFO_BUILD OFF) - SET(OSPRAY_RELEASE_BUILD ON ) + SET(OSPRAY_BUILD_DEBUG FALSE) + SET(OSPRAY_BUILD_RELWITHDEBINFO FALSE) + SET(OSPRAY_BUILD_RELEASE TRUE ) ENDIF() SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}) @@ -86,7 +88,6 @@ IF (WIN32) ADD_DEFINITIONS(-DNOMINMAX) ENDIF() - ############################################################## # OSPRay specific build options and configuration selection ############################################################## @@ -124,7 +125,41 @@ MARK_AS_ADVANCED(OSPRAY_INSTALL_DEPENDENCIES) INCLUDE(package) +############################################################## +# redistribute TBB and Embree +############################################################## + IF (OSPRAY_INSTALL_DEPENDENCIES) + MACRO(OSPRAY_INSTALL_NAMELINK NAME) + EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" -E create_symlink + lib${NAME}.so.2 ${CMAKE_CURRENT_BINARY_DIR}/lib${NAME}.so) + INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/lib${NAME}.so + DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT redist) + ENDMACRO() + + IF (OSPRAY_TASKING_TBB) + IF (WIN32) + SET(TBB_DLL_HINTS + ${TBB_ROOT}/../redist/${TBB_ARCH}_win/tbb/${TBB_VCVER} + ${TBB_ROOT}/../redist/${TBB_ARCH}/tbb/${TBB_VCVER} + ${TBB_ROOT}/bin/${TBB_ARCH}/${TBB_VCVER} + ) + FIND_FILE(TBB_DLL tbb.dll HINTS ${TBB_DLL_HINTS}) + FIND_FILE(TBB_DLL_MALLOC tbbmalloc.dll PATHS HINTS ${TBB_DLL_HINTS}) + MARK_AS_ADVANCED(TBB_DLL) + MARK_AS_ADVANCED(TBB_DLL_MALLOC) + INSTALL(PROGRAMS ${TBB_DLL} ${TBB_DLL_MALLOC} + DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT redist) + ELSE() + INSTALL(PROGRAMS ${TBB_LIBRARY} ${TBB_LIBRARY_MALLOC} + DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT redist) + IF (NOT APPLE) + OSPRAY_INSTALL_NAMELINK(tbb) + OSPRAY_INSTALL_NAMELINK(tbbmalloc) + ENDIF() + ENDIF() + ENDIF() + IF (WIN32) GET_FILENAME_COMPONENT(EMBREE_LIB_DIR ${EMBREE_LIBRARY} PATH) SET(EMBREE_DLL_HINTS @@ -140,5 +175,8 @@ IF (OSPRAY_INSTALL_DEPENDENCIES) ELSE() INSTALL(PROGRAMS ${EMBREE_LIBRARY} DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT redist) + IF (NOT APPLE) + OSPRAY_INSTALL_NAMELINK(embree) + ENDIF() ENDIF() ENDIF() diff --git a/components/ospcommon/AffineSpace.h b/components/ospcommon/AffineSpace.h index 26881ec930..c4d56969a3 100644 --- a/components/ospcommon/AffineSpace.h +++ b/components/ospcommon/AffineSpace.h @@ -70,11 +70,11 @@ namespace ospcommon { /*! return matrix for rotation around arbitrary axis and point, only in 3D */ static inline AffineSpaceT rotate(const VectorT& p, const VectorT& u, const ScalarT& r) { return translate(+p) * rotate(u,r) * translate(-p); } - /*! return matrix for looking at given point, only in 3D */ + /*! return matrix for looking at given point, only in 3D; right-handed coordinate system */ static inline AffineSpaceT lookat(const VectorT& eye, const VectorT& point, const VectorT& up) { VectorT Z = normalize(point-eye); - VectorT U = normalize(cross(up,Z)); - VectorT V = normalize(cross(Z,U)); + VectorT U = normalize(cross(Z,up)); + VectorT V = cross(U,Z); return AffineSpaceT(L(U,V,Z),eye); } diff --git a/components/ospcommon/CMakeLists.txt b/components/ospcommon/CMakeLists.txt index 99d9bc8366..86a20b7a8c 100644 --- a/components/ospcommon/CMakeLists.txt +++ b/components/ospcommon/CMakeLists.txt @@ -120,8 +120,11 @@ ELSE() ) OSPRAY_INSTALL_SDK_HEADERS( - tasking/parallel_for.h tasking/async.h + tasking/parallel_for.h + tasking/parallel_for.inl + tasking/schedule.h + tasking/schedule.inl tasking/tasking_system_handle.h tasking/TaskSys.h tasking/TaskingTypeTraits.h diff --git a/components/ospcommon/cmake/macros.cmake b/components/ospcommon/cmake/macros.cmake index 23acd8732a..3adc172e0f 100644 --- a/components/ospcommon/cmake/macros.cmake +++ b/components/ospcommon/cmake/macros.cmake @@ -28,22 +28,6 @@ MACRO(OSPRAY_WARN_ONCE identifier message) ENDIF() ENDMACRO() -## Function to check for Embree features ## -FUNCTION(OSPRAY_CHECK_EMBREE_FEATURE FEATURE DESCRIPTION) - SET(FEATURE EMBREE_${FEATURE}) - IF(NOT ${ARGN}) - IF (${FEATURE}) - MESSAGE(FATAL_ERROR "OSPRay requires Embree to be compiled " - "without ${DESCRIPTION} (${FEATURE}=OFF).") - ENDIF() - ELSE() - IF (NOT ${FEATURE}) - MESSAGE(FATAL_ERROR "OSPRay requires Embree to be compiled " - "with support for ${DESCRIPTION} (${FEATURE}=ON).") - ENDIF() - ENDIF() -ENDFUNCTION() - ## Macro configure ISA targets for ispc ## MACRO(OSPRAY_CONFIGURE_ISPC_ISA) @@ -229,7 +213,7 @@ FUNCTION(OSPRAY_SPLIT_CREATE_ARGS PREFIX) IF (NOT ${MY_EXCLUDE_FROM_ALL}) LIST(LENGTH MY_COMPONENT COMPONENTS) IF (COMPONENTS EQUAL 0) - MESSAGE(WARNING "No COMPONENT for installation specified!") + MESSAGE(STATUS "No COMPONENT for installation specified! Using default COMPONENT name \"${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}\"") SET(MY_COMPONENT ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}) ELSE() LIST(GET MY_COMPONENT -1 MY_COMPONENT) @@ -355,26 +339,26 @@ MACRO(OSPRAY_CONFIGURE_COMPILER) OPTION(OSPRAY_STRICT_BUILD "Build with additional warning flags" OFF) MARK_AS_ADVANCED(OSPRAY_STRICT_BUILD) - SET(OSPRAY_COMPILER_ICC OFF) - SET(OSPRAY_COMPILER_GCC OFF) - SET(OSPRAY_COMPILER_CLANG OFF) - SET(OSPRAY_COMPILER_MSVC OFF) + SET(OSPRAY_COMPILER_ICC FALSE) + SET(OSPRAY_COMPILER_GCC FALSE) + SET(OSPRAY_COMPILER_CLANG FALSE) + SET(OSPRAY_COMPILER_MSVC FALSE) IF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel") - SET(OSPRAY_COMPILER_ICC ON) + SET(OSPRAY_COMPILER_ICC TRUE) IF(WIN32) # icc on Windows behaves like msvc INCLUDE(msvc) ELSE() INCLUDE(icc) ENDIF() ELSEIF (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") - SET(OSPRAY_COMPILER_GCC ON) + SET(OSPRAY_COMPILER_GCC TRUE) INCLUDE(gcc) ELSEIF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") - SET(OSPRAY_COMPILER_CLANG ON) + SET(OSPRAY_COMPILER_CLANG TRUE) INCLUDE(clang) ELSEIF (${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") - SET(OSPRAY_COMPILER_MSVC ON) + SET(OSPRAY_COMPILER_MSVC TRUE) INCLUDE(msvc) ELSE() MESSAGE(FATAL_ERROR diff --git a/ospray/CMakeLists.txt b/ospray/CMakeLists.txt index 6427f7c79d..6647651d96 100644 --- a/ospray/CMakeLists.txt +++ b/ospray/CMakeLists.txt @@ -22,29 +22,6 @@ SET(CMAKE_THREAD_PREFER_PTHREAD TRUE) SET(THREADS_PREFER_PTHREAD_FLAG TRUE) # for gcc6 FIND_PACKAGE(Threads REQUIRED) -# ------------------------------------------------------- -# redistribute TBB -# ------------------------------------------------------- - -IF (OSPRAY_TASKING_TBB AND OSPRAY_INSTALL_DEPENDENCIES) - IF (WIN32) - SET(TBB_DLL_HINTS - ${TBB_ROOT}/../redist/${TBB_ARCH}_win/tbb/${TBB_VCVER} - ${TBB_ROOT}/../redist/${TBB_ARCH}/tbb/${TBB_VCVER} - ${TBB_ROOT}/bin/${TBB_ARCH}/${TBB_VCVER} - ) - FIND_FILE(TBB_DLL tbb.dll HINTS ${TBB_DLL_HINTS}) - FIND_FILE(TBB_DLL_MALLOC tbbmalloc.dll PATHS HINTS ${TBB_DLL_HINTS}) - MARK_AS_ADVANCED(TBB_DLL) - MARK_AS_ADVANCED(TBB_DLL_MALLOC) - INSTALL(PROGRAMS ${TBB_DLL} ${TBB_DLL_MALLOC} - DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT redist) - ELSE() - INSTALL(PROGRAMS ${TBB_LIBRARY} ${TBB_LIBRARY_MALLOC} - DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT redist) - ENDIF() -ENDIF() - # ------------------------------------------------------- # Setup ospray include directories and source files # ------------------------------------------------------- @@ -262,6 +239,8 @@ OSPRAY_INSTALL_SDK_HEADERS( OSPRAY_INSTALL_SDK_HEADERS( fb/FrameBuffer.h fb/FrameBuffer.ih + fb/LocalFB.h + fb/LocalFB.ih fb/PixelOp.h fb/Tile.h fb/Tile.ih @@ -273,6 +252,7 @@ OSPRAY_INSTALL_SDK_HEADERS( geometry/Geometry.h geometry/Geometry.ih geometry/Instance.h + geometry/Instance.ih geometry/Isosurfaces.h geometry/Slices.h geometry/Spheres.h diff --git a/ospray/camera/Camera.h b/ospray/camera/Camera.h index e720a4491d..77320b732c 100644 --- a/ospray/camera/Camera.h +++ b/ospray/camera/Camera.h @@ -56,6 +56,6 @@ namespace ospray { of this camera. */ #define OSP_REGISTER_CAMERA(InternalClass, external_name) \ - OSP_REGISTER_OBJECT(Camera, camera, InternalClass, external_name) + OSP_REGISTER_OBJECT(::ospray::Camera, camera, InternalClass, external_name) } // ::ospray diff --git a/ospray/camera/PerspectiveCamera.cpp b/ospray/camera/PerspectiveCamera.cpp index fa5691445f..169a10098e 100644 --- a/ospray/camera/PerspectiveCamera.cpp +++ b/ospray/camera/PerspectiveCamera.cpp @@ -49,7 +49,7 @@ namespace ospray { // now, update the local precomputed values // ------------------------------------------------------------------ dir = normalize(dir); - vec3f dir_du = normalize(cross(dir, up)); + vec3f dir_du = normalize(cross(dir, up)); // right-handed coordinate system vec3f dir_dv; if (architectural) dir_dv = normalize(up); // orient film to be parallel to 'up' and shift such that 'dir' is centered diff --git a/ospray/common/Material.h b/ospray/common/Material.h index 9899be3f44..27578c0f7b 100644 --- a/ospray/common/Material.h +++ b/ospray/common/Material.h @@ -67,6 +67,7 @@ namespace ospray { of this material. */ #define OSP_REGISTER_MATERIAL(InternalClass, external_name) \ - OSP_REGISTER_OBJECT(Material, material, InternalClass, external_name) + OSP_REGISTER_OBJECT(::ospray::Material, material, \ + InternalClass, external_name) } // ::ospray diff --git a/ospray/geometry/Geometry.h b/ospray/geometry/Geometry.h index 13fc92f021..75c1471a28 100644 --- a/ospray/geometry/Geometry.h +++ b/ospray/geometry/Geometry.h @@ -83,6 +83,7 @@ namespace ospray { of this geometry. */ #define OSP_REGISTER_GEOMETRY(InternalClass, external_name) \ - OSP_REGISTER_OBJECT(Geometry, geometry, InternalClass, external_name) + OSP_REGISTER_OBJECT(::ospray::Geometry, geometry, \ + InternalClass, external_name) } // ::ospray diff --git a/ospray/lights/Light.h b/ospray/lights/Light.h index 690e77dde6..7c1722807e 100644 --- a/ospray/lights/Light.h +++ b/ospray/lights/Light.h @@ -38,6 +38,6 @@ namespace ospray { }; #define OSP_REGISTER_LIGHT(InternalClass, external_name) \ - OSP_REGISTER_OBJECT(Light, light, InternalClass, external_name) + OSP_REGISTER_OBJECT(::ospray::Light, light, InternalClass, external_name) } // ::ospray diff --git a/ospray/render/Renderer.h b/ospray/render/Renderer.h index c3d5a5bf3e..16d7015c41 100644 --- a/ospray/render/Renderer.h +++ b/ospray/render/Renderer.h @@ -126,7 +126,8 @@ namespace ospray { of this renderer. */ #define OSP_REGISTER_RENDERER(InternalClass, external_name) \ - OSP_REGISTER_OBJECT(Renderer, renderer, InternalClass, external_name) + OSP_REGISTER_OBJECT(::ospray::Renderer, renderer, \ + InternalClass, external_name) } // ::ospray diff --git a/ospray/transferFunction/TransferFunction.h b/ospray/transferFunction/TransferFunction.h index a7b14ee139..eca2f03131 100644 --- a/ospray/transferFunction/TransferFunction.h +++ b/ospray/transferFunction/TransferFunction.h @@ -50,6 +50,7 @@ namespace ospray { module and registered with OSPRay using this macro. */ #define OSP_REGISTER_TRANSFER_FUNCTION(InternalClass, external_name) \ - OSP_REGISTER_OBJECT(TransferFunction, transfer_function, InternalClass, external_name) + OSP_REGISTER_OBJECT(::ospray::TransferFunction, transfer_function, \ + InternalClass, external_name) } // ::ospray diff --git a/ospray/volume/Volume.h b/ospray/volume/Volume.h index 5610505d37..173780fea1 100644 --- a/ospray/volume/Volume.h +++ b/ospray/volume/Volume.h @@ -99,6 +99,6 @@ namespace ospray { module and registered with OSPRay using this macro. */ #define OSP_REGISTER_VOLUME(InternalClass, external_name) \ - OSP_REGISTER_OBJECT(Volume, volume, InternalClass, external_name) + OSP_REGISTER_OBJECT(::ospray::Volume, volume, InternalClass, external_name) } // ::ospray diff --git a/scripts/release/linux.sh b/scripts/release/linux.sh index 167a2846e6..406a54b478 100755 --- a/scripts/release/linux.sh +++ b/scripts/release/linux.sh @@ -68,15 +68,6 @@ if [ -z $CC ]; then export CXX=icpc fi -# to make sure we do not include nor link against wrong TBB -# NOTE: if we are not verifying CentOS6 defaults, we are likely using -# a different compiler which requires LD_LIBRARY_PATH! -if [ -n $OSPRAY_RELEASE_NO_VERIFY ]; then - unset CPATH - unset LIBRARY_PATH - unset LD_LIBRARY_PATH -fi - #### Fetch dependencies (TBB+Embree+ISPC) #### mkdir -p $DEP_DIR @@ -124,13 +115,9 @@ cmake \ # create RPM files make -j `nproc` preinstall -# if we define 'OSPRAY_RELEASE_NO_VERIFY' to anything, then we -# don't verify link dependencies for CentOS6 -if [ -z $OSPRAY_RELEASE_NO_VERIFY ]; then - check_symbols libospray.so GLIBC 2 4 0 - check_symbols libospray.so GLIBCXX 3 4 11 - check_symbols libospray.so CXXABI 1 3 0 -fi +check_symbols libospray.so GLIBC 2 4 0 +check_symbols libospray.so GLIBCXX 3 4 11 +check_symbols libospray.so CXXABI 1 3 0 make -j `nproc` package @@ -138,7 +125,7 @@ make -j `nproc` package OSPRAY_VERSION=`sed -n 's/#define OSPRAY_VERSION "\(.*\)"/\1/p' ospray/version.h` # rename RPMs to have component name before version -for i in ospray-${OSPRAY_VERSION}-1.*.rpm ; do +for i in ospray-${OSPRAY_VERSION}-1.*.rpm ; do newname=`echo $i | sed -e "s/ospray-\(.\+\)-\([a-z_]\+\)\.rpm/ospray-\2-\1.rpm/"` mv $i $newname done