casacore,casacpp: fix build on darwin (#522111)

This commit is contained in:
Christian Kögler
2026-05-21 19:21:26 +00:00
committed by GitHub
4 changed files with 106 additions and 3 deletions
+4
View File
@@ -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 = {
@@ -0,0 +1,58 @@
From 7d946685a48be3a0c854793950b7d0dd95125041 Mon Sep 17 00:00:00 2001
From: Kiran Shila <me@kiranshila.com>
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<casacore::Bool&> (use_data_weights) = other.use_data_weights;
const_cast<casacore::Bool&> (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
@@ -0,0 +1,28 @@
From 71a658844e69e3993ab2fe712e0063a67daa00e0 Mon Sep 17 00:00:00 2001
From: Moraxyc <i@qaq.li>
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
+16 -3
View File
@@ -17,11 +17,13 @@
protobuf,
gsl,
libxml2,
libxslt,
fftw,
fftwFloat,
sqlite,
blas,
lapack,
libxslt,
openssl,
sqlite,
mpi,
mpiSupport ? false,
}:
@@ -58,6 +60,15 @@ 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<vi::VisibilityIterator2>'
# error: object of type 'std::unique_ptr<vi::VisibilityIterator2>' 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 = ''
@@ -83,9 +94,11 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optional mpiSupport mpi;
buildInputs = [
blas
libxslt
sqlite
openssl
sqlite
lapack
];
propagatedBuildInputs = [