From 42ddba9d6a0de1ba01806d3920b61e8472143924 Mon Sep 17 00:00:00 2001 From: YiZhangCUG Date: Fri, 7 May 2021 10:00:26 +0800 Subject: [PATCH] update cmakelists --- lib/CMakeLists.txt | 5 +++++ lib/linalg.cpp | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 73398ab..616f4c1 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -33,6 +33,11 @@ set_target_properties(magtess_static PROPERTIES CLEAN_DIRECT_OUTPUT 1) # 设置动态库的版本号 set_target_properties(magtess PROPERTIES VERSION 1.0 SOVERSION 1.0) +if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL "Linux") + target_link_libraries(magtess PUBLIC openblas) + target_link_libraries(magtess PUBLIC m) +endif() + # 库的安装命令 if(WIN32) install(TARGETS magtess DESTINATION lib) diff --git a/lib/linalg.cpp b/lib/linalg.cpp index 82d028a..b057a0a 100755 --- a/lib/linalg.cpp +++ b/lib/linalg.cpp @@ -11,11 +11,11 @@ Functions matrix and vector multiplications. //#include #ifdef __linux__ // Debian, Ubuntu, Gentoo, Fedora, openSUSE, RedHat, Centos and other - #include + #include #elif defined(__APPLE__) && defined(__MACH__) #include #else - // + #endif /* Calculate magnetization vector in a coordinate system of a given point */