Commit e84e8b84 authored by David E. DeMarle's avatar David E. DeMarle Committed by Kitware Robot
Browse files

Merge topic 'bump-ospray-to-2.4.0'

27cda366 add installed rpath to openvkl to make SB's build run as is
c4b864bb

 bump to ospray 2.4

Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: Utkarsh Ayachit's avatarUtkarsh Ayachit <utkarsh.ayachit@kitware.com>
Merge-request: !782
parents 0f5408de 27cda366
......@@ -5,6 +5,3 @@ superbuild_add_project(openimagedenoise
-DCMAKE_INSTALL_NAME_DIR:PATH=<INSTALL_DIR>/lib
-DCMAKE_INSTALL_LIBDIR:STRING=lib
)
superbuild_apply_patch(openimagedenoise fix-openmp-flag
"Fix openmp-simd flag on older compilers")
......@@ -8,4 +8,4 @@ superbuild_add_project(openvkl
-DCMAKE_INSTALL_LIBDIR:STRING=lib
-DISPC_EXECUTABLE:PATH=<INSTALL_DIR>/bin/ispc)
superbuild_apply_patch(openvkl anchor-libraries "assist with dynamic library resolution")
superbuild_apply_patch(openvkl install-rpath "make rpath for superbuild to modify")
......@@ -27,5 +27,3 @@ superbuild_add_project(ospray
superbuild_add_extra_cmake_args(
-DOSPRAY_INSTALL_DIR:PATH=<INSTALL_DIR>)
superbuild_apply_patch(ospray anchor-libraries "assist with dynamic library resolution")
diff --git a/cmake/oidn_platform.cmake b/cmake/oidn_platform.cmake
index b06853e..a292c2f 100644
--- a/cmake/oidn_platform.cmake
+++ b/cmake/oidn_platform.cmake
@@ -1,6 +1,8 @@
## Copyright 2009-2020 Intel Corporation
## SPDX-License-Identifier: Apache-2.0
+include(CheckCXXCompilerFlag)
+
set(OIDN_C_CXX_FLAGS)
set(OIDN_C_CXX_FLAGS_RELEASE)
set(OIDN_C_CXX_FLAGS_DEBUG)
@@ -142,7 +144,10 @@ if(WIN32)
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
append(OIDN_C_CXX_FLAGS "-qopenmp-simd")
else()
- append(OIDN_C_CXX_FLAGS "-fopenmp-simd")
+ check_cxx_compiler_flag(-fopenmp-simd compiler-openmp-simd-support)
+ if(compiler-openmp-simd-support)
+ append(OIDN_C_CXX_FLAGS "-fopenmp-simd")
+ endif()
endif()
## -----------------------------------------------------------------------------
diff --git a/openvkl/common/VKLCommon.cpp b/openvkl/common/VKLCommon.cpp
index a9e2f57..aa240d1 100644
--- a/openvkl/common/VKLCommon.cpp
+++ b/openvkl/common/VKLCommon.cpp
@@ -13,7 +13,7 @@ namespace openvkl {
VKLError loadLocalModule(const std::string &moduleName)
{
std::string libName = "openvkl_module_" + moduleName;
- rkcommon::loadLibrary(libName);
+ rkcommon::loadLibrary(libName, true);
std::string initSymName = "openvkl_init_module_" + moduleName;
void *initSym = rkcommon::getSymbol(initSymName);
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1aef5d9..eb5d9ca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,6 +21,15 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
project(openvkl VERSION 0.11.0 LANGUAGES C CXX)
+#put rpath into install tree for ParaViewSB to fixup after
+set(CMAKE_SKIP_INSTALL_RPATH OFF)
+if (APPLE)
+ set(CMAKE_MACOSX_RPATH ON)
+ set(CMAKE_INSTALL_RPATH "@executable_path/" "@executable_path/../${CMAKE_INSTALL_LIBDIR}")
+else()
+ set(CMAKE_INSTALL_RPATH "\$ORIGIN:\$ORIGIN/../${CMAKE_INSTALL_LIBDIR}")
+endif()
+
## Add openvkl specific macros ##
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
diff --git a/doc/ospray-doc b/doc/ospray-doc
deleted file mode 160000
index e89eabcc5..000000000
--- a/doc/ospray-doc
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit e89eabcc590d7ec94be655305f52b5b03addbf8d
diff --git a/ospray/common/OSPCommon.cpp b/ospray/common/OSPCommon.cpp
index 7ff2b34a4..55e16aead 100644
--- a/ospray/common/OSPCommon.cpp
+++ b/ospray/common/OSPCommon.cpp
@@ -582,7 +582,7 @@ uint32_t logLevel()
OSPError loadLocalModule(const std::string &name)
{
std::string libName = "ospray_module_" + name;
- loadLibrary(libName, false);
+ loadLibrary(libName, true);
std::string initSymName = "ospray_module_init_" + name;
void *initSym = getSymbol(initSymName);
diff --git a/rkcommon/CMakeLists.txt b/rkcommon/CMakeLists.txt
index ddf6dc6..5bd6297 100644
--- a/rkcommon/CMakeLists.txt
+++ b/rkcommon/CMakeLists.txt
@@ -54,16 +54,7 @@ if (WIN32)
set(EXTRA_COMPILE_DEFINITIONS -DNOMINMAX -DWIN32_LEAN_AND_MEAN)
endif()
-target_compile_definitions(${PROJECT_NAME}
- PRIVATE
- # NOTE(jda) - OSPRAY_SOVERSION fallbacks in library.cpp should be handled
- # in the Library object's interface directly, where librkcommon
- # would inject versioning information independent of rkcommon
- # version.
- -DOSPRAY_SOVERSION=2
- PUBLIC
- ${EXTRA_COMPILE_DEFINITIONS}
-)
+target_compile_definitions(${PROJECT_NAME} PUBLIC ${EXTRA_COMPILE_DEFINITIONS})
set_property(TARGET rkcommon PROPERTY POSITION_INDEPENDENT_CODE ON)
diff --git a/rkcommon/os/library.cpp b/rkcommon/os/library.cpp
index 734fa80..080befb 100644
--- a/rkcommon/os/library.cpp
+++ b/rkcommon/os/library.cpp
@@ -15,10 +15,16 @@
#include <sys/times.h>
#endif
+#if defined(__MACOSX__) || defined(__APPLE__)
+#define RKCOMMON_LIB_EXT ".dylib"
+#else
+#define RKCOMMON_LIB_EXT ".so"
+#endif
+
extern "C" {
/* Export a symbol to ask the dynamic loader about in order to locate this
* library at runtime. */
-RKCOMMON_INTERFACE int _ospray_anchor()
+RKCOMMON_INTERFACE int _rkcommon_anchor()
{
return 0;
}
@@ -30,7 +36,7 @@ namespace {
{
#if defined(_WIN32) && !defined(__CYGWIN__)
MEMORY_BASIC_INFORMATION mbi;
- VirtualQuery(&_ospray_anchor, &mbi, sizeof(mbi));
+ VirtualQuery(&_rkcommon_anchor, &mbi, sizeof(mbi));
char pathBuf[16384];
if (!GetModuleFileNameA(
static_cast<HMODULE>(mbi.AllocationBase), pathBuf, sizeof(pathBuf)))
@@ -39,7 +45,7 @@ namespace {
std::string path = std::string(pathBuf);
path.resize(path.rfind('\\') + 1);
#else
- const char *anchor = "_ospray_anchor";
+ const char *anchor = "_rkcommon_anchor";
void *handle = dlsym(RTLD_DEFAULT, anchor);
if (!handle)
return std::string();
@@ -60,11 +66,26 @@ namespace {
namespace rkcommon {
- Library::Library(const std::string &name, bool anchor) : libraryName(name)
+ Library::Library(const std::string &name, bool) : libraryName(name)
+ {
+ bool success = loadLibrary(false);
+ if (!success)
+ success = loadLibrary(true);
+
+ if (!success)
+ throw std::runtime_error(errorMessage);
+ }
+
+ Library::Library(void *const _lib)
+ : libraryName("<pre-loaded>"), lib(_lib), freeLibOnDelete(false)
+ {
+ }
+
+ bool Library::loadLibrary(bool withAnchor)
{
- std::string file = name;
+ std::string file = libraryName;
std::string errorMsg;
- std::string libLocation = anchor ? library_location() : std::string();
+ std::string libLocation = withAnchor ? library_location() : std::string();
#ifdef _WIN32
std::string fullName = libLocation + file + ".dll";
lib = LoadLibrary(fullName.c_str());
@@ -86,36 +107,17 @@ namespace rkcommon {
LocalFree(lpMsgBuf);
}
#else
-#if defined(__MACOSX__) || defined(__APPLE__)
- std::string fullName = libLocation + "lib" + file + ".dylib";
-#else
- std::string fullName = libLocation + "lib" + file + ".so";
-#endif
- lib = dlopen(fullName.c_str(), RTLD_LAZY | RTLD_LOCAL);
- if (lib == nullptr) {
- auto *_msg = dlerror();
- if (_msg)
- errorMsg = _msg; // remember original error
- // retry with SOVERSION in case symlinks are missing
- std::string soversion(TOSTRING(OSPRAY_SOVERSION));
-#if defined(__MACOSX__) || defined(__APPLE__)
- fullName = "lib" + file + "." + soversion + ".dylib";
-#else
- fullName += "." + soversion;
-#endif
- lib = dlopen(fullName.c_str(), RTLD_LAZY | RTLD_LOCAL);
- }
+ std::string fullName = libLocation + "lib" + file + RKCOMMON_LIB_EXT;
+ lib = dlopen(fullName.c_str(), RTLD_LAZY | RTLD_LOCAL);
#endif
if (lib == nullptr) {
- throw std::runtime_error("could not open module lib " + name + ": " +
- errorMsg);
+ errorMessage =
+ "could not open module lib " + libraryName + ": " + errorMsg;
+ return false;
}
- }
- Library::Library(void *const _lib)
- : libraryName("<pre-loaded>"), lib(_lib), freeLibOnDelete(false)
- {
+ return true;
}
Library::~Library()
diff --git a/rkcommon/os/library.h b/rkcommon/os/library.h
index 5afcaa6..8d67473 100644
--- a/rkcommon/os/library.h
+++ b/rkcommon/os/library.h
@@ -21,8 +21,12 @@ namespace rkcommon {
private:
Library(void *const lib);
+
+ bool loadLibrary(bool withAnchor);
+
std::string libraryName;
- void *lib;
+ std::string errorMessage;
+ void *lib{nullptr};
bool freeLibOnDelete{true};
friend class LibraryRepository;
};
......@@ -6,5 +6,3 @@ superbuild_add_project(rkcommon
-DCMAKE_INSTALL_NAME_DIR:PATH=<INSTALL_DIR>/lib
-DINSTALL_DEPS:BOOL=OFF
)
superbuild_apply_patch(rkcommon allow-library-paths "assist with dynamic library resolution")
......@@ -76,45 +76,45 @@ superbuild_set_revision(socat
if (WIN32)
set(ispc_suffix "-windows.zip")
set(ispc_md5 ec76fdd4a31dbfa90ffd70768bd21384)
set(ispc_md5 ad96f833c1429a292c40c4f4821985fe)
elseif (APPLE)
set(ispc_suffix "-macOS.tar.gz")
set(ispc_md5 d56d35cff940c89efe16297b236bca91)
set(ispc_md5 c856ed3af19b948e83f4277b1a19766f)
else()
set(ispc_suffix "-linux.tar.gz")
set(ispc_md5 7f0150e33a8f64a1942134b77f3c5046)
set(ispc_md5 7ce4350f079c7eb8a1ce9d9908f5d85d)
endif()
superbuild_set_revision(ispc
URL "https://www.paraview.org/files/dependencies/ispc-v1.12.0${ispc_suffix}"
URL "https://www.paraview.org/files/dependencies/ispc-v1.14.1${ispc_suffix}"
URL_MD5 "${ispc_md5}")
superbuild_set_revision(embree
URL "https://www.paraview.org/files/dependencies/embree-v3.9.0.tar.gz"
URL_MD5 a5c220ca9033ff4856895de7e1a6deaa)
URL "https://www.paraview.org/files/dependencies/embree-v3.12.0.tar.gz"
URL_MD5 f0db3c7029467fdc6d29709cb85fc607)
superbuild_set_revision(openvkl
URL "https://www.paraview.org/files/dependencies/openvkl-v0.10.0.tar.gz"
URL_MD5 ac8541bf6d7a067c91dd8b1c76a83fb3)
URL "https://www.paraview.org/files/dependencies/openvkl-v0.11.0.tar.gz"
URL_MD5 252980f79c3097599b2d8e643f9c5b8f)
superbuild_set_revision(ospray
URL "https://www.paraview.org/files/dependencies/ospray-v2.2.0.tar.gz"
URL_MD5 a514fd8238c1a00b9a2394912a726417)
URL "https://www.paraview.org/files/dependencies/ospray-v2.4.0.tar.gz"
URL_MD5 8e6537b0dacb08fffb0778663e617886)
superbuild_set_revision(ospraymodulempi
URL "https://www.paraview.org/files/dependencies/ospraymodulempi-v2.2.0.tar.gz"
URL_MD5 0d15ba06888e7dce29237b539a921fae)
URL "https://www.paraview.org/files/dependencies/ospraymodulempi-v2.4.0.tar.gz"
URL_MD5 1f8f2214c09f539de88004e47bce22bd)
superbuild_set_revision(ospraymaterials
URL "https://www.paraview.org/files/data/OSPRayMaterials-0.2.tar.gz"
URL_MD5 3b2716318ec8bf719373f25737b0bddc)
superbuild_set_revision(openimagedenoise
URL "https://www.paraview.org/files/dependencies/oidn-v1.2.2.tar.gz"
URL_MD5 87db47c8c0ea93db97112888b04bb941)
URL "https://www.paraview.org/files/dependencies/oidn-v1.2.4.tar.gz"
URL_MD5 501b787a5e2fcaf2dfd8a39d47ee03dd)
superbuild_set_revision(rkcommon
URL "https://www.paraview.org/files/dependencies/rkcommon-v1.4.2.tar.gz"
URL_MD5 e98bf98786739cfec82e661554d24f0f)
URL "https://www.paraview.org/files/dependencies/rkcommon-v1.5.1.tar.gz"
URL_MD5 61f55e4d0d8efd48c8bc308bf5b4ee1f)
superbuild_set_revision(openvr
URL "https://www.paraview.org/files/dependencies/openvr_1.0.10_win_thin.zip"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment