16

I'm trying to make one bitcoin-like daemon on my Ubuntu 14.04.3. When I hit ./configure:

checking for SSL... no
configure: error: openssl  not found.

but

# apt-get install libssl-dev linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
libssl-dev is already the newest version.
linux-headers-3.13.0-61-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I googled the error message but I haven't any idea what to do. I successfully maked exactly that one daemon on my other Ubuntu 14.04 so the sources and configuration scripts are good.

UPD1. Installing openssl didn't help:

# apt-get install openssl
..
openssl is already the newest version.
..

I've checked config.log and there're nothing about openssl at the end - HAVE_WORKING_BOOST_SLEEP_FOR refers to checking for dynamic linked boost test... yes - last successful line from ./configure output:

# tail config.log
#define HAVE_BOOST /**/
#define HAVE_BOOST_SYSTEM /**/
#define HAVE_BOOST_FILESYSTEM /**/
#define HAVE_BOOST_PROGRAM_OPTIONS /**/
#define HAVE_BOOST_THREAD /**/
#define HAVE_BOOST_CHRONO /**/
#define HAVE_BOOST_UNIT_TEST_FRAMEWORK /**/
#define HAVE_WORKING_BOOST_SLEEP_FOR 1

configure: exit 1

UPD2. I've found that in log, quite far from the end:

configure:25626: checking for SSL
configure:25633: $PKG_CONFIG --exists --print-errors "libssl"
Package libssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libssl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libssl' found
configure:25636: $? = 1
configure:25650: $PKG_CONFIG --exists --print-errors "libssl"
Package libssl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libssl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libssl' found
configure:25653: $? = 1
configure:25667: result: no
No package 'libssl' found
configure:25683: error: openssl  not found.
user510433
  • 221
  • 1
  • 2
  • 7
  • 1
    [libssl-dev](http://packages.ubuntu.com/search?keywords=libssl-dev) is not [openssl](http://packages.ubuntu.com/search?keywords=openssl). Try installing the latter. If that doesn't help, then check `config.log` for the exact command that's failing (it will be right near the end) and [edit] your question to include it, and we can suggest what you are missing. – user Oct 16 '15 at 21:59
  • @MichaelKjörling: But autoconf output isn't Debian package names, either… It's more likely that it refers to _pkg-config_ packages (and libssl-dev does include openssl.pc). – u1686_grawity Oct 16 '15 at 23:00
  • Updated. Is there anything else I can check? – user510433 Oct 17 '15 at 09:14
  • Does the file `/usr/lib//pkgconfig/libssl.pc` exist? – Gowtham Oct 17 '15 at 12:02
  • What is ? `/usr/lib/pkgconfig/; /usr/share/pkgconfig/; /usr/local/lib/pkgconfig/` don't contain `libssl.pc` – user510433 Oct 17 '15 at 12:45

2 Answers2

16

You will find a package name libssl-dev in Synaptic Package Manager (Ubuntu 16.04) and after you install libssl-dev, everything will be solved. by the way, libssl1.0.0 don't works. You'd better install libssl-dev and libssl1.0.0 at same time.

by the way, I don't think the following solution is works: 'pkg-config' is in your PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config is unavailable you can set INCLUDE_DIR and LIB_DIR manually via: R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'

Shicheng Guo
  • 261
  • 2
  • 6
  • I was trying to run a Crystal Lang http server and got the error "Package libssl was not found in the pkg-config search path. Perhaps you should add the directory containing `libssl.pc' to the PKG_CONFIG_PATH environment variable No package 'libssl' found ". Installing libssl-dev solved the problem. – VRPF May 25 '17 at 20:04
6

For some reason PKG_CONFIG_PATH didn't contain the right path for that openssl.pc file needed for pkg-config utility. I did find / -name 'openssl.pc' and found it in /usr/lib/x86_64-linux-gnu/pkgconfig/. That path was also used by my other ubuntu to ./configure.

So I ran PKG_CONFIG_PATH="/usr/lib/x86_64-linux-gnu/pkgconfig/" ./configure and that did the trick!

Other thing, there is another openssl.pc in my /usr/local/ssl/lib/pkgconfig/ but when I tried to use it, the following make command hangs with different errors (like unknown reference to function, etc.).

Salem F
  • 202
  • 1
  • 3
  • 12
user510433
  • 221
  • 1
  • 2
  • 7
  • Same here, openssl was installed using brew, and I was installing libevent on macos by building it. – Thihara Jan 18 '21 at 03:21