diff --git a/README.md b/README.md index 317ddd6..c859f8b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ sudo apt update sudo apt install intel-basekit source /opt/intel/oneapi/compiler/latest/env/vars.sh mkdir build -cmake -DCMAKE_Fortran_COMPILER=ifx -DCMAKE_CXX_COMPILER=icx -DMKL=ON -DILP64=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release -S . -B build +cmake -DCMAKE_Fortran_COMPILER=ifx -DMKL=ON -DILP64=ON -DBUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release -S . -B build cd build make -j ../lib/cvm_test diff --git a/cvm/src/CMakeLists.txt b/cvm/src/CMakeLists.txt index b35c2f4..cdf3528 100644 --- a/cvm/src/CMakeLists.txt +++ b/cvm/src/CMakeLists.txt @@ -3,7 +3,7 @@ set(OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../lib") add_subdirectory(ftn) -add_library(cvm SHARED +SET(SOURCE_FILES arrays.cpp cmatrix.cpp cvector.cpp @@ -13,7 +13,16 @@ add_library(cvm SHARED scmatrix.cpp srmatrix.cpp utils.cpp - ../../cvmlib/framework.h ../../cvmlib/dllmain.cpp ../../cvmlib/pch.cpp) + ) +if (NOT LINUX) + SET(SOURCE_FILES ${SOURCE_FILES} + ../../cvmlib/framework.h + ../../cvmlib/dllmain.cpp + ../../cvmlib/pch.cpp + ) +endif() + +add_library(cvm SHARED ${SOURCE_FILES}) set_target_properties( cvm @@ -33,9 +42,6 @@ add_dependencies(cvm ftn) if(ILP64) target_compile_definitions(cvm PUBLIC CVM_ILP64) endif() -#if(ICC) -# target_compile_options(cvm PUBLIC -fsycl -Rdebug-disables-optimization) -#endif() target_include_directories(cvm PRIVATE .) if(LINUX) @@ -59,8 +65,8 @@ endif() if(MKL) if(ILP64) - if(ICC) - target_compile_options(cvm PUBLIC /Qmkl-ilp64:parallel) + if(ICC AND NOT LINUX) + target_compile_options(cvm PUBLIC -Qmkl-ilp64:parallel) endif() if(IFORT) target_link_libraries(cvm mkl_intel_ilp64) @@ -68,7 +74,7 @@ if(MKL) target_link_libraries(cvm mkl_gf_ilp64) endif() else() - if(ICC) + if(ICC AND NOT LINUX) target_compile_options(cvm PUBLIC -Qmkl=parallel) endif() if(IFORT) diff --git a/cvm/src/globals.cpp b/cvm/src/globals.cpp index b16178e..78ff622 100644 --- a/cvm/src/globals.cpp +++ b/cvm/src/globals.cpp @@ -7,9 +7,9 @@ // http://www.boost.org/LICENSE_1_0.txt) #include "cvm.h" - #include -#if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER) + +#if !defined(_MSC_VER) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wexceptions" #endif @@ -25,10 +25,6 @@ extern "C" { } } -#if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER) -#pragma GCC diagnostic pop -#endif - #if !defined(_MSC_VER) #pragma GCC diagnostic pop #endif diff --git a/cvm/test/testBlas.cpp b/cvm/test/testBlas.cpp index 302f5ec..7f43487 100644 --- a/cvm/test/testBlas.cpp +++ b/cvm/test/testBlas.cpp @@ -300,10 +300,10 @@ TYPED_TEST(BlasTest, TestHermitianMatrixPolynom1) { std::abs(mp(2, 0)), spp(1.e-7,20)) << "schmatrix::polynom"; EXPECT_NEAR(std::abs(TPC(1.417932391600000e+008,-7.089661958000000e+007)), std::abs(mp(0, 1)), spp(1.e-14,20)) << "schmatrix::polynom"; - EXPECT_NEAR(std::abs(TPC(2.039982260400000e+008,0.)), - std::abs(mp(1, 1)), spp(1.e-14,20)) << "schmatrix::polynom"; - EXPECT_NEAR(std::abs(TPC(0.,2.325020965000000e+008)), - std::abs(mp(2, 1)), spp(1.e-14,20)) << "schmatrix::polynom"; + EXPECT_NEAR(2.039982260400000e+008, mp(1, 1).real(), spp(1.e-6,20)) << "schmatrix::polynom"; + EXPECT_NEAR(0., mp(1, 1).imag(), spp(1.e-14,20)) << "schmatrix::polynom"; + EXPECT_NEAR(0., mp(2, 1).real(), spp(1.e-14,20)) << "schmatrix::polynom"; + EXPECT_NEAR(2.325020965000000e+008, mp(2, 1).imag(), spp(1.e-14,20)) << "schmatrix::polynom"; EXPECT_NEAR(std::abs(TPC(-8.080273845999999e+007,-1.616054769200000e+008)), std::abs(mp(0, 2)), spp(1.e-14,20)) << "schmatrix::polynom"; EXPECT_NEAR(std::abs(TPC(TP(0.), 2.325020965000000e+008)),