WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: gcc refuses to find libgomp.spec  (Read 162 times)

Offline CardealRusso

  • Full Member
  • ***
  • Posts: 181
gcc refuses to find libgomp.spec
« on: December 12, 2024, 08:39:02 AM »
hi

when trying to pass -fopenmp to gcc it spits:
gcc: fatal error: cannot read spec file ‘libgomp.spec’: No such file or directory
despite being present in /usr/local/lib (it's part of gcc_libs-dev.tcz)

“-L/usr/local/lib -lgomp” works but needs to pass some arguments to the compiler

it would help a lot to know the destination that gcc is looking for in order to be able to link to it.

Offline CardealRusso

  • Full Member
  • ***
  • Posts: 181
Re: gcc refuses to find libgomp.spec
« Reply #1 on: December 12, 2024, 08:55:27 AM »
nvm, got it with sudo ln -s /usr/local/lib/libgomp.spec /lib/x86_64-pc-linux-gnu/13.2.0/libgomp.spec (need sudo mkdir -p /lib/x86_64-pc-linux-gnu/13.2.0/)

strace -e trace=access gcc -fopenmp -o hello hello.c results: (he looks everywhere but local)
Code: [Select]
access("/tmp/tcloop/gcc/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.2.0/libgomp.spec", R_OK) = -1 ENOENT (No such file or directory)
access("/tmp/tcloop/gcc/usr/local/bin/../lib/gcc/libgomp.spec", R_OK) = -1 ENOENT (No such file or directory)
access("/tmp/tcloop/gcc/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.2.0/../../../../x86_64-pc-linux-gnu/lib/x86_64-pc-linux-gnu/13.2.0/libgomp.spec", R_OK) = -1 ENOENT (No such file or directory)
access("/tmp/tcloop/gcc/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.2.0/../../../../x86_64-pc-linux-gnu/lib/../lib/libgomp.spec", R_OK) = -1 ENOENT (No such file or directory)
access("/tmp/tcloop/gcc/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.2.0/../../../x86_64-pc-linux-gnu/13.2.0/libgomp.spec", R_OK) = -1 ENOENT (No such file or directory)
access("/tmp/tcloop/gcc/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.2.0/../../../../lib/libgomp.spec", R_OK) = -1 ENOENT (No such file or directory)
access("/lib/x86_64-pc-linux-gnu/13.2.0/libgomp.spec", R_OK) = -1 ENOENT (No such file or directory)
access("/lib/../lib/libgomp.spec", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/x86_64-pc-linux-gnu/13.2.0/libgomp.spec", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/../lib/libgomp.spec", R_OK) = -1 ENOENT (No such file or directory)
access("/tmp/tcloop/gcc/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.2.0/../../../../x86_64-pc-linux-gnu/lib/libgomp.spec", R_OK) = -1 ENOENT (No such file or directory)
access("/tmp/tcloop/gcc/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.2.0/../../../libgomp.spec", R_OK) = -1 ENOENT (No such file or directory)
access("/lib/libgomp.spec", R_OK)       = -1 ENOENT (No such file or directory)
access("/usr/lib/libgomp.spec", R_OK)   = -1 ENOENT (No such file or directory)

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11691
Re: gcc refuses to find libgomp.spec
« Reply #2 on: December 12, 2024, 05:17:16 PM »
Hi CardealRusso
... (he looks everywhere but local)
Code: [Select]
----- Snip -----
access("/tmp/tcloop/gcc/usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/13.2.0/../../../../lib/libgomp.spec", R_OK) = -1 ENOENT (No such file or directory)
 ----- Snip -----
It looks like it is checking local, but it's checking local in the gcc extension.
The above simplfies to:
Code: [Select]
/tmp/tcloop/gcc/usr/local/lib/libgomp.specBut libgomp.spec is provided by gcc_libs-dev.tcz

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 289
Re: gcc refuses to find libgomp.spec
« Reply #3 on: December 12, 2024, 08:11:44 PM »
I had this trouble when making the links-full.tcz extension for x86_64 and fixed it (according to my notes) by adding "-B/usr/local/lib" to CFLAGS and CXXFLAGS:
Code: [Select]
export CFLAGS="-mtune=generic -Os -pipe -B/usr/local/lib" CXXFLAGS="-mtune=generic -Os -pipe -B/usr/local/lib" LDFLAGS="-Wl,-O1"

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14841
Re: gcc refuses to find libgomp.spec
« Reply #4 on: December 13, 2024, 10:04:28 AM »
If you symlink libgomp.spec to /usr/lib for the purposes of building an app, the app will find libgomp in /usr/local/lib once built.