Linking cython code against libiomp5 instead of libgomp

39 views
Skip to first unread message

torr...@gmail.com

unread,
Dec 19, 2022, 4:17:52 PM12/19/22
to cython-users
Hi,

is it possible to link cython code which uses OMP (say stuff like "prange" statements) and has been translated into *.c files using gcc against libiomp5 instead of libgomp?

My apologies if I'm violating netiquette by stating that I have tried to get an answer for this previously on stackoverflow, with however no help. Since my post there is pretty verbose, and since I'd like to refrain from copying stuff, I would hope that someone from the cython-users group here would be willing to hop over to that post and let me know if you have been able to use the combination of cython, gcc, and libiomp5 successfully ... and how?

Thx.
Mark Xaver

D Woods

unread,
Dec 22, 2022, 3:00:15 AM12/22/22
to cython-users
Hi Mark,

Not 100% sure (haven't tested this, and have no way to easily test this) but I think:
1. Do the c compiling and linking as separate steps.
2. In the compiling step, include `-fopenmp`.  Without this I think GCC will just ignore OpenMP pragmas.
3. In the linking step do -liomp5 to link to the intel implementation.

I think it's step 2 that you're missing.

torr...@gmail.com

unread,
Jan 10, 2023, 1:15:29 AM1/10/23
to cython-users
Hi D Woods,

finally able to get back here. Thx. so much for your suggestion. That was right on the money. If you like, see also here

Best, Mark
Reply all
Reply to author
Forward
0 new messages