Skip to content

Commit 103a7b8

Browse files
StellarBotct-clmsn
andcommitted
Merge #6369
6369: working issue with MPI_CC / CC conflict in automake r=hkaiser a=ct-clmsn Fixes # An issue with MPI_CC/CC conflict with gasnet-conduit-mpi autotools (autoconf in gasnet). ## Proposed Changes - set MPI_CC to the user set CMAKE_C_COMPILER - set ENV{MPI_CC} to CMAKE_C_COMPILER - set MPI_C_COMPILER to CMAKE_C_COMPILER ## Any background context you want to provide? When gasnet compiles it automatically detects for mpi. If it finds MPI then MPI_CC is set. If MPI_CC is set to a compiler that does not match the CMAKE_C_COMPILER set by a user to compile gasnet, then a runtime exception happens during gasnet's build. ## Checklist Not all points below apply to all pull requests. - [ ] I have added a new feature and have added tests to go along with it. - [ ] I have fixed a bug and have added a regression test. - [ ] I have added a test using random numbers; I have made sure it uses a seed, and that random numbers generated are valid inputs for the tests. Co-authored-by: ct-clmsn <[email protected]>
2 parents 53e9a95 + bd490d2 commit 103a7b8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

cmake/HPX_SetupGasnet.cmake

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,23 @@ macro(hpx_setup_gasnet)
153153
endif()
154154

155155
if(${MPI_C_COMPILER})
156-
set(CMAKE_C_COMPILER ${MPI_C_COMPILER})
156+
set(MPI_C_COMPILER ${CMAKE_C_COMPILER})
157+
set(MPI_CC ${CMAKE_C_COMPILER})
158+
set(ENV{MPI_CC} ${CMAKE_C_COMPILER})
157159
elseif(${MPI_CC})
158-
set(CMAKE_C_COMPILER ${MPI_CC})
159-
elseif(ENV{MPI_CC})
160-
set(CMAKE_C_COMPILER ENV{MPI_CC})
160+
set(MPI_CC ${CMAKE_C_COMPILER})
161+
set(ENV{MPI_CC} ${CMAKE_C_COMPILER})
162+
elseif($ENV{MPI_CC})
163+
set(MPI_CC ${CMAKE_C_COMPILER})
164+
set(ENV{MPI_CC} ${CMAKE_C_COMPILER})
161165
else()
162166
message(FATAL_ERROR "GASNet MPI Conduit selected; $MPI_CC not found!")
163167
endif()
164168

169+
if(NOT "$CMAKE_C_COMPILER" STREQUAL "${MPI_CC}")
170+
message(FATAL_ERROR "GASNet MPI: $MPI_CC != $CMAKE_C_COMPILER!")
171+
endif()
172+
165173
execute_process(
166174
COMMAND
167175
bash -c

0 commit comments

Comments
 (0)