Description: Fall back to a default Fortran name-mangling define when
 blaspp_defines is empty.
 BLAS++ 2025.05.28 exports an empty blaspp_defines from its installed
 blasppConfig.cmake.  LAPACK++'s LAPACK probes compile config/*.cc which
 include config/config.h, and that header #errors unless one of
 FORTRAN_ADD_/FORTRAN_LOWER/FORTRAN_UPPER is defined.  With an empty
 blaspp_defines every probe fails to compile ("routine not found") and
 LAPACK is reported as not found.  Fall back to -DBLAS_FORTRAN_ADD_
 (gfortran trailing-underscore convention, matching Debian/OpenKylin's
 reference liblapack) so the probes can link and run.
Author: tangxiaofeng <tangxiaofeng@kylinos.cn>
Origin: other
Forwarded: not-needed
Last-Update: 2026-09-04

--- lapackpp-2024.10.26.orig/CMakeLists.txt
+++ lapackpp-2024.10.26/CMakeLists.txt
@@ -721,6 +721,16 @@ endif()
 
 # Search for LAPACK library.
 message( "" )
+
+# Some installed BLAS++ configurations (e.g. 2025.05.28) export an empty
+# blaspp_defines, which would make every probe below fail to compile because
+# config/config.h requires a Fortran name-mangling define.  Fall back to the
+# reference-implementation convention (gfortran, trailing underscore) used by
+# Debian/OpenKylin's liblapack, so that the probes can link and run.
+if (NOT blaspp_defines)
+    set( blaspp_defines "-DBLAS_FORTRAN_ADD_" )
+endif()
+
 if (BLA_VENDOR OR use_cmake_find_lapack)
     message( DEBUG "Using CMake's FindLAPACK" )
     find_package( LAPACK )

