diff --git a/Makefile b/Makefile index 217e991..db55b2c 100644 --- a/Makefile +++ b/Makefile @@ -9,8 +9,11 @@ PROJECTS := $(wildcard $(SRC_DIR)/*) BINS := $(patsubst $(SRC_DIR)/%, $(OUT_DIR)/%, $(PROJECTS)) 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_CHECK := $(shell echo | $(CXX) -fopenmp -x c++ - -o /dev/null 2>/dev/null && echo yes) +OPENMP_CHECK := $(shell printf '#include \nint main(){return 0;}' | \ + $(CXX) -std=c++23 -fopenmp -x c++ - -o /dev/null 2>/dev/null && echo yes) ifeq ($(OPENMP_CHECK),yes) OPENMP_FLAG := -fopenmp