Skip to content

Commit f170db6

Browse files
authored
Merge pull request ERGO-Code#2257 from ERGO-Code/intel-llvm-linux
Updates for intel llvm compiler on linux
2 parents b28fecd + 0a1ac74 commit f170db6

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,19 @@ else()
5454
set(GITHASH "n/a")
5555
endif()
5656

57+
# message("CMAKE_CXX_COMPILER_ID is ${CMAKE_CXX_COMPILER_ID}")
58+
if (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
59+
message(STATUS "Compiler is IntelLLVM")
60+
if (CMAKE_HOST_WIN32 AND CMAKE_VERSION VERSION_LESS "3.23.0")
61+
message(FATAL_ERROR "Need at least CMake 3.23 for IntelLLVM support of IntelDPCPP package on Windows")
62+
elseif(CMAKE_VERSION VERSION_LESS "3.23.0")
63+
message(FATAL_ERROR "CMake 3.20.5 is the minimum recommended for IntelLLVM on Linux")
64+
endif()
65+
66+
find_package(IntelSYCL REQUIRED)
67+
endif()
68+
69+
5770
message(STATUS "Git hash: " ${GITHASH})
5871
# By default only build the C++ library.
5972
option(BUILD_CXX "Build C++ library" ON)

check/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY))
261261
# "--parallel=on"
262262
)
263263

264-
if (UNIX AND NOT APPLE)
264+
if (UNIX AND NOT APPLE AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
265265
if (CUPDLP_CPU AND NOT CUPDLP_FORCE_NATIVE)
266266
set(pdlpInstances
267267
"25fv47\; 5.50184588\;"
@@ -316,7 +316,7 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY))
316316
endif()
317317
endif()
318318
endif()
319-
elseif(WIN32)
319+
elseif(WIN32 AND NOT CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
320320
if (CUPDLP_CPU AND NOT CUPDLP_FORCE_NATIVE)
321321
# on windows e226 model status is unknown
322322
# on windows 25fv47 model status can be unknown, with objective 5.5018458957e+03
@@ -411,7 +411,7 @@ if ((NOT FAST_BUILD OR ALL_TESTS) AND NOT (BUILD_EXTRA_UNIT_ONLY))
411411
"Model status : ${solutionstatus}")
412412

413413
if(${solutionstatus} STREQUAL "Optimal")
414-
if(${setting} STREQUAL "--presolve=off")
414+
if(${setting} STREQUAL "--presolve=off" AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM"))
415415
set_tests_properties (${name}${setting} PROPERTIES
416416
PASS_REGULAR_EXPRESSION
417417
"Simplex iterations: ${iter}\nObjective value : ${optval}")

check/TestPresolve.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ void presolveSolvePostsolve(const std::string& model_file,
202202
REQUIRE(model_status == HighsModelStatus::kUnknown);
203203
const double dl_objective_value =
204204
std::fabs(highs0.getInfo().objective_function_value - objective_value);
205-
REQUIRE(dl_objective_value < 1e-12);
205+
REQUIRE(dl_objective_value < 1e-9);
206206
REQUIRE(highs0.getInfo().primal_solution_status == kSolutionStatusFeasible);
207207
double mip_feasibility_tolerance;
208208
highs0.getOptionValue("mip_feasibility_tolerance",

check/TestQpSolver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ TEST_CASE("test-qp-delete-col", "[qpsolver]") {
870870
hessianProduct(incumbent_model.hessian_, arg1, result1);
871871

872872
for (HighsInt iCol = 0; iCol < dim; iCol++) {
873-
REQUIRE(result0[iCol] == result1[iCol]);
873+
REQUIRE(fabs(result0[iCol] - result1[iCol]) < 1e-8);
874874
}
875875
}
876876

src/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ else()
296296
target_compile_options(highs PRIVATE "-Wno-unused-variable")
297297
target_compile_options(highs PRIVATE "-Wno-unused-const-variable")
298298
endif()
299+
if (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
300+
target_compile_options(highs PUBLIC "-Wno-invalid-offsetof")
301+
endif()
299302

300303
# Configure the config file for the build tree:
301304
# Either list all the src/* directories here, or put explicit paths in all the

0 commit comments

Comments
 (0)