Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Commit 43f83b7

Browse files
Merge branch 'develop' into unique_ptr
2 parents aa2b050 + fea96bd commit 43f83b7

14 files changed

+91
-57
lines changed

.github/workflows/cmake.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CMake
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ develop ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ develop ]
88
workflow_dispatch:
99

1010
env:

.github/workflows/documentation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Documentation
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ develop ]
66
pull_request:
7-
branches: [ main ]
7+
branches: [ develop ]
88

99
jobs:
1010
build:

.github/workflows/format.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: Clang Format Checker
22
on:
33
pull_request:
4-
branches: [ main ]
4+
branches: [ develop ]
55
push:
6-
branches: [ main ]
6+
branches: [ develop ]
77
workflow_dispatch:
88

99
jobs:

.github/workflows/ifpen_devenv_2021b.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: IFPEN devenv 2021b
22

33
on:
4+
push:
5+
branches: [ develop ]
46
workflow_dispatch:
57

68
env:
@@ -46,7 +48,7 @@ env:
4648
CT_OPTS: "--timeout 300 --output-on-failure"
4749

4850
jobs:
49-
build :
51+
build:
5052
name: ${{matrix.config.name}}
5153
runs-on: ubuntu-latest
5254
timeout-minutes: 120

.github/workflows/ifpen_el7_foss-2018b.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: IFPEN el7 foss/2018b
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ develop ]
66
workflow_dispatch:
77

88
env:

.github/workflows/ifpen_el7_gimkl-2018b.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: IFPEN el7 gimkl/2018b
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ develop ]
66
workflow_dispatch:
77

88
env:

.github/workflows/ifpen_el8_foss-2018b.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: IFPEN el8 foss/2018b
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ develop ]
66
workflow_dispatch:
77

88
env:

.github/workflows/ifpen_el8_gimkl-2018b.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: IFPEN el8 gimkl/2018b
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ develop ]
66
workflow_dispatch:
77

88
env:

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
88

99
- \[move\]: parallel matrix-market reader
1010
- \[hypre\]: improve AMG parameter choices, especially for GPU
11+
- \[trilinos\]: use modern CMake Trilinos and support for GPU
1112

1213
**Fixed bugs:**
1314

plugins/trilinos/CMakeLists.txt

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,6 @@ option(ALIEN_TRILINOS_UNIT_TESTS "Enable Trilinos wrapper tests" ${ALIEN_UNIT_TE
33

44
find_package(MPI REQUIRED)
55

6-
7-
# ----------------------------------------------------------------------------
8-
find_package(Trilinos 13 REQUIRED COMPONENTS Teuchos Kokkos KokkosKernels Belos Tpetra Ifpack2)
9-
10-
# Echo trilinos build info just for fun
11-
MESSAGE("\nFound Trilinos! Here are the details: ")
12-
MESSAGE(" Trilinos_DIR = ${Trilinos_DIR}")
13-
MESSAGE(" Trilinos_VERSION = ${Trilinos_VERSION}")
14-
MESSAGE(" Trilinos_PACKAGE_LIST = ${Trilinos_PACKAGE_LIST}")
15-
MESSAGE(" Trilinos_LIBRARIES = ${Trilinos_LIBRARIES}")
16-
MESSAGE(" Trilinos_INCLUDE_DIRS = ${Trilinos_INCLUDE_DIRS}")
17-
MESSAGE(" Trilinos_LIBRARY_DIRS = ${Trilinos_LIBRARY_DIRS}")
18-
MESSAGE(" Trilinos_TPL_LIST = ${Trilinos_TPL_LIST}")
19-
MESSAGE(" Trilinos_TPL_INCLUDE_DIRS = ${Trilinos_TPL_INCLUDE_DIRS}")
20-
MESSAGE(" Trilinos_TPL_LIBRARIES = ${Trilinos_TPL_LIBRARIES}")
21-
MESSAGE(" Trilinos_TPL_LIBRARY_DIRS = ${Trilinos_TPL_LIBRARY_DIRS}")
22-
MESSAGE(" Trilinos_BUILD_SHARED_LIBS = ${Trilinos_BUILD_SHARED_LIBS}")
23-
MESSAGE("End of Trilinos details\n")
24-
25-
# Make sure to use same compilers and flags as Trilinos
26-
#MESSAGE(" Trilinos_CXX_COMPILER_FLAGS = ${Trilinos_CXX_COMPILER_FLAGS}")
27-
string(REPLACE " " ";" Trilinos_CXX_COMPILER_FLAGS ${Trilinos_CXX_COMPILER_FLAGS})
28-
29-
# ----------------------------------------------------------------------------
306
# ----------------------------------------------------------------------------
317

328
add_library(trilinos_wrapper
@@ -46,26 +22,69 @@ add_library(trilinos_wrapper
4622
src/trilinos_config.cpp
4723
)
4824

49-
set_property(TARGET trilinos_wrapper
50-
APPEND_STRING
51-
PROPERTY
52-
COMPILE_OPTIONS ${Trilinos_CXX_COMPILER_FLAGS}
53-
)
54-
5525
target_link_libraries(trilinos_wrapper PUBLIC
5626
Alien::alien_core
5727
)
5828

29+
# ----------------------------------------------------------------------------
30+
find_package(Trilinos 13 REQUIRED COMPONENTS Teuchos Kokkos KokkosKernels Belos Tpetra Ifpack2 MueLu)
31+
32+
if (NOT TARGET Trilinos::all_selected_libs)
33+
# Newer versions of Trilinos should define this target.
34+
35+
# Echo trilinos build info just for fun
36+
MESSAGE("\nFound Trilinos! Here are the details: ")
37+
MESSAGE(" Trilinos_DIR = ${Trilinos_DIR}")
38+
MESSAGE(" Trilinos_VERSION = ${Trilinos_VERSION}")
39+
MESSAGE(" Trilinos_PACKAGE_LIST = ${Trilinos_PACKAGE_LIST}")
40+
MESSAGE(" Trilinos_LIBRARIES = ${Trilinos_LIBRARIES}")
41+
MESSAGE(" Trilinos_INCLUDE_DIRS = ${Trilinos_INCLUDE_DIRS}")
42+
MESSAGE(" Trilinos_LIBRARY_DIRS = ${Trilinos_LIBRARY_DIRS}")
43+
MESSAGE(" Trilinos_TPL_LIST = ${Trilinos_TPL_LIST}")
44+
MESSAGE(" Trilinos_TPL_INCLUDE_DIRS = ${Trilinos_TPL_INCLUDE_DIRS}")
45+
MESSAGE(" Trilinos_TPL_LIBRARIES = ${Trilinos_TPL_LIBRARIES}")
46+
MESSAGE(" Trilinos_TPL_LIBRARY_DIRS = ${Trilinos_TPL_LIBRARY_DIRS}")
47+
MESSAGE(" Trilinos_BUILD_SHARED_LIBS = ${Trilinos_BUILD_SHARED_LIBS}")
48+
MESSAGE("End of Trilinos details\n")
49+
50+
# Make sure to use same compilers and flags as Trilinos
51+
#MESSAGE(" Trilinos_CXX_COMPILER_FLAGS = ${Trilinos_CXX_COMPILER_FLAGS}")
52+
string(REPLACE " " ";" Trilinos_CXX_COMPILER_FLAGS ${Trilinos_CXX_COMPILER_FLAGS})
53+
add_library(Trilinos::all_selected_libs INTERFACE IMPORTED)
54+
target_compile_options(Trilinos::all_selected_libs INTERFACE ${Trilinos_CXX_COMPILER_FLAGS})
55+
target_include_directories(Trilinos::all_selected_libs INTERFACE ${Trilinos_INCLUDE_DIRS} ${TRILINOS_TPL_INCLUDE_DIRS})
56+
target_link_libraries(Trilinos::all_selected_libs INTERFACE ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
57+
58+
if (NOT TARGET Kokkos::kokkos)
59+
add_library(Kokkos::kokkos INTERFACE IMPORTED)
60+
else ()
61+
# Debian and Ubuntu packaging is bugged, INTERFACE_INCLUDE_DIRECTORIES referencing a /usr/lib/include directory
62+
get_target_property(KOKKOS_INC_DIRS Kokkos::kokkos INTERFACE_INCLUDE_DIRECTORIES)
63+
set(NEW_KOKKOS_INC_DIRS)
64+
foreach (INC_DIR ${KOKKOS_INC_DIRS})
65+
MESSAGE(STATUS "INC_DIR = ${INC_DIR}")
66+
if (EXISTS ${INC_DIR})
67+
LIST(APPEND NEW_KOKKOS_INC_DIRS ${INC_DIR})
68+
endif ()
69+
endforeach ()
70+
set_target_properties(Kokkos::kokkos PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${NEW_KOKKOS_INC_DIRS}")
71+
endif ()
72+
else ()
73+
kokkos_compilation(TARGET trilinos_wrapper)
74+
endif ()
75+
76+
# ----------------------------------------------------------------------------
77+
5978
target_link_libraries(trilinos_wrapper PRIVATE
6079
MPI::MPI_CXX
6180
Arccore::arccore_trace
6281
Arccore::arccore_collections
6382
Arccore::arccore_base
6483
Arccore::arccore_message_passing_mpi
65-
${Trilinos_LIBRARIES}
66-
${Trilinos_TPL_LIBRARIES}
84+
Trilinos::all_selected_libs Kokkos::kokkos
6785
)
6886

87+
6988
if (ALIEN_PLUGIN_TRILINOS_OMP)
7089
message("------ COMPILING TRILINOS WRAPPER WITH *OPENMP* BACKEND ------- ")
7190
elseif (ALIEN_PLUGIN_TRILINOS_CUDA)
@@ -91,8 +110,6 @@ target_include_directories(trilinos_wrapper PUBLIC
91110
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
92111
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
93112
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
94-
${Trilinos_INCLUDE_DIRS}
95-
${Trilinos_TPL_INCLUDE_DIRS}
96113
)
97114

98115
add_library(Alien::trilinos_wrapper ALIAS trilinos_wrapper)

0 commit comments

Comments
 (0)