coin-or / Clp

COIN-OR Linear Programming Solver
Other
392 stars 82 forks source link

Clp did not find immintrin.h on mips #243

Closed yingopq closed 1 year ago

yingopq commented 1 year ago

issue: git clone master branch, make failed and it reported error "immintrin.h: No such file or directory". compile environment is QEMU-user-based Arch Linux (MIPS R6) Docker image. Fix it with following patch can make successful.

diff --git a/src/ClpPackedMatrix.cpp b/src/ClpPackedMatrix.cpp
index bcd93600..e9efea19 100644
--- a/src/ClpPackedMatrix.cpp
+++ b/src/ClpPackedMatrix.cpp
@@ -6749,7 +6749,7 @@ ClpPackedMatrix3::ClpPackedMatrix3()
 #include <intrin.h>
 #elif defined(__ARM_FEATURE_SIMD32) || defined(__ARM_NEON)
 #include <arm_neon.h>
-#else
+#elif (defined(_M_IX86) || defined(_M_X64))
 #include <immintrin.h>
 //#include <fmaintrin.h>
 #endif

Thanks.

svigerske commented 1 year ago

Hmm, I remember that these includes have been an issue several times before. It's time to give up on looking for compiler defines and to add checks for the headers to configure.