Compiler -fPIC fix for Intel compiler on linux -- 3rdpary static libs need this option (Bug #125)


Added by Scott Callaway about 15 years ago. Updated about 15 years ago.


Status:Done Start date:
Priority:High Due date:
Assignee:- % Done:

0%

Category:build/install
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

When using the Intel compiler ( icc & icpc ), the CMake configuration process fails to create make files that use the -fPIC option. On 64bit linux ( Redhat 5) , this causes the compilation to fail.
A proposed fix is supplied with this ticket.
This issue exists in the 2.0 release and the current trunk SVN code.


patch_revision_2670_fPIC_ICC_fix.zip (28.2 kB) Scott Callaway, 2010-02-15 02:05 am


Associated revisions

Revision 5ce99654
Added by Marina Kolpakova over 12 years ago

Merge pull request #125 from taka-no-me:perf_tests

Revision e12bd476
Added by Andrey Pavlenko about 11 years ago

Merge pull request #125 from ElenaGvozdeva:ocl_MOG2

History

Updated by Scott Callaway about 15 years ago

The proposed fix fir this problem uses the existing CV_ICC symbol to determine if the Intel ICC compiler is being used.
1> In the main CMakeList.txt file, additional checks were added to see if either the Intel compiler symbols +ICC , +INTEL_COMPILER are defined OR if it finds that 'icc' is being used as the C compiler, then it sets the internal CV_ICC symbol.
2> The CMakeLists.txt files in the 3rdparty libraries add the "-fPIC" option if this 'CV_ICC' symbol is defined.
3> The 'cxtypes.h' file was updated to include the +INTEL_COMPILER match. I have seen reports of some users that state that the +ICC flag is sometimes not set but they found the +INTEL_COMPILER flag set. Both flags are mentioned in the Intel documentation.

Possible Issue: IMHO, it may make sense to separate the symbols used by the CMake process and the symbols set in files like the cxtypes.h file. I do not see any issues at this time, but someone with more expertise in the OpenCV project may decide to separate these two. I did not want to complicate the proposed fix with this additional complexity of this possible issue.

Updated by Scott Callaway about 15 years ago

This issue is resolved by check-in revision r2701.
Marking this issue as fixed.

  • Status changed from Open to Done
  • (deleted custom field) set to fixed

Also available in: Atom PDF