Skip to content

Commit

Permalink
Merge pull request #29 from jeffhammond/dlsuffix
Browse files Browse the repository at this point in the history
DL suffix
  • Loading branch information
jeffhammond authored Jan 31, 2024
2 parents 64526c6 + cd40eb7 commit 00826b2
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions libinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@

#if defined(__linux__)
#define LIBMPI_NAME "libmpi.so"
#define DLSUFFIX ".so"
#elif defined(__APPLE__)
#if defined(__x86_64__)
#define LIBMPI_NAME "/usr/local/lib/libmpi.dylib"
#else
#define LIBMPI_NAME "/opt/homebrew/lib/libmpi.dylib"
#endif
#define DLSUFFIX ".dylib"
#else
#warning No default MPI library path.
#endif
Expand Down Expand Up @@ -49,7 +51,7 @@ int * MPICH_WEIGHTS_EMPTY = NULL;
// alkaa = start
static int MUK_Alkaa(int * argc, char *** argv, int requested, int * provided)
{
int rc;
int rc = 0;

int verbose = 0;
{
Expand Down Expand Up @@ -96,7 +98,7 @@ static int MUK_Alkaa(int * argc, char *** argv, int requested, int * provided)
abort();
}

char * wrapname = "/dev/null";
char * wrapname = NULL;
// figure out which library i am using
MUK_Get_library_version = MUK_DLSYM(h,"MPI_Get_library_version");
{
Expand Down Expand Up @@ -124,15 +126,16 @@ static int MUK_Alkaa(int * argc, char *** argv, int requested, int * provided)
}

if (whose_mpi == OMPI) {
wrapname = "ompi-wrap.so";
wrapname = "ompi-wrap" DLSUFFIX;
} else if (whose_mpi == MPICH) {
wrapname = "mpich-wrap.so";
wrapname = "mpich-wrap" DLSUFFIX;
} else if (whose_mpi == INTEL) {
wrapname = "mpich-wrap.so";
wrapname = "mpich-wrap" DLSUFFIX;
} else {
printf("MPI implementation unknown.\n");
abort();
}
if (verbose) printf("wrapname = %s\n", wrapname);
}

// these are ABI-agnostic and important, so why not load them now...
Expand Down

0 comments on commit 00826b2

Please sign in to comment.