can't easily set CFLAGS to -diag-enable on packages with GNU autotools
Hi, I have this package built using GNU autotools and I would like to check the code for potential issues.
To do it I am supposed to set CC to icc and CFLAGS into '-diag-enable sc3'. This is the usual approach to change compiler and compiler flags.
However when doing that I got an error from the base configure script.
I think the main issue is that the configure test runs a quick hello world example unsuccessfuly.
CC=icc CFLAGS="-diag-enable sc3" ./configure
... configure: error: C compiler cannot create executables
Note: When trying with the GNU-style '-diag-enable=sc3' the compiler reports invalid syntax. Also long options should use double dash, if I recall correctly. That's another assumption that may be affecting the configure script.
So, I can't really use the GNU build tools configuration options to do static checking easily, as workaround I'm manually changing the Makefile to compile with the required flags. But it is far from being quick and easy.
It will be more useful to have a portable parameter handling approach, maybe using GNU tools to do it. (for instance, GNU lib C provides the 'argp' interface). There are lots of benefits on doing this, as most of the open source packages use GNU build tools for portable distribution.
I think it may be a good thing to incorporate in the tool.
I'd recommend to make the configuration with Intel compiler without the option from above (best: no optimization). If that works you kick-off the build with "inspxe-inject" tool. Afterwards you can run "inspxe-runsc" to create the reports. This works well for most builds. Give it a try and let me know.