Skip to content

Commit

Permalink
Merge pull request #1084 from edoapra/stdgnu23
Browse files Browse the repository at this point in the history
yet another gcc 15 update
  • Loading branch information
nwchemgit authored Feb 21, 2025
2 parents 73c9c4a + 3eba29d commit b5859da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/config/makefile.h
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ else
endif

ifeq ($(GA_LDFLAGS),)
GA_LDFLAGS := $(shell ${GA_PATH}/bin/ga-config --ldflags )
GA_LDFLAGS := $(shell ${GA_PATH}/bin/ga-config --ldflags )
endif

#extract GA libs location from last word in GA_LDLFLAGS
Expand Down Expand Up @@ -1332,6 +1332,7 @@ ifeq ($(TARGET),MACX64)
GNU_GE_4_8 := $(shell [ $(GNUMAJOR) -gt 4 -o \( $(GNUMAJOR) -eq 4 -a $(GNUMINOR) -ge 8 \) ] && echo true)
GNU_GE_6 := $(shell [ $(GNUMAJOR) -ge 6 ] && echo true)
GNU_GE_8 := $(shell [ $(GNUMAJOR) -ge 8 ] && echo true)
GNU_GE_14 := $(shell [ $(GNUMAJOR) -ge 14 ] && echo true)

ifeq ($(GNU_GE_4_6),true)
DEFINES += -DGCC46
Expand Down Expand Up @@ -1552,6 +1553,12 @@ ifeq ($(TARGET),$(findstring $(TARGET),LINUX CYGNUS CYGWIN))
endif

DEFINES += -DGFORTRAN
GCCMAJOR := $(shell $(CC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC__ |cut -c18-)
ifdef GCCMAJOR
GCCMINOR := $(shell $(CC) -dM -E - < /dev/null 2> /dev/null | grep __VERS | cut -c24)
GCC_GE_14 := $(shell [ $(GCCMAJOR) -ge 14 ] && echo true)
endif

GNUMAJOR := $(shell $(FC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC__ |cut -c18-)

ifdef GNUMAJOR
Expand Down Expand Up @@ -2180,6 +2187,11 @@ ifneq ($(TARGET),LINUX)
FFLAGS_FORGA = -mcmodel=medium
endif
else
GCCMAJOR := $(shell $(CC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC__ |cut -c18-)
ifdef GCCMAJOR
GCCMINOR := $(shell $(CC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC_MINOR | cut -c24-)
GCC_GE_14 := $(shell [ $(GCCMAJOR) -ge 14 ] && echo true)
endif
GNUMAJOR := $(shell $(FC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC__ |cut -c18-)
ifdef GNUMAJOR
GNUMINOR := $(shell $(FC) -dM -E - < /dev/null 2> /dev/null | grep __GNUC_MINOR | cut -c24)
Expand Down
3 changes: 3 additions & 0 deletions src/tools/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ endif
ifeq ($(GNU_GE_8),true)
FFLAGS_FORGA += -std=legacy
endif
ifeq ($(GCC_GE_14),true)
CFLAGS_FORGA += -std=gnu17
endif
#detect clang
GOTCLANG := $(shell $(CC) -dM -E - </dev/null 2> /dev/null |grep __clang__|head -1|cut -c19)
GOTFREEBSD := $(shell uname -o 2>&1|awk ' /FreeBSD/ {print "1";exit}')
Expand Down

0 comments on commit b5859da

Please sign in to comment.