File tree 3 files changed +13
-8
lines changed
3 files changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -43,5 +43,5 @@ cd build
43
43
# you need to have cmake version at least 3.23 for our build
44
44
cmake $ipwd -DCMAKE_PREFIX_PATH=$loc /install/kokkos-kernels/lib/cmake/KokkosKernels \
45
45
-DCMAKE_BUILD_TYPE=Release \
46
- -DLINK_GKLIB=True -DMETIS_DIR =" $loc /local" -DCMAKE_INSTALL_PREFIX=" $ipwd /install"
46
+ -DLINK_GKLIB=True -DMETIS_HINT =" $loc /local" -DCMAKE_INSTALL_PREFIX=" $ipwd /install"
47
47
make -j
Original file line number Diff line number Diff line change @@ -41,5 +41,5 @@ cd build
41
41
# requires at least cmake version 3.23
42
42
cmake $ipwd -DCMAKE_PREFIX_PATH=$loc /install/kokkos-kernels/lib/cmake/KokkosKernels \
43
43
-DCMAKE_CXX_COMPILER=$compiler -DCMAKE_BUILD_TYPE=Release \
44
- -DLINK_GKLIB=True -DMETIS_DIR =" $loc /local" -DCMAKE_INSTALL_PREFIX=" $ipwd /install"
44
+ -DLINK_GKLIB=True -DMETIS_HINT =" $loc /local" -DCMAKE_INSTALL_PREFIX=" $ipwd /install"
45
45
make -j
Original file line number Diff line number Diff line change @@ -11,21 +11,26 @@ target_sources(jet PUBLIC
11
11
FILES ${CMAKE_SOURCE_DIR} /header/jet.h ${CMAKE_SOURCE_DIR} /header/jet_defs.h ${CMAKE_SOURCE_DIR} /header/jet_config.h ${CMAKE_SOURCE_DIR} /header/experiment_data.hpp)
12
12
target_include_directories (jet PRIVATE ${CMAKE_SOURCE_DIR} /header)
13
13
14
- if (DEFINED METIS_DIR )
14
+ if (DEFINED METIS_HINT )
15
15
# This is used by the build script
16
16
# to avoid putting metis and gklib in the global path
17
- target_include_directories (jet PRIVATE ${METIS_DIR} /include )
18
- # downstream targets need to know about these link directories
19
- target_link_directories (jet INTERFACE ${METIS_DIR} /lib)
17
+ target_include_directories (jet PRIVATE ${METIS_HINT} /include )
18
+ endif ()
19
+
20
+ # find metis and GKlib using optional hint
21
+ # did you know that find_library doesn't search the LD_LIBRARY_PATH?
22
+ find_library (LIBMETIS metis HINTS ${METIS_HINT} /lib REQUIRED)
23
+ if (LINK_GKLIB)
24
+ find_library (LIBGKLIB GKlib HINTS ${METIS_HINT} /lib REQUIRED)
20
25
endif ()
21
26
22
27
# link libjet (for downstream library consumers)
23
28
# no linking actually occurs for libjet itself
24
29
find_package (KokkosKernels REQUIRED)
25
30
target_link_libraries (jet PUBLIC Kokkos::kokkos Kokkos::kokkoskernels)
26
- target_link_libraries (jet PRIVATE metis )
31
+ target_link_libraries (jet PRIVATE ${LIBMETIS} )
27
32
if (LINK_GKLIB)
28
- target_link_libraries (jet PRIVATE GKlib )
33
+ target_link_libraries (jet PRIVATE ${LIBGKLIB} )
29
34
endif ()
30
35
31
36
# install jetlib and create cmake package
You can’t perform that action at this time.
0 commit comments