openmp program does not run from IDE, but runs from explorer
Posted: Wed Jun 17, 2015 3:25 pm
Hello guys,
I have a problem with running a program from the IDE.
I am trying to work with openmp, so I installed default fresh installation of codelite and TDM-GCC (with openmp support).
Now, this small testing openmp program:
I have 3 options:
1, if I want to build and run the program (ctrl+F9) , the build process runs ok, but I get an error about missing libgomp_64-1.dll and the output window shows just "press any key to continue".
2, When I find the built .exe file in the debug folder and click it, I get some output "Hello from thread 0, nthreads 1" - output ok, but the multithread does not work.
3, when I compile it manually with g++, whoa - I get two lines "Hello from thread 1, nthreads 2" and "Hello from thread 0, nthreads 2" - output works and multi-thread part too.
Now, what am I doing wrong with setting of codelite? I added the fopenmp library to get rid of the error "Undefined reference to `omp_get_max_threads_'", now the compilation
and building is without any errors in the "Build" window.
I selected console and g++ compiler during the workspace creation.
May this be some 32/64 bit problem? I am using windows 7 x64, but the compiler is TDM-GCC-32 and this field cannot be changed in the project details.
thank you for your suggestions, and please be patient - I am total newbie to codelite (have some C experience though).
I have a problem with running a program from the IDE.
I am trying to work with openmp, so I installed default fresh installation of codelite and TDM-GCC (with openmp support).
Now, this small testing openmp program:
Code: Select all
#include <omp.h>
#include <stdio.h>
int main() {
#pragma omp parallel
printf("Hello from thread %d, nthreads %d\n", omp_get_thread_num(), omp_get_num_threads());
}
I have 3 options:
1, if I want to build and run the program (ctrl+F9) , the build process runs ok, but I get an error about missing libgomp_64-1.dll and the output window shows just "press any key to continue".
2, When I find the built .exe file in the debug folder and click it, I get some output "Hello from thread 0, nthreads 1" - output ok, but the multithread does not work.
3, when I compile it manually with g++, whoa - I get two lines "Hello from thread 1, nthreads 2" and "Hello from thread 0, nthreads 2" - output works and multi-thread part too.
Now, what am I doing wrong with setting of codelite? I added the fopenmp library to get rid of the error "Undefined reference to `omp_get_max_threads_'", now the compilation
and building is without any errors in the "Build" window.
I selected console and g++ compiler during the workspace creation.
May this be some 32/64 bit problem? I am using windows 7 x64, but the compiler is TDM-GCC-32 and this field cannot be changed in the project details.
thank you for your suggestions, and please be patient - I am total newbie to codelite (have some C experience though).