From 8cd37fe2fe6d40047dddd627b65d20582e104ec8 Mon Sep 17 00:00:00 2001
From: henedler <henrik.edler@hs.uni-hamburg.de>
Date: Thu, 24 Mar 2022 11:58:25 +0100
Subject: [PATCH] wsclean master facet tests

---
 build_lofar.sh            |  3 ++-
 build_lofar.sh.config.rrz |  4 +++-
 wsclean-buildfix.patch    | 11 -----------
 3 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/build_lofar.sh b/build_lofar.sh
index fdef9fe..e9dd8ef 100755
--- a/build_lofar.sh
+++ b/build_lofar.sh
@@ -513,7 +513,7 @@ if [ ! -e $prefix/.done ]; then
         if [ "$dp3_version" != "latest" ]; then
             ( cd presrc && git checkout tags/v$dp3_version )
         fi
-            echo "Patching build (for BLAS, Boost, Python, usually) ..." && 
+            echo "Patching build (for BLAS, Boost, Python, usually) ..." &&
         (cd presrc && patch -Np1 < "$scriptdir/DP3-buildfix.patch" ) &&
         mv presrc src
     fi &&
@@ -577,6 +577,7 @@ if [ ! -e $prefix/.done ]; then
         -DCASACORE_ROOT_DIR=$lofar_prefix/casacore \
         -DIDGAPI_INCLUDE_DIRS=$lofar_prefix/idg/include \
         -DIDGAPI_LIBRARIES=$lofar_prefix/idg/lib/libidg-api.so \
+        -DBLAS_openblas_LIBRARY:FILEPATH=/sw/env/cuda-11.1.1_gcc-8.4.0_openmpi-4.0.5/pkgsrc/2020Q3/lib/libopenblas_pthread.so \
         -DEVERYBEAM_INCLUDE_DIR=$lofar_prefix/EveryBeam/include \
         -DEVERYBEAM_LIB=$lofar_prefix/EveryBeam/lib/libeverybeam.so \
         ../src &&
diff --git a/build_lofar.sh.config.rrz b/build_lofar.sh.config.rrz
index 5c7668f..327b8f8 100644
--- a/build_lofar.sh.config.rrz
+++ b/build_lofar.sh.config.rrz
@@ -14,7 +14,7 @@ casacore_version=3.3.0
 dysco_version=1.2.0
 pybdsf_version=latest # weird C++ template error with 1.8.12
 pycasa_version=3.1.1
-wsclean_version=3.0.1 #2.10.1
+wsclean_version=latest
 dp3_version=5.2
 
 # This gives us CUDA, gcc, Open MPI and dependencies
@@ -24,6 +24,8 @@ dp3_version=5.2
 module use /sw/TEST
 module switch env env/2020Q3-cuda-gcc-openmpi
 module load pythonversion/3
+export RRZ_BLAS_LIBS="-lopenblas_pthread" #$RRZ_BLAS_LIBS       # from the env/ module
+export OPENBLAS_NUM_THREADS=1
 # You could experiment with idg using MKL, but it is recommened
 # to try a consistent environment where everyone agrees on using
 # MKL for BLAS/LAPACK, too.
diff --git a/wsclean-buildfix.patch b/wsclean-buildfix.patch
index c77b695..672695c 100644
--- a/wsclean-buildfix.patch
+++ b/wsclean-buildfix.patch
@@ -27,14 +27,3 @@ index 040c3bf..5c2b01b 100644
  
  # Include pybind11
  add_subdirectory("${CMAKE_SOURCE_DIR}/external/pybind11")
-@@ -373,8 +386,8 @@ set(ALL_LIBRARIES
-     schaapcommon)
- 
- # Perform the BLAS check from aocommon
--include("${CMAKE_CURRENT_LIST_DIR}/external/aocommon/CMake/CheckBLAS.cmake")
--check_blas(LIBRARIES ${ALL_LIBRARIES})
-+#include("${CMAKE_CURRENT_LIST_DIR}/external/aocommon/CMake/CheckBLAS.cmake")
-+#check_blas(LIBRARIES ${ALL_LIBRARIES})
- 
- add_library(wsclean-lib STATIC ${WSCLEANFILES})
- target_link_libraries(wsclean-lib PRIVATE pybind11::embed ${ALL_LIBRARIES})
-- 
GitLab