compilation problems: openbabel, EMBOSS & zlib on Centos 5

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

compilation problems: openbabel, EMBOSS & zlib on Centos 5

Brian Smith

Hi,

  I am having a bit of trouble compiling openbabel-2.2.3 from source
on 64bit CentOS 5. The compilation fails at the linking stage with:

make[2]: Entering directory `/usr/local/src/openbabel-2.2.3/test'
/bin/sh ../libtool --tag=CXX   --mode=link g++  -g -O2   -o roundtrip
roundtrip.o ../src/libopenbabel.la -ldl -lz -lm
libtool: link: g++ -g -O2 -o .libs/roundtrip roundtrip.o
../src/.libs/libopenbabel.so -ldl -lz -lm -Wl,-rpath -Wl,/usr/local/lib
../src/.libs/libopenbabel.so: undefined reference to `ecrc32'
../src/.libs/libopenbabel.so: undefined reference to `edeflateInit2_'
../src/.libs/libopenbabel.so: undefined reference to `einflateEnd'
../src/.libs/libopenbabel.so: undefined reference to `einflateInit2_'
../src/.libs/libopenbabel.so: undefined reference to `einflate'
../src/.libs/libopenbabel.so: undefined reference to `edeflateEnd'
../src/.libs/libopenbabel.so: undefined reference to `edeflate'
collect2: ld returned 1 exit status
make[2]: *** [roundtrip] Error 1
make[2]: Leaving directory `/usr/local/src/openbabel-2.2.3/test'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/openbabel-2.2.3/test'
make: *** [all-recursive] Error 1

>From other sources, I think this is because the compilation is picking up
conflicting zlib installations. I have 32 and 64 bit zlib libraries
installed:

# rpm -qa | grep zlib
zlib-1.2.3-3
zlib-1.2.3-3
zlib-devel-1.2.3-3
zlib-devel-1.2.3-3

but also installed EMBOSS from source which installs its own zlib headers
and libraries in /usr/local/include and /usr/local/lib, which is where the
e... versions of the zlib functions are coming from. What I don't quite
get is why openbabel is picking up these libraries at all the e...
definitions are in /usr/local/include/zlibemboss.h and the EMBOSS zlib
library is /usr/local/lib/libezlib*, so why should they ever be found by
openbabel?

Thanks in advance for any suggestions.

--
Dr. Brian O. Smith ---------------------- Brian Smith at glasgow ac uk
School of Life Sciences, College of Medical, Vetinary & Life Sciences,
   Joseph Black Building, University of Glasgow, Glasgow G12 8QQ, UK.
Tel: 0141 330 5167/6459/3089                        Fax: 0141 330 4600
----------------------------------------------------------------------
The University of Glasgow, charity number SC004401

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: compilation problems: openbabel, EMBOSS & zlib on Centos 5

Geoffrey Hutchison

On Aug 17, 2010, at 11:43 AM, Brian Smith wrote:

> get is why openbabel is picking up these libraries at all the e...
> definitions are in /usr/local/include/zlibemboss.h and the EMBOSS zlib
> library is /usr/local/lib/libezlib*, so why should they ever be found by
> openbabel?

Well, that's more of a "how does autoconf work" question. I don't know. You could try using CMake to build the OB-2.2.3 source code, which might ignore the libezlib bits.

Install CMake, create a build directory, and then cmake /path/to/source/dir

Hope that helps,
-Geoff
------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss
Reply | Threaded
Open this post in threaded view
|

Re: compilation problems: openbabel, EMBOSS & zlib on Centos 5

Brian Smith
On Sat, 21 Aug 2010, Geoffrey Hutchison wrote:

>
> On Aug 17, 2010, at 11:43 AM, Brian Smith wrote:
>
>> get is why openbabel is picking up these libraries at all the e...
>> definitions are in /usr/local/include/zlibemboss.h and the EMBOSS zlib
>> library is /usr/local/lib/libezlib*, so why should they ever be found by
>> openbabel?
>
> Well, that's more of a "how does autoconf work" question. I don't know. You could try using CMake to build the OB-2.2.3 source code, which might ignore the libezlib bits.
>
> Install CMake, create a build directory, and then cmake /path/to/source/dir
>
> Hope that helps,
> -Geoff

Thanks for the suggestion Geoff. I tried that but end up in a similar
place. So with freshly unpacked openbabel tarball in

/usr/local/src/openbabel-2.2.3/

and doing

mkdir /usr/local/src/openbabel-build
cd /usr/local/src/openbabel-build
cmake ../openbabel-2.2.3
make

ends in

[ 26%] Building CXX object src/CMakeFiles/openbabel.dir/ops/optransform.o
Linking CXX shared library libopenbabel.so
CMakeFiles/openbabel.dir/obconversion.o: In function
`zlib_stream::basic_unzip_streambuf<char, std::char_traits<char>
>::initialize(int)':
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:329: undefined
reference to `einflateInit2_'
CMakeFiles/openbabel.dir/obconversion.o: In function
`zlib_stream::basic_zip_streambuf<char, std::char_traits<char>
>::zip_to_stream(char*, long)':
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:251: undefined
reference to `ecrc32'
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:256: undefined
reference to `edeflate'
CMakeFiles/openbabel.dir/obconversion.o: In function
`zlib_stream::basic_zip_streambuf<char, std::char_traits<char>
>::flush()':
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:150: undefined
reference to `ecrc32'
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:155: undefined
reference to `edeflate'
CMakeFiles/openbabel.dir/obconversion.o: In function
`zlib_stream::basic_unzip_streambuf<char, std::char_traits<char>
>::unzip_from_stream(char*, long)':
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:557: undefined
reference to `einflate'
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:563: undefined
reference to `ecrc32'
CMakeFiles/openbabel.dir/obconversion.o: In function
`zlib_stream::basic_unzip_streambuf<char, std::char_traits<char>
>::seekpos(std::fpos<__mbstate_t>, std::_Ios_Openmode)':
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:445: undefined
reference to `einflateEnd'
CMakeFiles/openbabel.dir/obconversion.o: In function
`zlib_stream::basic_unzip_streambuf<char, std::char_traits<char>
>::seekoff(long, std::_Ios_Seekdir, std::_Ios_Openmode)':
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:424: undefined
reference to `einflateEnd'
CMakeFiles/openbabel.dir/obconversion.o: In function
`~basic_zip_streambuf':
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:88: undefined reference
to `edeflateEnd'
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:88: undefined reference
to `edeflateEnd'
CMakeFiles/openbabel.dir/obconversion.o: In function
`~basic_unzip_streambuf':
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:342: undefined
reference to `einflateEnd'
CMakeFiles/openbabel.dir/obconversion.o: In function
`~basic_zip_streambuf':
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:88: undefined reference
to `edeflateEnd'
CMakeFiles/openbabel.dir/obconversion.o: In function
`basic_zip_streambuf':
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:74: undefined reference
to `edeflateInit2_'
CMakeFiles/openbabel.dir/obconversion.o: In function
`~basic_unzip_streambuf':
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:342: undefined
reference to `einflateEnd'
/usr/local/src/openbabel-2.2.3/src/zipstreamimpl.h:342: undefined
reference to `einflateEnd'
collect2: ld returned 1 exit status
make[2]: *** [src/libopenbabel.so.3.0.3] Error 1
make[1]: *** [src/CMakeFiles/openbabel.dir/all] Error 2
make: *** [all] Error 2

So finally I understand the cause of the problem, I think. EMBOSS installs

/usr/local/include/zconf.h
/usr/local/include/zlibemboss.h
/usr/local/include/zlib.h
/usr/local/include/zutil.h

and zlib.h calls zconf.h which calls zlibemboss.h which #defines all the
e... function names.

So for a workaround I can (at least temporarily) rename
/usr/local/include/zlib.h

Alternatively I think messing with the Makefile to change the LIBS = -lz
to -lez would allow the EMBOSS installed ezlib libraries to be linked
instead of the system ones.

Are there any configure or cmake arguments I can pass to say "prefer
system include to /usr/local/include"?

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
OpenBabel-discuss mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss