Skip to content

Commit

Permalink
List mpi-serial's include directory before any system-level includes
Browse files Browse the repository at this point in the history
Without this, I was getting runtime failures on my new mac, using
gcc/gfortran 8.2.0. The problem was that it seemed to be picking up
/usr/local/include/mpif.h rather than the mpif.h from mpi-serial.

I'm not sure why this problem suddenly appeared on my new machine: both
my new and old machines had -I/usr/local/include before the mpi-serial
include directory, and both had an mpif.h in /usr/local/include. So I'm
not sure why this issue didn't appear on my old machine, too.
  • Loading branch information
billsacks committed Dec 26, 2018
1 parent 5e2af84 commit ab66ce6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/mct/mpeu)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/mct/mct)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/mct/mpeu)
if (USE_MPI_SERIAL)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/mct/mpi-serial)
link_directories(${CMAKE_CURRENT_BINARY_DIR}/mct/mpi-serial)
# We need to list the mpi-serial include directory before system-level
# directories so that we're sure to use mpi-serial's mpif.h instead of
# an mpif.h from a system path.
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/mct/mpi-serial)
link_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/mct/mpi-serial)
endif()

# ------------------------------------------------------------------------
Expand Down

0 comments on commit ab66ce6

Please sign in to comment.