From 63d3df9cd9fa2a60a2b060b7044e8faf0878d121 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Fri, 3 May 2024 18:38:16 +0200 Subject: [PATCH] Remove hard-coded paths --- libsrc/core/ng_mpi_wrapper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libsrc/core/ng_mpi_wrapper.cpp b/libsrc/core/ng_mpi_wrapper.cpp index fc124c93..b5752801 100644 --- a/libsrc/core/ng_mpi_wrapper.cpp +++ b/libsrc/core/ng_mpi_wrapper.cpp @@ -32,7 +32,7 @@ void InitMPI(std::filesystem::path mpi_lib_path, std::filesystem::path ng_libs_d get_version = GetSymbol("MPI_Get_library_version"); } catch (std::runtime_error &e) { cout << IM(3) << "MPI not loaded" << endl; - mpi_lib = std::make_unique("/usr/lib/libmpi.so", + mpi_lib = std::make_unique(mpi_lib_path, std::nullopt, true); mpi_init = mpi_lib->GetSymbol("MPI_Init"); mpi_initialized = @@ -57,10 +57,10 @@ void InitMPI(std::filesystem::path mpi_lib_path, std::filesystem::path ng_libs_d std::string libname = ""; if (mpi_library_version.substr(0, 8) == "Open MPI") { cout << IM(3) << "Have Open MPI" << endl; - libname = "/opt/netgen/lib/libng_openmpi.so"; + libname = std::string("libng_openmpi") + NETGEN_SHARED_LIBRARY_SUFFIX; } else if (mpi_library_version.substr(0, 5) == "MPICH") { cout << IM(3) << "Have MPICH" << endl; - libname = "/opt/netgen/lib/libng_mpich.so"; + libname = std::string("libng_mpich.so") + NETGEN_SHARED_LIBRARY_SUFFIX; } else cout << IM(3) << "Unknown MPI" << endl;