From a9379d0b03c8493c14990ea281ff9aee9b7d02e4 Mon Sep 17 00:00:00 2001 From: Tom Westerhout <14264576+twesterhout@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:45:05 +0200 Subject: [PATCH 1/9] arrayfire: 3.7.3 -> 3.9.0-pre --- .../libraries/arrayfire/default.nix | 218 +++++++++++++----- .../libraries/arrayfire/no-download.patch | 28 --- pkgs/development/libraries/forge/default.nix | 69 ++++-- pkgs/top-level/all-packages.nix | 8 +- 4 files changed, 210 insertions(+), 113 deletions(-) delete mode 100644 pkgs/development/libraries/arrayfire/no-download.patch diff --git a/pkgs/development/libraries/arrayfire/default.nix b/pkgs/development/libraries/arrayfire/default.nix index 2c1caf0bbb2b..5c52a43e4878 100644 --- a/pkgs/development/libraries/arrayfire/default.nix +++ b/pkgs/development/libraries/arrayfire/default.nix @@ -1,93 +1,185 @@ -{ lib -, stdenv -, fetchFromGitHub +{ blas +, boost , cmake -, pkg-config -, opencl-clhpp -, ocl-icd +, config +, cudaPackages +, fetchFromGitHub , fftw , fftwFloat -, blas -, lapack -, boost -, mesa -, libGLU -, libGL +, fmt_9 +, forge , freeimage +, git +, gtest +, lapack +, lib +, libGL +, mesa +, ocl-icd +, opencl-clhpp +, pkg-config , python3 -, clfft -, clblas -, doxygen -, buildDocs ? false -, config -, cudaSupport ? config.cudaSupport -, cudatoolkit -, darwin +, span-lite +, stdenv +, doCheck ? false +, withCPU ? true +, withCuda ? config.cudaSupport +, withOpenCL ? stdenv.isLinux +, nvidiaComputeDrivers ? null }: +assert blas.isILP64 == false; + stdenv.mkDerivation rec { pname = "arrayfire"; - version = "3.7.3"; + version = "3.9.0-pre"; src = fetchFromGitHub { owner = pname; repo = pname; - rev = "v${version}"; - sha256 = "0gcbg6b6gs38xhks5pp0vkcqs89zl7rh9982jqlzsd0h724qddw0"; - fetchSubmodules = true; + rev = "d2a66367d859cdb554f2374e29d39c88d5fff978"; + hash = "sha256-9r1w0U9MvhduHwBpEWpqkrQPawd94EY3FAqSJghi09I="; + }; + + assets = fetchFromGitHub { + owner = pname; + repo = "assets"; + rev = "cd08d749611b324012555ad6f23fd76c5465bd6c"; + sha256 = "sha256-v4uhqPz1P1g1430FTmMp22xJS50bb5hZTeEX49GgMWg="; + }; + clblast = fetchFromGitHub { + owner = "cnugteren"; + repo = "CLBlast"; + rev = "4500a03440e2cc54998c0edab366babf5e504d67"; + sha256 = "sha256-I25ylQp6kHZx6Q7Ph5r3abWlQ6yeIHIDdS1eGCyArZ0="; + }; + clfft = fetchFromGitHub { + owner = pname; + repo = "clfft"; + rev = "760096b37dcc4f18ccd1aac53f3501a83b83449c"; + sha256 = "sha256-vJo1YfC2AJIbbRj/zTfcOUmi0Oj9v64NfA9MfK8ecoY="; + }; + glad = fetchFromGitHub { + owner = pname; + repo = "glad"; + rev = "ef8c5508e72456b714820c98e034d9a55b970650"; + sha256 = "sha256-u9Vec7XLhE3xW9vzM7uuf+b18wZsh/VMtGbB6nMVlno="; + }; + threads = fetchFromGitHub { + owner = pname; + repo = "threads"; + rev = "4d4a4f0384d1ac2f25b2c4fc1d57b9e25f4d6818"; + sha256 = "sha256-qqsT9woJDtQvzuV323OYXm68pExygYs/+zZNmg2sN34="; + }; + test-data = fetchFromGitHub { + owner = pname; + repo = "arrayfire-data"; + rev = "a5f533d7b864a4d8f0dd7c9aaad5ff06018c4867"; + sha256 = "sha256-AWzhsrDXyZrQN2bd0Ng/XlE8v02x7QWTiFTyaAuRXSw="; + }; + cub = fetchFromGitHub { + owner = "NVIDIA"; + repo = "cub"; + rev = "1.10.0"; + sha256 = "sha256-JyyNaTrtoSGiMP7tVUu9lFL07lyfJzRTVtx8yGy6/BI="; + }; + spdlog = fetchFromGitHub { + owner = "gabime"; + repo = "spdlog"; + rev = "v1.9.2"; + hash = "sha256-GSUdHtvV/97RyDKy8i+ticnSlQCubGGWHg4Oo+YAr8Y="; }; cmakeFlags = [ - "-DAF_BUILD_OPENCL=OFF" + "-DBUILD_TESTING=ON" "-DAF_BUILD_EXAMPLES=OFF" - "-DBUILD_TESTING=OFF" - ] ++ lib.optional cudaSupport "-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs"; - - patches = [ ./no-download.patch ]; + "-DAF_COMPUTE_LIBRARY='FFTW/LAPACK/BLAS'" + "-DAF_TEST_WITH_MTX_FILES=OFF" + "-DAF_WITH_SPDLOG_HEADER_ONLY=ON" + "-DAF_BUILD_FORGE=OFF" + (if withCPU then "-DAF_BUILD_CPU=ON" else "-DAF_BUILD_CPU=OFF") + (if withOpenCL then "-DAF_BUILD_OPENCL=ON" else "-DAF_BUILD_OPENCL=OFF") + (if withCuda then "-DAF_BUILD_CUDA=ON" else "-DAF_BUILD_CUDA=OFF") + ] ++ lib.optionals withCuda [ + "-DCUDA_LIBRARIES_PATH=${cudaPackages.cudatoolkit}/lib" + ]; postPatch = '' - mkdir -p ./build/third_party/clFFT/src - cp -R --no-preserve=mode,ownership ${clfft.src}/ ./build/third_party/clFFT/src/clFFT-ext/ - mkdir -p ./build/third_party/clBLAS/src - cp -R --no-preserve=mode,ownership ${clblas.src}/ ./build/third_party/clBLAS/src/clBLAS-ext/ - mkdir -p ./build/include/CL - cp -R --no-preserve=mode,ownership ${opencl-clhpp}/include/CL/cl2.hpp ./build/include/CL/cl2.hpp + mkdir -p ./extern/af_glad-src + mkdir -p ./extern/af_threads-src + mkdir -p ./extern/af_assets-src + mkdir -p ./extern/af_test_data-src + mkdir -p ./extern/ocl_clfft-src + mkdir -p ./extern/ocl_clblast-src + mkdir -p ./extern/nv_cub-src + mkdir -p ./extern/spdlog-src + cp -R --no-preserve=mode,ownership ${glad}/* ./extern/af_glad-src/ + cp -R --no-preserve=mode,ownership ${threads}/* ./extern/af_threads-src/ + cp -R --no-preserve=mode,ownership ${assets}/* ./extern/af_assets-src/ + cp -R --no-preserve=mode,ownership ${test-data}/* ./extern/af_test_data-src/ + cp -R --no-preserve=mode,ownership ${clfft}/* ./extern/ocl_clfft-src/ + cp -R --no-preserve=mode,ownership ${clblast}/* ./extern/ocl_clblast-src/ + cp -R --no-preserve=mode,ownership ${cub}/* ./extern/nv_cub-src/ + cp -R --no-preserve=mode,ownership ${spdlog}/* ./extern/spdlog-src/ + + substituteInPlace src/api/unified/symbol_manager.cpp \ + --replace '"/opt/arrayfire-3/lib/",' \ + "\"$out/lib/\", \"/opt/arrayfire-3/lib/\"," ''; - preBuild = lib.optionalString cudaSupport '' - export CUDA_PATH="${cudatoolkit}" - ''; + inherit doCheck; + checkPhase = + let + LD_LIBRARY_PATH = builtins.concatStringsSep ":" ( + [ "${forge}/lib" "${freeimage}/lib" ] + ++ lib.optional withCuda "${cudaPackages.cudatoolkit}/lib64" + ++ lib.optional (nvidiaComputeDrivers != null) "${nvidiaComputeDrivers}/lib" + ); + ctestFlags = builtins.concatStringsSep " " ( + [ "--output-on-errors" "-j1" ] + # See https://github.com/arrayfire/arrayfire/issues/3484 + ++ lib.optional withOpenCL "-E '(inverse_dense|cholesky_dense)'" + ); + in + '' + export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} + '' + lib.optionalString (withOpenCL && nvidiaComputeDrivers != null) '' + export OCL_ICD_VENDORS=${nvidiaComputeDrivers}/etc/OpenCL/vendors + '' + '' + AF_TRACE=all AF_PRINT_ERRORS=1 ctest ${ctestFlags} + ''; + + buildInputs = [ + blas + boost.dev + boost.out + fftw + fftwFloat + fmt_9 + forge + freeimage + gtest + lapack + libGL + ocl-icd + opencl-clhpp + span-lite + ] + ++ lib.optionals withCuda [ + cudaPackages.cudatoolkit + cudaPackages.cudnn + ] + ++ lib.optionals withOpenCL [ + mesa + ]; nativeBuildInputs = [ cmake + git pkg-config python3 ]; - strictDeps = true; - - buildInputs = [ - opencl-clhpp - fftw - fftwFloat - blas - lapack - libGLU - libGL - mesa - freeimage - boost.out - boost.dev - ] ++ lib.optionals stdenv.isLinux [ - ocl-icd - ] ++ lib.optionals cudaSupport [ - cudatoolkit - ] ++ lib.optionals buildDocs [ - doxygen - ] ++ lib.optionals stdenv.isDarwin [ - darwin.apple_sdk_11_0.frameworks.Accelerate - ]; - meta = with lib; { description = "A general-purpose library for parallel and massively-parallel computations"; longDescription = '' @@ -96,6 +188,6 @@ stdenv.mkDerivation rec { license = licenses.bsd3; homepage = "https://arrayfire.com/"; platforms = platforms.linux ++ platforms.darwin; - maintainers = with maintainers; [ chessai ]; + maintainers = with maintainers; [ chessai twesterhout ]; }; } diff --git a/pkgs/development/libraries/arrayfire/no-download.patch b/pkgs/development/libraries/arrayfire/no-download.patch deleted file mode 100644 index 2b3ac492a54d..000000000000 --- a/pkgs/development/libraries/arrayfire/no-download.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/CMakeModules/build_clBLAS.cmake b/CMakeModules/build_clBLAS.cmake -index 8de529e8..6361b613 100644 ---- a/CMakeModules/build_clBLAS.cmake -+++ b/CMakeModules/build_clBLAS.cmake -@@ -14,8 +14,7 @@ find_package(OpenCL) - - ExternalProject_Add( - clBLAS-ext -- GIT_REPOSITORY https://github.com/arrayfire/clBLAS.git -- GIT_TAG arrayfire-release -+ DOWNLOAD_COMMAND true - BUILD_BYPRODUCTS ${clBLAS_location} - PREFIX "${prefix}" - INSTALL_DIR "${prefix}" -diff --git a/CMakeModules/build_clFFT.cmake b/CMakeModules/build_clFFT.cmake -index 28be38a3..85e3915e 100644 ---- a/CMakeModules/build_clFFT.cmake -+++ b/CMakeModules/build_clFFT.cmake -@@ -20,8 +20,7 @@ ENDIF() - - ExternalProject_Add( - clFFT-ext -- GIT_REPOSITORY https://github.com/arrayfire/clFFT.git -- GIT_TAG arrayfire-release -+ DOWNLOAD_COMMAND true - PREFIX "${prefix}" - INSTALL_DIR "${prefix}" - UPDATE_COMMAND "" diff --git a/pkgs/development/libraries/forge/default.nix b/pkgs/development/libraries/forge/default.nix index ba85cea73d69..5497aec839ed 100644 --- a/pkgs/development/libraries/forge/default.nix +++ b/pkgs/development/libraries/forge/default.nix @@ -1,38 +1,72 @@ -{ lib, stdenv, fetchFromGitHub, cmake, pkg-config -, arrayfire, expat, fontconfig, freeimage, freetype, boost -, mesa, libGLU, libGL, glfw3, SDL2, cudatoolkit +{ boost +, cmake +, expat +, fetchFromGitHub +, fontconfig +, freeimage +, freetype +, git +, glfw3 +, glm +, lib +, libGLU +, libGL +, mesa +, opencl-clhpp +, pkg-config +, stdenv +, SDL2 }: stdenv.mkDerivation rec { pname = "forge"; - version = "1.0.4"; + version = "1.0.8"; src = fetchFromGitHub { owner = "arrayfire"; - repo = "forge"; - rev = "v${version}"; - sha256 = "00pmky6kccd7pwi8sma79qpmzr2f9pbn6gym3gyqm64yckw6m484"; - fetchSubmodules = true; + repo = pname; + rev = "v1.0.8"; + sha256 = "sha256-lSZAwcqAHiuZkpYcVfwvZCfNmEF3xGN9S/HuZQrGeKU="; }; + glad = fetchFromGitHub { + owner = "arrayfire"; + repo = "glad"; + rev = "b94680aee5b8ce01ae1644c5f2661769366c765a"; + sha256 = "sha256-CrZy76gOGMpy9f1NuMK4tokZ57U//zYeNH5ZYY0SC2U="; + }; + + postPatch = '' + mkdir -p ./extern/fg_glad-src + cp -R --no-preserve=mode,ownership ${glad}/* ./extern/fg_glad-src/ + ln -s ${opencl-clhpp} ./extern/cl2hpp + + substituteInPlace CMakeModules/ForgeConfigureDepsVars.cmake \ + --replace 'set(BUILD_OFFLINE OFF)' 'set(BUILD_OFFLINE ON)' + ''; + + cmakeFlags = [ "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" ]; nativeBuildInputs = [ cmake + git pkg-config ]; buildInputs = [ - expat - fontconfig - freetype boost.out boost.dev + expat + fontconfig freeimage - mesa - libGLU libGL + freetype glfw3 + glm + libGL + libGLU + opencl-clhpp SDL2 - cudatoolkit - arrayfire + ] ++ lib.optionals (!stdenv.isDarwin) [ + mesa ]; meta = with lib; { @@ -44,8 +78,7 @@ stdenv.mkDerivation rec { ''; license = licenses.bsd3; homepage = "https://arrayfire.com/"; - platforms = platforms.linux; - maintainers = with maintainers; [ chessai ]; + platforms = platforms.linux ++ platforms.darwin; + maintainers = with maintainers; [ chessai twesterhout ]; }; - } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 44e8876d1977..4df715fd3029 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20548,7 +20548,9 @@ with pkgs; armadillo = callPackage ../development/libraries/armadillo { }; - arrayfire = darwin.apple_sdk_11_0.callPackage ../development/libraries/arrayfire { }; + arrayfire = darwin.apple_sdk_11_0.callPackage ../development/libraries/arrayfire { + cudaPackages = cudaPackages_12; + }; arrow-cpp = callPackage ../development/libraries/arrow-cpp { }; @@ -21190,9 +21192,7 @@ with pkgs; fflas-ffpack = callPackage ../development/libraries/fflas-ffpack { }; - forge = callPackage ../development/libraries/forge { - cudatoolkit = buildPackages.cudatoolkit_11; - }; + forge = callPackage ../development/libraries/forge { }; linbox = callPackage ../development/libraries/linbox { }; From 1519be1234dc63424f8a41b058c06043bbc233bf Mon Sep 17 00:00:00 2001 From: Tom Westerhout <14264576+twesterhout@users.noreply.github.com> Date: Wed, 23 Aug 2023 13:46:22 +0200 Subject: [PATCH 2/9] arrayfire: use cudaPackages.cuda_cccl instead of manually cloning cub --- pkgs/development/libraries/arrayfire/default.nix | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkgs/development/libraries/arrayfire/default.nix b/pkgs/development/libraries/arrayfire/default.nix index 5c52a43e4878..a52166167b81 100644 --- a/pkgs/development/libraries/arrayfire/default.nix +++ b/pkgs/development/libraries/arrayfire/default.nix @@ -77,12 +77,6 @@ stdenv.mkDerivation rec { rev = "a5f533d7b864a4d8f0dd7c9aaad5ff06018c4867"; sha256 = "sha256-AWzhsrDXyZrQN2bd0Ng/XlE8v02x7QWTiFTyaAuRXSw="; }; - cub = fetchFromGitHub { - owner = "NVIDIA"; - repo = "cub"; - rev = "1.10.0"; - sha256 = "sha256-JyyNaTrtoSGiMP7tVUu9lFL07lyfJzRTVtx8yGy6/BI="; - }; spdlog = fetchFromGitHub { owner = "gabime"; repo = "spdlog"; @@ -119,7 +113,6 @@ stdenv.mkDerivation rec { cp -R --no-preserve=mode,ownership ${test-data}/* ./extern/af_test_data-src/ cp -R --no-preserve=mode,ownership ${clfft}/* ./extern/ocl_clfft-src/ cp -R --no-preserve=mode,ownership ${clblast}/* ./extern/ocl_clblast-src/ - cp -R --no-preserve=mode,ownership ${cub}/* ./extern/nv_cub-src/ cp -R --no-preserve=mode,ownership ${spdlog}/* ./extern/spdlog-src/ substituteInPlace src/api/unified/symbol_manager.cpp \ @@ -168,6 +161,7 @@ stdenv.mkDerivation rec { ++ lib.optionals withCuda [ cudaPackages.cudatoolkit cudaPackages.cudnn + cudaPackages.cuda_cccl ] ++ lib.optionals withOpenCL [ mesa From fab8a8fe38d729fb657dc948588b407fa221d04a Mon Sep 17 00:00:00 2001 From: Tom Westerhout <14264576+twesterhout@users.noreply.github.com> Date: Fri, 25 Aug 2023 13:47:49 +0200 Subject: [PATCH 3/9] arrayfire: rename input some inputs; add comments - Rename withCPU, withOpenCL, withCUDA to cpuSupport, openclSupport, cudaSupport, since cudaSupport is already used in Nixpkgs. - Replace clblast with one from Nixpkgs. - Get rid of the assets attribute. - Add some explanatory note. --- .../libraries/arrayfire/default.nix | 92 ++++++++++++------- .../libraries/arrayfire/no-assets.patch | 41 +++++++++ 2 files changed, 100 insertions(+), 33 deletions(-) create mode 100644 pkgs/development/libraries/arrayfire/no-assets.patch diff --git a/pkgs/development/libraries/arrayfire/default.nix b/pkgs/development/libraries/arrayfire/default.nix index a52166167b81..269b5a4e950a 100644 --- a/pkgs/development/libraries/arrayfire/default.nix +++ b/pkgs/development/libraries/arrayfire/default.nix @@ -1,5 +1,6 @@ { blas , boost +, clblast , cmake , config , cudaPackages @@ -21,10 +22,17 @@ , python3 , span-lite , stdenv + # NOTE: We disable tests by default, because they cannot be run easily on + # non-NixOS systems when either CUDA or OpenCL support is enabled (CUDA and + # OpenCL need access to drivers that are installed outside of Nix on + # non-NixOS systems). , doCheck ? false -, withCPU ? true -, withCuda ? config.cudaSupport -, withOpenCL ? stdenv.isLinux +, cpuSupport ? true +, cudaSupport ? config.cudaSupport + # OpenCL needs mesa which is broken on Darwin +, openclSupport ? !stdenv.isDarwin + # This argument lets one run CUDA & OpenCL tests on non-NixOS systems by + # telling Nix where to find the drivers. , nvidiaComputeDrivers ? null }: @@ -41,18 +49,11 @@ stdenv.mkDerivation rec { hash = "sha256-9r1w0U9MvhduHwBpEWpqkrQPawd94EY3FAqSJghi09I="; }; - assets = fetchFromGitHub { - owner = pname; - repo = "assets"; - rev = "cd08d749611b324012555ad6f23fd76c5465bd6c"; - sha256 = "sha256-v4uhqPz1P1g1430FTmMp22xJS50bb5hZTeEX49GgMWg="; - }; - clblast = fetchFromGitHub { - owner = "cnugteren"; - repo = "CLBlast"; - rev = "4500a03440e2cc54998c0edab366babf5e504d67"; - sha256 = "sha256-I25ylQp6kHZx6Q7Ph5r3abWlQ6yeIHIDdS1eGCyArZ0="; - }; + # We cannot use the clfft from Nixpkgs because ArrayFire maintain a fork + # of clfft where they've modified the CMake build system, and the + # CMakeLists.txt of ArrayFire assumes that we're using that fork. + # + # This can be removed once ArrayFire upstream their changes. clfft = fetchFromGitHub { owner = pname; repo = "clfft"; @@ -77,6 +78,9 @@ stdenv.mkDerivation rec { rev = "a5f533d7b864a4d8f0dd7c9aaad5ff06018c4867"; sha256 = "sha256-AWzhsrDXyZrQN2bd0Ng/XlE8v02x7QWTiFTyaAuRXSw="; }; + # ArrayFire fails to compile with newer versions of spdlog, so we can't use + # the one in Nixpkgs. Once they upgrade, we can switch to using spdlog from + # Nixpkgs. spdlog = fetchFromGitHub { owner = "gabime"; repo = "spdlog"; @@ -86,35 +90,46 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DBUILD_TESTING=ON" + # We do not build examples, because building tests already takes long enough... "-DAF_BUILD_EXAMPLES=OFF" - "-DAF_COMPUTE_LIBRARY='FFTW/LAPACK/BLAS'" - "-DAF_TEST_WITH_MTX_FILES=OFF" - "-DAF_WITH_SPDLOG_HEADER_ONLY=ON" + # No need to build forge, because it's a separate package "-DAF_BUILD_FORGE=OFF" - (if withCPU then "-DAF_BUILD_CPU=ON" else "-DAF_BUILD_CPU=OFF") - (if withOpenCL then "-DAF_BUILD_OPENCL=ON" else "-DAF_BUILD_OPENCL=OFF") - (if withCuda then "-DAF_BUILD_CUDA=ON" else "-DAF_BUILD_CUDA=OFF") - ] ++ lib.optionals withCuda [ + "-DAF_COMPUTE_LIBRARY='FFTW/LAPACK/BLAS'" + # Prevent ArrayFire from trying to download some matrices from the Internet + "-DAF_TEST_WITH_MTX_FILES=OFF" + # Have to use the header-only version, because we're not using the version + # from Nixpkgs. Otherwise, libaf.so won't be able to find the shared + # library, because ArrayFire's CMake files do not run the install step of + # spdlog. + "-DAF_WITH_SPDLOG_HEADER_ONLY=ON" + (if cpuSupport then "-DAF_BUILD_CPU=ON" else "-DAF_BUILD_CPU=OFF") + (if openclSupport then "-DAF_BUILD_OPENCL=ON" else "-DAF_BUILD_OPENCL=OFF") + (if cudaSupport then "-DAF_BUILD_CUDA=ON" else "-DAF_BUILD_CUDA=OFF") + ] ++ lib.optionals cudaSupport [ + # ArrayFire use deprecated FindCUDA in their CMake files, so we help CMake + # locate cudatoolkit. "-DCUDA_LIBRARIES_PATH=${cudaPackages.cudatoolkit}/lib" ]; + # ArrayFire have a repo with assets for the examples. Since we don't build + # the examples anyway, remove the dependency on assets. + patches = [ ./no-assets.patch ]; + postPatch = '' mkdir -p ./extern/af_glad-src mkdir -p ./extern/af_threads-src - mkdir -p ./extern/af_assets-src mkdir -p ./extern/af_test_data-src mkdir -p ./extern/ocl_clfft-src - mkdir -p ./extern/ocl_clblast-src - mkdir -p ./extern/nv_cub-src mkdir -p ./extern/spdlog-src cp -R --no-preserve=mode,ownership ${glad}/* ./extern/af_glad-src/ cp -R --no-preserve=mode,ownership ${threads}/* ./extern/af_threads-src/ - cp -R --no-preserve=mode,ownership ${assets}/* ./extern/af_assets-src/ cp -R --no-preserve=mode,ownership ${test-data}/* ./extern/af_test_data-src/ cp -R --no-preserve=mode,ownership ${clfft}/* ./extern/ocl_clfft-src/ - cp -R --no-preserve=mode,ownership ${clblast}/* ./extern/ocl_clblast-src/ cp -R --no-preserve=mode,ownership ${spdlog}/* ./extern/spdlog-src/ + # libaf.so (the unified backend) tries to load the right shared library at + # runtime, and the search paths are hard-coded... We tweak them to point to + # the installation directory in the Nix store. substituteInPlace src/api/unified/symbol_manager.cpp \ --replace '"/opt/arrayfire-3/lib/",' \ "\"$out/lib/\", \"/opt/arrayfire-3/lib/\"," @@ -125,29 +140,36 @@ stdenv.mkDerivation rec { let LD_LIBRARY_PATH = builtins.concatStringsSep ":" ( [ "${forge}/lib" "${freeimage}/lib" ] - ++ lib.optional withCuda "${cudaPackages.cudatoolkit}/lib64" + ++ lib.optional cudaSupport "${cudaPackages.cudatoolkit}/lib64" + # On non-NixOS systems, help the tests find Nvidia drivers ++ lib.optional (nvidiaComputeDrivers != null) "${nvidiaComputeDrivers}/lib" ); ctestFlags = builtins.concatStringsSep " " ( + # We have to run with "-j1" otherwise various segfaults occur on non-NixOS systems. [ "--output-on-errors" "-j1" ] # See https://github.com/arrayfire/arrayfire/issues/3484 - ++ lib.optional withOpenCL "-E '(inverse_dense|cholesky_dense)'" + ++ lib.optional openclSupport "-E '(inverse_dense|cholesky_dense)'" ); in '' export LD_LIBRARY_PATH=${LD_LIBRARY_PATH} - '' + lib.optionalString (withOpenCL && nvidiaComputeDrivers != null) '' + '' + + # On non-NixOS systems, help the tests find Nvidia drivers + lib.optionalString (openclSupport && nvidiaComputeDrivers != null) '' export OCL_ICD_VENDORS=${nvidiaComputeDrivers}/etc/OpenCL/vendors '' + '' - AF_TRACE=all AF_PRINT_ERRORS=1 ctest ${ctestFlags} + # Note: for debugging, enable AF_TRACE=all + AF_PRINT_ERRORS=1 ctest ${ctestFlags} ''; buildInputs = [ blas boost.dev boost.out + clblast fftw fftwFloat + # We need fmt_9 because ArrayFire fails to compile with newer versions. fmt_9 forge freeimage @@ -158,17 +180,21 @@ stdenv.mkDerivation rec { opencl-clhpp span-lite ] - ++ lib.optionals withCuda [ + ++ lib.optionals cudaSupport [ cudaPackages.cudatoolkit cudaPackages.cudnn cudaPackages.cuda_cccl ] - ++ lib.optionals withOpenCL [ + ++ lib.optionals openclSupport [ mesa ]; nativeBuildInputs = [ cmake + # ArrayFire have their own CMake functions for downloading the + # dependencies, and it uses git. Even though we bypass that system by + # downloading the dependencies beforehand, CMake files still invoke git for + # checking... git pkg-config python3 diff --git a/pkgs/development/libraries/arrayfire/no-assets.patch b/pkgs/development/libraries/arrayfire/no-assets.patch new file mode 100644 index 000000000000..fdcf7083b0dc --- /dev/null +++ b/pkgs/development/libraries/arrayfire/no-assets.patch @@ -0,0 +1,41 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index deafa7a75..b9ca54621 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -320,11 +320,11 @@ if(NOT TARGET nonstd::span-lite) + + endif() + +-af_dep_check_and_populate(${assets_prefix} +- URI https://github.com/arrayfire/assets.git +- REF master +-) +-set(ASSETS_DIR ${${assets_prefix}_SOURCE_DIR}) ++# af_dep_check_and_populate(${assets_prefix} ++# URI https://github.com/arrayfire/assets.git ++# REF master ++# ) ++# set(ASSETS_DIR ${${assets_prefix}_SOURCE_DIR}) + + # when crosscompiling use the bin2cpp file from the native bin directory + if(CMAKE_CROSSCOMPILING) +@@ -477,13 +477,13 @@ install(FILES ${ArrayFire_BINARY_DIR}/include/af/version.h + # source files does not depend on AF_BUILD_EXAMPLES + # when AF_BUILD_EXAMPLES is OFF, the examples source is installed without + # building the example executables +-install(DIRECTORY examples/ #NOTE The slash at the end is important +- DESTINATION ${AF_INSTALL_EXAMPLE_DIR} +- COMPONENT examples) ++# install(DIRECTORY examples/ #NOTE The slash at the end is important ++# DESTINATION ${AF_INSTALL_EXAMPLE_DIR} ++# COMPONENT examples) + +-install(DIRECTORY ${ASSETS_DIR}/examples/ #NOTE The slash at the end is important +- DESTINATION ${AF_INSTALL_EXAMPLE_DIR} +- COMPONENT examples) ++#install(DIRECTORY ${ASSETS_DIR}/examples/ #NOTE The slash at the end is important ++# DESTINATION ${AF_INSTALL_EXAMPLE_DIR} ++# COMPONENT examples) + + install(DIRECTORY "${ArrayFire_SOURCE_DIR}/LICENSES/" + DESTINATION LICENSES From 4dc3266a3b6770ef2859152536209d95a7e879ab Mon Sep 17 00:00:00 2001 From: Tom Westerhout <14264576+twesterhout@users.noreply.github.com> Date: Fri, 25 Aug 2023 21:07:59 +0200 Subject: [PATCH 4/9] arrayfire: use plain callPackage instead of darwin.apple_sdk_11_0.callPackage --- pkgs/development/libraries/forge/default.nix | 4 ++++ pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/forge/default.nix b/pkgs/development/libraries/forge/default.nix index 5497aec839ed..c5fe5dcc9af1 100644 --- a/pkgs/development/libraries/forge/default.nix +++ b/pkgs/development/libraries/forge/default.nix @@ -48,6 +48,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake + # ArrayFire have their own CMake functions for downloading the + # dependencies, and it uses git. Even though we bypass that system by + # downloading the dependencies beforehand, CMake files still invoke git for + # checking... git pkg-config ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4df715fd3029..67d4ffda063e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20548,7 +20548,7 @@ with pkgs; armadillo = callPackage ../development/libraries/armadillo { }; - arrayfire = darwin.apple_sdk_11_0.callPackage ../development/libraries/arrayfire { + arrayfire = callPackage ../development/libraries/arrayfire { cudaPackages = cudaPackages_12; }; From 8fc2536265bd4a887a406fe11793e691f8e76b6e Mon Sep 17 00:00:00 2001 From: Tom Westerhout <14264576+twesterhout@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:28:15 +0200 Subject: [PATCH 5/9] arrayfire: 3.9.0-pre -> 3.9.0 --- pkgs/development/libraries/arrayfire/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/arrayfire/default.nix b/pkgs/development/libraries/arrayfire/default.nix index 269b5a4e950a..e957eed1c6d4 100644 --- a/pkgs/development/libraries/arrayfire/default.nix +++ b/pkgs/development/libraries/arrayfire/default.nix @@ -40,13 +40,13 @@ assert blas.isILP64 == false; stdenv.mkDerivation rec { pname = "arrayfire"; - version = "3.9.0-pre"; + version = "3.9.0"; src = fetchFromGitHub { owner = pname; repo = pname; - rev = "d2a66367d859cdb554f2374e29d39c88d5fff978"; - hash = "sha256-9r1w0U9MvhduHwBpEWpqkrQPawd94EY3FAqSJghi09I="; + rev = "v3.9.0"; + hash = "sha256-80fxdkaeAQ5u0X/UGPaI/900cdkZ/vXNcOn5tkZ+C3Y="; }; # We cannot use the clfft from Nixpkgs because ArrayFire maintain a fork From f32e19928e81678b29d325cce48116a2b6254a6d Mon Sep 17 00:00:00 2001 From: Tom Westerhout <14264576+twesterhout@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:04:24 +0200 Subject: [PATCH 6/9] arrayfire: try compiling with 64-bit openblas --- pkgs/development/libraries/arrayfire/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/arrayfire/default.nix b/pkgs/development/libraries/arrayfire/default.nix index e957eed1c6d4..6aa9171fd59f 100644 --- a/pkgs/development/libraries/arrayfire/default.nix +++ b/pkgs/development/libraries/arrayfire/default.nix @@ -16,6 +16,7 @@ , lib , libGL , mesa +, openblas , ocl-icd , opencl-clhpp , pkg-config @@ -36,7 +37,7 @@ , nvidiaComputeDrivers ? null }: -assert blas.isILP64 == false; +# assert blas.isILP64 == false; stdenv.mkDerivation rec { pname = "arrayfire"; @@ -163,7 +164,7 @@ stdenv.mkDerivation rec { ''; buildInputs = [ - blas + # blas boost.dev boost.out clblast @@ -174,10 +175,11 @@ stdenv.mkDerivation rec { forge freeimage gtest - lapack + # lapack libGL ocl-icd opencl-clhpp + openblas span-lite ] ++ lib.optionals cudaSupport [ From 91a24f08c7f07319fd0f8b7d6eef8506b6e73acb Mon Sep 17 00:00:00 2001 From: Tom Westerhout <14264576+twesterhout@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:10:05 +0200 Subject: [PATCH 7/9] arrayfire: explain why 64-bit BLAS is not supported; explain how to use nvidiaComputDrivers --- .../libraries/arrayfire/default.nix | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/arrayfire/default.nix b/pkgs/development/libraries/arrayfire/default.nix index 6aa9171fd59f..a75ada8c1eb6 100644 --- a/pkgs/development/libraries/arrayfire/default.nix +++ b/pkgs/development/libraries/arrayfire/default.nix @@ -16,7 +16,6 @@ , lib , libGL , mesa -, openblas , ocl-icd , opencl-clhpp , pkg-config @@ -33,11 +32,29 @@ # OpenCL needs mesa which is broken on Darwin , openclSupport ? !stdenv.isDarwin # This argument lets one run CUDA & OpenCL tests on non-NixOS systems by - # telling Nix where to find the drivers. + # telling Nix where to find the drivers. If you know the version of the + # NVidia driver that is installed on your system, you can do: + # + # arrayfire.override { + # nvidiaComputeDrivers = + # callPackage + # (prev.linuxPackages.nvidiaPackages.mkDriver { + # version = cudaVersion; # our driver version + # sha256_64bit = cudaHash; # sha256 of the .run binary + # useGLVND = false; + # useProfiles = false; + # useSettings = false; + # usePersistenced = false; + # ... + # }) + # { libsOnly = true; }; + # } , nvidiaComputeDrivers ? null }: -# assert blas.isILP64 == false; +# ArrayFire compiles with 64-bit BLAS, but some tests segfault or throw +# exceptions, which means that it isn't really supported yet... +assert blas.isILP64 == false; stdenv.mkDerivation rec { pname = "arrayfire"; @@ -164,7 +181,7 @@ stdenv.mkDerivation rec { ''; buildInputs = [ - # blas + blas boost.dev boost.out clblast @@ -175,11 +192,10 @@ stdenv.mkDerivation rec { forge freeimage gtest - # lapack + lapack libGL ocl-icd opencl-clhpp - openblas span-lite ] ++ lib.optionals cudaSupport [ From dbe957d77339b155cd406b0f6dd48aaadc879637 Mon Sep 17 00:00:00 2001 From: Tom Westerhout <14264576+twesterhout@users.noreply.github.com> Date: Sat, 25 Nov 2023 11:43:02 +0100 Subject: [PATCH 8/9] arrayfire: remove darwin from the list of supported platforms --- pkgs/development/libraries/arrayfire/default.nix | 2 +- pkgs/development/libraries/forge/default.nix | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/arrayfire/default.nix b/pkgs/development/libraries/arrayfire/default.nix index a75ada8c1eb6..eeafd10b9faf 100644 --- a/pkgs/development/libraries/arrayfire/default.nix +++ b/pkgs/development/libraries/arrayfire/default.nix @@ -225,7 +225,7 @@ stdenv.mkDerivation rec { ''; license = licenses.bsd3; homepage = "https://arrayfire.com/"; - platforms = platforms.linux ++ platforms.darwin; + platforms = platforms.linux; maintainers = with maintainers; [ chessai twesterhout ]; }; } diff --git a/pkgs/development/libraries/forge/default.nix b/pkgs/development/libraries/forge/default.nix index c5fe5dcc9af1..6e576545c970 100644 --- a/pkgs/development/libraries/forge/default.nix +++ b/pkgs/development/libraries/forge/default.nix @@ -69,7 +69,6 @@ stdenv.mkDerivation rec { libGLU opencl-clhpp SDL2 - ] ++ lib.optionals (!stdenv.isDarwin) [ mesa ]; @@ -82,7 +81,7 @@ stdenv.mkDerivation rec { ''; license = licenses.bsd3; homepage = "https://arrayfire.com/"; - platforms = platforms.linux ++ platforms.darwin; + platforms = platforms.linux; maintainers = with maintainers; [ chessai twesterhout ]; }; } From 12eb3a5731afb0b139a8bd82d3b6d7482a09ec80 Mon Sep 17 00:00:00 2001 From: Tom Westerhout <14264576+twesterhout@users.noreply.github.com> Date: Sun, 26 Nov 2023 11:02:01 +0100 Subject: [PATCH 9/9] arrayfire: avoid FetchContent downloading stuff --- .../libraries/arrayfire/default.nix | 8 +---- .../libraries/arrayfire/no-assets.patch | 30 +++++++----------- .../libraries/arrayfire/no-download.patch | 31 +++++++++++++++++++ pkgs/development/libraries/forge/default.nix | 21 +++++-------- .../libraries/forge/no-download-glad.patch | 31 +++++++++++++++++++ 5 files changed, 83 insertions(+), 38 deletions(-) create mode 100644 pkgs/development/libraries/arrayfire/no-download.patch create mode 100644 pkgs/development/libraries/forge/no-download-glad.patch diff --git a/pkgs/development/libraries/arrayfire/default.nix b/pkgs/development/libraries/arrayfire/default.nix index eeafd10b9faf..5c4336572b8f 100644 --- a/pkgs/development/libraries/arrayfire/default.nix +++ b/pkgs/development/libraries/arrayfire/default.nix @@ -10,7 +10,6 @@ , fmt_9 , forge , freeimage -, git , gtest , lapack , lib @@ -131,7 +130,7 @@ stdenv.mkDerivation rec { # ArrayFire have a repo with assets for the examples. Since we don't build # the examples anyway, remove the dependency on assets. - patches = [ ./no-assets.patch ]; + patches = [ ./no-assets.patch ./no-download.patch ]; postPatch = '' mkdir -p ./extern/af_glad-src @@ -209,11 +208,6 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake - # ArrayFire have their own CMake functions for downloading the - # dependencies, and it uses git. Even though we bypass that system by - # downloading the dependencies beforehand, CMake files still invoke git for - # checking... - git pkg-config python3 ]; diff --git a/pkgs/development/libraries/arrayfire/no-assets.patch b/pkgs/development/libraries/arrayfire/no-assets.patch index fdcf7083b0dc..b8820f8aa55b 100644 --- a/pkgs/development/libraries/arrayfire/no-assets.patch +++ b/pkgs/development/libraries/arrayfire/no-assets.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index deafa7a75..b9ca54621 100644 +index 12d6e557c..cc004555d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -320,11 +320,11 @@ if(NOT TARGET nonstd::span-lite) +@@ -321,11 +321,6 @@ if(NOT TARGET nonstd::span-lite) endif() @@ -11,31 +11,25 @@ index deafa7a75..b9ca54621 100644 - REF master -) -set(ASSETS_DIR ${${assets_prefix}_SOURCE_DIR}) -+# af_dep_check_and_populate(${assets_prefix} -+# URI https://github.com/arrayfire/assets.git -+# REF master -+# ) -+# set(ASSETS_DIR ${${assets_prefix}_SOURCE_DIR}) # when crosscompiling use the bin2cpp file from the native bin directory if(CMAKE_CROSSCOMPILING) -@@ -477,13 +477,13 @@ install(FILES ${ArrayFire_BINARY_DIR}/include/af/version.h - # source files does not depend on AF_BUILD_EXAMPLES - # when AF_BUILD_EXAMPLES is OFF, the examples source is installed without - # building the example executables +@@ -473,18 +468,6 @@ install(FILES ${ArrayFire_BINARY_DIR}/include/af/version.h + DESTINATION "${AF_INSTALL_INC_DIR}/af/" + COMPONENT headers) + +-# install the examples irrespective of the AF_BUILD_EXAMPLES value +-# only the examples source files are installed, so the installation of these +-# source files does not depend on AF_BUILD_EXAMPLES +-# when AF_BUILD_EXAMPLES is OFF, the examples source is installed without +-# building the example executables -install(DIRECTORY examples/ #NOTE The slash at the end is important - DESTINATION ${AF_INSTALL_EXAMPLE_DIR} - COMPONENT examples) -+# install(DIRECTORY examples/ #NOTE The slash at the end is important -+# DESTINATION ${AF_INSTALL_EXAMPLE_DIR} -+# COMPONENT examples) - +- -install(DIRECTORY ${ASSETS_DIR}/examples/ #NOTE The slash at the end is important - DESTINATION ${AF_INSTALL_EXAMPLE_DIR} - COMPONENT examples) -+#install(DIRECTORY ${ASSETS_DIR}/examples/ #NOTE The slash at the end is important -+# DESTINATION ${AF_INSTALL_EXAMPLE_DIR} -+# COMPONENT examples) install(DIRECTORY "${ArrayFire_SOURCE_DIR}/LICENSES/" DESTINATION LICENSES diff --git a/pkgs/development/libraries/arrayfire/no-download.patch b/pkgs/development/libraries/arrayfire/no-download.patch new file mode 100644 index 000000000000..f7903e74112d --- /dev/null +++ b/pkgs/development/libraries/arrayfire/no-download.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeModules/AFconfigure_deps_vars.cmake b/CMakeModules/AFconfigure_deps_vars.cmake +index aac332f5a..e9e711159 100644 +--- a/CMakeModules/AFconfigure_deps_vars.cmake ++++ b/CMakeModules/AFconfigure_deps_vars.cmake +@@ -94,7 +94,7 @@ macro(af_dep_check_and_populate dep_prefix) + URL ${adcp_args_URI} + URL_HASH ${adcp_args_REF} + DOWNLOAD_COMMAND \"\" +- UPDATE_DISCONNECTED ON ++ UPDATE_COMMAND \"\" + SOURCE_DIR "${ArrayFire_SOURCE_DIR}/extern/${dep_prefix}-src" + BINARY_DIR "${ArrayFire_BINARY_DIR}/extern/${dep_prefix}-build" + SUBBUILD_DIR "${ArrayFire_BINARY_DIR}/extern/${dep_prefix}-subbuild" +@@ -104,7 +104,7 @@ macro(af_dep_check_and_populate dep_prefix) + QUIET + URL ${adcp_args_URI} + DOWNLOAD_COMMAND \"\" +- UPDATE_DISCONNECTED ON ++ UPDATE_COMMAND \"\" + SOURCE_DIR "${ArrayFire_SOURCE_DIR}/extern/${dep_prefix}-src" + BINARY_DIR "${ArrayFire_BINARY_DIR}/extern/${dep_prefix}-build" + SUBBUILD_DIR "${ArrayFire_BINARY_DIR}/extern/${dep_prefix}-subbuild" +@@ -116,7 +116,7 @@ macro(af_dep_check_and_populate dep_prefix) + GIT_REPOSITORY ${adcp_args_URI} + GIT_TAG ${adcp_args_REF} + DOWNLOAD_COMMAND \"\" +- UPDATE_DISCONNECTED ON ++ UPDATE_COMMAND \"\" + SOURCE_DIR "${ArrayFire_SOURCE_DIR}/extern/${dep_prefix}-src" + BINARY_DIR "${ArrayFire_BINARY_DIR}/extern/${dep_prefix}-build" + SUBBUILD_DIR "${ArrayFire_BINARY_DIR}/extern/${dep_prefix}-subbuild" diff --git a/pkgs/development/libraries/forge/default.nix b/pkgs/development/libraries/forge/default.nix index 6e576545c970..d9996ada5067 100644 --- a/pkgs/development/libraries/forge/default.nix +++ b/pkgs/development/libraries/forge/default.nix @@ -5,7 +5,6 @@ , fontconfig , freeimage , freetype -, git , glfw3 , glm , lib @@ -32,27 +31,23 @@ stdenv.mkDerivation rec { owner = "arrayfire"; repo = "glad"; rev = "b94680aee5b8ce01ae1644c5f2661769366c765a"; - sha256 = "sha256-CrZy76gOGMpy9f1NuMK4tokZ57U//zYeNH5ZYY0SC2U="; + hash = "sha256-CrZy76gOGMpy9f1NuMK4tokZ57U//zYeNH5ZYY0SC2U="; }; - postPatch = '' - mkdir -p ./extern/fg_glad-src - cp -R --no-preserve=mode,ownership ${glad}/* ./extern/fg_glad-src/ - ln -s ${opencl-clhpp} ./extern/cl2hpp + # This patch ensures that Forge does not try to fetch glad from GitHub and + # uses our sources that we've checked out via Nix. + patches = [ ./no-download-glad.patch ]; - substituteInPlace CMakeModules/ForgeConfigureDepsVars.cmake \ - --replace 'set(BUILD_OFFLINE OFF)' 'set(BUILD_OFFLINE ON)' + postPatch = '' + mkdir -p ./extern + cp -R --no-preserve=mode,ownership ${glad} ./extern/fg_glad-src + ln -s ${opencl-clhpp} ./extern/cl2hpp ''; cmakeFlags = [ "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" ]; nativeBuildInputs = [ cmake - # ArrayFire have their own CMake functions for downloading the - # dependencies, and it uses git. Even though we bypass that system by - # downloading the dependencies beforehand, CMake files still invoke git for - # checking... - git pkg-config ]; diff --git a/pkgs/development/libraries/forge/no-download-glad.patch b/pkgs/development/libraries/forge/no-download-glad.patch new file mode 100644 index 000000000000..0957be82a3b7 --- /dev/null +++ b/pkgs/development/libraries/forge/no-download-glad.patch @@ -0,0 +1,31 @@ +diff --git a/CMakeModules/ForgeConfigureDepsVars.cmake b/CMakeModules/ForgeConfigureDepsVars.cmake +index ee5c2fc..2f75181 100644 +--- a/CMakeModules/ForgeConfigureDepsVars.cmake ++++ b/CMakeModules/ForgeConfigureDepsVars.cmake +@@ -84,7 +84,7 @@ macro(fg_dep_check_and_populate dep_prefix) + URL ${fdcp_args_URI} + URL_HASH ${fdcp_args_REF} + DOWNLOAD_COMMAND \"\" +- UPDATE_DISCONNECTED ON ++ UPDATE_COMMAND \"\" + SOURCE_DIR "${Forge_SOURCE_DIR}/extern/${dep_prefix}-src" + BINARY_DIR "${Forge_BINARY_DIR}/extern/${dep_prefix}-build" + SUBBUILD_DIR "${Forge_BINARY_DIR}/extern/${dep_prefix}-subbuild" +@@ -94,7 +94,7 @@ macro(fg_dep_check_and_populate dep_prefix) + QUIET + URL ${fdcp_args_URI} + DOWNLOAD_COMMAND \"\" +- UPDATE_DISCONNECTED ON ++ UPDATE_COMMAND \"\" + SOURCE_DIR "${Forge_SOURCE_DIR}/extern/${dep_prefix}-src" + BINARY_DIR "${Forge_BINARY_DIR}/extern/${dep_prefix}-build" + SUBBUILD_DIR "${Forge_BINARY_DIR}/extern/${dep_prefix}-subbuild" +@@ -106,7 +106,7 @@ macro(fg_dep_check_and_populate dep_prefix) + GIT_REPOSITORY ${fdcp_args_URI} + GIT_TAG ${fdcp_args_REF} + DOWNLOAD_COMMAND \"\" +- UPDATE_DISCONNECTED ON ++ UPDATE_COMMAND \"\" + SOURCE_DIR "${Forge_SOURCE_DIR}/extern/${dep_prefix}-src" + BINARY_DIR "${Forge_BINARY_DIR}/extern/${dep_prefix}-build" + SUBBUILD_DIR "${Forge_BINARY_DIR}/extern/${dep_prefix}-subbuild"