![](https://secure.gravatar.com/avatar/83e2e81183334c30c4089728bc9745d3.jpg?s=120&d=mm&r=g)
Does anyone know where the g2c-pic library is from? I'm trying to build the arpack python extension but it needs g2c-pic. I have g2c on my computer but not g2c-pic. It builds fine with just g2c but I'm not sure what the difference is between the two. Thanks, David -- David J. Grant http://www.davidgrant.ca:81
![](https://secure.gravatar.com/avatar/9b85a909fbfc71a3ea3275c7872e714d.jpg?s=120&d=mm&r=g)
On Thu, 28 Oct 2004, David Grant wrote:
Does anyone know where the g2c-pic library is from? I'm trying to build the arpack python extension but it needs g2c-pic. I have g2c on my computer but not g2c-pic. It builds fine with just g2c but I'm not sure what the difference is between the two.
g2c-pic is g2c with a difference that its content is compiled with -fPIC flag enabled. Pearu
![](https://secure.gravatar.com/avatar/c84d03cc4b6ed728e124b61d78b3f1e4.jpg?s=120&d=mm&r=g)
Pearu Peterson wrote:
On Thu, 28 Oct 2004, David Grant wrote:
Does anyone know where the g2c-pic library is from? I'm trying to build the arpack python extension but it needs g2c-pic. I have g2c on my computer but not g2c-pic. It builds fine with just g2c but I'm not sure what the difference is between the two.
g2c-pic is g2c with a difference that its content is compiled with -fPIC flag enabled.
I've seen -fPIC used a lot... Just looked at it's description on man gcc and I'm thinking that this will work on my machine but perhaps not on others? Dave -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION This electronic transmission, and any documents attached hereto, is confidential. The information is intended only for use by the recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited.
![](https://secure.gravatar.com/avatar/b8e98e90ee68e1128f9cbb53ecbf89d9.jpg?s=120&d=mm&r=g)
<41812971.5070606@dwavesys.com>David Grant writes: <snip>
I've seen -fPIC used a lot... Just looked at it's description on man gcc and I'm thinking that this will work on my machine but perhaps not on others?
well, yes and no... I ran into this issue when I started using an AMD64 machine -- every library must be compiled with -fPIC or strange things happen on AMD64. The manual page says it will "only work on some architectures" but I don't think you actually need to worry about this. I can't remember exactly anymore but I think "some" in this definition encompasses very esoteric setups you'll likely never see. I've been paying attention to things that got compiled with the flag on all machines I use for a while now, and its never been a problem on any combination of hardware / free UNIX (inluding linux) / compiler platform to date. I wouldn't think twice about it, unless you're on some ill-used architecture that few people have even heard of. Just my $.02... -tom
![](https://secure.gravatar.com/avatar/c84d03cc4b6ed728e124b61d78b3f1e4.jpg?s=120&d=mm&r=g)
tom fogal wrote:
<41812971.5070606@dwavesys.com>David Grant writes: <snip>
I've seen -fPIC used a lot... Just looked at it's description on man gcc and I'm thinking that this will work on my machine but perhaps not on others?
well, yes and no... I ran into this issue when I started using an AMD64 machine -- every library must be compiled with -fPIC or strange things happen on AMD64.
The manual page says it will "only work on some architectures" but I don't think you actually need to worry about this. I can't remember exactly anymore but I think "some" in this definition encompasses very esoteric setups you'll likely never see. I've been paying attention to things that got compiled with the flag on all machines I use for a while now, and its never been a problem on any combination of hardware / free UNIX (inluding linux) / compiler platform to date.
I wouldn't think twice about it, unless you're on some ill-used architecture that few people have even heard of.
Just my $.02...
Is there any way to tell if my g2c.a was actually compiled with -fPIC? And that they didn't rename it to g2c-pic.a? I'm using gentoo. -- David J. Grant Scientific Officer Intellectual Property D-Wave Systems Inc. tel: 604.732.6604 fax: 604.732.6614 ************************** CONFIDENTIAL COMMUNICATION This electronic transmission, and any documents attached hereto, is confidential. The information is intended only for use by the recipient named above. If you have received this electronic message in error, please notify the sender and delete the electronic message. Any disclosure, copying, distribution, or use of the contents of information received in error is strictly prohibited.
![](https://secure.gravatar.com/avatar/b8e98e90ee68e1128f9cbb53ecbf89d9.jpg?s=120&d=mm&r=g)
<41812F72.6@dwavesys.com>David Grant writes:
tom fogal wrote:
<41812971.5070606@dwavesys.com>David Grant writes: <snip>
I've seen -fPIC used a lot... Just looked at it's description on man gcc and I'm thinking that this will work on my machine but perhaps not on others?
<snip>
I wouldn't think twice about it, unless you're on some ill-used architecture that few people have even heard of.
Is there any way to tell if my g2c.a was actually compiled with -fPIC? And that they didn't rename it to g2c-pic.a? I'm using gentoo.
hrm. good question. i'm not sure, but if you look into it more and find out the answer i'd be interested to hear it. One option is to add -fPIC to your /etc/make.conf's CFLAGS, and then emerge g2c again. This should ensure it gets compiled with the right support and clobber your old g2c installation. HTH, -tom
![](https://secure.gravatar.com/avatar/5c85708f2eed0869671a7d303ca55b85.jpg?s=120&d=mm&r=g)
On Thu, Oct 28, 2004 at 01:36:13PM -0400, tom fogal wrote:
<41812971.5070606@dwavesys.com>David Grant writes: <snip>
I've seen -fPIC used a lot... Just looked at it's description on man gcc and I'm thinking that this will work on my machine but perhaps not on others?
well, yes and no... I ran into this issue when I started using an AMD64 machine -- every library must be compiled with -fPIC or strange things happen on AMD64.
Also shared libraries on PowerPC linux (it's the default on OS X). From when I ran linux on my iBook, you'd know when some programmer assumed you didn't need it from the long list of RELOC errors the program would spew. My experience is everything *but* i386 needs -fPIC when compiling shared libraries (which Python extensions are).
The manual page says it will "only work on some architectures" but I don't think you actually need to worry about this. I can't remember exactly anymore but I think "some" in this definition encompasses very esoteric setups you'll likely never see. I've been paying attention to
If it doesn't work on an architecture, very likely it will be ignored. (Not sure though).
things that got compiled with the flag on all machines I use for a while now, and its never been a problem on any combination of hardware / free UNIX (inluding linux) / compiler platform to date.
I wouldn't think twice about it, unless you're on some ill-used architecture that few people have even heard of.
Just my $.02...
Another $.02... -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm@physics.mcmaster.ca
participants (5)
-
David Grant
-
David Grant
-
David M. Cooke
-
Pearu Peterson
-
tom fogal