Skip to content

Commit

Permalink
update to 17
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveBronder committed Sep 27, 2024
1 parent 2d1dbbd commit b31f4ee
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions make/compiler_flags
Original file line number Diff line number Diff line change
Expand Up @@ -119,33 +119,9 @@ INC_GTEST ?= -I $(GTEST)/include -I $(GTEST)
## setup precompiler options
CPPFLAGS_BOOST ?= -DBOOST_DISABLE_ASSERTS
CPPFLAGS_SUNDIALS ?= -DNO_FPRINTF_OUTPUT $(CPPFLAGS_OPTIM_SUNDIALS) $(CXXFLAGS_FLTO_SUNDIALS)
#CPPFLAGS_GTEST ?=
STAN_HAS_CXX17 ?= false
ifeq ($(CXX_TYPE), gcc)
GCC_GE_73 := $(shell [ $(CXX_MAJOR) -gt 7 -o \( $(CXX_MAJOR) -eq 7 -a $(CXX_MINOR) -ge 1 \) ] && echo true)
ifeq ($(GCC_GE_73),true)
STAN_HAS_CXX17 := true
endif
else ifeq ($(CXX_TYPE), clang)
CLANG_GE_5 := $(shell [ $(CXX_MAJOR) -gt 5 -o \( $(CXX_MAJOR) -eq 5 -a $(CXX_MINOR) -ge 0 \) ] && echo true)
ifeq ($(CLANG_GE_5),true)
STAN_HAS_CXX17 := true
endif
else ifeq ($(CXX_TYPE), mingw32-gcc)
MINGW_GE_50 := $(shell [ $(CXX_MAJOR) -gt 5 -o \( $(CXX_MAJOR) -eq 5 -a $(CXX_MINOR) -ge 0 \) ] && echo true)
ifeq ($(MINGW_GE_50),true)
STAN_HAS_CXX17 := true
endif
endif

ifeq ($(STAN_HAS_CXX17), true)
CXXFLAGS_LANG ?= -std=c++17
CXXFLAGS_STANDARD ?= c++17
else
$(warning "Stan cannot detect if your compiler has the C++17 standard. If it does, please set STAN_HAS_CXX17=true in your make/local file. C++17 support is mandatory in the next release of Stan. Defaulting to C++14")
CXXFLAGS_LANG ?= -std=c++1y
CXXFLAGS_STANDARD ?= c++1y
endif
CXXFLAGS_LANG ?= -std=c++17
CXXFLAGS_STANDARD ?= c++17
#CXXFLAGS_BOOST ?=
CXXFLAGS_SUNDIALS ?= -pipe $(CXXFLAGS_OPTIM_SUNDIALS) $(CPPFLAGS_FLTO_SUNDIALS)
#CXXFLAGS_GTEST
Expand Down

0 comments on commit b31f4ee

Please sign in to comment.