Skip to content

Commit

Permalink
Fixing gcc-13 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
bobrobey committed Sep 26, 2023
1 parent 3c293ba commit 9d38801
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 14 deletions.
6 changes: 5 additions & 1 deletion Pragma_Examples/OpenACC/C/Make/reduction/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ else
endif

CFLAGS = -g -O3 -fstrict-aliasing ${OPENACC_FLAGS}
LDFLAGS = ${OPENACC_FLAGS} -lm
ifeq (${CC1},gcc-13)
LDFLAGS = ${OPENACC_FLAGS} -fno-lto -lm
else
LDFLAGS = ${OPENACC_FLAGS} -lm
endif

${EXEC}: ${EXEC}.o codelet.o
$(CC) $(LDFLAGS) $^ -o $@
Expand Down
12 changes: 9 additions & 3 deletions Pragma_Examples/OpenACC/C/Make/saxpy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@ UNAMEP = $(shell uname -p)
ROCM_CPUTARGET = $(UNAMEP)-pc-linux-gnu
ROCM_GPUTARGET ?= amdgcn-amd-amdhsa

ifeq ($(notdir $(CC)), clang)
CC1=$(notdir $(CC))

ifeq ($(findstring, clang, $(CC1)), clang)
OPENACC_FLAGS = Clang_does_not_support_OpenACC_for_AMD_GPUs
else ifeq ($(notdir $(CC)), amdclang)
else ifeq ($(findstring, amdclang, $(CC1)), amdclang)
OPENACC_FLAGS = amdclang_does_not_support_OpenACC_for_AMD_GPUs
else
OPENACC_FLAGS = -fopenacc -foffload=-march=${ROCM_GPU} -fopt-info-optimized-omp
endif

CFLAGS = -g -O3 -fstrict-aliasing ${OPENACC_FLAGS}
LDFLAGS = ${OPENACC_FLAGS} -lm
ifeq (${CC1},gcc-13)
LDFLAGS = ${OPENACC_FLAGS} -fno-lto -lm
else
LDFLAGS = ${OPENACC_FLAGS} -lm
endif

${EXEC}: ${EXEC}.o codelet.o
$(CC) $(LDFLAGS) $^ -o $@
Expand Down
12 changes: 9 additions & 3 deletions Pragma_Examples/OpenACC/C/Make/vecadd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,22 @@ UNAMEP = $(shell uname -p)
ROCM_CPUTARGET = $(UNAMEP)-pc-linux-gnu
ROCM_GPUTARGET ?= amdgcn-amd-amdhsa

ifeq ($(notdir $(CC)), clang)
CC1=$(notdir $(CC))

ifeq ($(findstring, clang, $(CC1)), clang)
OPENACC_FLAGS = Clang_does_not_support_OpenACC_for_AMD_GPUs
else ifeq ($(notdir $(CC)), amdclang)
else ifeq ($(findstring, amdclang, $(CC1)), amdclang)
OPENACC_FLAGS = amdclang_does_not_support_OpenACC_for_AMD_GPUs
else
OPENACC_FLAGS = -fopenacc -foffload=-march=${ROCM_GPU} -fopt-info-optimized-omp
endif

CFLAGS = -g -O3 -fstrict-aliasing ${OPENACC_FLAGS}
LDFLAGS = ${OPENACC_FLAGS} -lm
ifeq (${CC1},gcc-13)
LDFLAGS = ${OPENACC_FLAGS} -fno-lto -lm
else
LDFLAGS = ${OPENACC_FLAGS} -lm
endif

${EXEC}: ${EXEC}.o timer.o
$(CC) $(LDFLAGS) $^ -o $@
Expand Down
6 changes: 5 additions & 1 deletion Pragma_Examples/OpenACC/Fortran/Make/freduce/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ else
endif

FFLAGS = -g -O3 ${FREE_FORM_FLAG} -fstrict-aliasing ${OPENACC_FLAGS}
LDFLAGS = ${OPENACC_FLAGS}
ifeq (${FC1},gfortran-13)
LDFLAGS = ${OPENACC_FLAGS} -fno-lto
else
LDFLAGS = ${OPENACC_FLAGS}
endif

${EXEC}: ${EXEC}.o
$(FC) $(LDFLAGS) $^ -o $@
Expand Down
6 changes: 5 additions & 1 deletion Pragma_Examples/OpenACC/Fortran/Make/vecadd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ else
endif

FFLAGS = -g -O3 ${FREE_FORM_FLAG} -fstrict-aliasing ${OPENACC_FLAGS}
LDFLAGS = ${OPENACC_FLAGS}
ifeq (${FC1},gfortran-13)
LDFLAGS = ${OPENACC_FLAGS} -fno-lto
else
LDFLAGS = ${OPENACC_FLAGS}
endif

ftimers.o: timers.o
vecadd.o: ftimers.o
Expand Down
6 changes: 5 additions & 1 deletion Pragma_Examples/OpenMP/C/Make/reduction/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ else
endif

CFLAGS = -g -O3 -fstrict-aliasing ${OPENMP_FLAGS}
LDFLAGS = ${OPENMP_FLAGS} -lm
ifeq (${CC1},gcc-13)
LDFLAGS = ${OPENMP_FLAGS} -fno-lto -lm
else
LDFLAGS = ${OPENMP_FLAGS} -lm
endif

${EXEC}: ${EXEC}.o codelet.o
$(CC) $(LDFLAGS) $^ -o $@
Expand Down
6 changes: 5 additions & 1 deletion Pragma_Examples/OpenMP/C/Make/saxpy/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ else
endif

CFLAGS = -g -O3 -fstrict-aliasing ${OPENMP_FLAGS}
LDFLAGS = ${OPENMP_FLAGS} -lm
ifeq (${CC1},gcc-13)
LDFLAGS = ${OPENMP_FLAGS} -fno-lto -lm
else
LDFLAGS = ${OPENMP_FLAGS} -lm
endif

${EXEC}: ${EXEC}.o codelet.o
$(CC) $(LDFLAGS) $^ -o $@
Expand Down
6 changes: 5 additions & 1 deletion Pragma_Examples/OpenMP/C/Make/vecadd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ else
endif

CFLAGS = -g -O3 -fstrict-aliasing ${OPENMP_FLAGS}
LDFLAGS = ${OPENMP_FLAGS} -lm
ifeq (${CC1},gcc-13)
LDFLAGS = ${OPENMP_FLAGS} -fno-lto -lm
else
LDFLAGS = ${OPENMP_FLAGS} -lm
endif

${EXEC}: ${EXEC}.o timer.o
$(CC) $(LDFLAGS) $^ -o $@
Expand Down
6 changes: 5 additions & 1 deletion Pragma_Examples/OpenMP/Fortran/Make/freduce/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ ifeq ($(notdir $(FC)), ftn)
else
FFLAGS = -g -O3 ${FREE_FORM_FLAG} -fstrict-aliasing ${OPENMP_FLAGS}
endif
LDFLAGS = ${OPENMP_FLAGS}
ifeq (${FC1},gfortran-13)
LDFLAGS = ${OPENMP_FLAGS} -fno-lto
else
LDFLAGS = ${OPENMP_FLAGS}
endif

${EXEC}: ${EXEC}.o
$(FC) $(LDFLAGS) $^ -o $@
Expand Down
6 changes: 5 additions & 1 deletion Pragma_Examples/OpenMP/Fortran/Make/vecadd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ else
FFLAGS = -g -O3 ${FREE_FORM_FLAG} -fstrict-aliasing ${OPENMP_FLAGS}
endif
CFLAGS = -g -O3 -fstrict-aliasing ${OPENMP_FLAGS}
LDFLAGS = ${OPENMP_FLAGS}
ifeq (${FC1},gfortran-13)
LDFLAGS = ${OPENMP_FLAGS} -fno-lto
else
LDFLAGS = ${OPENMP_FLAGS}
endif

ftimers.o: timers.o
${EXEC}.o: ftimers.o
Expand Down

0 comments on commit 9d38801

Please sign in to comment.