Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: Andries 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
-
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.
-
the Intel C++ Compiler for Linux is free for non commercial use: http://software.intel.com/en-us/articles/non-commercial-software-development/ (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/ (http://software.intel.com/en-us/articles/using-intel-compilers-for-linux-with-ubuntu/)
together with OpenMP (http://www.openmp.org/ (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"