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 bfe4d0d751
commit 06c63a125b
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)
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)
target_link_libraries(poet PRIVATE poetlib MPI::MPI_C RRuntime)

View File

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

View File

@ -1,8 +1,10 @@
#ifndef POET_H
#define POET_H
#include <string>
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