📌 Fixed openmp check in Makefile.

main
Isabell Pflug 2 days ago
parent 999a3a23e6
commit 548ef99a09

@ -9,8 +9,11 @@ PROJECTS := $(wildcard $(SRC_DIR)/*)
BINS := $(patsubst $(SRC_DIR)/%, $(OUT_DIR)/%, $(PROJECTS)) BINS := $(patsubst $(SRC_DIR)/%, $(OUT_DIR)/%, $(PROJECTS))
LIB_SOURCES := $(wildcard $(LIB_DIR)/*.cpp) LIB_SOURCES := $(wildcard $(LIB_DIR)/*.cpp)
# checking with a silly test program whether openmp is accessible
# maybe at some point a cmake file would be more elegant.
OPENMP_FLAG := OPENMP_FLAG :=
OPENMP_CHECK := $(shell echo | $(CXX) -fopenmp -x c++ - -o /dev/null 2>/dev/null && echo yes) OPENMP_CHECK := $(shell printf '#include <omp.h>\nint main(){return 0;}' | \
$(CXX) -std=c++23 -fopenmp -x c++ - -o /dev/null 2>/dev/null && echo yes)
ifeq ($(OPENMP_CHECK),yes) ifeq ($(OPENMP_CHECK),yes)
OPENMP_FLAG := -fopenmp OPENMP_FLAG := -fopenmp

Loading…
Cancel
Save