File: FindPETSc_mpi_include_path.patch

package info (click to toggle)
dolfinx 2019.2.0~git20210130.c14cb0a-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,584 kB
  • sloc: cpp: 48,110; python: 9,536; xml: 9,114; makefile: 261; sh: 17
file content (41 lines) | stat: -rw-r--r-- 1,476 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Index: dolfinx/cpp/cmake/modules/FindPETSc.cmake
===================================================================
--- dolfinx.orig/cpp/cmake/modules/FindPETSc.cmake
+++ dolfinx/cpp/cmake/modules/FindPETSc.cmake
@@ -102,6 +102,14 @@ if (PETSC_FOUND AND NOT TARGET PETSC::pe
   set_property(TARGET PETSC::petsc_static PROPERTY INTERFACE_LINK_LIBRARIES "${_libs}")
 endif()
 
+# Add MPI variables if MPI has been found
+if (MPI_C_FOUND)
+  set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${MPI_C_INCLUDE_PATH})
+  set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${MPI_C_LIBRARIES})
+  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${MPI_C_COMPILE_FLAGS}")
+  set(MPI_LINK_LIBRARIES MPI::MPI_C)
+endif()
+
 # Attempt to build and run PETSc test program
 if (DOLFINX_SKIP_BUILD_TESTS)
 
@@ -131,13 +139,6 @@ int main()
 }
 ")
 
-  # Add MPI variables if MPI has been found
-  if (MPI_C_FOUND)
-    set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${MPI_C_INCLUDE_PATH})
-    set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${MPI_C_LIBRARIES})
-    set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${MPI_C_COMPILE_FLAGS}")
-    set(MPI_LINK_LIBRARIES MPI::MPI_C)
-  endif()
 
   # Try to run test program (shared linking)
   try_run(
@@ -211,6 +212,7 @@ int main()
   endif()
 endif()
 
+
 # Check sizeof(PetscInt) and check scalar type
 if (PETSC_INCLUDE_DIRS)
   set(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${PETSC_INCLUDE_DIRS})