Apparently it seams to be SWIG's fault. CentOS has SWIG in version 1.x.
Compiling latest SWIG 2.x fixed the issue. Maybe we should ad a note about
that in wiki, since that could potentially lead to some other undiscovered
errors.

Curiously cmake calls for SWIG in version 2.0 and loads successfully 1.x.
----
Pozdrawiam,  |  Best regards,
Maciek Wójcikowski
mac...@wojcikowski.pl


2012/5/31 Maciek Wójcikowski <mac...@wojcikowski.pl>

> It worked.
>
> The failing line was:
> /usr/bin/c++  -fPIC -O2 -g -O2 -g -Wl,--enable-new-dtags
> -Wl,--enable-new-dtags -Wl,--fatal-warnings -Wl,--no-undefined -lc  -shared
> -Wl,-soname,OpenBabel.so -o ../lib/OpenBabel.so
> CMakeFiles/bindings_perl.dir/perl/openbabel-perl.cpp.o
> -L/usr/lib64/perl5/CORE -lperl ../lib/libopenbabel.so.4.0.0 -lm -ldl -lz
> -Wl,-rpath,/usr/lib64/perl5/CORE:/home/maciek/openbabel/build/lib
>
> Adding -lpthread leads to succesful compilation.
>
> ----
> Pozdrawiam,  |  Best regards,
> Maciek Wójcikowski
> mac...@wojcikowski.pl
>
>
> 2012/5/31 Noel O'Boyle <baoille...@gmail.com>
>
>> We changed to compiling the bindings directly rather than use Perl's
>> build system. It seems to work fine on some Linux OSes but not on
>> others. I haven't tracked down the problem but you could try
>> "VERBOSE=1 make" to see the command that we are using to compile, and
>> repeating it manually but adding -lpthread to see what happens.
>>
>> - Noel
>>
>> On 31 May 2012 09:56, Maciek Wójcikowski <mac...@wojcikowski.pl> wrote:
>> > Hi,
>> >
>> > I have trouble building Perl bindings in openbabel SVN branch. My
>> system is
>> > running 64bit CentOS 6.
>> >
>> > To compile i use following command:
>> >
>> > cmake ../openbabel \
>> > -DRUN_SWIG=ON \
>> > -DPERL_BINDINGS=ON \
>> > -DPERL_LIBRARY=/usr/lib64/perl5/CORE/libperl.so \
>> > -DPERL_INCLUDE_PATH=/usr/lib64/perl5/CORE/ \
>> > -DPERL_PREFIX=/usr/lib64/perl5/ \
>> > -DPYTHON_BINDINGS=ON \
>> > -DPYTHON_LIBRARY=/usr/lib64/libpython2.6.so \
>> > -DPYTHON_INCLUDE_PATH=/usr/include/python2.6/
>> >
>> > Which leads to error:
>> > Linking CXX shared module ../lib/OpenBabel.so
>> > CMakeFiles/bindings_perl.dir/perl/openbabel-perl.cpp.o: In function
>> > `_wrap_resdat_get':
>> > /home/maciek/openbabel/openbabel/scripts/perl/openbabel-perl.cpp:2641:
>> > undefined reference to `pthread_getspecific'
>> > CMakeFiles/bindings_perl.dir/perl/openbabel-perl.cpp.o: In function
>> > `_wrap_chainsparser_get':
>> > /home/maciek/openbabel/openbabel/scripts/perl/openbabel-perl.cpp:2633:
>> > undefined reference to `pthread_getspecific'
>> > CMakeFiles/bindings_perl.dir/perl/openbabel-perl.cpp.o: In function
>> > `_wrap_atomtyper_get':
>> > /home/maciek/openbabel/openbabel/scripts/perl/openbabel-perl.cpp:2625:
>> > undefined reference to `pthread_getspecific'
>> > CMakeFiles/bindings_perl.dir/perl/openbabel-perl.cpp.o: In function
>> > `_wrap_aromtyper_get':
>> > /home/maciek/openbabel/openbabel/scripts/perl/openbabel-perl.cpp:2617:
>> > undefined reference to `pthread_getspecific'
>> > CMakeFiles/bindings_perl.dir/perl/openbabel-perl.cpp.o: In function
>> > `_wrap_isotab_get':
>> > /home/maciek/openbabel/openbabel/scripts/perl/openbabel-perl.cpp:2609:
>> > undefined reference to `pthread_getspecific'
>> >
>> CMakeFiles/bindings_perl.dir/perl/openbabel-perl.cpp.o:/home/maciek/openbabel/openbabel/scripts/perl/openbabel-perl.cpp:2601:
>> > more undefined references to `pthread_getspecific' follow
>> > collect2: ld returned 1 exit status
>> > make[2]: *** [lib/OpenBabel.so] Błąd 1
>> > make[1]: *** [scripts/CMakeFiles/bindings_perl.dir/all] Błąd 2
>> >
>> > To clarify, given cmake command build 2.3.1 version without problem.
>> >
>> > ----
>> > Pozdrawiam,  |  Best regards,
>> > Maciek Wójcikowski
>> > mac...@wojcikowski.pl
>> >
>> >
>> ------------------------------------------------------------------------------
>> > Live Security Virtual Conference
>> > Exclusive live event will cover all the ways today's security and
>> > threat landscape has changed and how IT managers can respond.
>> Discussions
>> > will include endpoint security, mobile security and the latest in
>> malware
>> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> > _______________________________________________
>> > OpenBabel-discuss mailing list
>> > OpenBabel-discuss@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
>> >
>>
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenBabel-discuss mailing list
OpenBabel-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to