diff --git a/L/Libxc/Libxc/build_tarballs.jl b/L/Libxc/Libxc/build_tarballs.jl index 099a35b4439..d6d041a26f3 100644 --- a/L/Libxc/Libxc/build_tarballs.jl +++ b/L/Libxc/Libxc/build_tarballs.jl @@ -1,7 +1,7 @@ using BinaryBuilder, Pkg name = "Libxc" -version = v"6.1.0" +version = v"7.0.0" include("../sources.jl") @@ -13,9 +13,13 @@ cd $WORKSPACE/srcdir/libxc-*/ mkdir libxc_build cd libxc_build -cmake -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \ - -DCMAKE_BUILD_TYPE=Release -DENABLE_XHOST=OFF -DBUILD_SHARED_LIBS=ON \ - -DENABLE_FORTRAN=OFF -DDISABLE_KXC=ON .. +cmake -DCMAKE_INSTALL_PREFIX=$prefix \ + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=ON \ + -DENABLE_XHOST=OFF \ + -DENABLE_FORTRAN=OFF \ + -DDISABLE_KXC=ON .. make -j${nproc} make install @@ -37,4 +41,5 @@ dependencies = [ # Build the tarballs, and possibly a `build.jl` as well. build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; - preferred_gcc_version=v"5", julia_compat="1.6") + preferred_gcc_version=v"8", + julia_compat="1.8") diff --git a/L/Libxc/Libxc_GPU/build_tarballs.jl b/L/Libxc/Libxc_GPU/build_tarballs.jl index 30d3634348a..91a624f55ac 100644 --- a/L/Libxc/Libxc_GPU/build_tarballs.jl +++ b/L/Libxc/Libxc_GPU/build_tarballs.jl @@ -5,43 +5,41 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl")) include(joinpath(YGGDRASIL_DIR, "platforms", "cuda.jl")) name = "Libxc_GPU" -version = v"6.1.0" +version = v"7.0.0" include("../sources.jl") -sources = [ - sources; - DirectorySource("./bundled") -] - # Bash recipe for building GPU version # Notes: # - 3rd and 4th derivatives (KXC, LXC) not built since gives a binary size of ~200MB script = raw""" cd $WORKSPACE/srcdir/libxc-*/ -# Needed for Libxc 6.1.0 as these backport some fixes on libxc master -# On Libxc > 6.1.0 we can also remove the -DBUILD_TESTING=OFF -atomic_patch -p1 ${WORKSPACE}/srcdir/patches/cmake-cuda.patch -atomic_patch -p1 ${WORKSPACE}/srcdir/patches/source-fixes.patch +ln -s $prefix/cuda/lib $prefix/cuda/lib64 mkdir libxc_build cd libxc_build -cmake -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \ - -DCMAKE_BUILD_TYPE=Release -DENABLE_XHOST=OFF -DBUILD_SHARED_LIBS=ON \ - -DENABLE_CUDA=ON -DCMAKE_CUDA_COMPILER=$prefix/cuda/bin/nvcc -DBUILD_TESTING=OFF \ - -DENABLE_FORTRAN=OFF -DDISABLE_KXC=ON .. -make -j${nproc} -make install -""" +cmake -DCMAKE_INSTALL_PREFIX=$prefix \ + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CUDA_COMPILER=$prefix/cuda/bin/nvcc \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_TESTING=OFF \ + -DENABLE_CUDA=ON \ + -DENABLE_XHOST=OFF\ + -DENABLE_FORTRAN=OFF \ + -DDISABLE_KXC=ON .. -augment_platform_block = CUDA.augment +cmake --build . --parallel $nproc +cmake --install . + +unlink $prefix/cuda/lib64 +""" # Override the default platforms -platforms = CUDA.supported_platforms() +platforms = CUDA.supported_platforms(; min_version=v"11.4") filter!(p -> arch(p) == "x86_64", platforms) - # The products that we will ensure are always built products = [ LibraryProduct("libxc", :libxc) @@ -56,10 +54,12 @@ dependencies = [ for platform in platforms should_build_platform(triplet(platform)) || continue - cuda_deps = CUDA.required_dependencies(platform) + cuda_deps = CUDA.required_dependencies(platform; static_sdk=true) build_tarballs(ARGS, name, version, sources, script, [platform], - products, [dependencies; cuda_deps]; lazy_artifacts=true, - julia_compat="1.7", augment_platform_block, - skip_audit=true, dont_dlopen=true) + products, [dependencies; cuda_deps]; + lazy_artifacts=true, + julia_compat="1.8", + augment_platform_block=CUDA.augment, + preferred_gcc_version=v"8") end diff --git a/L/Libxc/Libxc_GPU/bundled/patches/cmake-cuda.patch b/L/Libxc/Libxc_GPU/bundled/patches/cmake-cuda.patch deleted file mode 100644 index 37b4dedc249..00000000000 --- a/L/Libxc/Libxc_GPU/bundled/patches/cmake-cuda.patch +++ /dev/null @@ -1,72 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index a45f2db9e..2ee468621 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -11,6 +11,16 @@ cmake_minimum_required(VERSION 3.1) - set(CMAKE_C_STANDARD 99) - list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) - -+if(ENABLE_CUDA) -+ cmake_minimum_required(VERSION 3.8) -+ set(CMAKE_VERBOSE_MAKEFILE ON) -+ enable_language(CUDA) -+ set(CMAKE_CUDA_STANDARD 98) -+ if(POLICY CMP0104) -+ cmake_policy(SET CMP0104 OLD) -+ endif() -+endif() -+ - ################################### Options #################################### - include(psi4OptionsTools) - option_with_default(CMAKE_BUILD_TYPE "Build type" Release) -@@ -443,6 +453,11 @@ set(raw_sources_list - set(src_prefix "src/") - string(REGEX REPLACE "([^;]+)" "${src_prefix}\\1" sources_list "${raw_sources_list}") - -+ -+if(ENABLE_CUDA) -+ set_source_files_properties(${sources_list} PROPERTIES LANGUAGE CUDA) -+endif() -+ - set(raw_sources_list_f03 - src/libxc_master.F90 - ) -@@ -468,6 +483,7 @@ set(CMAKE_INSTALL_RPATH ${base} ${base}/${relDir}) - - # STATIC/SHARED on below governed by BUILD_SHARED_LIBS - add_library(xc ${sources_list}) -+set_target_properties(xc PROPERTIES CUDA_SEPARABLE_COMPILATION ON) - target_link_libraries(xc INTERFACE ${STANDARD_MATH_LIBRARY}) - set_target_properties(xc PROPERTIES POSITION_INDEPENDENT_CODE ${BUILD_FPIC} - SOVERSION ${${PROJECT_NAME}_SOMAJOR}) -@@ -493,9 +509,15 @@ if(ENABLE_FORTRAN) - endif() - - add_executable(xc-info "${src_prefix}/xc-info.c") -+if(ENABLE_CUDA) -+ set_source_files_properties("${src_prefix}/xc-info.c" PROPERTIES LANGUAGE CUDA) -+endif() - target_link_libraries(xc-info xc) - - add_executable(xc-threshold "${src_prefix}/xc-threshold.c") -+if(ENABLE_CUDA) -+ set_source_files_properties("${src_prefix}/xc-threshold.c" PROPERTIES LANGUAGE CUDA) -+endif() - target_link_libraries(xc-threshold xc) - - -diff --git a/config.h.cmake.in b/config.h.cmake.in -index 7b151e5bf..816fd600e 100644 ---- a/config.h.cmake.in -+++ b/config.h.cmake.in -@@ -7,5 +7,10 @@ - #define FC_FUNC_ FC_FUNC_GLOBAL_ - #endif - -+#cmakedefine ENABLE_CUDA @ENABLE_CUDA@ -+#ifdef ENABLE_CUDA -+#define HAVE_CUDA 1 -+#endif -+ - #include - diff --git a/L/Libxc/Libxc_GPU/bundled/patches/source-fixes.patch b/L/Libxc/Libxc_GPU/bundled/patches/source-fixes.patch deleted file mode 100644 index ebac855517e..00000000000 --- a/L/Libxc/Libxc_GPU/bundled/patches/source-fixes.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff --git a/src/util.h b/src/util.h -index ce26160bd..1f1c3b820 100644 ---- a/src/util.h -+++ b/src/util.h -@@ -331,14 +331,14 @@ void libxc_free(void *ptr); - #else - - template --auto libxc_malloc(const int_type size){ -+void* libxc_malloc(const int_type size){ - void * mem; - cudaMallocManaged(&mem, size); - return mem; - } - - template --auto libxc_calloc(const int_type1 size1, const int_type2 size2){ -+void* libxc_calloc(const int_type1 size1, const int_type2 size2){ - void * mem; - cudaMallocManaged(&mem, size1*size2); - cudaMemset(mem, 0, size1*size2); diff --git a/L/Libxc/sources.jl b/L/Libxc/sources.jl index c146ef991d5..ee9bb0d3834 100644 --- a/L/Libxc/sources.jl +++ b/L/Libxc/sources.jl @@ -1,5 +1,5 @@ # Sources required for all builds sources = [ ArchiveSource("https://gitlab.com/libxc/libxc/-/archive/$(version)/libxc-$(version).tar.gz", - "f593745fa47ebfb9ddc467aaafdc2fa1275f0d7250c692ce9761389a90dd8eaf"), + "8d4e343041c9cd869833822f57744872076ae709a613c118d70605539fb13a77"), ]