Skip to content

Commit

Permalink
Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
drnikolaev committed Feb 20, 2023
1 parent 66a0025 commit 70136a0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 14 additions & 8 deletions cvm/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -59,16 +65,16 @@ 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)
else()
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)
Expand Down
8 changes: 2 additions & 6 deletions cvm/src/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
// http://www.boost.org/LICENSE_1_0.txt)

#include "cvm.h"

#include <algorithm>
#if defined(__INTEL_COMPILER) || defined(__INTEL_LLVM_COMPILER)

#if !defined(_MSC_VER)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wexceptions"
#endif
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions cvm/test/testBlas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,10 +300,10 @@ TYPED_TEST(BlasTest, TestHermitianMatrixPolynom1) {
std::abs(mp(2, 0)), spp<TP>(1.e-7,20)) << "schmatrix::polynom";
EXPECT_NEAR(std::abs(TPC(1.417932391600000e+008,-7.089661958000000e+007)),
std::abs(mp(0, 1)), spp<TP>(1.e-14,20)) << "schmatrix::polynom";
EXPECT_NEAR(std::abs(TPC(2.039982260400000e+008,0.)),
std::abs(mp(1, 1)), spp<TP>(1.e-14,20)) << "schmatrix::polynom";
EXPECT_NEAR(std::abs(TPC(0.,2.325020965000000e+008)),
std::abs(mp(2, 1)), spp<TP>(1.e-14,20)) << "schmatrix::polynom";
EXPECT_NEAR(2.039982260400000e+008, mp(1, 1).real(), spp<TP>(1.e-6,20)) << "schmatrix::polynom";
EXPECT_NEAR(0., mp(1, 1).imag(), spp<TP>(1.e-14,20)) << "schmatrix::polynom";
EXPECT_NEAR(0., mp(2, 1).real(), spp<TP>(1.e-14,20)) << "schmatrix::polynom";
EXPECT_NEAR(2.325020965000000e+008, mp(2, 1).imag(), spp<TP>(1.e-14,20)) << "schmatrix::polynom";
EXPECT_NEAR(std::abs(TPC(-8.080273845999999e+007,-1.616054769200000e+008)),
std::abs(mp(0, 2)), spp<TP>(1.e-14,20)) << "schmatrix::polynom";
EXPECT_NEAR(std::abs(TPC(TP(0.), 2.325020965000000e+008)),
Expand Down

0 comments on commit 70136a0

Please sign in to comment.