You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add option to use external dependencies instead of fetchcontent
This commit adds the ability to search for already installed software on the
system instead of downloading the required libraries using fetchcontent. This
allows package managers to select dependencies that are more compatible with the
system than the one targeted by the ArrayFire build system. One disadvantage of
this approach is the increase build failures and version incompatibilities
Copy file name to clipboardExpand all lines: CMakeLists.txt
+56-26Lines changed: 56 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,11 @@ set_policies(
39
39
CMP0079)
40
40
arrayfire_set_cmake_default_variables()
41
41
42
+
option(AF_WITH_EXTERNAL_PACKAGES_ONLY"Build ArrayFire with External packages only"OFF)
43
+
if(AF_WITH_EXTERNAL_PACKAGES_ONLY)
44
+
set(AF_REQUIRED REQUIRED)
45
+
endif()
46
+
42
47
#Set Intel OpenMP as default MKL thread layer
43
48
set(MKL_THREAD_LAYER "Intel OpenMP"CACHESTRING"The thread layer to choose for MKL")
44
49
@@ -54,7 +59,15 @@ find_package(CBLAS)
54
59
find_package(LAPACKE)
55
60
find_package(Doxygen)
56
61
find_package(MKL)
57
-
find_package(spdlog1.8.5QUIET)
62
+
find_package(spdlogQUIET${AF_REQUIRED})
63
+
find_package(fmtQUIET${AF_REQUIRED})
64
+
find_package(span-liteQUIET)
65
+
find_package(GTest)
66
+
find_package(CLBlastQUIET)
67
+
find_package(Boost1.70${AF_REQUIRED})
68
+
69
+
# CLFFT used in ArrayFire requires a specific fork
70
+
#find_package(clFFT QUIET)
58
71
59
72
include(boost_package)
60
73
include(config_ccache)
@@ -75,6 +88,8 @@ option(AF_WITH_STACKTRACE "Add stacktraces to the error messages." ON)
75
88
option(AF_CACHE_KERNELS_TO_DISK"Enable caching kernels to disk"ON)
76
89
option(AF_WITH_STATIC_MKL"Link against static Intel MKL libraries"OFF)
77
90
option(AF_WITH_STATIC_CUDA_NUMERIC_LIBS"Link libafcuda with static numeric libraries(cublas, cufft, etc.)"OFF)
91
+
option(AF_WITH_SPDLOG_HEADER_ONLY"Build ArrayFire with header only version of spdlog"OFF)
92
+
option(AF_WITH_FMT_HEADER_ONLY"Build ArrayFire with header only version of fmt"OFF)
78
93
79
94
if(AF_WITH_STATIC_CUDA_NUMERIC_LIBS)
80
95
option(AF_WITH_PRUNE_STATIC_CUDA_NUMERIC_LIBS"Prune CUDA static libraries to reduce binary size.(WARNING: May break some libs on older CUDA toolkits for some compute arch)"OFF)
@@ -173,7 +188,7 @@ mark_as_advanced(
173
188
FG_BUILD_OFFLINE
174
189
)
175
190
176
-
if(MKL_FOUND)
191
+
if(AF_COMPUTE_LIBRARY STREQUAL"Intel-MKL")
177
192
set(BLA_VENDOR "Intel10_64lp")
178
193
if(MKL_THREAD_LAYER STREQUAL"Sequential")
179
194
set(BLA_VENDOR "${BLA_VENDOR}_seq")
@@ -209,22 +224,38 @@ endif()
209
224
#forge is included in ALL target if AF_BUILD_FORGE is ON
0 commit comments