MPI.jl: Error building: recompile with -fPIC?

question

#1

Hi all,

Before a complete re-installation of Julia in early December, MPI.jl worked for me. Now I cannot install the MPI.jl package anymore - it fails building:

julia> import Pkg; Pkg.add("MPI")
  Updating registry at `~/.julia/registries/General`
  Updating git-repo `https://github.com/JuliaRegistries/General.git`
 Resolving package versions...
  Updating `~/.julia/environments/v1.0/Project.toml`
  [da04e1cc] + MPI v0.7.2
  Updating `~/.julia/environments/v1.0/Manifest.toml`
  [da04e1cc] + MPI v0.7.2

julia> Pkg.build("MPI")
  Building MPI → `~/.julia/packages/MPI/U5ujD/deps/build.log`
┌ Error: Error building `MPI`: 
│ -- The Fortran compiler identification is Cray 8.7
│ -- The C compiler identification is Cray 8.7
│ -- Cray Programming Environment 2.5.15 Fortran
│ -- Check for working Fortran compiler: /opt/cray/pe/craype/2.5.15/bin/ftn
│ -- Check for working Fortran compiler: /opt/cray/pe/craype/2.5.15/bin/ftn  -- works
│ -- Detecting Fortran compiler ABI info
│ -- Detecting Fortran compiler ABI info - done
│ -- Checking whether /opt/cray/pe/craype/2.5.15/bin/ftn supports Fortran 90
│ -- Checking whether /opt/cray/pe/craype/2.5.15/bin/ftn supports Fortran 90 -- yes
│ -- Cray Programming Environment 2.5.15 C
│ -- Check for working C compiler: /opt/cray/pe/craype/2.5.15/bin/cc
│ -- Check for working C compiler: /opt/cray/pe/craype/2.5.15/bin/cc -- works
│ -- Detecting C compiler ABI info
│ -- Detecting C compiler ABI info - done
│ -- Found Git: /usr/bin/git (found version "2.12.3") 
│ -- Found MPI_C: /opt/cray/pe/craype/2.5.15/bin/cc  
│ -- Found MPI_Fortran: /opt/cray/pe/craype/2.5.15/bin/ftn  
│ -- Detecting Fortran/C Interface
│ -- Detecting Fortran/C Interface - Found GLOBAL but not MODULE mangling
│ -- Looking for MPI_Comm_c2f
│ -- Looking for MPI_Comm_c2f - not found
│ -- Configuring done
│ -- Generating done
│ -- Build files have been written to: /users/omlins/.julia/packages/MPI/U5ujD/deps/build
│ Scanning dependencies of target gen_constants
│ [ 11%] Building Fortran object CMakeFiles/gen_constants.dir/gen_constants.f90.o
│ [ 22%] Linking Fortran executable gen_constants
│ [ 22%] Built target gen_constants
│ Scanning dependencies of target gen_functions
│ [ 33%] Building C object CMakeFiles/gen_functions.dir/gen_functions.c.o
│ [ 44%] Linking C executable gen_functions
│ [ 44%] Built target gen_functions
│ Scanning dependencies of target mpijl
│ [ 55%] Generating compile-time.jl
│ [ 55%] Built target mpijl
│ Scanning dependencies of target mpijl-build
│ [ 66%] Generating mpi-build.jl
│ [ 66%] Built target mpijl-build
│ Scanning dependencies of target juliampi
│ [ 77%] Building C object CMakeFiles/juliampi.dir/juliampi.c.o
│ [ 88%] Building Fortran object CMakeFiles/juliampi.dir/test_mpi.f90.o
│ [100%] Linking Fortran shared library libjuliampi.so
│ /opt/cray/pe/cce/8.7.3/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld: CMakeFiles/juliampi.dir/juliampi.c.o: relocation R_X86_64_32 against symbol `finalize_atexit' can not be used when making a shared object; recompile with -fPIC
│ /opt/cray/pe/cce/8.7.3/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
│ /usr/bin/X11/sha1sum: libjuliampi.so: No such file or directory
│ CMakeFiles/juliampi.dir/build.make:120: recipe for target 'libjuliampi.so' failed
│ make[2]: *** [libjuliampi.so] Error 1
│ CMakeFiles/Makefile2:68: recipe for target 'CMakeFiles/juliampi.dir/all' failed
│ make[1]: *** [CMakeFiles/juliampi.dir/all] Error 2
│ Makefile:149: recipe for target 'all' failed
│ make: *** [all] Error 2
│ [ Info: Attempting to create directory /users/omlins/.julia/packages/MPI/U5ujD/deps/build
│ [ Info: Changing directory to /users/omlins/.julia/packages/MPI/U5ujD/deps/build
│ ERROR: LoadError: failed process: Process(`make`, ProcessExited(2)) [2]
│ Stacktrace:
│  [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
│  [2] pipeline_error at ./process.jl:705 [inlined]
│  [3] #run#504(::Bool, ::Function, ::Cmd) at ./process.jl:663
│  [4] run(::Cmd) at ./process.jl:661
│  [5] macro expansion at ./logging.jl:306 [inlined]
│  [6] run(::BinDeps.SynchronousStepCollection) at /users/omlins/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:518
│  [7] macro expansion at ./logging.jl:306 [inlined]
│  [8] run(::BinDeps.SynchronousStepCollection) at /users/omlins/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:518
│  [9] macro expansion at ./logging.jl:306 [inlined]
│  [10] run(::BinDeps.SynchronousStepCollection) at /users/omlins/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:518
│  [11] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at /users/omlins/.julia/packages/BinDeps/ZEval/src/dependencies.jl:944
│  [12] satisfy!(::BinDeps.LibraryDependency) at /users/omlins/.julia/packages/BinDeps/ZEval/src/dependencies.jl:922
│  [13] top-level scope at /users/omlins/.julia/packages/BinDeps/ZEval/src/dependencies.jl:977
│  [14] include at ./boot.jl:317 [inlined]
│  [15] include_relative(::Module, ::String) at ./loading.jl:1044
│  [16] include(::Module, ::String) at ./sysimg.jl:29
│  [17] include(::String) at ./client.jl:392
│  [18] top-level scope at none:0
│ in expression starting at /users/omlins/.julia/packages/MPI/U5ujD/deps/build.jl:54
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1097

The error message suggests to recompile with -fPIC. How can I make Julia do that?
Or do you believe the problem is elsewhere?

In any case, it should not be a big issue as MPI.jl worked before…

Thanks!

Sam


#2

What version of CMake are you using? It looks like there was a bug that was fixed in version 3.11. According to that thread, setting CRAYPE_LINK_TYPE=dynamic and adding -fPIC to CMAKE_C_FLAGS is a workaround. You may also need to add the flag to CMAKE_Fortran_FLAGS because there is a Fortran file in there too.


#3

@JaredCrean2: The default CMake on the system, version 3.5.2, was used. I tried now also with the newest version available, version 3.8.1. Yet, it still fails. Note that I had always set CRAYPE_LINK_TYPE=dynamic (without that, it had failed much earlier in the build).
How do I properly modify the CMAKE flags that Julia is going to use for the build when calling Pkg.build("MPI")?


#4

In the shell (before launching Julia), do

export CMAKE_C_FLAGS="-fPIC $CMAKE_C_FLAGS"
export CMAKE_Fortran_FLAGS="-fPIC $CMAKE_Fortran_FLAGS"

The open Julia and install MPI.jl as usual.


#5

@JaredCrean2: I have tried that: the error is the same. Thus, it seems not to take these environment variables into account.

I have also tried with the following environment variables set (following this section in the MPI.jl doc):

export JULIA_MPI_Fortran_COMPILE_FLAGS="-fPIC"
export JULIA_MPI_C_COMPILE_FLAGS="-fPIC"

The build failed with the same error.


#6

Can you do

export VERBOSE=1

in addition to the other environment variables and post the output? That should show the exact commands the compiler is executing.


#7
> export VERBOSE=1
> export CRAYPE_LINK_TYPE=dynamic
> export JULIA_MPI_C_COMPILE_FLAGS="-fPIC"
> export JULIA_MPI_Fortran_COMPILE_FLAGS="-fPIC"
> julia
julia> import Pkg; Pkg.build("MPI")

produced the following build log:

> cat ~/.julia/packages/MPI/U5ujD/deps/build.log
Re-run cmake no build system arguments
-- The Fortran compiler identification is Cray 8.7
-- The C compiler identification is Cray 8.7
-- Cray Programming Environment 2.5.15 Fortran
-- Check for working Fortran compiler: /opt/cray/pe/craype/2.5.15/bin/ftn
-- Check for working Fortran compiler: /opt/cray/pe/craype/2.5.15/bin/ftn  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /opt/cray/pe/craype/2.5.15/bin/ftn supports Fortran 90
-- Checking whether /opt/cray/pe/craype/2.5.15/bin/ftn supports Fortran 90 -- yes
-- Cray Programming Environment 2.5.15 C
-- Check for working C compiler: /opt/cray/pe/craype/2.5.15/bin/cc
-- Check for working C compiler: /opt/cray/pe/craype/2.5.15/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found Git: /usr/bin/git (found version "2.12.3") 
-- Found MPI_C: /opt/cray/pe/craype/2.5.15/bin/cc  
-- Found MPI_Fortran: /opt/cray/pe/craype/2.5.15/bin/ftn  
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Found GLOBAL but not MODULE mangling
-- Looking for MPI_Comm_c2f
-- Looking for MPI_Comm_c2f - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /users/omlins/.julia/packages/MPI/U5ujD/deps/build
/usr/bin/cmake -H/users/omlins/.julia/packages/MPI/U5ujD/deps -B/users/omlins/.julia/packages/MPI/U5ujD/deps/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/gen_constants.dir/build.make CMakeFiles/gen_constants.dir/depend
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
cd /users/omlins/.julia/packages/MPI/U5ujD/deps/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_constants.dir/DependInfo.cmake --color=
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_constants.dir/DependInfo.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_constants.dir/depend.internal".
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_constants.dir/depend.internal".
Scanning dependencies of target gen_constants
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/gen_constants.dir/build.make CMakeFiles/gen_constants.dir/requires
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make[2]: Nothing to be done for 'CMakeFiles/gen_constants.dir/requires'.
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/gen_constants.dir/build.make CMakeFiles/gen_constants.dir/build
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 11%] Building Fortran object CMakeFiles/gen_constants.dir/gen_constants.f90.o
/opt/cray/pe/craype/2.5.15/bin/ftn   -I/users/omlins/.julia/packages/MPI/U5ujD/deps/build  -em -J.   -c /users/omlins/.julia/packages/MPI/U5ujD/deps/gen_constants.f90 -o CMakeFiles/gen_constants.dir/gen_constants.f90.o
[ 22%] Linking Fortran executable gen_constants
/usr/bin/cmake -E cmake_link_script CMakeFiles/gen_constants.dir/link.txt --verbose=1
/opt/cray/pe/craype/2.5.15/bin/ftn      CMakeFiles/gen_constants.dir/gen_constants.f90.o  -o gen_constants -dynamic 
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 22%] Built target gen_constants
make -f CMakeFiles/gen_functions.dir/build.make CMakeFiles/gen_functions.dir/depend
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
cd /users/omlins/.julia/packages/MPI/U5ujD/deps/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_functions.dir/DependInfo.cmake --color=
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_functions.dir/DependInfo.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_functions.dir/depend.internal".
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_functions.dir/depend.internal".
Scanning dependencies of target gen_functions
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/gen_functions.dir/build.make CMakeFiles/gen_functions.dir/build
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 33%] Building C object CMakeFiles/gen_functions.dir/gen_functions.c.o
/opt/cray/pe/craype/2.5.15/bin/cc   -I/users/omlins/.julia/packages/MPI/U5ujD/deps/build   -o CMakeFiles/gen_functions.dir/gen_functions.c.o   -c /users/omlins/.julia/packages/MPI/U5ujD/deps/gen_functions.c
[ 44%] Linking C executable gen_functions
/usr/bin/cmake -E cmake_link_script CMakeFiles/gen_functions.dir/link.txt --verbose=1
/opt/cray/pe/craype/2.5.15/bin/cc      CMakeFiles/gen_functions.dir/gen_functions.c.o  -o gen_functions -dynamic 
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 44%] Built target gen_functions
make -f CMakeFiles/mpijl.dir/build.make CMakeFiles/mpijl.dir/depend
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
cd /users/omlins/.julia/packages/MPI/U5ujD/deps/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl.dir/DependInfo.cmake --color=
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl.dir/DependInfo.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl.dir/depend.internal".
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl.dir/depend.internal".
Scanning dependencies of target mpijl
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/mpijl.dir/build.make CMakeFiles/mpijl.dir/build
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 55%] Generating compile-time.jl
/usr/bin/cmake -DSRC=/users/omlins/.julia/packages/MPI/U5ujD/deps/../src/mpi-base.jl -DLIB=/users/omlins/.julia/packages/MPI/U5ujD/deps/usr/lib/libmpi -DDST=/users/omlins/.julia/packages/MPI/U5ujD/deps/build/compile-time.jl -P /users/omlins/.julia/packages/MPI/U5ujD/deps/build/mpi.cmake
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 55%] Built target mpijl
make -f CMakeFiles/mpijl-build.dir/build.make CMakeFiles/mpijl-build.dir/depend
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
cd /users/omlins/.julia/packages/MPI/U5ujD/deps/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl-build.dir/DependInfo.cmake --color=
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl-build.dir/DependInfo.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl-build.dir/depend.internal".
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl-build.dir/depend.internal".
Scanning dependencies of target mpijl-build
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/mpijl-build.dir/build.make CMakeFiles/mpijl-build.dir/build
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 66%] Generating mpi-build.jl
/usr/bin/cmake -DSRC=/users/omlins/.julia/packages/MPI/U5ujD/deps/../src/mpi-base.jl -DLIB=/users/omlins/.julia/packages/MPI/U5ujD/deps/usr/lib/libmpi -DDST=/users/omlins/.julia/packages/MPI/U5ujD/deps/build/mpi-build.jl -P /users/omlins/.julia/packages/MPI/U5ujD/deps/build/mpi.cmake
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 66%] Built target mpijl-build
make -f CMakeFiles/juliampi.dir/build.make CMakeFiles/juliampi.dir/depend
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
cd /users/omlins/.julia/packages/MPI/U5ujD/deps/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/juliampi.dir/DependInfo.cmake --color=
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/juliampi.dir/DependInfo.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/juliampi.dir/depend.internal".
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/juliampi.dir/depend.internal".
Scanning dependencies of target juliampi
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/juliampi.dir/build.make CMakeFiles/juliampi.dir/requires
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make[2]: Nothing to be done for 'CMakeFiles/juliampi.dir/requires'.
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/juliampi.dir/build.make CMakeFiles/juliampi.dir/build
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 77%] Building C object CMakeFiles/juliampi.dir/juliampi.c.o
/opt/cray/pe/craype/2.5.15/bin/cc  -Djuliampi_EXPORTS -I/users/omlins/.julia/packages/MPI/U5ujD/deps/build   -o CMakeFiles/juliampi.dir/juliampi.c.o   -c /users/omlins/.julia/packages/MPI/U5ujD/deps/juliampi.c
[ 88%] Building Fortran object CMakeFiles/juliampi.dir/test_mpi.f90.o
/opt/cray/pe/craype/2.5.15/bin/ftn  -Djuliampi_EXPORTS -I/users/omlins/.julia/packages/MPI/U5ujD/deps/build  -em -J.   -c /users/omlins/.julia/packages/MPI/U5ujD/deps/test_mpi.f90 -o CMakeFiles/juliampi.dir/test_mpi.f90.o
[100%] Linking Fortran shared library libjuliampi.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/juliampi.dir/link.txt --verbose=1
/opt/cray/pe/craype/2.5.15/bin/ftn      -shared -Wl,-soname,libjuliampi.so -o libjuliampi.so CMakeFiles/juliampi.dir/juliampi.c.o CMakeFiles/juliampi.dir/test_mpi.f90.o 
/opt/cray/pe/cce/8.7.3/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld: CMakeFiles/juliampi.dir/juliampi.c.o: relocation R_X86_64_32 against symbol `finalize_atexit' can not be used when making a shared object; recompile with -fPIC
/opt/cray/pe/cce/8.7.3/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
/usr/bin/X11/sha1sum: libjuliampi.so: No such file or directory
CMakeFiles/juliampi.dir/build.make:120: recipe for target 'libjuliampi.so' failed
make[2]: *** [libjuliampi.so] Error 1
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
CMakeFiles/Makefile2:68: recipe for target 'CMakeFiles/juliampi.dir/all' failed
make[1]: *** [CMakeFiles/juliampi.dir/all] Error 2
make[1]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
[ Info: Attempting to create directory /users/omlins/.julia/packages/MPI/U5ujD/deps/build
[ Info: Changing directory to /users/omlins/.julia/packages/MPI/U5ujD/deps/build
ERROR: LoadError: failed process: Process(`make`, ProcessExited(2)) [2]
Stacktrace:
 [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
 [2] pipeline_error at ./process.jl:705 [inlined]
 [3] #run#504(::Bool, ::Function, ::Cmd) at ./process.jl:663
 [4] run(::Cmd) at ./process.jl:661
 [5] macro expansion at ./logging.jl:306 [inlined]
 [6] run(::BinDeps.SynchronousStepCollection) at /users/omlins/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:518
 [7] macro expansion at ./logging.jl:306 [inlined]
 [8] run(::BinDeps.SynchronousStepCollection) at /users/omlins/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:518
 [9] macro expansion at ./logging.jl:306 [inlined]
 [10] run(::BinDeps.SynchronousStepCollection) at /users/omlins/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:518
 [11] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at /users/omlins/.julia/packages/BinDeps/ZEval/src/dependencies.jl:944
 [12] satisfy!(::BinDeps.LibraryDependency) at /users/omlins/.julia/packages/BinDeps/ZEval/src/dependencies.jl:922
 [13] top-level scope at /users/omlins/.julia/packages/BinDeps/ZEval/src/dependencies.jl:977
 [14] include at ./boot.jl:317 [inlined]
 [15] include_relative(::Module, ::String) at ./loading.jl:1044
 [16] include(::Module, ::String) at ./sysimg.jl:29
 [17] include(::String) at ./client.jl:392
 [18] top-level scope at none:0
in expression starting at /users/omlins/.julia/packages/MPI/U5ujD/deps/build.jl:54

…and

> export VERBOSE=1
> export CRAYPE_LINK_TYPE=dynamic
> export CMAKE_C_FLAGS="-fPIC $CMAKE_C_FLAGS"
> export CMAKE_Fortran_FLAGS="-fPIC $CMAKE_Fortran_FLAGS"
> julia
julia> import Pkg; Pkg.build("MPI")

produced the following build log:

> cat ~/.julia/packages/MPI/U5ujD/deps/build.log
Re-run cmake no build system arguments
-- The Fortran compiler identification is Cray 8.7
-- The C compiler identification is Cray 8.7
-- Cray Programming Environment 2.5.15 Fortran
-- Check for working Fortran compiler: /opt/cray/pe/craype/2.5.15/bin/ftn
-- Check for working Fortran compiler: /opt/cray/pe/craype/2.5.15/bin/ftn  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /opt/cray/pe/craype/2.5.15/bin/ftn supports Fortran 90
-- Checking whether /opt/cray/pe/craype/2.5.15/bin/ftn supports Fortran 90 -- yes
-- Cray Programming Environment 2.5.15 C
-- Check for working C compiler: /opt/cray/pe/craype/2.5.15/bin/cc
-- Check for working C compiler: /opt/cray/pe/craype/2.5.15/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found Git: /usr/bin/git (found version "2.12.3") 
-- Found MPI_C: /opt/cray/pe/craype/2.5.15/bin/cc  
-- Found MPI_Fortran: /opt/cray/pe/craype/2.5.15/bin/ftn  
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Found GLOBAL but not MODULE mangling
-- Looking for MPI_Comm_c2f
-- Looking for MPI_Comm_c2f - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /users/omlins/.julia/packages/MPI/U5ujD/deps/build
/usr/bin/cmake -H/users/omlins/.julia/packages/MPI/U5ujD/deps -B/users/omlins/.julia/packages/MPI/U5ujD/deps/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/gen_functions.dir/build.make CMakeFiles/gen_functions.dir/depend
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
cd /users/omlins/.julia/packages/MPI/U5ujD/deps/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_functions.dir/DependInfo.cmake --color=
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_functions.dir/DependInfo.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_functions.dir/depend.internal".
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_functions.dir/depend.internal".
Scanning dependencies of target gen_functions
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/gen_functions.dir/build.make CMakeFiles/gen_functions.dir/build
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 11%] Building C object CMakeFiles/gen_functions.dir/gen_functions.c.o
/opt/cray/pe/craype/2.5.15/bin/cc   -I/users/omlins/.julia/packages/MPI/U5ujD/deps/build   -o CMakeFiles/gen_functions.dir/gen_functions.c.o   -c /users/omlins/.julia/packages/MPI/U5ujD/deps/gen_functions.c
[ 22%] Linking C executable gen_functions
/usr/bin/cmake -E cmake_link_script CMakeFiles/gen_functions.dir/link.txt --verbose=1
/opt/cray/pe/craype/2.5.15/bin/cc      CMakeFiles/gen_functions.dir/gen_functions.c.o  -o gen_functions -dynamic 
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 22%] Built target gen_functions
make -f CMakeFiles/gen_constants.dir/build.make CMakeFiles/gen_constants.dir/depend
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
cd /users/omlins/.julia/packages/MPI/U5ujD/deps/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_constants.dir/DependInfo.cmake --color=
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_constants.dir/DependInfo.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_constants.dir/depend.internal".
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/gen_constants.dir/depend.internal".
Scanning dependencies of target gen_constants
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/gen_constants.dir/build.make CMakeFiles/gen_constants.dir/requires
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make[2]: Nothing to be done for 'CMakeFiles/gen_constants.dir/requires'.
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/gen_constants.dir/build.make CMakeFiles/gen_constants.dir/build
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 33%] Building Fortran object CMakeFiles/gen_constants.dir/gen_constants.f90.o
/opt/cray/pe/craype/2.5.15/bin/ftn   -I/users/omlins/.julia/packages/MPI/U5ujD/deps/build  -em -J.   -c /users/omlins/.julia/packages/MPI/U5ujD/deps/gen_constants.f90 -o CMakeFiles/gen_constants.dir/gen_constants.f90.o
[ 44%] Linking Fortran executable gen_constants
/usr/bin/cmake -E cmake_link_script CMakeFiles/gen_constants.dir/link.txt --verbose=1
/opt/cray/pe/craype/2.5.15/bin/ftn      CMakeFiles/gen_constants.dir/gen_constants.f90.o  -o gen_constants -dynamic 
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 44%] Built target gen_constants
make -f CMakeFiles/mpijl-build.dir/build.make CMakeFiles/mpijl-build.dir/depend
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
cd /users/omlins/.julia/packages/MPI/U5ujD/deps/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl-build.dir/DependInfo.cmake --color=
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl-build.dir/DependInfo.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl-build.dir/depend.internal".
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl-build.dir/depend.internal".
Scanning dependencies of target mpijl-build
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/mpijl-build.dir/build.make CMakeFiles/mpijl-build.dir/build
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 55%] Generating mpi-build.jl
/usr/bin/cmake -DSRC=/users/omlins/.julia/packages/MPI/U5ujD/deps/../src/mpi-base.jl -DLIB=/users/omlins/.julia/packages/MPI/U5ujD/deps/usr/lib/libmpi -DDST=/users/omlins/.julia/packages/MPI/U5ujD/deps/build/mpi-build.jl -P /users/omlins/.julia/packages/MPI/U5ujD/deps/build/mpi.cmake
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 55%] Built target mpijl-build
make -f CMakeFiles/mpijl.dir/build.make CMakeFiles/mpijl.dir/depend
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
cd /users/omlins/.julia/packages/MPI/U5ujD/deps/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl.dir/DependInfo.cmake --color=
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl.dir/DependInfo.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl.dir/depend.internal".
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/mpijl.dir/depend.internal".
Scanning dependencies of target mpijl
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/mpijl.dir/build.make CMakeFiles/mpijl.dir/build
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 66%] Generating compile-time.jl
/usr/bin/cmake -DSRC=/users/omlins/.julia/packages/MPI/U5ujD/deps/../src/mpi-base.jl -DLIB=/users/omlins/.julia/packages/MPI/U5ujD/deps/usr/lib/libmpi -DDST=/users/omlins/.julia/packages/MPI/U5ujD/deps/build/compile-time.jl -P /users/omlins/.julia/packages/MPI/U5ujD/deps/build/mpi.cmake
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 66%] Built target mpijl
make -f CMakeFiles/juliampi.dir/build.make CMakeFiles/juliampi.dir/depend
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
cd /users/omlins/.julia/packages/MPI/U5ujD/deps/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build /users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/juliampi.dir/DependInfo.cmake --color=
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/juliampi.dir/DependInfo.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/juliampi.dir/depend.internal".
Dependee "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/users/omlins/.julia/packages/MPI/U5ujD/deps/build/CMakeFiles/juliampi.dir/depend.internal".
Scanning dependencies of target juliampi
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/juliampi.dir/build.make CMakeFiles/juliampi.dir/requires
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make[2]: Nothing to be done for 'CMakeFiles/juliampi.dir/requires'.
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
make -f CMakeFiles/juliampi.dir/build.make CMakeFiles/juliampi.dir/build
make[2]: Entering directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
[ 77%] Building C object CMakeFiles/juliampi.dir/juliampi.c.o
/opt/cray/pe/craype/2.5.15/bin/cc  -Djuliampi_EXPORTS -I/users/omlins/.julia/packages/MPI/U5ujD/deps/build   -o CMakeFiles/juliampi.dir/juliampi.c.o   -c /users/omlins/.julia/packages/MPI/U5ujD/deps/juliampi.c
[ 88%] Building Fortran object CMakeFiles/juliampi.dir/test_mpi.f90.o
/opt/cray/pe/craype/2.5.15/bin/ftn  -Djuliampi_EXPORTS -I/users/omlins/.julia/packages/MPI/U5ujD/deps/build  -em -J.   -c /users/omlins/.julia/packages/MPI/U5ujD/deps/test_mpi.f90 -o CMakeFiles/juliampi.dir/test_mpi.f90.o
[100%] Linking Fortran shared library libjuliampi.so
/usr/bin/cmake -E cmake_link_script CMakeFiles/juliampi.dir/link.txt --verbose=1
/opt/cray/pe/craype/2.5.15/bin/ftn      -shared -Wl,-soname,libjuliampi.so -o libjuliampi.so CMakeFiles/juliampi.dir/juliampi.c.o CMakeFiles/juliampi.dir/test_mpi.f90.o 
/opt/cray/pe/cce/8.7.3/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld: CMakeFiles/juliampi.dir/juliampi.c.o: relocation R_X86_64_32 against symbol `finalize_atexit' can not be used when making a shared object; recompile with -fPIC
/opt/cray/pe/cce/8.7.3/binutils/x86_64/x86_64-pc-linux-gnu/bin/ld: final link failed: Nonrepresentable section on output
/usr/bin/X11/sha1sum: libjuliampi.so: No such file or directory
CMakeFiles/juliampi.dir/build.make:120: recipe for target 'libjuliampi.so' failed
make[2]: *** [libjuliampi.so] Error 1
make[2]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
CMakeFiles/Makefile2:68: recipe for target 'CMakeFiles/juliampi.dir/all' failed
make[1]: *** [CMakeFiles/juliampi.dir/all] Error 2
make[1]: Leaving directory '/users/omlins/.julia/packages/MPI/U5ujD/deps/build'
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2
[ Info: Attempting to create directory /users/omlins/.julia/packages/MPI/U5ujD/deps/build
[ Info: Changing directory to /users/omlins/.julia/packages/MPI/U5ujD/deps/build
ERROR: LoadError: failed process: Process(`make`, ProcessExited(2)) [2]
Stacktrace:
 [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at ./error.jl:42
 [2] pipeline_error at ./process.jl:705 [inlined]
 [3] #run#504(::Bool, ::Function, ::Cmd) at ./process.jl:663
 [4] run(::Cmd) at ./process.jl:661
 [5] macro expansion at ./logging.jl:306 [inlined]
 [6] run(::BinDeps.SynchronousStepCollection) at /users/omlins/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:518
 [7] macro expansion at ./logging.jl:306 [inlined]
 [8] run(::BinDeps.SynchronousStepCollection) at /users/omlins/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:518
 [9] macro expansion at ./logging.jl:306 [inlined]
 [10] run(::BinDeps.SynchronousStepCollection) at /users/omlins/.julia/packages/BinDeps/ZEval/src/BinDeps.jl:518
 [11] satisfy!(::BinDeps.LibraryDependency, ::Array{DataType,1}) at /users/omlins/.julia/packages/BinDeps/ZEval/src/dependencies.jl:944
 [12] satisfy!(::BinDeps.LibraryDependency) at /users/omlins/.julia/packages/BinDeps/ZEval/src/dependencies.jl:922
 [13] top-level scope at /users/omlins/.julia/packages/BinDeps/ZEval/src/dependencies.jl:977
 [14] include at ./boot.jl:317 [inlined]
 [15] include_relative(::Module, ::String) at ./loading.jl:1044
 [16] include(::Module, ::String) at ./sysimg.jl:29
 [17] include(::String) at ./client.jl:392
 [18] top-level scope at none:0
in expression starting at /users/omlins/.julia/packages/MPI/U5ujD/deps/build.jl:54

#8

The -fPIC flag is definitely not getting to the compiler (both C and Fortran), which is weird because the CMakeLists.txt definitely uses CMAKE_C_FLAGS. Do you have GNU compilers available on your machine. If so, try doing module swap PrgEvn-cray PrgEnv-gnu (or similar depending on the module names). I want to see if this works with GNU compilers to see if this really is a bug with CMake and the Cray compilers.


#9

Yes, if I swap to PrgEnv-gnu, then it works. See the following (done after a fresh login):

> export CRAYPE_LINK_TYPE=dynamic
> module switch PrgEnv-cray/6.0.4 PrgEnv-gnu
> julia

julia> import Pkg; Pkg.build("MPI")
  Building MPI → `~/.julia/packages/MPI/U5ujD/deps/build.log`

julia> 
> cat ~/.julia/packages/MPI/U5ujD/deps/build.log
-- The Fortran compiler identification is GNU 6.2.0
-- The C compiler identification is GNU 6.2.0
-- Cray Programming Environment 2.5.15 Fortran
-- Check for working Fortran compiler: /opt/cray/pe/craype/2.5.15/bin/ftn
-- Check for working Fortran compiler: /opt/cray/pe/craype/2.5.15/bin/ftn  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /opt/cray/pe/craype/2.5.15/bin/ftn supports Fortran 90
-- Checking whether /opt/cray/pe/craype/2.5.15/bin/ftn supports Fortran 90 -- yes
-- Cray Programming Environment 2.5.15 C
-- Check for working C compiler: /opt/cray/pe/craype/2.5.15/bin/cc
-- Check for working C compiler: /opt/cray/pe/craype/2.5.15/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found Git: /usr/bin/git (found version "2.12.3") 
-- Found MPI_C: /opt/cray/pe/craype/2.5.15/bin/cc  
-- Found MPI_Fortran: /opt/cray/pe/craype/2.5.15/bin/ftn  
-- Detecting Fortran/C Interface
-- Detecting Fortran/C Interface - Found GLOBAL and MODULE mangling
-- Looking for MPI_Comm_c2f
-- Looking for MPI_Comm_c2f - not found
-- Configuring done
-- Generating done
-- Build files have been written to: /users/omlins/.julia/packages/MPI/U5ujD/deps/build
Scanning dependencies of target gen_constants
[ 11%] Building Fortran object CMakeFiles/gen_constants.dir/gen_constants.f90.o
[ 22%] Linking Fortran executable gen_constants
[ 22%] Built target gen_constants
Scanning dependencies of target gen_functions
[ 33%] Building C object CMakeFiles/gen_functions.dir/gen_functions.c.o
[ 44%] Linking C executable gen_functions
[ 44%] Built target gen_functions
Scanning dependencies of target mpijl-build
[ 55%] Generating mpi-build.jl
[ 55%] Built target mpijl-build
Scanning dependencies of target mpijl
[ 66%] Generating compile-time.jl
[ 66%] Built target mpijl
Scanning dependencies of target juliampi
[ 77%] Building C object CMakeFiles/juliampi.dir/juliampi.c.o
[ 88%] Building Fortran object CMakeFiles/juliampi.dir/test_mpi.f90.o
[100%] Linking Fortran shared library libjuliampi.so
[100%] Built target juliampi
[ 22%] Built target gen_constants
[ 44%] Built target gen_functions
[ 55%] Built target mpijl-build
[ 66%] Built target mpijl
[100%] Built target juliampi
Install the project...
-- Install configuration: ""
-- Installing: /users/omlins/.julia/packages/MPI/U5ujD/deps/src/./compile-time.jl
-- Installing: /users/omlins/.julia/packages/MPI/U5ujD/deps/usr/lib/libjuliampi.so
[ Info: Attempting to create directory /users/omlins/.julia/packages/MPI/U5ujD/deps/build
[ Info: Changing directory to /users/omlins/.julia/packages/MPI/U5ujD/deps/build


#10

It must be a problem with CMake and the Cray compilers. You can try building a newer version of CMake yourself (something newer than 3.11) and see if that works with the Cray compilers.


#11

It must be a problem with CMake and the Cray compilers.

Yes, absolutely.

As you could see above, building with PrgEnv-gnu worked; however the following still appeared in the configuring phase:

-- Looking for MPI_Comm_c2f
-- Looking for MPI_Comm_c2f - not found

Do you know the relevance of MPI_Comm_c2f for MPI.jl? What will not work (properly)?


#12

The short answer is everthing will work fine.

The long answer is MPI.jl uses the Fortran MPI interface, but many MPI-aware libraries use the C interface. The MPI standard requires that either a C and Fortran communicator must be the same or the MPI library must provide functions to convert one to the other. The configure phase checks to see if the C to Fortran conversion function exists, and uses that information to define the proper conversion function wrappers in Julia.