Author Topic: Multi threaded apps & Intel C++ compiler  (Read 6894 times)

Offline Andries

  • Single posting newcomer
  • *
  • Posts: 4
Multi threaded apps & Intel C++ compiler
« on: April 14, 2008, 03:38:47 pm »
Dear All,

I really love C::B. It's getting time to abandon Visual C++ 6.0 as it is getting outdated, and nobody wants to make the transfer to the .NET misery.

Under Linux I use gcc in C::B, and so far I was also using MINGW gcc under Windows, until I recently got a dual core laptop and wanted to use the two cores to reduce the waiting time of my simulations, and found out that MINGW does not support multi-threading somewhere.

Hence, I am looking for a C++ compiler producing fast executables for long numerical work other than gcc that still allows me to use C::B, and there I came across the Intel compiler on my hard disk (don't want to use the Ms compiler of VC 6.0; don't want to install anything newer from Ms). 

In the Build option list, I don't see an entry to tell C::B it should do code generation for a multi-threaded rather than a single-threaded app. Is there any way around this?

Regards, A

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Multi threaded apps & Intel C++ compiler
« Reply #1 on: April 15, 2008, 10:22:46 am »
In the Build option list, I don't see an entry to tell C::B it should do code generation for a multi-threaded rather than a single-threaded app. Is there any way around this?
You can setup custom compiler/linker options within the compiler/linker settings of your project / target. So if you know the Intel option, just use it there. Unfortunately I don't know the Intel compiler, so I can't tell you the right option. :-(

BTW: Within the compiler settings you can setup how many processes C::B shall use for the compilation. This allow for example running two build steps in parallel. This has nothing to do with a muli-threaded application (and won't work with all compilers) but may be of help anyways in terms of compilation speed as you have a dual-core processor.
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

Offline franzl

  • Single posting newcomer
  • *
  • Posts: 5
Re: Multi threaded apps & Intel C++ compiler
« Reply #2 on: November 11, 2009, 09:43:08 pm »
the Intel C++ Compiler for Linux is free for non commercial use: http://software.intel.com/en-us/articles/non-commercial-software-development/
how to install for ubuntu: http://software.intel.com/en-us/articles/using-intel-compilers-for-linux-with-ubuntu/

together with OpenMP (http://www.openmp.org/) it produces very fast binaries, perfect for numerical simulations

to use the Intel Compiler in C::B settings are (tested for C::B build 5859 and Intel C++ Compiler 11.1.046 on ubuntu 9.10 amd64 and suse 11.1 amd64):
  • settings - compiler and debugger - toolchain executables: insert path e.g. "/opt/intel/Compiler/11.1/046/bin/intel64"
  • settings - compiler and debugger - search directories - compiler: add path, e.g. "/opt/intel/Compiler/11.1/046/include" and "/opt/intel/Compiler/11.1/046/include/intel64"
  • settings - compiler and debugger - search directories - linker: add path, e.g. "/opt/intel/Compiler/11.1/046/lib/intel64"
  • project - build options - selected compiler: select "Intel C/C++ Compiler"

for parallel programming with OpenMP (of course first you have to add some "#pragma omp parallel" at the right places in your source code)
  • project - build options - compiler settings - compiler flags: enable "process OpenMP directives"
  • project - build options - linker settings - other linker options: add "-openmp"
« Last Edit: November 12, 2009, 02:30:41 am by franzl »