Skip to content

Conversation

@JanStreffing
Copy link
Collaborator

…mments

@JanStreffing JanStreffing self-assigned this Sep 2, 2025
@JanStreffing JanStreffing added the enhancement New feature or request label Sep 2, 2025
@JanStreffing JanStreffing added this to the FESOM 2.7 milestone Sep 2, 2025
@JanStreffing
Copy link
Collaborator Author

We used to set build type debug by default. The actual inclusion of debug flags under this type tripped the CI tests. It also makes the CI tests take much longer and cost more. I changed the build type to release.

Copy link
Collaborator

@suvarchal suvarchal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

G.Catch!!

TODO: Some what related to this there is some nesting and repetition of compilers and machine blocks for instance for the same compiler: gnu options on levante and on ubuntu differ some parts are machine specific and is needed but others should be common like link time optimization like -flto and it does make a difference as #775 showed runs in ci env and failed with gnu on levante. when organized better so all the machine specific can go into env files and rest in src/CMakeLists.txt so that we remove clutter.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder if we should just remove -DCMAKE_BUILD_TYPE=.... from ./configure.sh because 1. ./configure.sh also takes cmake args so gives flexibility for user to use ./configure.sh blahblah -DCMAKE_BUILD_TYPE=Debug if they want to. 2. in CMakeLists.txt build type is set to be Release in case the variable is not set.

#)
## if use -fsanitize=undefined,address you also need ... PRIVATE -lubsan)
#target_link_libraries(${PROJECT_NAME} PRIVATE -lubsan)
# debugging related compiler flags (activated for Debug build type)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should use address sanitizer definitely for testing new code to check if we are allocating badly and creating leaks but I will skip -fsanitize for now as it need libasan to also be installed and present, this possibly need a cmake module to check this. so would skip this for now just, and ubsan seems to be a typo? should be -lasan or -static-libasan to compile options. More over any use of asan also need a env variable or someting to trace specific issue like ASAN_OPTIONS=detect_leaks=1 for detecting leaks. so this should be possibly done differently for it to be useful.

@JanStreffing JanStreffing merged commit 4e45379 into main Oct 10, 2025
14 checks passed
@JanStreffing JanStreffing deleted the activate_debug_flags_with_cmake_build_type branch October 10, 2025 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants