Skip to content

add -Werror #1071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

add -Werror #1071

wants to merge 3 commits into from

Conversation

simonpintarelli
Copy link
Collaborator

ref. #1070

@simonpintarelli
Copy link
Collaborator Author

cscs-ci run default

@simonpintarelli
Copy link
Collaborator Author

cscs-ci run default

@toxa81
Copy link
Collaborator

toxa81 commented Apr 21, 2025

hmm, this doesn't help. Actually, pure gcc stops with errors. It's the spack gcc wrapper doing something under the hood with the flags.

@simonpintarelli
Copy link
Collaborator Author

hmm, this doesn't help. Actually, pure gcc stops with errors. It's the spack gcc wrapper doing something under the hood with the flags.

I can compile sirius@=develop+apps+cuda+python+tests+fortran locally with -Werror -Wall (again using spack). But spack doesn't remove these flags.

Where do you still get an error?

@toxa81
Copy link
Collaborator

toxa81 commented May 14, 2025

@simonpintarelli my point is : even if you added -Wall -Werror, ci/cd here works fine. It should fail in many places because of the warnings turned into errors. Basically, the question is: why it's greenlighted? :)

@simonpintarelli
Copy link
Collaborator Author

simonpintarelli commented May 14, 2025

I'm using gcc13 and the previously mentioned spec, these are the flags (-Werrro -Wall are present) shown by spack install -vvv

cd /mnt/nvme/spack-stage/simon/spack-stage-sirius-develop-ut6kecocmew2tjttfivabjak5tzrtury/spack-build-ut6keco/src && /home/simon/spack/opt/spack/linux-skylake/compiler-wrapper-1.0-3msxjtnjn3b36gldsotgdppvty6ligce/libexec/spack/gcc/g++ -DCAMP_HAVE_CUDA -DFMT_HEADER_ONLY=1 -DH5_BUILT_AS_DYNAMIC_LIB -DSIRIUS_CUDA -DSIRIUS_GPU -DSIRIUS_GPU_MEMORY_ALIGMENT="" -DSIRIUS_PROFILE -DSIRIUS_USE_MEMORY_POOL -DSIRIUS_USE_PUGIXML -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200809L -Dsirius_cxx_EXPORTS -I/scratch/sirius-PRs/sirius-werror-1071/src -I/mnt/nvme/spack-stage/simon/spack-stage-sirius-develop-ut6kecocmew2tjttfivabjak5tzrtury/spack-build-ut6keco/src -isystem /home/simon/spack/opt/spack/linux-skylake/libxc-7.0.0-abeextzsjwevcwuvomuzl4jcnjmiecuc/include -isystem /home/simon/spack/opt/spack/linux-skylake/spglib-2.5.0-wfkvy3lodea5u7aomcp4bqc2nlvu57i4/include -isystem /home/simon/spack/opt/spack/linux-skylake/hdf5-1.14.6-xv22lm7gcqp7nykobo66sycvwf7naqio/include -isystem /home/simon/spack/opt/spack/linux-skylake/costa-2.2.4-qoqnw2gailehb2n57f5ageske6lmwsdq/include -isystem /home/simon/spack/opt/spack/linux-skylake/spfft-1.1.1-hyqi6usy232x3k4rhkot7fhp7lwkd25v/include -isystem /home/simon/spack/opt/spack/linux-skylake/spla-1.6.1-4m3idz7warhm6d5purhyi7pcpwkha2ju/include -isystem /usr/lib -isystem /home/simon/spack/opt/spack/linux-skylake/gsl-2.8-xc4jodqz7y7hroiawat6ik2elxjrkjc3/include -isystem /home/simon/spack/opt/spack/linux-skylake/pugixml-1.14-bnse34u6k7dqbpggo3oag2neduqfnjl5/include -isystem /home/simon/spack/opt/spack/linux-skylake/fmt-11.0.2-bccfjh4aifjx3xdxwigrfemwnejbaj4k/include -isystem /home/simon/spack/opt/spack/linux-skylake/camp-2025.03.0-lrl54rzyeze6wlcp462wfqwssj4afhj6/include -isystem /home/simon/spack/opt/spack/linux-skylake/umpire-2025.03.0-ealkmz5fzsuspa7pkhcjxili7gu6zv5l/include -isystem /opt/cuda/include -isystem /opt/cuda/targets/x86_64-linux/include -Wall -Werror -O3 -DNDEBUG -std=gnu++17 -fPIC -fopenmp -MD -MT src/CMakeFiles/sirius_cxx.dir/beta_projectors/beta_projectors_base.cpp.o -MF CMakeFiles/sirius_cxx.dir/beta_projectors/beta_projectors_base.cpp.o.d -o CMakeFiles/sirius_cxx.dir/beta_projectors/beta_projectors_base.cpp.o -c /scratch/sirius-PRs/sirius-werror-1071/src/beta_projectors/beta_projectors_base.cpp
[  6%] Building CXX object src/CMakeFiles/sirius_cxx.dir/hubbard/hubbard_potential_energy.cpp.o

I just see the nvtx deprecation warning, no other warnings. Which gcc version are you using and which warnings are reported? I didn't check the debug build.

@simonpintarelli
Copy link
Collaborator Author

@simonpintarelli
Copy link
Collaborator Author

cscs-ci run default

@simonpintarelli
Copy link
Collaborator Author

@simonpintarelli my point is : even if you added -Wall -Werror, ci/cd here works fine. It should fail in many places because of the warnings turned into errors. Basically, the question is: why it's greenlighted? :)

Indeed, the spack compiler wrapper does remove -Werror by default. After changing the config we get the expected failure in the CI.

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.

2 participants