Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 5f484dee authored by PRUVOST Florent's avatar PRUVOST Florent
Browse files

Merge branch 'fix-ptscotch-tests' into 'master'

Fixed and added required includes for ptscotch tests

See merge request !2
parents 3905d3e4 5ca32fa2
No related branches found
No related tags found
1 merge request!2Fixed and added required includes for ptscotch tests
...@@ -285,7 +285,7 @@ if(PTSCOTCH_LIBRARIES) ...@@ -285,7 +285,7 @@ if(PTSCOTCH_LIBRARIES)
# MPI # MPI
if (MPI_FOUND) if (MPI_FOUND)
if (MPI_C_INCLUDE_PATH) if (MPI_C_INCLUDE_PATH)
list(APPEND CMAKE_REQUIRED_INCLUDES "${MPI_C_INCLUDE_PATH}") list(APPEND REQUIRED_INCDIRS "${MPI_C_INCLUDE_PATH}")
endif() endif()
if (MPI_C_LINK_FLAGS) if (MPI_C_LINK_FLAGS)
if (${MPI_C_LINK_FLAGS} MATCHES " -") if (${MPI_C_LINK_FLAGS} MATCHES " -")
...@@ -373,12 +373,15 @@ mark_as_advanced(PTSCOTCH_DIR_FOUND) ...@@ -373,12 +373,15 @@ mark_as_advanced(PTSCOTCH_DIR_FOUND)
# Check the size of SCOTCH_Num # Check the size of SCOTCH_Num
# --------------------------------- # ---------------------------------
set(CMAKE_REQUIRED_INCLUDES ${PTSCOTCH_INCLUDE_DIRS}) set(CMAKE_REQUIRED_INCLUDES ${PTSCOTCH_INCLUDE_DIRS})
# Add ptscotch dependencies incdirs (mainly MPI) to required includes for the examples
list(APPEND CMAKE_REQUIRED_INCLUDES ${PTSCOTCH_INCLUDE_DIRS_DEP})
include(CheckCSourceRuns) include(CheckCSourceRuns)
#stdio.h and stdint.h should be included by scotch.h directly #stdio.h and stdint.h should be included by scotch.h directly
#mpi.h not included into ptscotch.h => MPI_comm undefined
set(PTSCOTCH_C_TEST_SCOTCH_Num_4 " set(PTSCOTCH_C_TEST_SCOTCH_Num_4 "
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <mpi.h>
#include <ptscotch.h> #include <ptscotch.h>
int main(int argc, char **argv) { int main(int argc, char **argv) {
if (sizeof(SCOTCH_Num) == 4) if (sizeof(SCOTCH_Num) == 4)
...@@ -391,6 +394,7 @@ int main(int argc, char **argv) { ...@@ -391,6 +394,7 @@ int main(int argc, char **argv) {
set(PTSCOTCH_C_TEST_SCOTCH_Num_8 " set(PTSCOTCH_C_TEST_SCOTCH_Num_8 "
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include <mpi.h>
#include <ptscotch.h> #include <ptscotch.h>
int main(int argc, char **argv) { int main(int argc, char **argv) {
if (sizeof(SCOTCH_Num) == 8) if (sizeof(SCOTCH_Num) == 8)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment