Author Topic: Issues getting OpenMP to work  (Read 97 times)

Offline Crumble

  • Single posting newcomer
  • *
  • Posts: 2
Issues getting OpenMP to work
« on: July 04, 2018, 10:53:53 am »
Hi!

I'm currently trying to add some parallelization to a program that I wrote to get it faster, but I can't get OpenMP to work...
I've seen some similar issues on other threads, but unfortunately nothing fixed the problem for me...
I'm running Code::Blocks on Windows 7 64bits.

I've added the flag -fopenmp and included omp.h, which is normally enough from what I've read. I keep getting undefined references to whatever I call from OpenMP (from "#pragma omp parallel" to "omp_get_num_threads()").

I've also tried to link gomp (http://forums.codeblocks.org/index.php?topic=13104.0), but then I just get a "cannot find -lgomp" linker error.

Any idea how to get even the simplest thing working with OpenMP ?

Thanks!

Online stahta01

  • Lives here!
  • ****
  • Posts: 6253
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org