Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openmp #331

Closed
jboulanger opened this issue Feb 21, 2014 · 7 comments
Closed

openmp #331

jboulanger opened this issue Feb 21, 2014 · 7 comments

Comments

@jboulanger
Copy link

Hi,

I had hard time to cross compile code using openmp.

I found discussion (2009) about the support of openmp on the mailing list but the current status was unclear.

By default the gcc.mk has openmp disabled (--disable-libgomp) and the default thread model is win32 (which i read is incompatible with gcc implementation of libgomp). I found using
--enable-threads=posix
--enable-libgomp \

  • adding pthreads as a dependency working (although a cyclic dependency warning is triggered).

An enhancement would be to have the possibility to enable openmp as an global option... if this makes sense. At least document these steps.

Otherwise many thanks for this great project.

@tonytheodore
Copy link
Member

Thanks for the feedback. If I recall correctly, libgomp was disabled and moved into it's own package as it never really worked correctly - pthreads-w32 has since been updated so it's worth revisiting. There are plans to allow for user-defined variants, but if this is now working I'd rather make it the default.

Do you know if the standalone libgomp package works and/or if there's a test suite that we could use to verify either that or enabling it in the gcc build?

@jboulanger
Copy link
Author

Finally, the previous trick was not enough to use the x64_86-w64-mingw toolchain so i went for another try with

  • compile gcc with default .mk (make gcc)
  • compile libgomp (make liggomp)
  • modifiy gcc.mk to use posix thread and enable libgomp
  • compile gcc (make gcc)
  • continue with other libs
  • compile my code (./configure detects openmp as enabled 👍 )
  • enjoy running the program with huge allocation and many threads

The src directory contains already a test from openmp website (src/libgomp-test.c)

@tonytheodore
Copy link
Member

enjoy running the program with huge allocation and many threads

Good to hear.

I tidied up the standalone libgomp and found an easily accessible validation suite that is now included in MXE.

This isn't intended to be an absolute test, just a relative one to see the impact of different configurations. Testing with i686-w64-mingw32 on Win7, both the standalone libgomp and the method above return the same results:

Total tests: 218  Total Failed: 20 Total Passed: 198

I'll try an inline build with gcc and see if there's any difference.

@tonytheodore
Copy link
Member

I had hard time to cross compile code using openmp.

Were you initially trying to build fortran code?

@jboulanger
Copy link
Author

the code is in c++ (sorry for the delay)

@TimothyGu
Copy link
Member

@jboulanger are you having any further problems with the existing libgomp infrastructure? There are multiple packages using OpenMP successfully in MXE already, like flann. If not, I'll close the issue.

@jboulanger
Copy link
Author

No more problem with openmp and MXE. You can close the issue. Thanks a lot for the support!
Edit:
1/ You still need to modify the gcc.mk as openmp is disabled by default (line 396 gcc.mk). Applying the earlier (Feb 21) described step allow to use openmp (re tested today).
2/ disabling openmp will probably no induce a fail in a compilation benchmark as it can be safely ignored by gcc.
3/ Again this is not a bug but more about documentation i think.
4/ Sorry for commenting on a closed issue

tonytheodore added a commit to tonytheodore/mxe that referenced this issue Oct 27, 2015
* fixes "~winpthreads changes ~pthread_signal.h" etc. reported by build-pkg
  mingw-w64 installs dummy headers if winpthreads isn't built
* enables libgomp to avoid double-build (see mxe#331)
* no change in openmp-validation (still 20 failures - taken with a grain of
  salt as the batch file test runner isn't a reliable perl substitute)
* pthreads virtual package kept for future testing
tonytheodore added a commit to tonytheodore/mxe that referenced this issue Oct 27, 2015
…libgomp

* fixes "~winpthreads changes ~pthread_signal.h" etc. reported by build-pkg
  mingw-w64 installs dummy headers if winpthreads isn't built
* enables libgomp to avoid double-build (see mxe#331)
* no change in openmp-validation (still 20 failures - taken with a grain of
  salt as the batch file test runner isn't a reliable perl substitute)
* pthreads virtual package kept for future testing
tonytheodore added a commit to tonytheodore/mxe that referenced this issue Oct 27, 2015
…libgomp

* fixes "~winpthreads changes ~pthread_signal.h" etc. reported by build-pkg
  mingw-w64 installs dummy headers if winpthreads isn't built
* enables libgomp to avoid double-build (see mxe#331)
* no change in openmp-validation (still 20 failures - taken with a grain of
  salt as the batch file test runner isn't a reliable perl substitute)
* pthreads virtual package kept for future testing
tonytheodore added a commit to tonytheodore/mxe that referenced this issue Oct 31, 2015
…libgomp

* fixes "~winpthreads changes ~pthread_signal.h" etc. reported by build-pkg
  mingw-w64 installs dummy headers if winpthreads isn't built
* enables libgomp to avoid double-build (see mxe#331)
* no change in openmp-validation (still 20 failures - taken with a grain of
  salt as the batch file test runner isn't a reliable perl substitute)
* pthreads virtual package kept for future testing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants