Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support FreeBSD #48

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```sh
# -DBUILD_SHARED_LIBS=ON
rm -rf mpitrampoline $HOME/src/c/MPIstuff/mpitrampoline
cmake -S . -B mpitrampoline -G Ninja -DCMAKE_C_COMPILER=gcc-mp-12 -DCMAKE_CXX_COMPILER=g++-mp-12 -DCMAKE_Fortran_COMPILER=gfortran-mp-12 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$HOME/src/c/MPIstuff/mpitrampoline
cmake -B mpitrampoline -G Ninja -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$HOME/src/c/MPIstuff/mpitrampoline
cmake --build mpitrampoline && cmake --install mpitrampoline
```

Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ authors:
given-names: Erik
orcid: https://orcid.org/0000-0002-4518-9017
title: MPItrampoline
version: v5.4.1
version: v5.5.0
doi: 10.5281/zenodo.6174408
date-released: 2024-08-29
date-released: 2024-09-25
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.12...3.20)
project(
MPItrampoline VERSION 5.4.1
MPItrampoline VERSION 5.5.0
DESCRIPTION "MPI trampoline"
HOMEPAGE_URL "https://github.com/eschnett/MPItrampoline"
LANGUAGES NONE
Expand Down
7 changes: 7 additions & 0 deletions src/mpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,13 @@ static void *load_library(const char *const libname) {
assert(0);
}

#elif __FreeBSD__

// dlmopen is not supported, always use dlopen instead
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think dlmopen is a glibc-only thing?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it doesn't exist on FreeBSD. There's a run-time option to choose between dlopen and dlmopen, and I'm ignoring this on FreeBSD.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I wanted to suggest is to allow dlmopen only on glibc, rather than excluding on all platforms that don't support it, since it's more of an exception rather than the norm.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not excluding any platforms. I'm ignoring the option so that FreeBSD unconditionally uses dlopen. The alternative would be to emit an error on FreeBSD, but that doesn't seem worth the trouble.

if (verbose)
fprintf(stderr, "[MPItrampoline] Calling dlopen\n");
handle = dlopen(libname, dlopen_flags | RTLD_LOCAL | RTLD_DEEPBIND);

#else
#error "Unsupported operating system"
#endif
Expand Down