On some systems such as Cray the FindMPI.cmake module can't find the proper
libraries to link to. Therefore we now test whether the given C compiler
is an MPI wrapper and skip the rest of the tests.
Thanks to Roland Schulz for the patch.
# Microsoft HPC SDK is automatically added to the system path
# Argonne National Labs MPICH2 sets a registry key that we can use.
+TRY_COMPILE(MPI_FOUND ${CMAKE_BINARY_DIR}
+ "${CMAKE_SOURCE_DIR}/cmake/TestMPI.c"
+ COMPILE_DEFINITIONS )
+
+if(MPI_FOUND)
+ return()
+endif()
+
set(_MPI_PACKAGE_DIR
mpi
mpich
--- /dev/null
+#include <mpi.h>
+
+int main(int argc, char **argv)
+{
+ MPI_Init(&argc,&argv);
+}
add_library(gmx ${GMXLIB_SOURCES} ${BLAS_SOURCES} ${LAPACK_SOURCES} ${GMX_SSEKERNEL_C_SRC} ${GMX_SSEKERNEL_ASM_SRC} ${FORTRAN_SOURCES} ${GMX_BLUEGENE_C_SRC} ${THREAD_MPI_SRC})
target_link_libraries(gmx ${GMX_EXTRA_LIBRARIES} ${THREAD_LIB})
-add_dependencies(gmx gmx_version)
+if(USE_VERSION_H)
+ add_dependencies(gmx gmx_version)
+endif()
set_target_properties(gmx PROPERTIES OUTPUT_NAME "gmx${GMX_LIBS_SUFFIX}" SOVERSION ${SOVERSION} INSTALL_NAME_DIR "${LIB_INSTALL_DIR}")
install(TARGETS gmx DESTINATION ${LIB_INSTALL_DIR} COMPONENT libraries)