Skip to content

Commit

Permalink
Use OIIO_R3D_LIBRARY_PATH environment variable
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Kovář <[email protected]>
  • Loading branch information
1div0 committed Apr 17, 2024
1 parent d8f600a commit 6c42d2d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/r3d.imageio/r3dinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#include <list>
#include <map>
#include <mutex>
#include <string_view>
#include <thread>
#include <time.h>
#include <unistd.h>
Expand Down Expand Up @@ -167,11 +168,22 @@ R3dInput::initialize()
{
DBG("R3dInput::initialize()\n");

std::string library_path
= Sysutil::getenv("OIIO_R3D_LIBRARY_PATH",
#if defined(__linux__)
"/opt/R3DSDKv8_5_1/Redistributable/linux"
#elif defined(__APPLE__)
"/Library/R3DSDKv8_5_1/Redistributable/mac"
#elif defined(__WINDOWS__)
"C:\\R3DSDKv8_5_1\\Redistributable\\win"
#else
#error "Unknown OS"
#endif
);
// initialize SDK
// R3DSDK::InitializeStatus init_status = R3DSDK::InitializeSdk(".", OPTION_RED_CUDA);
R3DSDK::InitializeStatus init_status
= R3DSDK::InitializeSdk("/opt/R3DSDKv8_5_1/Redistributable/linux",
OPTION_RED_NONE);
= R3DSDK::InitializeSdk(library_path.c_str(), OPTION_RED_NONE);
if (init_status != R3DSDK::ISInitializeOK) {
R3DSDK::FinalizeSdk();
DBG("Failed to load R3DSDK Library\n");
Expand Down

0 comments on commit 6c42d2d

Please sign in to comment.