Skip to content

Commit f54b5ed

Browse files
committed
Support additional cmake configuration variables
Some of these are now necessary since `MPI.jl` started using the MPI C interface, and requires the respective settings in `CMakeLists.txt`.
1 parent 06b5d6e commit f54b5ed

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

README.md

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,37 @@ which will build and install the wrapper into `$HOME/.julia/vX.Y/MPI`.
3232

3333
It may be that CMake selects the wrong MPI version, or that CMake
3434
fails to correctly detect and configure your MPI implementation. You
35-
can override CMake's mechanism by setting two environment variables:
35+
can override CMake's mechanism by setting certain environment variables:
3636
```sh
37-
JULIA_MPI_INCLUDE_PATH
38-
JULIA_MPI_LIBRARIES
37+
JULIA_MPI_C_LIBRARIES
38+
JULIA_MPI_Fortran_INCLUDE_PATH
39+
JULIA_MPI_Fortran_LIBRARIES
3940
```
40-
This will set `MPI_Fortran_INCLUDE_PATH` and `MPI_Fortran_LIBRARIES`
41-
when calling CMake as described in its [FindMPI] module. You can set
42-
these variables either in your shell startup file, or e.g. via your
41+
This will set `MPI_C_LIBRARIES`, `MPI_Fortran_INCLUDE_PATH`, and
42+
`MPI_Fortran_LIBRARIES` when calling CMake as described in its [FindMPI] module.
43+
You can set these variables either in your shell startup file, or e.g. via your
4344
`~/.juliarc` file. Here is an example:
4445
```Julia
45-
ENV["JULIA_MPI_INCLUDE_PATH"] = "-I/opt/local/include"
46-
ENV["JULIA_MPI_LIBRARIES"] = "-L/opt/local/lib/openmpi-gcc5 -lmpi_usempif08 -lmpi_mpifh -lmpi"
46+
ENV["JULIA_MPI_C_LIBRARIES"] = "-L/opt/local/lib/openmpi-gcc5 -lmpi"
47+
ENV["JULIA_MPI_Fortran_INCLUDE_PATH"] = "-I/opt/local/include"
48+
ENV["JULIA_MPI_Fortran_LIBRARIES"] = "-L/opt/local/lib/openmpi-gcc5 -lmpi_usempif08 -lmpi_mpifh -lmpi"
49+
```
50+
51+
You can set other configuration variables as well (by adding a `JULIA_` prefix);
52+
the full list of variables currently supported is
53+
```sh
54+
MPI_C_COMPILER
55+
MPI_C_COMPILE_FLAGS
56+
MPI_C_INCLUDE_PATH
57+
MPI_C_LINK_FLAGS
58+
MPI_C_LIBRARIES
59+
MPI_Fortran_COMPILER
60+
MPI_Fortran_COMPILE_FLAGS
61+
MPI_Fortran_INCLUDE_PATH
62+
MPI_Fortran_LINK_FLAGS
63+
MPI_Fortran_LIBRARIES
64+
MPI_INCLUDE_PATH
65+
MPI_LIBRARIES
4766
```
4867

4968
## Usage : MPI-Only mode

deps/build.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ end
1616

1717
# Add cmake flags to specify the MPI library location
1818
configure = `cmake`
19-
flags = ["MPI_Fortran_COMPILER",
19+
flags = ["MPI_C_COMPILER",
20+
"MPI_C_COMPILE_FLAGS",
21+
"MPI_C_INCLUDE_PATH",
22+
"MPI_C_LINK_FLAGS",
23+
"MPI_C_LIBRARIES",
24+
"MPI_Fortran_COMPILER",
2025
"MPI_Fortran_COMPILE_FLAGS",
2126
"MPI_Fortran_INCLUDE_PATH",
2227
"MPI_Fortran_LINK_FLAGS",

0 commit comments

Comments
 (0)