Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 892825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:07:20+00:00 2026-05-15T14:07:20+00:00

I have a c99 function that uses openmp, which works as expected. I also

  • 0

I have a c99 function that uses openmp, which works as expected. I also wrote a python interface using ctypes which causes the problem. Ctypes/python can not find the library for openmp. Here is the error message:

File "foo.py", line 2, in <module>
    foobar=cdll.LoadLibrary("./libfoo.so")
  File "/usr/lib/python2.6/ctypes/__init__.py", line 431, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python2.6/ctypes/__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: ./libfoo.so: undefined symbol: GOMP_parallel_end

And I use these cmds:

gcc -fPIC -std=c99 -lm -Wall -fopenmp -pedantic -c foo.c
gcc -shared -o libfoo.so foo.o
python foo.py

I already googled and found a ”solution” online, but I don’t understand what is meant with:

I suppose I should set restype on constructors to ctypes.c_void_p.
And that I should set the corresponding types in argtypes on called
functions to ctypes.c_void_p. Will this cause necessary conversions
to take place? I’d like some confirmation that this is the right way
to approach this situation.

What does the solution mean or do you know an other way?

[update]

So here is the correct cmd line options with the help from Iulian Şerbănoiu:

gcc -fPIC -std=c99 -lm -Wall -fopenmp -pedantic -c foo.c
gcc -shared -lgomp -lrt  -o libfoo.so foo.o
python foo.py
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:07:21+00:00Added an answer on May 15, 2026 at 2:07 pm

    Try adding -lgomp option in order to link with openmp library. From here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a program which is configured by the user by using C++ classes
I have an application that uses the mmap system call, I was having an
I have written a function which tries to do an auto-allocating sprintf by returning
gcc 4.1.2 c99 I have the following enum's in this file ccsmd.h : enum
have written this little class, which generates a UUID every time an object of
Have a procedure which looks like Procedure TestProc(TVar1, TVar2 : variant); Begin TVar1 :=
Have deployed numerous report parts which reference the same view however one of them
have 2 questions : A computer with 32-bit address uses 2-level page table (9
I am learning C and because VC++ 2008 doesn't support C99 features I have
Let's say I have a variadic function foo(int tmp, ...) , when calling foo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.