cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-1871649 ] problem compiling curl-7.17.1 with openssl-0.9.8g by source

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Thu, 22 May 2008 12:04:31 -0700

Bugs item #1871649, was opened at 2008-01-14 18:37
Message generated for change (Comment added) made by lmpmbernardo
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1871649&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: compile or build problem
Group: bad behaviour
Status: Closed
Resolution: Invalid
Priority: 5
Private: No
Submitted By: pierregrand (pierregrand)
Assigned to: Daniel Stenberg (bagder)
Summary: problem compiling curl-7.17.1 with openssl-0.9.8g by source

Initial Comment:
Hi,

I have a new clean system running Centos 5 (minimal install - nothing except the compilers).

uname -a:

Linux localhost.localdomain 2.6.18-8.1.15.el5 #1 SMP Mon Oct 22 08:32:04 EDT 2007 i686 i686 i386 GNU/Linux

I then installed openssl-0.9.8g from source:

cd openssl-0.9.8g
./config --openssldir=/usr/local/ssl
make; make install

I then attempted to install curl-7.17.1:

cd curl-7.17.1
./configure --disable-ipv6 --with-ssl=/usr/local/ssl;

Here's the error message:

checking whether to support http... yes
checking whether to support ftp... yes
checking whether to support file... yes
checking whether to support ldap... yes
checking whether to support ldaps... no
checking whether to support dict... yes
checking whether to support telnet... yes
checking whether to support tftp... yes
checking whether to provide built-in manual... yes
checking for icc in use... no
checking for gethostbyname... yes
checking for strcasecmp... yes
checking for connect... yes
checking whether to use libgcc... no
checking for lber.h... no
checking for ldap.h... no
checking for ldapssl.h... no
checking for ldap_ssl.h... no
checking for LDAP libraries... cannot find LDAP libraries
configure: WARNING: Cannot find libraries for LDAP support: LDAP disabled
checking for timeGetTime in winmm... no
checking whether to enable ipv6... no
checking non-blocking sockets style... O_NONBLOCK
checking if argv can be written to... yes
checking if Kerberos4 support is requested... no
checking if SPNEGO support is requested... no
checking if GSSAPI support is requested... no
checking for gdi32... no
checking for CRYPTO_lock in -lcrypto... yes
checking for SSL_connect in -lssl... no
checking for ssl with RSAglue/rsaref libs in use... checking for SSL_connect in -lssl... (cached) no
no
configure: error: OpenSSL libs and/or directories were not found where specified!

I also attempted to add /usr/local/ssl/lib and /usr/local/ssl/include in the file /etc/ld.so.conf and running ldconfig - didn't do anything.

I also attempted to compile using:

CPPFLAGS="-I/usr/local/ssl/include" LDFLAGS="-L/usr/local/ssl/lib" \
./configure --disable-ipv6 --with-ssl=/usr/local/ssl;

Same problem. Is this a known issue?

Thanks,

Pierre G

----------------------------------------------------------------------

Comment By: Luis Bernardo (lmpmbernardo)
Date: 2008-05-22 14:04

Message:
Logged In: YES
user_id=137011
Originator: NO

I had the same problem with a very different setup. I think the problem is
in curl. I was able to work around it by using both CPPFLAGS and LDFLAGS
but also LIBS before ./configure. The -ldl should go in LIBS, not LDFLGAS
(that was my experience, but with -lz, not -ldl).

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2008-02-07 11:00

Message:
Logged In: YES
user_id=1110
Originator: NO

Closed as discussed. This really doesn't seem to be a curl bug.

----------------------------------------------------------------------

Comment By: pierregrand (pierregrand)
Date: 2008-02-01 17:41

Message:
Logged In: YES
user_id=1981607
Originator: YES

I think I resolved this by doing:
yum install openssl-devel

And then everything was installable from source with no glitch.

Honestly this is a little odd since I shouldn't have to do this when you
install something from source.
I think the yum package manager does some extra work that is necessary on
Centos system, which does not get done when openssl is installed from
source.
Bug in openssl? Maybe.
I would definitely consider this bug report bogus as far as curl is
concerned. It seems to be related discrepancies with openssl with
installing on systems. I'm sorry for the bad report, but it originally
looked like curl bug.
Thanks for your help in the process.

----------------------------------------------------------------------

Comment By: Dan Fandrich (dfandrich)
Date: 2008-02-01 17:32

Message:
Logged In: YES
user_id=236775
Originator: NO

Did installing pkg-config solve this issue?

----------------------------------------------------------------------

Comment By: Dan Fandrich (dfandrich)
Date: 2008-01-15 15:39

Message:
Logged In: YES
user_id=236775
Originator: NO

> Does this confirm that I installed only a static version of openssl?
Yes, it does. Why, I don't know--you'll have to figure that one out.

> -bash: pkg-config: command not found
There's the problem. If pkg-config isn't found, then curl uses a fall-back
mechanism to configure OpenSSL, but that mechanism only works with
dynamically-linked OpenSSL libraries. Try installing pkg-config (in the
pkgconfig package) and try again (with PKG_CONFIG_PATH).

----------------------------------------------------------------------

Comment By: pierregrand (pierregrand)
Date: 2008-01-15 15:19

Message:
Logged In: YES
user_id=1981607
Originator: YES

Hi,

Today I attempted to find the following answers for you:

Did you compile just a static version of OpenSSL or did you create a
dynamic version as well?

To be honest, I do not really know the differences. I am compiling from
source by doing the following:

cd /usr/local/src
wget [mirror]openssl-0.9.8g.tar.gz
tar xfz openssl-0.9.8g.tar.gz
cd openssl-0.9.8g
./config --openssldir=/usr/local/ssl
make; make install

I don't really know if that install static or dynamic, to be honest.
However, I did a quick search:

ls -la /usr/local/ssl/lib/
total 2572
drwxr-xr-x 4 root root 4096 Jan 14 03:46 .
drwxr-xr-x 10 root root 4096 Jan 14 10:48 ..
drwxr-xr-x 2 root root 4096 Jan 14 03:46 engines
-rw-r--r-- 1 root root 2215652 Jan 14 03:46 libcrypto.a
-rw-r--r-- 1 root root 366348 Jan 14 03:46 libssl.a
drwxr-xr-x 2 root root 4096 Jan 14 03:46 pkgconfig

Does this confirm that I installed only a static version of openssl?

Did the -ldl hack work to let you compile?

I tried doing the following:
LDFLAGS="-L/usr/local/ssl/lib -ldl" \
./configure --disable-ipv6 --with-ssl=/usr/local/ssl;

I can confirm that this DOES help. The configure does end successfully,
the make and make install report no errors.
Whether or not it will actually work in production I'll know more in a
week or two.

What's the output of the command:
PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig pkg-config --libs libssl

[root_at_localhost src]# PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig
pkg-config --libs libssl
-bash: pkg-config: command not found

----------------------------------------------------------------------

Comment By: Daniel Stenberg (bagder)
Date: 2008-01-15 05:07

Message:
Logged In: YES
user_id=1110
Originator: NO

I consider this an openssl problem due to the errors in the config.log
shown when trying to figure out the libs:

[sample snippet]

configure:25820: gcc -o conftest -g -O2 -I/usr/local/ssl/include/openssl
-I/usr/local/ssl/include -L/usr/local/ssl/lib conftest.c -lssl -lcrypto
>&5
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function
`dlfcn_bind_func':
dso_dlfcn.c:(.text+0x2e5): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x3c6): undefined reference to `dlerror'

So I fail to see how this openssl installation is usable to anyone.

----------------------------------------------------------------------

Comment By: Dan Fandrich (dfandrich)
Date: 2008-01-14 22:33

Message:
Logged In: YES
user_id=236775
Originator: NO

It's still not clear to me if this is an OpenSSL problem, a curl problem,
or a user problem. It's probably best to continue the discussion on the
curl-users mailing list. I'd still like to know the answers to these
questions, though:

Did you compile just a static version of OpenSSL or did you create a
dynamic version as well?

Did the -ldl hack work to let you compile?

What's the output of the command:
PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig pkg-config --libs libssl

----------------------------------------------------------------------

Comment By: pierregrand (pierregrand)
Date: 2008-01-14 22:21

Message:
Logged In: YES
user_id=1981607
Originator: YES

Hi,

In a previous post I mentioned that I had attempted the following:

PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig \
./configure --disable-ipv6 --with-ssl=/usr/local/ssl;

The result was the same as without the
PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig \ line.
The config.log is exactly the same as the previous failed configure
without the PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig . (I did a diff)

If you could please try it on your end, it might help for you to see what
I am experiencing.

Cheers,

----------------------------------------------------------------------

Comment By: Dan Fandrich (dfandrich)
Date: 2008-01-14 19:56

Message:
Logged In: YES
user_id=236775
Originator: NO

Dynamic libraries' names end in .so while static libraries end in .a

Does the config.log file look any different this time? Did the -ldl hack
work? What's the output of the command:
PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig pkg-config --libs libssl

----------------------------------------------------------------------

Comment By: pierregrand (pierregrand)
Date: 2008-01-14 19:42

Message:
Logged In: YES
user_id=1981607
Originator: YES

The log shows that gcc is linking OpenSSL statically, and a library is
missing on the link command. Using LDFLAGS="-L/usr/local/ssl/lib -ldl"
will
probably let you compile, but that's just papering over the problem.
First,
did you compile just a static version of OpenSSL or did you create a
dynamic version as well?

On a clean Centos 5 system (with minimal install, and only development
tools installed) (development tools are gcc, etc):

I install openssl from source by doing the following:

cd /usr/local/src
tar xfz openssl-0.9.8g.tar.gz
cd openssl-0.9.8g
./config --openssldir=/usr/local/ssl
make; make install

I don't know if this installs openssl as static or dynamic. How would I be
able to tell?

Second, did OpenSSL install a .pc file anywhere

Here's the results of my search:

[root_at_localhost src]# updatedb
[root_at_localhost src]# locate .pc
/lib/modules/2.6.18-8.1.15.el5/modules.pcimap
/lib/modules/2.6.18-8.el5/modules.pcimap
/usr/lib/pkgconfig/devmapper-event.pc
/usr/lib/pkgconfig/devmapper.pc
/usr/lib/pkgconfig/libnfsidmap.pc
/usr/lib/pkgconfig/librpcsecgss.pc
/usr/local/lib/pkgconfig/libcrypto.pc
/usr/local/lib/pkgconfig/libcurl.pc
/usr/local/lib/pkgconfig/libssl.pc
/usr/local/lib/pkgconfig/openssl.pc
/usr/local/src/curl-7.17.1/libcurl.pc.in
/usr/local/src/openssl-0.9.7m/openssl.pc
/usr/local/src/openssl-0.9.8g/libcrypto.pc
/usr/local/src/openssl-0.9.8g/libssl.pc
/usr/local/src/openssl-0.9.8g/openssl.pc
/usr/local/ssl/lib/pkgconfig/libcrypto.pc
/usr/local/ssl/lib/pkgconfig/libssl.pc
/usr/local/ssl/lib/pkgconfig/openssl.pc
/usr/local/ssl-0-9-7/lib/pkgconfig/openssl.pc
/usr/share/doc/gawk-3.1.5/README_d/README.pc
/usr/share/doc/gawk-3.1.5/README_d/README.pcdynamic

for use with pkg-config? If so, then try setting the environment variable
PKG_CONFIG_PATH to that directory (probably something like
PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ) before configuring. You
shouldn't need to specify LDFLAGS or CPPFLAGS if everything is configured
properly.

Sure, Here's my attempt:

PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig \
./configure --disable-ipv6 --with-ssl=/usr/local/ssl;

checking for CRYPTO_lock in -lcrypto... yes
checking for SSL_connect in -lssl... no
checking for ssl with RSAglue/rsaref libs in use... checking for
SSL_connect in -lssl... (cached) no
no
configure: error: OpenSSL libs and/or directories were not found where
specified!

Still the same problem.

Is this an openssl problem or curl problem?

----------------------------------------------------------------------

Comment By: Dan Fandrich (dfandrich)
Date: 2008-01-14 19:22

Message:
Logged In: YES
user_id=236775
Originator: NO

The log shows that gcc is linking OpenSSL statically, and a library is
missing on the link command. Using LDFLAGS="-L/usr/local/ssl/lib -ldl" will
probably let you compile, but that's just papering over the problem. First,
did you compile just a static version of OpenSSL or did you create a
dynamic version as well? Second, did OpenSSL install a .pc file anywhere
for use with pkg-config? If so, then try setting the environment variable
PKG_CONFIG_PATH to that directory (probably something like
PKG_CONFIG_PATH=/usr/local/ssl/lib/pkgconfig ) before configuring. You
shouldn't need to specify LDFLAGS or CPPFLAGS if everything is configured
properly.

----------------------------------------------------------------------

Comment By: pierregrand (pierregrand)
Date: 2008-01-14 19:06

Message:
Logged In: YES
user_id=1981607
Originator: YES

Yes, the file structure is very similar.

For openssl-0.9.8g:

ls -la /usr/local/ssl
total 88
drwxr-xr-x 9 root root 4096 Jan 14 03:46 .
drwxr-xr-x 17 root root 4096 Jan 14 04:05 ..
drwxr-xr-x 2 root root 4096 Jan 14 03:46 bin
drwxr-xr-x 2 root root 4096 Jan 14 03:46 certs
drwxr-xr-x 3 root root 4096 Jan 14 03:46 include
drwxr-xr-x 4 root root 4096 Jan 14 03:46 lib
drwxr-xr-x 6 root root 4096 Jan 14 03:45 man
drwxr-xr-x 2 root root 4096 Jan 14 03:46 misc
-rw-r--r-- 1 root root 9374 Jan 14 03:46 openssl.cnf
drwxr-xr-x 2 root root 4096 Jan 14 03:46 private

for openssl 0.9.7m:

ls -la /usr/local/ssl-0-9-7/
total 48
drwxr-xr-x 6 root root 4096 Jan 14 03:23 .
drwxr-xr-x 17 root root 4096 Jan 14 04:05 ..
drwxr-xr-x 2 root root 4096 Jan 14 03:24 bin
drwxr-xr-x 3 root root 4096 Jan 14 03:23 include
drwxr-xr-x 3 root root 4096 Jan 14 03:24 lib
drwxr-xr-x 6 root root 4096 Jan 14 03:24 ssl

[root_at_localhost curl-7.17.1]# cat config.log | grep openssl
configure:25605: gcc -o conftest -g -O2 -I/usr/local/ssl/include/openssl
-I/usr/local/ssl/include -L/usr/local/ssl/lib conftest.c -lgdi32 >&5
configure:25669: gcc -o conftest -g -O2 -I/usr/local/ssl/include/openssl
-I/usr/local/ssl/include -L/usr/local/ssl/lib conftest.c -lcrypto >&5
configure:25820: gcc -o conftest -g -O2 -I/usr/local/ssl/include/openssl
-I/usr/local/ssl/include -L/usr/local/ssl/lib conftest.c -lssl -lcrypto
>&5
CPPFLAGS=' -I/usr/local/ssl/include/openssl -I/usr/local/ssl/include'

I have also attached the file config.log to help you.
File Added: config.log

----------------------------------------------------------------------

Comment By: pierregrand (pierregrand)
Date: 2008-01-14 18:54

Message:
Logged In: YES
user_id=1981607
Originator: YES

One last comment. I have been able to compile openssl 0.9.8g with curl
7.16.4:

cd curl-7.16.4
./configure --disable-ipv6 --with-ssl=/usr/local/ssl; make; make install

----------------------------------------------------------------------

Comment By: Dan Fandrich (dfandrich)
Date: 2008-01-14 18:54

Message:
Logged In: YES
user_id=236775
Originator: NO

Are the files installed in /usr/local/ssl similar to the ones installed in
/usr/local/ssl-0-9-7? Can you post the relevant parts of the OpenSSL
checking output of config.log for the failing case?

----------------------------------------------------------------------

Comment By: pierregrand (pierregrand)
Date: 2008-01-14 18:42

Message:
Logged In: YES
user_id=1981607
Originator: YES

I'd like to add that when I do the following on the SAME system, the
compile works with openssl version 0.9.7. So this should help to confirm
that I didn't do anything wrong.

I downloaded openssl-0.9.7m.tar.gz
cd openssl-0.9.7m
./config --openssldir=/usr/local/ssl-0-9-7
make; make install

./configure --disable-ipv6 --with-ssl=/usr/local/ssl-0-9-7/;
make; make install

No problem with the configure and the make & make install

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=1871649&group_id=976
Received on 2008-05-22

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET