Author Topic: Settings for Installing Intel Compiler v11  (Read 9351 times)

Offline cdemirkir

  • Single posting newcomer
  • *
  • Posts: 7
Settings for Installing Intel Compiler v11
« on: March 28, 2009, 10:44:23 pm »
Hi Everyone,

   I'd like to use Intel Compiler v11 as default compiler in C::B. I applied the similar settings defined in http://wiki.codeblocks.org/index.php?title=Installing_a_supported_compiler#Intel_C.2B.2B_Compiler as the following

For executables:
C:\Program Files\Microsoft Visual Studio 8\VC\bin
C:\Program Files\Microsoft Visual Studio 8\Common7\IDE
Z:\Libraries\Microsoft SDKs\Windows\v6.1\bin

For includes:
C:\Program Files\Intel\Compiler\11.0\066\cpp\include
C:\Program Files\Microsoft Visual Studio 8\VC\include
Z:\Libraries\Microsoft SDKs\Windows\v6.1\Include

For libraries :
C:\Program Files\Intel\Compiler\11.0\066\cpp\bin\ia32\lib
C:\Program Files\Microsoft Visual Studio 8\VC\lib
Z:\Libraries\Microsoft SDKs\Windows\v6.1\Lib
 
   Then I tried the compile a source which uses OpenCV library include file, cxmisc.h, and gives an error in the following preprocessor check lines of the header file and exits, which means it goes the last #elif condition. When I check if the C::B can find the definition of WIN32, it can find the definition of this macro in Ole2.h of the SDK header but it can the definition of _MSC_VER and therefore I guess, it it goes till last #elif preprocessor condition which is equal to the error condition. I can not see the reason of this error. I'd be grateful to anyone who can help me resolve this issue ?

Regards
Cem

/****************************************************************************************\
*                                  Common declarations                                   *
\****************************************************************************************/

/* get alloca declaration */
#ifdef __GNUC__
    #undef alloca
    #define alloca __builtin_alloca
#elif defined(WIN32) || defined(WIN64)
    #if defined(_MSC_VER) || defined(__BORLANDC__)
        #include <malloc.h>
    #endif
#elif defined HAVE_ALLOCA_H
    #include <alloca.h>
#elif defined HAVE_ALLOCA
    #include <stdlib.h>
#elif   <------------GIVES ERROR AT THIS CONDITION
    #error
#endif

I can not find the reason of that _MSCVER can not be recognized by the compiler ....
« Last Edit: March 29, 2009, 08:18:35 am by cdemirkir »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Settings for Installing Intel Compiler v11
« Reply #1 on: March 29, 2009, 04:23:53 am »
can intel compiler build OpenCV project sucessfully?
I have used MinGW and Visual C++ compiler, but I never heart it can be compiled by Intel compiler in the OpenCV forum.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline cdemirkir

  • Single posting newcomer
  • *
  • Posts: 7
Re: Settings for Installing Intel Compiler v11
« Reply #2 on: March 29, 2009, 08:12:12 am »
can intel compiler build OpenCV project sucessfully?
I have used MinGW and Visual C++ compiler, but I never heart it can be compiled by Intel compiler in the OpenCV forum.

OpenCV can be compiled with Intel Compiler, see the INSTALL file in OpenCV root directory to read the details.

Offline cdemirkir

  • Single posting newcomer
  • *
  • Posts: 7
Re: Settings for Installing Intel Compiler v11
« Reply #3 on: March 29, 2009, 08:14:05 am »
Eventhough it looks like #defines aren't set right for some unknown reason, you may be able to force it to work.  If I were you, I'd comment out the whole #ifdef block and try replacing it one by one with one of those three #includes until it works (or not!!!). Try #include <malloc.h>, if it doesn't like that, try #include <stdlib.h>, and finally try #include <alloca.h>

Not a great answer I know, just something to try until someone who knows what they are doing can help!!!

Good luck. Lemme know how you like the Intel compiler. I really want to try it.

The reason for preferring Intel Compiler to GCC, GCC produces compiling problems with OpenMP directives.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Settings for Installing Intel Compiler v11
« Reply #4 on: March 29, 2009, 09:51:36 am »
The reason for preferring Intel Compiler to GCC, GCC produces compiling problems with OpenMP directives.

For testing, I just successfully built svn opencv libraries with TDM-Mingw 4.3.3 with OpenMP enabled :D.
No compiling problems happened if you follow the readme supplied my TDM package.

You can have a try.
Good luck.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline cdemirkir

  • Single posting newcomer
  • *
  • Posts: 7
Re: Settings for Installing Intel Compiler v11
« Reply #5 on: March 29, 2009, 11:17:14 am »
The reason for preferring Intel Compiler to GCC, GCC produces compiling problems with OpenMP directives.

For testing, I just successfully built svn opencv libraries with TDM-Mingw 4.3.3 with OpenMP enabled :D.
No compiling problems happened if you follow the readme supplied my TDM package.

You can have a try.
Good luck.

Another reason for preferring Intel compiler, I need a compiler which can be run at two different operating systems,Windows and Linux, without OpenMP compilation problem. I like to develop and stay in Windows, but at the same time I need the application to run in Linux, Therefore I develop the code in Windows using Intel Compiler and building it with the same compiler in Linux.

Regards
Cem

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Settings for Installing Intel Compiler v11
« Reply #6 on: March 29, 2009, 11:49:45 am »
I believe you have miss something.
TDM-Mingw is a windows version of GCC.
Which compiler problem did you have when trying to use OpenCV in linux?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline cdemirkir

  • Single posting newcomer
  • *
  • Posts: 7
Re: Settings for Installing Intel Compiler v11
« Reply #7 on: March 29, 2009, 01:43:47 pm »
I believe you have miss something.
TDM-Mingw is a windows version of GCC.
Which compiler problem did you have when trying to use OpenCV in linux?


I surely used GCC in the first try in Linux, but It gives compilation errors for OpenMP clauses separated with comma, therefore I moved to the Intel compiler ....
« Last Edit: March 29, 2009, 01:45:36 pm by cdemirkir »

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Settings for Installing Intel Compiler v11
« Reply #8 on: March 29, 2009, 01:56:41 pm »
Strange problem.
I haven't work under linux, but I think you have use an old version of GCC. Even the TDM-mingw( windows portion of GCC) can compile and build opencv successfully. So, I suggest you should try a newer version.

I do believe the newer GCC can do this, by the way, a lot of developer of OpenCV were working under linux, if you have problem with GCC, you can write a bug report to sourceforge. They will give you a kind response.

I have search the document of openmp. see here

http://gcc.gnu.org/projects/gomp/

Quote
Status

June 6, 2008

    The gomp-3_0-branch has been merged into SVN mainline, so GCC 4.4 and later will feature OpenMP v3.0 support


Good luck!
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline cdemirkir

  • Single posting newcomer
  • *
  • Posts: 7
Re: Settings for Installing Intel Compiler v11
« Reply #9 on: March 29, 2009, 07:05:47 pm »
Strange problem.
I haven't work under linux, but I think you have use an old version of GCC. Even the TDM-mingw( windows portion of GCC) can compile and build opencv successfully. So, I suggest you should try a newer version.

I do believe the newer GCC can do this, by the way, a lot of developer of OpenCV were working under linux, if you have problem with GCC, you can write a bug report to sourceforge. They will give you a kind response.

I have search the document of openmp. see here

http://gcc.gnu.org/projects/gomp/

Quote


Status

June 6, 2008

    The gomp-3_0-branch has been merged into SVN mainline, so GCC 4.4 and later will feature OpenMP v3.0 support


Good luck!

Thanks for your interest ... by the way ... Do you know how a static boost library, such as  libboost_filesystem-mgw43-s.lib, can be linked ? Mingw ld.exe can not find, libboost_filesystem-mgw43-mt-s-1_38.lib, when I add it to the linker line at the C::B. It wants dynamic link library, boost_filesystem-mgw43-mt-1_38. How can I build my application with a static boost library ?

Regards
Cem

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Settings for Installing Intel Compiler v11
« Reply #10 on: March 29, 2009, 07:26:27 pm »
Thanks for your interest ... by the way ... Do you know how a static boost library, such as  libboost_filesystem-mgw43-s.lib, can be linked ? Mingw ld.exe can not find, libboost_filesystem-mgw43-mt-s-1_38.lib, when I add it to the linker line at the C::B. It wants dynamic link library, boost_filesystem-mgw43-mt-1_38. How can I build my application with a static boost library ?

Hi Cem,

read this thread: http://forums.codeblocks.org/index.php/topic,10257.0.html, it might give you the answer.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Settings for Installing Intel Compiler v11
« Reply #11 on: March 29, 2009, 08:22:02 pm »
I can not find the reason of that _MSCVER can not be recognized by the compiler ....
If you are using the Intel compiler I wonder if this sets the _MSCVER flag at all. IMHO this is set by the Visual Studio C compiler. Intel might set another define... (I don't know/use the Intel compiler though...). Notice that MSC stands for Microsoft Compiler. Intel might not really want to claim to be a Microsoft compiler... right?! ;-)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ