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
1 change: 1 addition & 0 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ if binary == "system"
const mpiexec_cmd = Cmd(mpiexec isa String ? [mpiexec] : mpiexec)

_doc_external(fname) = ""

include(joinpath("..","src","implementations.jl"))

@info "Using implementation" libmpi mpiexec_cmd MPI_LIBRARY_VERSION_STRING
Expand Down
12 changes: 12 additions & 0 deletions src/implementations.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
const use_stdcall = startswith(basename(libmpi), "msmpi")

# This is required in addition to __init__() so that we can call library at precompilation time.
if Sys.isunix()
Libdl.dlopen(libmpi, Libdl.RTLD_LAZY | Libdl.RTLD_GLOBAL)
end

macro mpicall(expr)
@assert expr isa Expr && expr.head == :call && expr.args[1] == :ccall

# On unix systems we call the global symbols to allow for LD_PRELOAD interception
# It can be emulated in Windows (via Libdl.dllist), but this is not fast.
if Sys.isunix() && expr.args[2].head == :tuple
expr.args[2] = expr.args[2].args[1]
end

# Microsoft MPI uses stdcall calling convention
# this only affects 32-bit Windows
# unfortunately we need to use ccall to call Get_library_version
Expand Down