Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Code fails at runtime - can't find omp_lib(Can't tell compiler/linker where amp_lib is, I think.)
Code fails at runtime - can't find omp_lib [message #1840253] Fri, 09 April 2021 20:43 Go to next message
Robert Lockwood is currently offline Robert LockwoodFriend
Messages: 45
Registered: October 2010
Location: Riverside, CA, USA
Member
I'm trying to relearn Fortran (and make) after 35 years or so using f95 and OpenMP.

My test code (copy and paste) builds with no errors but at runtime fails with the error message: 'There are no files that export a module named omp_lib'

I'm assuming that this has something to do with the statement:

use, intrinsic :: opt_lib


but I might be wrong.

I've provided a path to first of the two places where I found include files

/usr/local/Cellar/gcc/10.2.0_4/lib/gcc/10/gcc/x86_64-apple-darwin20/10.2.0/finclude/omp_lib.h
/usr/local/Cellar/gcc/10.2.0_4/lib/gcc/10/gcc/x86_64-apple-darwin20/10.2.0/finclude/omp_lib.h


That did not work.
I'm on Big Sur and using OpenMP installed with Homebrew and gfortran.

How do I interpret the error and what fix is available.
TIA

[Updated on: Fri, 09 April 2021 20:43]

Report message to a moderator

Re: Code fails at runtime - can't find omp_lib [message #1840295 is a reply to message #1840253] Sun, 11 April 2021 22:34 Go to previous message
David VavraFriend
Messages: 1407
Registered: October 2012
Senior Member
You likely need to add the path to libomp.so (what it's called in Linux anyway) to the dynamic library search path.
I have no idea how you do this in macOS .

A liberal use of the magical -fopenmp switch during compile and link may solve this
https://gcc.gnu.org/onlinedocs/libgomp/Enabling-OpenMP.html

UPDATE:
All that was needed to get the OpenMP Hello World example to compile and link
was to add -fopenmp to the compile and link steps

  • g++ -O0 -g3 -Wall -c -fmessage-length=0 -fopenmp -MMD -MP -MF"src/OpenMP-HelloWorld.d" -MT"src/OpenMP-HelloWorld.o" -o "src/OpenMP-HelloWorld.o" "../src/OpenMP-HelloWorld.cpp"
  • g++ -fopenmp -o "OpenMP-HelloWorld" ./src/OpenMP-HelloWorld.o


[Updated on: Mon, 12 April 2021 08:29]

Report message to a moderator

Previous Topic:cannot create temporary il file
Next Topic:Obscure error while attempting to build first "Hello World" program
Goto Forum:
  


Current Time: Tue Dec 07 13:14:33 GMT 2021

Powered by FUDForum. Page generated in 0.01745 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top