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

Intel/gcc makefile dependency issues

Brian_V_1
Beginner
345 Views

I'm using the Intel Compiler (v11.1.059) and having problems with the Eclipse integration not rebuilding source files which have had header changes. I've traced the issue back to the generation of makefile dependencies. g++ (v3.4.6 and v4.3.2) behaves differently from the Intel compiler for the dependency file options (detailed below).

Setup:

Header file test.h

Source file test.cpp which includes test.h

Compiled with options (among others): -MMD -MP -MF"test.d" -MT"test.d" -c -o"test.o" ../test.cpp

The dependency file output by icpc is (truncated):

test.d: ../test.cpp ../test.h

The dependency file output by g++ is(truncated):

test.d test.o: ../test.cpp ../test.h

The end result of all of this is that when the icpc version of test.d is included into the master make file, any change in test.h does not cause a rebuild of test.o (i.e. broken dependency tracking). The Intel toolchain for Eclipse uses the same dependency generator as GCC (same options automatically added to the invocation command line).

The man pages for g++ seem to indicate that the argument to MT changes the entire target string, but it appears to be prepended onto the output object instead. I tried 2 versions of g++ (v3.4.6 on a 64-bit CentOS machine which has icpc also installed, and v4.3.2 on a recent 32-bit Fedora Coremachine with no icpc).

Can the Intel compiler be updated to behave similarly to the g++ compiler in this case? Thanks.

Brian Ventre

0 Kudos
1 Reply
Dale_S_Intel
Employee
345 Views

Brian, Thanks for the succinct description. I've filed a feature request (for future reference you can refer to it as CQ150925). I'll try to respond back here when I have more information.

Thanks!

Dale

0 Kudos
Reply