Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7877 Discussions

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 hope this is useful for you.
0 Kudos
2 Replies

yes, that's correct and to be expected. The reason is that "configure" makes some test builds. Enabling "-diag-enable sc3" won't create any executable and hence the tests will fail.

Did you take a look at "inspxe-inject" tool? See documentation here:

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.

Best regards,

Georg Zitzlsberger
0 Kudos
You can see config.log to see the tests.
0 Kudos