Skip to content

Conversation

@pstoecker
Copy link
Member

This addresses our quite complex workaround to silence compiler warnings originating from external packages such as eigen3.

We have silenced the warnings by wrapping the include statements for eigen3 headers between the headers begin_ignore_warnings_eigen.hpp and end_ignore_warnings.hpp and every "annoying" compiler warning is explicitly stated in there.

CMake actually offers a cleaner solution for this. In the include_directories function, one can pass the SYSTEM keyword (cf. CMake docs - target_include_directories). This will tell the compiler (if supported) to treat these headers as system header and warnings originating from code in their is suppressed.

This PR sets the SYSTEM keyword for the Eigen3 library and deletes the begin_ignore_warnings_eigen.hpp and its usages. I have tested it with clang and there are no compiler warnings related to eigen3 code. I am not sure though how good this solution works with intel compilers.

I guess that similar improvements could be made for the other external packages, such as pybind11 in which we silence the warnings in the same fashion.

 * This will tell the compiler that Eigen3 headers are external and compiler warnings originating from there are silenced

	modified:       CMakeLists.txt
 * This header is not needed anymore as compiler wanrings originating from eigen3 are silenced as per the previous commit

	modified:       Backends/include/gambit/Backends/backend_types/gm2calc_1_2_0/loaded_types.hpp
	modified:       Backends/include/gambit/Backends/backend_types/gm2calc_1_3_0/loaded_types.hpp
	modified:       Backends/scripts/BOSS/configs/gm2calc_1_2_0.py
	modified:       Backends/scripts/BOSS/configs/gm2calc_1_3_0.py
	modified:       ColliderBit/include/gambit/ColliderBit/analyses/AnalysisData.hpp
	modified:       ColliderBit/include/gambit/ColliderBit/analyses/SignalRegionData.hpp
	modified:       ColliderBit/src/LHC_likelihoods.cpp
	modified:       ColliderBit/src/analyses/Analysis_ATLAS_13TeV_0LEP_139invfb.cpp
	modified:       ColliderBit/src/analyses/Analysis_ATLAS_13TeV_0LEP_13invfb.cpp
	modified:       ColliderBit/src/analyses/Analysis_ATLAS_13TeV_0LEP_36invfb.cpp
	modified:       DarkBit/src/Axions.cpp
	modified:       NeutrinoBit/include/gambit/NeutrinoBit/NeutrinoBit_rollcall.hpp
	modified:       NeutrinoBit/src/NeutrinoBit.cpp
	modified:       ScannerBit/include/gambit/ScannerBit/py_module.hpp
	modified:       ScannerBit/include/gambit/ScannerBit/python_utils.hpp
	removed:        Utils/include/gambit/Utils/begin_ignore_warnings_eigen.hpp
@ChrisJChang
Copy link
Collaborator

This works for my build, but I do not compile with Intel. If anyone does, would be great if they could try this and see if it works.

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