From ec39d13c2ba9035c30f3b1d240e6ab293ee54295 Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Wed, 20 May 2026 08:42:41 +0800 Subject: [PATCH 1/3] casacore: fix build on darwin --- pkgs/by-name/ca/casacore/package.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/by-name/ca/casacore/package.nix b/pkgs/by-name/ca/casacore/package.nix index 5a026b41ba10..13323464fef4 100644 --- a/pkgs/by-name/ca/casacore/package.nix +++ b/pkgs/by-name/ca/casacore/package.nix @@ -101,6 +101,10 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "PORTABLE" true) (lib.cmakeBool "USE_PCH" false) (lib.cmakeBool "BUILD_FFTPACK_DEPRECATED" true) # Needed for casacpp + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # Upstream probes this flag, but it fails on darwin, so pass it explicitly + (lib.cmakeFeature "CMAKE_Fortran_FLAGS" "-fallow-argument-mismatch") ]; meta = { From 6621c6e9e066f6bd7b45ab8cb443552321d5e730 Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Wed, 20 May 2026 15:18:22 +0800 Subject: [PATCH 2/3] casacpp: fix build with clang --- .../Fix-Vi2DataProvider-move-semantics.patch | 58 +++++++++++++++++++ pkgs/by-name/ca/casacpp/package.nix | 5 ++ 2 files changed, 63 insertions(+) create mode 100644 pkgs/by-name/ca/casacpp/Fix-Vi2DataProvider-move-semantics.patch diff --git a/pkgs/by-name/ca/casacpp/Fix-Vi2DataProvider-move-semantics.patch b/pkgs/by-name/ca/casacpp/Fix-Vi2DataProvider-move-semantics.patch new file mode 100644 index 000000000000..e291e966987f --- /dev/null +++ b/pkgs/by-name/ca/casacpp/Fix-Vi2DataProvider-move-semantics.patch @@ -0,0 +1,58 @@ +From 7d946685a48be3a0c854793950b7d0dd95125041 Mon Sep 17 00:00:00 2001 +From: Kiran Shila +Date: Wed, 20 May 2026 15:11:25 +0800 +Subject: Fix Vi2DataProvider move semantics + +--- + msvis/MSVis/statistics/Vi2DataProvider.h | 18 ++++++++---------- + 1 file changed, 8 insertions(+), 10 deletions(-) + +diff --git a/msvis/MSVis/statistics/Vi2DataProvider.h b/msvis/MSVis/statistics/Vi2DataProvider.h +index 4570d13..cb76a2e 100644 +--- a/msvis/MSVis/statistics/Vi2DataProvider.h ++++ b/msvis/MSVis/statistics/Vi2DataProvider.h +@@ -121,7 +121,7 @@ public: + } + + Vi2DataProvider(Vi2DataProvider&& other) +- : vi2(other.vi2) ++ : vi2(std::move(other.vi2)) + , mergedColumns(other.mergedColumns) + , datasetIndex(other.datasetIndex) + , datasetChunkOrigin(other.datasetChunkOrigin) +@@ -130,14 +130,13 @@ public: + , component(other.component) + , use_data_weights(other.use_data_weights) + , omit_flagged_data(other.omit_flagged_data) +- , data_iterator(other.data_iterator) +- , weights_iterator(other.weights_iterator) +- , mask_iterator(other.mask_iterator) { +- other.vi2 = nullptr; ++ , data_iterator(std::move(other.data_iterator)) ++ , weights_iterator(std::move(other.weights_iterator)) ++ , mask_iterator(std::move(other.mask_iterator)) { + } + + Vi2DataProvider& operator=(Vi2DataProvider&& other) { +- vi2 = other.vi2; ++ vi2 = std::move(other.vi2); + mergedColumns = other.mergedColumns; + datasetIndex = other.datasetIndex; + datasetChunkOrigin = other.datasetChunkOrigin; +@@ -146,10 +145,9 @@ public: + component = other.component; + const_cast (use_data_weights) = other.use_data_weights; + const_cast (omit_flagged_data) = other.omit_flagged_data; +- data_iterator = other.data_iterator; +- weights_iterator = other.weights_iterator; +- mask_iterator = other.mask_iterator; +- other.vi2 = nullptr; ++ data_iterator = std::move(other.data_iterator); ++ weights_iterator = std::move(other.weights_iterator); ++ mask_iterator = std::move(other.mask_iterator); + return *this; + } + +-- +2.53.0 + diff --git a/pkgs/by-name/ca/casacpp/package.nix b/pkgs/by-name/ca/casacpp/package.nix index f495ec40a467..6a701b79e35b 100644 --- a/pkgs/by-name/ca/casacpp/package.nix +++ b/pkgs/by-name/ca/casacpp/package.nix @@ -58,6 +58,11 @@ stdenv.mkDerivation (finalAttrs: { # leaving it empty, and remove hardcoded absolute cmake build paths from # Cflags (which would embed /nix/store paths from the build environment). ./casacpp-pkgconfig.patch + + # TODO: remove this once the upstream resolves this issue + # error: call to implicitly-deleted copy constructor of 'std::unique_ptr' + # error: object of type 'std::unique_ptr' cannot be assigned because its copy assignment operator is implicitly deleted + ./Fix-Vi2DataProvider-move-semantics.patch ]; postPatch = '' From ebf1b68b2e3a142ff641e07b38a0085b8903d76b Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Wed, 20 May 2026 15:22:08 +0800 Subject: [PATCH 3/3] casacpp: fix darwin build by explicitly linking blas/lapack --- ...is-target-with-LAPACK-BLAS-libraries.patch | 28 +++++++++++++++++++ pkgs/by-name/ca/casacpp/package.nix | 14 ++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 pkgs/by-name/ca/casacpp/Link-synthesis-target-with-LAPACK-BLAS-libraries.patch diff --git a/pkgs/by-name/ca/casacpp/Link-synthesis-target-with-LAPACK-BLAS-libraries.patch b/pkgs/by-name/ca/casacpp/Link-synthesis-target-with-LAPACK-BLAS-libraries.patch new file mode 100644 index 000000000000..97e17f5bfc02 --- /dev/null +++ b/pkgs/by-name/ca/casacpp/Link-synthesis-target-with-LAPACK-BLAS-libraries.patch @@ -0,0 +1,28 @@ +From 71a658844e69e3993ab2fe712e0063a67daa00e0 Mon Sep 17 00:00:00 2001 +From: Moraxyc +Date: Wed, 20 May 2026 15:13:10 +0800 +Subject: Link synthesis target with LAPACK/BLAS libraries + +--- + synthesis/CMakeLists.txt | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/synthesis/CMakeLists.txt b/synthesis/CMakeLists.txt +index e2250f0..59b55dc 100644 +--- a/synthesis/CMakeLists.txt ++++ b/synthesis/CMakeLists.txt +@@ -42,6 +42,11 @@ target_link_libraries(casacpp_synthesis PUBLIC PkgConfig::CASACORE) + # Libsakura dependency + target_link_libraries(casacpp_synthesis PUBLIC PkgConfig::SAKURA) + ++# LAPACK / BLAS dependency ++find_package(BLAS REQUIRED) ++find_package(LAPACK REQUIRED) ++target_link_libraries(casacpp_synthesis PRIVATE LAPACK::LAPACK) ++ + # Optional HPG dependency + if(DEFINED hpg_FOUND AND ${hpg_FOUND}) + target_link_libraries(casacpp_synthesis PUBLIC hpg::hpg) +-- +2.53.0 + diff --git a/pkgs/by-name/ca/casacpp/package.nix b/pkgs/by-name/ca/casacpp/package.nix index 6a701b79e35b..26495a1573e6 100644 --- a/pkgs/by-name/ca/casacpp/package.nix +++ b/pkgs/by-name/ca/casacpp/package.nix @@ -17,11 +17,13 @@ protobuf, gsl, libxml2, - libxslt, fftw, fftwFloat, - sqlite, + blas, + lapack, + libxslt, openssl, + sqlite, mpi, mpiSupport ? false, }: @@ -63,6 +65,10 @@ stdenv.mkDerivation (finalAttrs: { # error: call to implicitly-deleted copy constructor of 'std::unique_ptr' # error: object of type 'std::unique_ptr' cannot be assigned because its copy assignment operator is implicitly deleted ./Fix-Vi2DataProvider-move-semantics.patch + + # fix missing LAPACK symbols + # ld: symbol(s) not found, dgetrf_ dgetri_ dposv_ dpotri_ + ./Link-synthesis-target-with-LAPACK-BLAS-libraries.patch ]; postPatch = '' @@ -88,9 +94,11 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional mpiSupport mpi; buildInputs = [ + blas libxslt - sqlite openssl + sqlite + lapack ]; propagatedBuildInputs = [