Skip to content

Commit

Permalink
Add RTLD_GLOBAL for loading OpenMPI
Browse files Browse the repository at this point in the history
This partially reverts bb656f8 and fixes JuliaParallel#216.
  • Loading branch information
lcw committed Oct 2, 2018
1 parent 400beca commit 45f909c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/MPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ const mpitype_dict_inverse = Dict{Cint, DataType}()
end

function __init__()
@static if Compat.Sys.isunix()
# need to open libmpi with RTLD_GLOBAL flag for Linux, before
# any ccall cannot use RTLD_DEEPBIND; this leads to segfaults
# at least on Ubuntu 15.10
Libdl.dlopen(libmpi, Libdl.RTLD_LAZY | Libdl.RTLD_GLOBAL)
end

# Note: older versions of OpenMPI (e.g. the version on Travis) do not
# define MPI_CHAR and MPI_*INT*_T for Fortran, so we don't use them (yet).
for (T,mpiT) in (Char => MPI_INTEGER4, # => MPI_WCHAR, (note: wchar_t is 16 bits in Windows)
Expand Down

0 comments on commit 45f909c

Please sign in to comment.