User forums > Help

How to enable OpenMP with C::B?

<< < (2/3) > >>

dvb:

--- Quote from: reckless on August 16, 2010, 12:35:10 am ---the dll itself resides in mingw/bin on windows the library is in /mingw/lib/gcc/mingw32/(version number)/libgomp.dll.a -fopenmp seems to be enough on most things i tried that could actually use it :)

--- End quote ---
I've found '/mingw/lib/gcc/mingw32/(version number)/libgomp.dll.a' and added the absolute path of '....\MinGW\lib\gcc\mingw32\4.4.1\' to the search directories. I've also put '-fopenmp' but I still receive the errors...

Jenna:

--- Quote from: dvb on August 16, 2010, 12:53:33 am ---
--- Quote from: reckless on August 16, 2010, 12:35:10 am ---the dll itself resides in mingw/bin on windows the library is in /mingw/lib/gcc/mingw32/(version number)/libgomp.dll.a -fopenmp seems to be enough on most things i tried that could actually use it :)

--- End quote ---
I've found '/mingw/lib/gcc/mingw32/(version number)/libgomp.dll.a' and added the absolute path of '....\MinGW\lib\gcc\mingw32\4.4.1\' to the search directories. I've also put '-fopenmp' but I still receive the errors...

--- End quote ---
Remove the path from search directories and add gomp to the link libraries !

dvb:
thanks, seems like it's the right direction... but now I'm receiving a new error in the build log:
"Process terminated with status -1073741515"

I'm also receiving a box message (I'm on a non-english system so this may not be the exact translation):
Title: "OpenMP_Test.exe - system failure"
Message: "{Unable To Locate Component} This application has failed to start because libgomp-1.dll was not found. Re-installing the application may fix this problem."

(BTW, I want this application to be cross-platform)

Jenna:
The dll has to be in system path or in the exe's directory.

The easiest way is to add your MinGW's bin directory to the system-path.

ligand:

--- Quote from: jens on August 16, 2010, 09:30:20 am ---
--- Quote from: dvb on August 16, 2010, 12:53:33 am ---
--- Quote from: reckless on August 16, 2010, 12:35:10 am ---the dll itself resides in mingw/bin on windows the library is in /mingw/lib/gcc/mingw32/(version number)/libgomp.dll.a -fopenmp seems to be enough on most things i tried that could actually use it :)

--- End quote ---
I've found '/mingw/lib/gcc/mingw32/(version number)/libgomp.dll.a' and added the absolute path of '....\MinGW\lib\gcc\mingw32\4.4.1\' to the search directories. I've also put '-fopenmp' but I still receive the errors...

--- End quote ---
Remove the path from search directories and add gomp to the link libraries !

--- End quote ---


Obvious the above is the right way!!!

I met the same problem: in C::B, compiled a small OpenMP example but got undefined reference to `omp_get_num_threads'
I have manually compiled and linked the example using mingw-gcc, but it is OK.
  g++ testOpenMP.cpp -o a.exe -fopenmp
I then manually compiled and linked standalone respectively,
   g++ testOpenMP.cpp -c -o testOpenMP.o -fopenmp
   g++ testOpenMP.o -o a.exe
the same problem occurred. If linked with -fopenmp, it is OK.

Conclusion: C::B executed the linker to create execute, not with -fopenmp link options.  The solution is  add gomp to the link libraries

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version