casacpp: fix darwin build by explicitly linking blas/lapack

This commit is contained in:
Moraxyc
2026-05-20 15:22:08 +08:00
parent 6621c6e9e0
commit ebf1b68b2e
2 changed files with 39 additions and 3 deletions
@@ -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
+11 -3
View File
@@ -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<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 = ''
@@ -88,9 +94,11 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optional mpiSupport mpi;
buildInputs = [
blas
libxslt
sqlite
openssl
sqlite
lapack
];
propagatedBuildInputs = [