You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that these flags may have arguments (values). Since the replacement is simple, any such value is left hanging.
For instance debian packages are built with standard CFLAGS intended to improve security (build hardening), determined by dpkg-buildflags, for instance
In cmake builds this is passed to CMAKE_C_FLAGS (and CMAKE_CXX_FLAGS etc). So adios2 gets built with -Werror=format-security. Then, once testing/install/CMakeLists.txt has had its way, the compilation line gets rendered with c++ -Wformat =format-security, which obviously fails. The error message is
cc: warning: =format-security: linker input file unused because linking not done
cc: error: =format-security: linker input file not found: No such file or directory
from trying to interpret =format-security on its own as a valid linker flag.
There are a handful of options for fixing it, depending on what the intention for removing -Werror was in the first place.
If it's just -Werror itself, add a tailing space "-Werror " (and likewise "-Wall "). If any -Werror is meant to be removed then use a wildcard "-Werror*" (or .*, whatever the wildcard syntax needs to be in this context)
A more robust solution might be to parse the flags individually, e.g. using add_definitions and remove_definitions.
Another option is to append -Wno-error rather than removing -Werror (likewise -Wno-all)
To Reproduce
export CMAKE_CXX_FLAGS="-Werror=format-security"
cmake configure, build
ctest
See error
Expected behavior
tests should pass. The names of CFLAGS should not be removed leaving their values hanging in place.
Desktop (please complete the following information):
@drew-parsons many thanks for reporting this. This indeed has been a nightmare which has probably caused issues with the generation of the adios2-config script needed for non-cmake applications to find adios2 includes and libraries.
Another option is to append -Wno-error rather than removing -Werror (likewise -Wno-all)
The configuration file for testing/install removes -Werror (and -Wall) blindly from CFLAGS (CXXFLAGS),
ADIOS2/testing/install/CMakeLists.txt
Line 85 in 06c8fec
The problem is that these flags may have arguments (values). Since the replacement is simple, any such value is left hanging.
For instance debian packages are built with standard CFLAGS intended to improve security (build hardening), determined by
dpkg-buildflags
, for instanceIn cmake builds this is passed to CMAKE_C_FLAGS (and CMAKE_CXX_FLAGS etc). So adios2 gets built with
-Werror=format-security
. Then, once testing/install/CMakeLists.txt has had its way, the compilation line gets rendered withc++ -Wformat =format-security
, which obviously fails. The error message isfrom trying to interpret
=format-security
on its own as a valid linker flag.There are a handful of options for fixing it, depending on what the intention for removing -Werror was in the first place.
If it's just
-Werror
itself, add a tailing space"-Werror "
(and likewise"-Wall "
). If any -Werror is meant to be removed then use a wildcard"-Werror*"
(or .*, whatever the wildcard syntax needs to be in this context)A more robust solution might be to parse the flags individually, e.g. using add_definitions and remove_definitions.
Another option is to append
-Wno-error
rather than removing-Werror
(likewise-Wno-all
)To Reproduce
Expected behavior
tests should pass. The names of CFLAGS should not be removed leaving their values hanging in place.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: