Commit 040e1805 authored by Ben Boeckel's avatar Ben Boeckel
Browse files

ospray: bump to 1.8.4

This fixes ospray plugin loading in the packages.
parent 5028dc93
......@@ -17,7 +17,7 @@ foreach (paraview_plugin IN LISTS paraview_plugins)
continue ()
endif ()
foreach (path IN ITEMS "" "paraview-${paraview_version}")
foreach (path IN ITEMS "" "paraview-${paraview_version}" "paraview-${paraview_version}/plugins/${paraview_plugin}")
if (EXISTS "${superbuild_install_location}/lib/${path}/lib${paraview_plugin}.dylib")
list(APPEND paraview_plugin_paths
"${superbuild_install_location}/lib/${path}/lib${paraview_plugin}.dylib")
......
......@@ -36,8 +36,5 @@ superbuild_add_project(ospray
-DOSPRAY_MODULE_TACHYON:BOOL=OFF
-DCMAKE_INSTALL_LIBDIR:STRING=lib)
# https://github.com/ospray/ospray/pull/312
superbuild_apply_patch(ospray plugin-paths "Open plugins relative to libospray")
superbuild_add_extra_cmake_args(
-DOSPRAY_INSTALL_DIR:PATH=<INSTALL_DIR>)
From 4dde523b12a4a8c15ca7d533d32d9b6a4bfcd7aa Mon Sep 17 00:00:00 2001
From: Ben Boeckel <ben.boeckel@kitware.com>
Date: Fri, 29 Mar 2019 10:09:32 -0400
Subject: [PATCH] library: open module relative to libospray's location
See #311
---
components/ospcommon/library.cpp | 54 +++++++++++++++++++++++++++++---
1 file changed, 49 insertions(+), 5 deletions(-)
diff --git a/components/ospcommon/library.cpp b/components/ospcommon/library.cpp
index d9cacf056..3fef82184 100644
--- a/components/ospcommon/library.cpp
+++ b/components/ospcommon/library.cpp
@@ -29,6 +29,50 @@
#include <sys/times.h>
#endif
+extern "C" {
+
+ /* Export a symbol to ask the dynamic loader about in order to locate this
+ * library at runtime. */
+ OSPCOMMON_INTERFACE const int _ospray_anchor()
+ {
+ return 0;
+ }
+
+}
+
+namespace {
+
+ std::string library_location()
+ {
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ MEMORY_BASIC_INFORMATION mbi;
+ VirtualQuery(&_ospray_anchor, &mbi, sizeof(mbi));
+ char pathBuf[16384];
+ if (!GetModuleFileNameA(static_cast<HMODULE>(mbi.AllocationBase), pathBuf, sizeof(pathBuf)))
+ return std::string();
+
+ std::string path = std::string(pathBuf);
+ path.resize(path.rfind('\\') + 1);
+#else
+ const char* anchor = "_ospray_anchor";
+ void* handle = dlsym(RTLD_DEFAULT, anchor);
+ if (!handle)
+ return std::string();
+
+ Dl_info di;
+ int ret = dladdr(handle, &di);
+ if (!ret || !di.dli_saddr || !di.dli_fname)
+ return std::string();
+
+ std::string path = std::string(di.dli_fname);
+ path.resize(path.rfind('/') + 1);
+#endif
+
+ return path;
+ }
+
+}
+
namespace ospcommon {
/*! helper class that executes a asm 'cpuid' instruction to query
@@ -98,11 +142,11 @@ namespace ospcommon {
std::string file = name;
void *lib = nullptr;
#ifdef _WIN32
- std::string fullName = file + ".dll";
+ std::string fullName = library_location() + file + ".dll";
lib = LoadLibrary(fullName.c_str());
#else
std::string fullName =
- "lib" + file + "_" + desiredISAname + "_" + precision;
+ library_location() + "lib" + file + "_" + desiredISAname + "_" + precision;
#if defined(__MACOSX__) || defined(__APPLE__)
fullName += ".dylib";
@@ -172,7 +216,7 @@ namespace ospcommon {
std::string file = name;
std::string errorMsg;
#ifdef _WIN32
- std::string fullName = file + ".dll";
+ std::string fullName = library_location() + file + ".dll";
lib = LoadLibrary(fullName.c_str());
if (lib == nullptr) {
DWORD err = GetLastError();
@@ -193,9 +237,9 @@ namespace ospcommon {
}
#else
#if defined(__MACOSX__) || defined(__APPLE__)
- std::string fullName = "lib" + file + ".dylib";
+ std::string fullName = library_location() + "lib" + file + ".dylib";
#else
- std::string fullName = "lib" + file + ".so";
+ std::string fullName = library_location() + "lib" + file + ".so";
#endif
lib = dlopen(fullName.c_str(), RTLD_NOW | RTLD_GLOBAL);
if (lib == nullptr) {
--
2.20.1
......@@ -107,8 +107,8 @@ superbuild_set_revision(embree
URL_MD5 f414fefe6167ba58102fd0eb06c9ee5b)
superbuild_set_revision(ospray
URL "https://www.paraview.org/files/dependencies/ospray-1.8.2.tar.gz"
URL_MD5 8fb04c82927fef9a39903290477912af)
URL "https://www.paraview.org/files/dependencies/ospray-1.8.4.tar.gz"
URL_MD5 359a56552d981d057bfbd3e97f4fc0b7)
superbuild_set_revision(ospraymaterials
URL "https://www.paraview.org/files/data/OSPRayMaterials-0.1.tar.gz"
......
Markdown is supported
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