Alexandre Hannud Abdo | 16 Nov 2006 21:01
Picon
Gravatar

64bit and PIC

Ni!

 I had the problem below when compiling graph-tool on a 64 bit amd machine.
 It's seems a problem generating position independent code while
linking the libraries.

 The linker asks me to compile with -fPIC, but doing that changes
nothing (by adding "-fPIC" to CXXFLAGS in the Makefile, should I have
done someting different?)

 One thing I notice is that the last call, to "g++ -shared", does not
include -fPIC.
 All others do, so this might be expected (as in "it's just linking")

 I remember someone on the list successfully compiled on a 64 bit
machine, did you have to do something special?

 []s
ale
~~

/bin/bash ../../libtool --tag=CXX --mode=link g++ -Wall -I/usr/include/python2.4
-I/usr/include -ftemplate-depth-150 -fvisibility=hidden
-fvisibility-inlines-hidden
-O99 -fPIC   -o libgraph_tool.la -rpath /usr/local/lib/python2.4/site-packages
graph.lo graph_properties.lo graph_correlations.lo
graph_correlations_combined.lo
graph_correlations_neighbours.lo graph_assortativity.lo graph_clustering.lo
graph_extended_clustering.lo graph_generation.lo graph_distance.lo
graph_distance_sampled.lo graph_reciprocity.lo graph_minimum_spanning_tree.lo
(Continue reading)

Tiago de Paula Peixoto | 16 Nov 2006 21:16
Picon
Gravatar

Re: 64bit and PIC

On 11/16/2006 06:01 PM, Alexandre Hannud Abdo wrote:
>  I had the problem below when compiling graph-tool on a 64 bit amd machine.
>  It's seems a problem generating position independent code while
> linking the libraries.

[...]

> /usr/bin/ld: .libs/graph.o: relocation R_X86_64_PC32 against
> `std::basic_string<char,
>  std::char_traits<char>, std::allocator<char> >::~basic_string() <at>  <at> GLIBCXX_3.4'
> can not be used when making a shared object; recompile with -fPIC

Well, this certainly has nothing to do with graph-tool... I noticed you
were using GCC 4.1.2, which is not yet released, and is probably a
pre-release or something. Do you get the same error when you compile
with a stable GCC (eg. 4.1.1)?

--

-- 
Tiago de Paula Peixoto <tiago <at> forked.de>

_______________________________________________
graph-tool mailing list
graph-tool <at> forked.de
http://lists.forked.de/mailman/listinfo/graph-tool
Alexandre Hannud Abdo | 17 Nov 2006 00:44
Picon
Gravatar

Re: 64bit and PIC

Ni!

On 11/16/06, Tiago de Paula Peixoto <tiago <at> forked.de> wrote:
> On 11/16/2006 06:01 PM, Alexandre Hannud Abdo wrote:
> >  I had the problem below when compiling graph-tool on a 64 bit amd machine.
> >  It's seems a problem generating position independent code while
> > linking the libraries.
>
> [...]
>
> > /usr/bin/ld: .libs/graph.o: relocation R_X86_64_PC32 against
> > `std::basic_string<char,
> >  std::char_traits<char>, std::allocator<char> >::~basic_string() <at>  <at> GLIBCXX_3.4'
> > can not be used when making a shared object; recompile with -fPIC
>
> Well, this certainly has nothing to do with graph-tool... I noticed you
> were using GCC 4.1.2, which is not yet released, and is probably a
> pre-release or something. Do you get the same error when you compile
> with a stable GCC (eg. 4.1.1)?

Removing, as you suggested,

-fvisibility=hidden -fvisibility-inlines-hidden

from CXXFLAGS works around the compiler bug.

tx!
ale

Gmane