Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
trouble compiling cython module against c library
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Thomas Keller  
View profile  
 More options Jun 15 2012, 1:54 pm
From: Thomas Keller <thomas.e.kel...@gmail.com>
Date: Fri, 15 Jun 2012 10:54:13 -0700 (PDT)
Local: Fri, Jun 15 2012 1:54 pm
Subject: trouble compiling cython module against c library

Hello all! I've been using Cython now for a couple years and it has been a
great help. I recently, however, ran into a bit of a snag when I tried
compiling some bindings I had used in the past on a new server. It works
fine on my home laptop and on our cluster, just not this partilcular
server, which leads me to believe something is missing or configured
incorrectly.

The error I get is "/usr/bin/ld: cannot find -lRNA" . In the
setup_pyfold.py file, the ext_module line is:

 ext_modules=[
    Extension("pyfold",      
["pyfold.pyx"],library_dirs=['/home/thomas/ViennaRNA-1.7/lib'],libraries=[' RNA'],include_dirs=['/home/thomas/ViennaRNA-1.7/H',numpy.get_include()]),

]

Now, I had thought that the libraries option didn't really matter unless
you were linking to a system library (obviously I was wrong), but having
"libraries=['RNA']" in that bit of code has never mattered before.

Any thoughts as to what might be going on?

Cheers,
Thomas

Here is the full output when I try compiling the cython module.

[2003] lja485@Anu $ python setup_pyfold.py build_ext -i
running build_ext
cythoning pyfold.pyx to pyfold.c
building 'pyfold' extension
creating build
creating build/temp.linux-x86_64-2.7
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -fPIC -I/home/lja485/ViennaRNA-1.8.
5/H
-I/usr/lib/pymodules/python2.7/numpy/core/include
-I/usr/include/python2.7 -c pyfold.c -o
build/temp.linux-x86_64-2.7/pyfold.o
/usr/lib/pymodules/python2.7/numpy/core/include/numpy/__multiarray_api.h:11 87:
warning: ‘_import_array’ defined but not used
/usr/lib/pymodules/python2.7/numpy/core/include/numpy/__ufunc_api.h:196:
warning: ‘_import_umath’ defined but not used
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions
-Wl,-Bsymbolic-functions build/temp.linux-x86_64-2.7/pyfold.o
-L/home/lja485/ViennaRNA-1.8.5/lib -lRNA -o /home/lja485/dir/pyfold.so
/usr/bin/ld: cannot find -lRNA
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Robert Bradshaw  
View profile  
 More options Jun 16 2012, 2:14 pm
From: Robert Bradshaw <rober...@gmail.com>
Date: Sat, 16 Jun 2012 11:14:30 -0700
Local: Sat, Jun 16 2012 2:14 pm
Subject: Re: [cython-users] trouble compiling cython module against c library
On Fri, Jun 15, 2012 at 10:54 AM, Thomas Keller

It can't find your library. What is the contents of
/home/thomas/ViennaRNA-1.7/lib? Are you sure your library is in there
and named appropriately and the right architecture?

- Robert


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Thomas Keller  
View profile  
 More options Jun 17 2012, 11:37 am
From: Thomas Keller <thomas.e.kel...@gmail.com>
Date: Sun, 17 Jun 2012 08:37:04 -0700 (PDT)
Local: Sun, Jun 17 2012 11:37 am
Subject: Re: [cython-users] trouble compiling cython module against c library

Ah, I think I see what the problem is. So I should be using the libraries
option to specify the exact libraries that the .pyx files uses, correct?
For instance, it uses functions/etc from the stdlib, libRNA_a-fold,
libRNA_a-cofold, libRNA_a-fold_vars, libRNA_a-part_func, and
libRNA_a-inverse libraries. Thus, the libraries option should be
"libraries=['stdlib','libRNA_a-fold',..etc]", correct?

I still have no idea why it worked fine on the other computers, as there's
not even a library called RNA in that directory. Anyway, thanks!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Stefan Behnel  
View profile  
 More options Jun 18 2012, 2:16 am
From: Stefan Behnel <stefan...@behnel.de>
Date: Mon, 18 Jun 2012 08:16:48 +0200
Local: Mon, Jun 18 2012 2:16 am
Subject: Re: [cython-users] trouble compiling cython module against c library
Hi,

please don't top-post. I fixed the posting order to make it readable.

Thomas Keller, 17.06.2012 17:37:

Yes.

> For instance, it uses functions/etc from the stdlib, libRNA_a-fold,
> libRNA_a-cofold, libRNA_a-fold_vars, libRNA_a-part_func, and
> libRNA_a-inverse libraries. Thus, the libraries option should be
> "libraries=['stdlib','libRNA_a-fold',..etc]", correct?

No. The C compiler knows the "lib" prefix. It also knows that stdlib is in
libc, no need to link against that. But it won't magically know about the
"part_func" etc. bits.

Also, the "_a" bit looks like a static library, but maybe I'm mistaken.

> I still have no idea why it worked fine on the other computers, as there's
> not even a library called RNA in that directory. Anyway, thanks!

Maybe it found it somewhere else? Finding that out will likely help you in
understanding what goes wrong on the failing side.

Stefan


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »