Merge pull request #1256 from ACSimon33/intel_compilers_on_windows

Fixes for Intel compilers on Windows
This commit is contained in:
langou
2026-04-22 19:33:37 -06:00
committed by GitHub
5 changed files with 17 additions and 8 deletions
+10 -3
View File
@@ -13,9 +13,16 @@ endif()
set(LAPACK_INSTALL_EXPORT_NAME ${CBLASLIB}-targets)
include(CheckCSourceCompiles)
check_c_source_compiles("int __attribute__((weak)) main() {};"
HAS_ATTRIBUTE_WEAK_SUPPORT)
if(WIN32)
# MSVC does not support __attribute__((weak)) and the Intel compiler supports
# it but produces linker errors when used in CBLAS, so we disable it for all
# Windows builds.
set(HAS_ATTRIBUTE_WEAK_SUPPORT FALSE)
else()
include(CheckCSourceCompiles)
check_c_source_compiles("int __attribute__((weak)) main() {};"
HAS_ATTRIBUTE_WEAK_SUPPORT)
endif()
include_directories(include ${LAPACK_BINARY_DIR}/include)
add_subdirectory(src)
+4 -2
View File
@@ -47,7 +47,8 @@
#else
#include <complex>
#endif
#if _MSC_VER
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__INTEL_LLVM_COMPILER)
#define lapack_complex_float _Fcomplex
#else
#define lapack_complex_float float _Complex
@@ -69,7 +70,8 @@
#else
#include <complex>
#endif
#if _MSC_VER
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__INTEL_LLVM_COMPILER)
#define lapack_complex_double _Dcomplex
#else
#define lapack_complex_double double _Complex
+1 -1
View File
@@ -99,7 +99,7 @@ typedef struct { double real, imag; } _lapack_complex_double;
#define lapack_complex_double_real(z) ((z).real())
#define lapack_complex_double_imag(z) ((z).imag())
#elif _MSC_VER
#elif defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__INTEL_LLVM_COMPILER)
#include <complex.h>
#define lapack_complex_float _Fcomplex
+1 -1
View File
@@ -43,7 +43,7 @@ lapack_complex_double lapack_make_complex_double( double re, double im ) {
z = re + im * I;
#elif defined(LAPACK_COMPLEX_CPP)
z = std::complex<double>(re,im);
#elif _MSC_VER
#elif defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__INTEL_LLVM_COMPILER)
z = _Cbuild(re, im);
#else /* C99 is default */
z = re + im*I;
+1 -1
View File
@@ -43,7 +43,7 @@ lapack_complex_float lapack_make_complex_float( float re, float im ) {
z = re + im * I;
#elif defined(LAPACK_COMPLEX_CPP)
z = std::complex<float>(re,im);
#elif _MSC_VER
#elif defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__INTEL_LLVM_COMPILER)
z = _FCbuild(re, im);
#else /* C99 is default */
z = re + im*I;