Skip to content

Commit 1a96800

Browse files
authored
HIP Debug Build (#3311)
Use -O1 instead of -O0, because the HIP compiler has various issues with the latter. For example, it segfaults when compiling WarpX. It fails with errors of size exceeding limit at link time when compiling Tests/Amr/Advection_AmrCore/Exec. Now both codes work (with GNU Make). Add -munsafe-fp-atomics in debug mode too. The changes are for GNU Make only. Even with `-O1`, CMake still does not work.
1 parent ab567b8 commit 1a96800

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.github/workflows/codeql.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ jobs:
8282
ccache -s
8383
du -hs ~/.cache/ccache
8484
85+
# Make sure CodeQL has something to do
86+
touch Src/Base/AMReX.cpp
87+
export CCACHE_DISABLE=1
88+
cd build
89+
make -j 2
90+
8591
- name: Perform CodeQL Analysis
8692
uses: github/codeql-action/analyze@v2
8793
with:

Tools/GNUMake/Make.defs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ else
5656
endif
5757

5858
ifeq ($(USE_HIP),TRUE)
59-
DEBUG := FALSE # Currently there is a compiler bug for DEBUG=TRUE.
6059
USE_CUDA := FALSE
6160
override COMP = hip
6261
ifneq ($(NO_CONFIG_CHECKING),TRUE)

Tools/GNUMake/comps/hip.mak

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ endif # BL_NO_FORT
8383
ifeq ($(HIP_COMPILER),clang)
8484

8585
ifeq ($(DEBUG),TRUE)
86-
CXXFLAGS += -g -O0 #-ftrapv
87-
CFLAGS += -g -O0 #-ftrapv
86+
CXXFLAGS += -g -O1 -munsafe-fp-atomics
87+
CFLAGS += -g -O0
8888

8989
FFLAGS += -g -O0 -ggdb -fbounds-check -fbacktrace -Wuninitialized -Wunused -ffpe-trap=invalid,zero -finit-real=snan -finit-integer=2147483647 -ftrapv
9090
F90FLAGS += -g -O0 -ggdb -fbounds-check -fbacktrace -Wuninitialized -Wunused -ffpe-trap=invalid,zero -finit-real=snan -finit-integer=2147483647 -ftrapv

0 commit comments

Comments
 (0)