@@ -55,35 +55,6 @@ file(GLOB ARGPARSE_FILES ${CMAKE_SOURCE_DIR}/argparse/*.cpp)
5555
5656add_executable (next ${SRC_FILES} ${ARGPARSE_FILES} )
5757
58- # ============================
59- # Pre-install OpenMP if needed (Clang/Linux)
60- # ============================
61- if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND UNIX AND NOT APPLE )
62- if (NOT EXISTS "/usr/lib/llvm-18/lib/libomp.so"
63- AND NOT EXISTS "/usr/lib/x86_64-linux-gnu/libomp.so"
64- AND NOT EXISTS "/usr/lib/libomp.so" )
65- message (STATUS "Clang detected — installing OpenMP before configuration..." )
66-
67- if (EXISTS "/usr/bin/apt" )
68- execute_process (COMMAND sudo apt update -y )
69- execute_process (COMMAND sudo apt install -y libomp-dev )
70- elseif (EXISTS "/usr/bin/dnf" )
71- execute_process (COMMAND sudo dnf install -y libomp-devel )
72- elseif (EXISTS "/usr/bin/pacman" )
73- execute_process (COMMAND sudo pacman -Sy --noconfirm openmp )
74- elseif (EXISTS "/usr/bin/zypper" )
75- execute_process (COMMAND sudo zypper install -y libomp-devel )
76- else ()
77- message (FATAL_ERROR "Unsupported Linux distro for automatic OpenMP installation." )
78- endif ()
79- endif ()
80- endif ()
81-
82- # ============================
83- # OpenMP detection (after any pre-install)
84- # ============================
85- find_package (OpenMP QUIET )
86-
8758if (OpenMP_CXX_FOUND)
8859 message (STATUS "OpenMP detected — enabling multithreading." )
8960 target_link_libraries (next PRIVATE OpenMP::OpenMP_CXX )
0 commit comments