mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Wrapped the first instance trying to use dlopen in a posix safety ifdef
This commit is contained in:
parent
bc7e03e708
commit
8f515b504a
1 changed files with 8 additions and 0 deletions
|
|
@ -2,7 +2,10 @@
|
|||
|
||||
#include <algorithm> // for move
|
||||
#include <sstream> // for stringstream
|
||||
|
||||
#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
|
||||
#include <dlfcn.h> // for dlopen
|
||||
#endif
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include "xtensor/xadapt.hpp"
|
||||
|
|
@ -277,12 +280,17 @@ void initialize_source()
|
|||
msg << "Sampling from library source " << settings::path_source << "...";
|
||||
write_message(msg, 6);
|
||||
|
||||
#if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
|
||||
// Open the library
|
||||
void* source_library = dlopen(settings::path_source_library.c_str(),RTLD_LAZY);
|
||||
if(!source_library) {
|
||||
std::stringstream msg("Couldnt open source library " + settings::path_source_library);
|
||||
fatal_error(msg);
|
||||
}
|
||||
#else
|
||||
std::stringstream msg("This feature has not yet been implemented for non POSIX systems");
|
||||
fatal_error(msg);
|
||||
#endif
|
||||
|
||||
// load the symbol
|
||||
typedef Particle::Bank (*sample_t)();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue