eschnett / MPItrampoline

A forwarding MPI implementation that can use any other MPI implementation via an MPI ABI
MIT License
44 stars 4 forks source link

Building shared and static libraries at once #13

Open ocaisa opened 2 years ago

ocaisa commented 2 years ago

Currently the default behaviour is to only build static libraries. It might be good build both static and shared libraries since then if libmpi.so is in the default search path it is not selected over the library from MPItrampoline (MPItrampoline would shadow libmpi.so and libmpi.a).

eschnett commented 2 years ago

I am using the default cmake settings here (I think). These seem to be to build static libraries only be default, and build shared libraries when the cmake option -DBUILD_SHARED_LIBS=ON is given.

Are you asking for a way to build shared libraries, or are you asking to change the default behaviour?

ocaisa commented 2 years ago

Well, it is much more common to find MPI as a shared library, so in this case I think a change in the default is a good idea. Doing both builds would help cover yourself (but we could also do this in our build process, leveraging -DBUILD_SHARED_LIBS=ON and -DBUILD_SHARED_LIBS=OFF)

eschnett commented 2 years ago

I realize I'm not testing shared libraries in the CI setup. Indeed it's failing for the Fortran 2008 bindings (see https://github.com/eschnett/MPItest/runs/5112540330?check_suite_focus=true), although those are very incomplete and almost certainly not used in practice yet. Will have to debug before changing the default.

eschnett commented 2 years ago

Building MPItrampoline as shared library does not work on macOS for the Fortran MPI bindings. I would like to keep the default as is (static) to keep things consistent across operating systems.