diff --git a/Makefile.system b/Makefile.system index 67830f2a3..8a7099808 100644 --- a/Makefile.system +++ b/Makefile.system @@ -355,7 +355,7 @@ OBJCONV = $(CROSS_SUFFIX)objconv # When fortran support was either not detected or actively deselected, only build BLAS. ifeq ($(NOFORTRAN), 1) C_LAPACK = 1 -override FEXTRALIB = +override FEXTRALIB = ifeq ($(C_COMPILER), GCC) CCOMMON_OPT += -Wno-error=incompatible-pointer-types endif diff --git a/cmake/system.cmake b/cmake/system.cmake index 7166cc07f..6fec04bfc 100644 --- a/cmake/system.cmake +++ b/cmake/system.cmake @@ -160,6 +160,12 @@ else() endif () endif () +if (C_LAPACK) + if (${CMAKE_C_COMPILER_ID} STREQUAL "GNU") + set(CCOMMON_OPT "${CCOMMON_OPT} -Wno-error=incompatible-pointer-types") + endif () +endif () + include("${PROJECT_SOURCE_DIR}/cmake/prebuild.cmake") if (DEFINED TARGET) if (${TARGET} STREQUAL COOPERLAKE AND NOT NO_AVX512) diff --git a/cpuid_x86.c b/cpuid_x86.c index 6cf4d6503..40735c563 100644 --- a/cpuid_x86.c +++ b/cpuid_x86.c @@ -1535,6 +1535,7 @@ int get_cpuname(void){ return CPUTYPE_SANDYBRIDGE; else return CPUTYPE_NEHALEM; + case 0: // Meteor Lake case 7: // Rocket Lake if(support_avx512()) return CPUTYPE_SKYLAKEX; @@ -1560,6 +1561,19 @@ int get_cpuname(void){ return CPUTYPE_NEHALEM; } break; + case 12: //family 6 exmodel 12 + switch (model) { + case 15: + if(support_avx512()) + return CPUTYPE_SAPPHIRERAPIDS; + if(support_avx2()) + return CPUTYPE_HASWELL; + if(support_avx()) + return CPUTYPE_SANDYBRIDGE; + else + return CPUTYPE_NEHALEM; + } + break; } break; case 0x7: diff --git a/ctest/Makefile b/ctest/Makefile index 6c7cc1ed5..46885f3bb 100644 --- a/ctest/Makefile +++ b/ctest/Makefile @@ -25,6 +25,9 @@ endif override CFLAGS += -DADD$(BU) -DCBLAS ifeq ($(F_COMPILER),GFORTRAN) +ifneq (, $(filter $(CORE),LOONGSON3R3 LOONGSON3R4)) + override FFLAGS = $(filter_out(-O2 -O3,$(FFLAGS)) -O0 +endif override FFLAGS += -fno-tree-vectorize endif override TARGET_ARCH= diff --git a/docs/user_manual.md b/docs/user_manual.md index b5cd632f1..4d5fa9eaa 100644 --- a/docs/user_manual.md +++ b/docs/user_manual.md @@ -49,7 +49,7 @@ For more information, please read [Installation Guide](install.md). gcc -o test test.c -I/your_path/OpenBLAS/include/ -L/your_path/OpenBLAS/lib -Wl,-rpath,/your_path/OpenBLAS/lib -lopenblas ``` -The `-Wl,-rpath,/your_path/OpenBLAS/lib` option to linker can be omitted if you ran `ldconfig` to update linker cache, put `/your_path/OpenBLAS/lib` in `/etc/ld.so.conf` or a file in `/etc/ld.so.conf.d`, or installed OpenBLAS in a location part of `ld.so` default search path. Otherwise, linking at runtime will fail. +The `-Wl,-rpath,/your_path/OpenBLAS/lib` option to linker can be omitted if you ran `ldconfig` to update linker cache, put `/your_path/OpenBLAS/lib` in `/etc/ld.so.conf` or a file in `/etc/ld.so.conf.d`, or installed OpenBLAS in a location that is part of the `ld.so` default search path (usually /lib,/usr/lib and /usr/local/lib). Alternatively, you can set the environment variable LD_LIBRARY_PATH to point to the folder that contains libopenblas.so. Otherwise, linking at runtime will fail with a message like `cannot open shared object file: no such file or directory` If the library is multithreaded, please add `-lpthread`. If the library contains LAPACK functions, please add `-lgfortran` or other Fortran libs, although if you only make calls to LAPACKE routines, i.e. your code has `#include "lapacke.h"` and makes calls to methods like `LAPACKE_dgeqrf`, `-lgfortran` is not needed. @@ -159,7 +159,7 @@ int main(int argc, char* argv[]) ``` ``` -gcc -o time_dgemm time_dgemm.c /your/path/libopenblas.a +gcc -o time_dgemm time_dgemm.c /your/path/libopenblas.a -lpthread ./time_dgemm ``` diff --git a/test/Makefile b/test/Makefile index 6a50b6c98..85bdca103 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,6 +1,9 @@ TOPDIR = .. include ../Makefile.system ifeq ($(F_COMPILER),GFORTRAN) +ifneq (, $(filter $(CORE),LOONGSON3R3 LOONGSON3R4)) + override FFLAGS = $(filter_out(-O2 -O3,$(FFLAGS)) -O0 +endif override FFLAGS += -fno-tree-vectorize endif diff --git a/utest/test_extensions/utest_main2.c b/utest/test_extensions/utest_main2.c index 1a761cb75..41269f0e1 100644 --- a/utest/test_extensions/utest_main2.c +++ b/utest/test_extensions/utest_main2.c @@ -40,7 +40,7 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define CTEST_ADD_TESTS_MANUALLY #include "cblas.h" -#include "openblas_utest.h" +#include "utest/openblas_utest.h" #if 1 CTEST(amax, samax){ blasint N=3, inc=1; diff --git a/utest/test_extensions/xerbla.c b/utest/test_extensions/xerbla.c index 9487b20a6..8c90d4ce7 100644 --- a/utest/test_extensions/xerbla.c +++ b/utest/test_extensions/xerbla.c @@ -39,7 +39,7 @@ static char *rout; static void F77_xerbla(char *srname, void *vinfo) { - int info=*(int*)vinfo; + blasint info=*(blasint*)vinfo; if (link_xerbla) { @@ -85,4 +85,4 @@ void set_xerbla(char* current_rout, int expected_info){ lerr = TRUE; _info = expected_info; rout = current_rout; -} \ No newline at end of file +}