GNU Make: Add new option DEBUG_OPT_LEVEL#4674
Merged
asalmgren merged 1 commit intoAMReX-Codes:developmentfrom Sep 25, 2025
Merged
GNU Make: Add new option DEBUG_OPT_LEVEL#4674asalmgren merged 1 commit intoAMReX-Codes:developmentfrom
asalmgren merged 1 commit intoAMReX-Codes:developmentfrom
Conversation
This does not change the existing behavior, because it's 0 by default. This allows us to increase the optimization level when DEBUG=TRUE. ERF's radiation test problem does not compile with `USE_CUDA=TRUE DEBUG=TRUE`. It fails at link time with ``` /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x21): relocation truncated to fit: R_X86_64_GOTPCRELX against symbol `__libc_start_main@@GLIBC_2.34' defined in .text section in /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/Scrt1.o:(.eh_frame+0x20): relocation truncated to fit: R_X86_64_PC32 against `.text' /usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/crti.o: in function `_init': (.init+0xb): relocation truncated to fit: R_X86_64_REX_GOTPCRELX against undefined symbol `__gmon_start__' /usr/local/cuda/lib64/libcudart_static.a(cudart_static.o): in function `libcudart_static_a3bf49b59a3e5c73e23c76622c3ce0951724bc73': cuda_runtime_api.cpp:(.text.startup+0x19): relocation truncated to fit: R_X86_64_PC32 against `.data' cuda_runtime_api.cpp:(.text.startup+0x20): relocation truncated to fit: R_X86_64_PC32 against `.data' cuda_runtime_api.cpp:(.text.startup+0x27): relocation truncated to fit: R_X86_64_PC32 against `.data' cuda_runtime_api.cpp:(.text.startup+0x3d): relocation truncated to fit: R_X86_64_PC32 against `.data' /usr/local/cuda/lib64/libcudart_static.a(cudart_static.o): in function `libcudart_static_7bd86af72cd50dfe63513852abf557d8ffc48b76': cudart_global.cpp:(.text.startup+0xbb): relocation truncated to fit: R_X86_64_PC32 against `.bss' cudart_global.cpp:(.text.startup+0xcb): relocation truncated to fit: R_X86_64_PC32 against symbol `__dso_handle' defined in .data.rel.local section in /usr/lib/gcc/x86_64-linux-gnu/13/crtbeginS.o cudart_global.cpp:(.text.startup+0xd2): relocation truncated to fit: R_X86_64_PC32 against `.bss' /usr/local/cuda/lib64/libcudart_static.a(cudart_static.o):(.eh_frame+0x4b18): additional relocation overflows omitted from the output ERF3d.gnu.DEBUG.MPI.CUDA.ex: PC-relative offset overflow in PLT entry for `mlock@@GLIBC_2.2.5' collect2: error: ld returned 1 exit status make: *** [../../../Submodules/AMReX/Tools/GNUMake/Make.rules:64: ERF3d.gnu.DEBUG.MPI.CUDA.ex] Error 1 ``` With `USE_CUDA=TRUE DEBUG=TRUE DEBUG_OPT_LEVEL=1`, it compiles.
asalmgren
approved these changes
Sep 25, 2025
This was referenced Sep 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This does not change the existing behavior, because it's 0 by default. This allows us to increase the optimization level when DEBUG=TRUE.
ERF's radiation test problem does not compile with
USE_CUDA=TRUE DEBUG=TRUE. It fails at link time withWith
USE_CUDA=TRUE DEBUG=TRUE DEBUG_OPT_LEVEL=1, it compiles.