@@ -1163,38 +1163,8 @@ if(mathmore OR builtin_gsl OR (tmva-cpu AND use_gsl_cblas))
11631163 endif ()
11641164 endif ()
11651165 else ()
1166- set (gsl_version 2.8)
1167- message (STATUS "Downloading and building GSL version ${gsl_version} " )
1168- foreach (l gsl gslcblas)
1169- list (APPEND GSL_LIBRARIES ${CMAKE_BINARY_DIR } /lib/${CMAKE_STATIC_LIBRARY_PREFIX }${l}${CMAKE_STATIC_LIBRARY_SUFFIX } )
1170- endforeach ()
1171- set (GSL_CBLAS_LIBRARY ${CMAKE_BINARY_DIR } /lib/${CMAKE_STATIC_LIBRARY_PREFIX } gslcblas${CMAKE_STATIC_LIBRARY_SUFFIX } )
1172- if (CMAKE_OSX_SYSROOT)
1173- set (_gsl_cppflags "-isysroot ${CMAKE_OSX_SYSROOT} " )
1174- set (_gsl_ldflags "-isysroot ${CMAKE_OSX_SYSROOT} " )
1175- endif ()
1176- ExternalProject_Add (
1177- GSL
1178- # http://mirror.switch.ch/ftp/mirror/gnu/gsl/gsl-${gsl_version}.tar.gz
1179- URL ${lcgpackages} /gsl-${gsl_version} .tar.gz
1180- URL_HASH SHA256=6a99eeed15632c6354895b1dd542ed5a855c0f15d9ad1326c6fe2b2c9e423190
1181- SOURCE_DIR GSL-src # prevent "<gsl/...>" vs GSL/ macOS warning
1182- INSTALL_DIR ${CMAKE_BINARY_DIR }
1183- CONFIGURE_COMMAND <SOURCE_DIR >/configure --prefix <INSTALL_DIR >
1184- --libdir=<INSTALL_DIR >/lib
1185- --enable-shared=no --with-pic
1186- CC=${CMAKE_C_COMPILER }
1187- CFLAGS=${CMAKE_C_FLAGS }
1188- CPPFLAGS=${_gsl_cppflags}
1189- LDFLAGS=${_gsl_ldflags}
1190- LOG_DOWNLOAD 1 LOG_CONFIGURE 1 LOG_BUILD 1 LOG_INSTALL 1 LOG_OUTPUT_ON_FAILURE 1
1191- BUILD_BYPRODUCTS ${GSL_LIBRARIES}
1192- TIMEOUT 600
1193- )
1194- set (GSL_TARGET GSL)
1195- # FIXME: one need to find better way to extract path with GSL include files
1196- set (GSL_INCLUDE_DIR ${CMAKE_BINARY_DIR } /GSL-prefix/src/GSL-build)
1197- set (GSL_FOUND ON )
1166+ list (APPEND ROOT_BUILTINS BUILTIN_GSL)
1167+ add_subdirectory (builtins/gsl )
11981168 set (mathmore ON CACHE BOOL "Enabled because builtin_gsl requested (${mathmore_description} )" FORCE )
11991169 endif ()
12001170endif ()
@@ -1206,16 +1176,14 @@ if(tmva-cpu)
12061176 add_library (ROOT::BLAS ALIAS Blas )
12071177 if (NOT use_gsl_cblas AND BLAS_FOUND)
12081178 target_link_libraries (Blas INTERFACE BLAS::BLAS )
1209- elseif (use_gsl_cblas AND builtin_gsl)
1210- message (STATUS "Using builtin GSL CBLAS for optional parts of TMVA" )
1211- add_dependencies (Blas GSL )
1212- target_include_directories (Blas INTERFACE ${GSL_INCLUDE_DIR} )
1213- target_link_libraries (Blas INTERFACE ${GSL_CBLAS_LIBRARY} )
1214- target_compile_definitions (Blas INTERFACE -DR__USE_CBLAS )
12151179 elseif (use_gsl_cblas AND GSL_FOUND)
1216- message (STATUS "Using GSL CBLAS for optional parts of TMVA" )
1217- target_link_libraries (Blas INTERFACE GSL::gslcblas )
1180+ if (builtin_gsl)
1181+ message (STATUS "Using builtin GSL CBLAS for optional parts of TMVA" )
1182+ else ()
1183+ message (STATUS "Using system GSL CBLAS for optional parts of TMVA" )
1184+ endif ()
12181185 target_compile_definitions (Blas INTERFACE -DR__USE_CBLAS )
1186+ target_link_libraries (Blas INTERFACE GSL::gslcblas )
12191187 else ()
12201188 if (fail-on -missing)
12211189 message (SEND_ERROR "tmva-cpu can't be built because BLAS was not found!" )
0 commit comments