fix: missing namespace of phreeqcrm leads to ambiguous macro names

This commit is contained in:
Max Luebke 2022-11-07 16:32:43 +01:00 committed by Max Lübke
parent 99d937eaf6
commit df08e38b9a
6 changed files with 11 additions and 14 deletions

View File

@ -24,6 +24,7 @@ add_subdirectory(data)
add_subdirectory(app)
add_subdirectory(ext/tug EXCLUDE_FROM_ALL)
add_subdirectory(ext/phreeqcrm EXCLUDE_FROM_ALL)
option(BUILD_DOC "Build documentation with doxygen" OFF)

View File

@ -74,10 +74,10 @@ int main(int argc, char *argv[]) {
SimParams params(world_rank, world_size);
int pret = params.parseFromCmdl(argv, R);
if (pret == PARSER_ERROR) {
if (pret == poet::PARSER_ERROR) {
MPI_Finalize();
return EXIT_FAILURE;
} else if (pret == PARSER_HELP) {
} else if (pret == poet::PARSER_HELP) {
MPI_Finalize();
return EXIT_SUCCESS;
}

View File

@ -26,6 +26,7 @@
#include "Grid.hpp"
#include "RInside.h"
#include "SimParams.hpp"
#include <PhreeqcRM.h>
#include <array>
#include <bits/stdint-uintn.h>
#include <cstdint>

View File

@ -30,13 +30,6 @@
#include <Rcpp.h>
// BSD-licenced
/** Return value if no error occured */
#define PARSER_OK 0
/** Return value if error occured during parsing of program arguments */
#define PARSER_ERROR -1
/** Return value if user asked for help message with program parameter */
#define PARSER_HELP -2
/** Standard DHT Size (Defaults to 1 GiB) */
#define DHT_SIZE_PER_PROCESS 1073741824
/** Standard work package size */
@ -44,6 +37,8 @@
namespace poet {
enum { PARSER_OK, PARSER_ERROR, PARSER_HELP };
/**
* @brief Defining all simulation parameters
*

View File

@ -8,5 +8,5 @@ find_library(CRYPTO_LIBRARY crypto)
add_library(poet_lib ${poet_lib_SRC})
target_include_directories(poet_lib PUBLIC ${PROJECT_SOURCE_DIR}/include)
target_link_libraries(poet_lib PUBLIC
MPI::MPI_C ${MATH_LIBRARY} ${CRYPTO_LIBRARY} RRuntime tug)
MPI::MPI_C ${MATH_LIBRARY} ${CRYPTO_LIBRARY} RRuntime tug PhreeqcRM)
target_compile_definitions(poet_lib PUBLIC STRICT_R_HEADERS OMPI_SKIP_MPICXX)

View File

@ -76,7 +76,7 @@ int SimParams::parseFromCmdl(char *argv[], RInside &R) {
cout << "Todo" << endl
<< "See README.md for further information." << endl;
}
return PARSER_HELP;
return poet::PARSER_HELP;
}
// if positional arguments are missing
else if (!cmdl(2)) {
@ -86,7 +86,7 @@ int SimParams::parseFromCmdl(char *argv[], RInside &R) {
<< "2) the directory prefix where to save results and profiling"
<< endl;
}
return PARSER_ERROR;
return poet::PARSER_ERROR;
}
// collect all parameters which are not known, print them to stderr and return
@ -100,7 +100,7 @@ int SimParams::parseFromCmdl(char *argv[], RInside &R) {
}
cerr << "\nMake sure to use available options. Exiting!" << endl;
}
return PARSER_ERROR;
return poet::PARSER_ERROR;
}
/*Parse DHT arguments*/
@ -177,7 +177,7 @@ int SimParams::parseFromCmdl(char *argv[], RInside &R) {
// eval the init string, ignoring any returns
R.parseEvalQ("source(filesim)");
return PARSER_OK;
return poet::PARSER_OK;
}
void SimParams::initVectorParams(RInside &R, int col_count) {