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

icpc: error #10014: problem during multi-file optimization compilation (code 1)

Ildar_S_
Beginner
1,376 Views

Hi!

Try to compile your project, but Intel C++ Compiler 13.1 shows an error:

ipo: error #11063: ipp_DFT.o : Amplitude(Ipp64fc&, double&, double)(_Z9AmplitudeR7Ipp64fcRdd) already defined in main.o
icpc: error #10014: problem during multi-file optimization compilation (code 1)

Without -ipo flag:

ipp_DFT.o: In function `Amplitude(Ipp64fc&, double&, double)':
/home/Jam/build-FFT_filter-Linux_QT_5_0_2_LinuxICC_64bit-Debug/../../FFT_filter/ipp_tbb.h:20: multiple definition of `Amplitude(Ipp64fc&, double&, double)'
main.o:/home/Jam/build-FFT_filter-Linux_QT_5_0_2_LinuxICC_64bit-Debug/../../FFT_filter/ipp_tbb.h:20: first defined here
make: *** [FFT_filter] Error 1

What could be the problem?

Tried to use the flag -ip, but to no avail.

Tech info:

icpc version 13.1.1 (gcc version 4.6.0 compatibility);

flags: -O3 -ipo -use-intel-optimized-headers -xCORE-AVX-I -axCORE-AVX-I -openmp -restrict -std=c++11

Thanks!

0 Kudos
10 Replies
SergeyKostrov
Valued Contributor II
1,376 Views
>>Try to compile your project, but Intel C++ Compiler 13.1 shows an error: >> >>ipo: error #11063: ipp_DFT.o : Amplitude(Ipp64fc&, double&, double)(_Z9AmplitudeR7Ipp64fcRdd) already >>defined in main.o >>icpc: error #10014: problem during multi-file optimization compilation (code 1) What project are you talking about? Please specify. Is there a small reproducer? >>...FFT_filter/ipp_tbb.h:20: multiple definition of `Amplitude( Ipp64fc&, double&, double )' Did you implement codes for Amplitude function in ipp_tbb.h header file? If Yes, move these codes to a cpp-file and I expect that you should have a ipp_tbb.cpp file.
0 Kudos
TimP
Honored Contributor III
1,376 Views

As I wild guess, I wonder why you specify CORE-AVX-I twice.  It seems you are asking for run-time detection of "IVB" corei7-3 and to default to the same if it isn't present (but possibly with the order of options backwards).  If CORE_AVX-I does anything more than plain AVX, it would only to be to enable the special intrinsics (AES).  -xAVX or -mAVX would be more straightforward.  If you wanted a dual path build for AVX and SSE4.1, I believe it would be -axAVX -xSSE4.1  As Sergey said, we would need a reproducer.

0 Kudos
Ildar_S_
Beginner
1,376 Views

Hi!

Thanks for the reply. Sorry for the "Tried to build your project," it's a typo.
The situation is the following, I'm trying to apply a function of the Intel TBB library, but the compiler complains about multiple definitions. After going through all the choices I have made to the code to compile.

Below I have attached the two working version and a version that does not work. As an example, bring the code of page http://software.intel.com/sites/products/documentation/doclib/tbb_sa/help/tbb_userguide/parallel_for.htm

0 Kudos
SergeyKostrov
Valued Contributor II
1,376 Views
>>After going through all the choices I have made to the code to compile. >> >>Below I have attached the two working version and a version that does not work. Thanks for the update. I could look at the project and what exactly concerns you now? Is there something else to look at?
0 Kudos
Ildar_S_
Beginner
1,376 Views

I want to understand why there is an error of multiple definitions. And just want to inform about the error, all of a sudden it's another bug in the compiler.

0 Kudos
Ildar_S_
Beginner
1,376 Views

I want to understand why the compiler generates an error # 10014.

0 Kudos
SergeyKostrov
Valued Contributor II
1,376 Views
>>...I want to understand why the compiler generates an error # 10014. You've added tbb_examples.h header file twice. That is, in the makefile and in main.cpp source file. The fixed versions of your project don't have tbb_examples.h in the makefile. Header files should be included in source files ( C or C++ ). Note: The fixed version 2 doesn't have that header file at all.
0 Kudos
Ildar_S_
Beginner
1,376 Views

Hmm, I thought that all cleaned up makefile from a double including the header file. But I have the following situation, there is a project on work, at QtLibraries, and no makefile any mention of the inclusion of header files twice. I'll have another look at my makefile project Qt. But anyway thank you!

0 Kudos
mecej4
Honored Contributor III
1,376 Views

Your makefile in the "..broken.." directory is defective. A header file is usually not a separately compilable unit by itself, since in normal usage the contents of the header files are merged into the rest of the C/C++ source by the preprocessor before being handed to the compiler pass. Secondly, the conventions of the compiler driver (on most OSes) are that a file with an extension other than  '.c'  or '.cpp' is not a source file and is passed as-is to the linker. The linker, in turn, does not know what to do with a header file.


In such situations, the -n option of the make program is quite useful. Look at the output of make -n on your makefile. Do the resulting commands look sensible? If not, fix the makefile.

0 Kudos
SergeyKostrov
Valued Contributor II
1,376 Views
>>...Secondly, the conventions of the compiler driver (on most OSes) are that a file with an extension other than '.c' or '.cpp' is not >>a source file and is passed as-is to the linker. The linker, in turn, does not know what to do with a header file... Linkers do not work with c, or cpp, or h, or hxx, etc files and they always process object or library files. If any of source files would be passed to the Linker a message like, Bad Input Format ( or something like this ), would be generated.
0 Kudos
Reply