Skip to content

Introduced CMake options for the Fortran-API and compiler warnings#299

Open
Niklas997 wants to merge 11 commits into
trixi-framework:mainfrom
Niklas997:main
Open

Introduced CMake options for the Fortran-API and compiler warnings#299
Niklas997 wants to merge 11 commits into
trixi-framework:mainfrom
Niklas997:main

Conversation

@Niklas997

Copy link
Copy Markdown

Thank you for developing libtrixi! I wanted to use it with t8code and only needed the C-interface, therefore, I added some CMake-Options to exclude building the Fortran-interface. Additionally, the -Wall -Wextra -Werror options have been set obligatory, which has led to errors for me (Ubuntu 24.04. (WSL2), GCC-Version: 13.3.0) due to some unused parameters in the garbage-collection-interface, e.g. "~/.julia/juliaup/julia-1.12.2+0.x64.linux.gnu/include/julia/gc-interface.h:243:47: warning: unused parameter ‘parent’ [-Wunused-parameter]", which is why I added some switches for those options as well.

The following options with the given default values have been introduced: LIBTRIXI_BUILD_FORTRAN_API=ON; LIBTRIXI_WITH_T8CODE=OFF; LIBTRIXI_ENABLE_WARNINGS=OFF; LIBTRIXI_ENABLE_WERROR=OFF; LIBTRIXI_ENABLE_TESTING=OFF
Maybe the changes are interesting for libtrixi, but I am not sure, if I covered everything and if that is the intended way for libtrixi.

@benegee benegee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks a lot for your contribution @Niklas997 !

I like the added options! About the warning I am not sure yet.

Comment thread examples/CMakeLists.txt Outdated
Comment thread CMakeLists.txt
Comment thread README.md
Comment thread README.md Outdated
Comment thread examples/CMakeLists.txt Outdated
Comment thread README.md Outdated

@benegee benegee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oh no, I just realized one of my comments was still pending in github. @Niklas997

Comment thread README.md
or debug code.
- By default the Fortran-Interface is built; it may be excluded with `DLIBTRIXI_BUILD_FORTRAN_API=OFF`.
- Optional compiler options `-Wall -Wextra` are specified with `-DLIBTRIXI_ENABLE_WARNINGS=ON`.
- Optional compiler option `-Werror` is specified with `-DLIBTRIXI_ENABLE_WERROR=ON`.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

So far, we have been very strict with respect to warning, because we could. I would thus like to keep it this way, or at least have them on by default.

Regarding the Julia 1.12 issue: #259 (comment)
Currently I would set -DCMAKE_C_FLAGS="-Wno-error=unused-parameter" when running cmake.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Any strong opinions on this @sloede ?

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.11%. Comparing base (3fb7a70) to head (04737e9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #299   +/-   ##
=======================================
  Coverage   96.11%   96.11%           
=======================================
  Files          25       25           
  Lines        1260     1260           
  Branches       74       74           
=======================================
  Hits         1211     1211           
  Misses         45       45           
  Partials        4        4           
Flag Coverage Δ
unittests 96.11% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants