Add R library file as string to executable

This commit is contained in:
Max Lübke 2024-03-06 12:34:02 +01:00
parent 13e79382fe
commit 10c31e3a9a
3 changed files with 7 additions and 4 deletions

View File

@ -38,7 +38,9 @@ if (POET_PHT_ADDITIONAL_INFO)
target_compile_definitions(poetlib PRIVATE POET_PHT_ADD) target_compile_definitions(poetlib PRIVATE POET_PHT_ADD)
endif() endif()
configure_file(poet.hpp.in poet.hpp) file(READ "${PROJECT_SOURCE_DIR}/R_lib/kin_r_library.R" R_KIN_LIB )
configure_file(poet.hpp.in poet.hpp @ONLY)
add_executable(poet poet.cpp) add_executable(poet poet.cpp)
target_link_libraries(poet PRIVATE poetlib MPI::MPI_C RRuntime) target_link_libraries(poet PRIVATE poetlib MPI::MPI_C RRuntime)

View File

@ -302,8 +302,7 @@ int main(int argc, char *argv[]) {
/*Loading Dependencies*/ /*Loading Dependencies*/
// TODO: kann raus // TODO: kann raus
std::string r_load_dependencies = "source('../R_lib/kin_r_library.R');"; R.parseEvalQ(kin_r_library);
R.parseEvalQ(r_load_dependencies);
SimParams params(world_rank, world_size); SimParams params(world_rank, world_size);
int pret = params.parseFromCmdl(argv, R); int pret = params.parseFromCmdl(argv, R);

View File

@ -1,8 +1,10 @@
#ifndef POET_H #ifndef POET_H
#define POET_H #define POET_H
#include <string>
static const char *poet_version = "@POET_VERSION@"; static const char *poet_version = "@POET_VERSION@";
static const char *CHEMISTRY_MODULE_NAME = "state_C"; // using the Raw string literal to avoid escaping the quotes
static inline std::string kin_r_library = R"(@R_KIN_LIB@)";
#endif // POET_H #endif // POET_H