Skip to content
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
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
- macos-15
- macos-14
- macos-13
- windows-2022
- windows-2019
steps:
- uses: actions/checkout@v4
- run: bash -x build-cmake.sh
Expand All @@ -40,8 +44,10 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
- macos-15
- macos-14
- macos-13
steps:
Expand All @@ -58,8 +64,10 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-24.04
- ubuntu-22.04
- ubuntu-20.04
- macos-15
- macos-14
- macos-13
steps:
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
cmake_minimum_required(VERSION 3.5.0)
project(mpi-stubs VERSION 4.2 LANGUAGES C)
project(mpi-abi-stubs VERSION 5.0 LANGUAGES C)

option(BUILD_SHARED_LIBS "Build libraries as SHARED" TRUE)

add_library(mpi_abi mpistubs.c)
set_target_properties(mpi_abi PROPERTIES VERSION 0)
set_target_properties(mpi_abi PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS 1)

include(GNUInstallDirs)
install(FILES mpi.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
Expand Down
4 changes: 2 additions & 2 deletions build-cmake.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh
set -eu
cmake -B build -DCMAKE_INSTALL_PREFIX="${PREFIX:-$PWD}"
cmake --build build
cmake --install build
cmake --build build --config Release
cmake --install build --config Release
(test -d lib64 && ln -f -s lib64 lib) || true
20 changes: 12 additions & 8 deletions check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ export PATH=${prefix}/bin:$PATH

case "$(uname)" in
Linux)
lib="lib"
so=".so"
;;
Darwin)
ldd () { otool -L "$1"; }
lib="lib"
so=".dylib"
;;
*_NT-*)
lib=""
so=".dll"
;;
esac

tempdir="$(mktemp -d)"
Expand Down Expand Up @@ -41,13 +47,11 @@ command -v mpicc
command -v mpicxx
echo "$(mpicc -show-incdir)/mpi.h":
grep -E 'MPI_(SUB)?VERSION' "$(mpicc -show-incdir)/mpi.h"
echo "$(mpicc -show-libdir)/lib$(mpicc -show-libs)$so":
ldd "$(mpicc -show-libdir)/lib$(mpicc -show-libs)$so"
echo "$(mpicc -show-libdir)/$lib$(mpicc -show-libs)$so":
ldd "$(mpicc -show-libdir)/$lib$(mpicc -show-libs)$so"

set -x

RPATH=-Wl,-rpath,$(mpicc -show-libdir)

mpicc -show
mpicc -show-incdir
mpicc -show-libdir
Expand All @@ -58,8 +62,8 @@ for cc in gcc clang; do
diff cc.log mpicc.log
mpicc -cc="$cc" ./helloworld.c -c
test -f helloworld.o && rm helloworld.o
mpicc -cc="$cc" ./helloworld.c "$RPATH"
ldd a.out && rm a.out
mpicc -cc="$cc" ./helloworld.c -o hw.exe
ldd hw.exe && rm hw.exe
done

mpicxx -show
Expand All @@ -72,6 +76,6 @@ for cxx in g++ clang++; do
diff cxx.log mpicxx.log
mpicxx -cxx="$cxx" ./helloworld.cxx -c
test -f helloworld.o && rm helloworld.o
mpicxx -cxx="$cxx" ./helloworld.cxx "$RPATH"
ldd a.out && rm a.out
mpicxx -cxx="$cxx" ./helloworld.cxx -o hw.exe
ldd hw.exe && rm hw.exe
done
Loading