Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Error: "library containing EVP_EncryptInit... no" #218

Closed
tinyheero opened this issue Jan 19, 2016 · 7 comments · Fixed by #231
Closed

Installation Error: "library containing EVP_EncryptInit... no" #218

tinyheero opened this issue Jan 19, 2016 · 7 comments · Fixed by #231

Comments

@tinyheero
Copy link

Hi,

I am trying to install git2r on R-3.2.3 on a shared linux machine. After running install.packages("git2r"):

* installing *source* package ‘git2r’ ...
** package ‘git2r’ successfully unpacked and MD5 sums checked
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for pkg-config... yes
checking for library containing inflate... -lz
checking for library containing EVP_EncryptInit... no
configure: error: in `/tmp/RtmpG8PvkI/R.INSTALL5e633e0e39c/git2r':
configure: error:
  ---------------------------------------------
   OpenSSL library required

   Please install:
   libssl-dev (deb) or openssl-devel (rpm)
  ---------------------------------------------

I installed openssl from source into my ~/usr/local. I can see the files:

/home/fong/usr/local/lib64/libcrypto.a
/home/fong/usr/local/lib64/libssl.a
/home/fong/usr/local/include/openssl

I then downloaded the package source git2r_0.13.1.tar.gz, extracted, and then tried to configure with:

./configure --prefix=/home/fong/usr/local LDFLAGS="-L/home/fong/usr/local/lib64" CPPFLAGS="-I/home/fong/usr/local/include/openssl"

But still ran into the same error. Looking into the config.log file, the error message appears:

configure:3705: gcc -o conftest -g -O2  -I/usr/local/include -L/home/fong/usr/local/lib conftest.c -lcrypto  -lz  >&5
/home/fong/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x30): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x43): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x4e): undefined reference to `dlclose'
/home/fong/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_pathbyaddr':
dso_dlfcn.c:(.text+0x9f): undefined reference to `dladdr'
dso_dlfcn.c:(.text+0xf4): undefined reference to `dlerror'
/home/fong/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x424): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x4ca): undefined reference to `dlerror'
/home/fong/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
dso_dlfcn.c:(.text+0x544): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x5fc): undefined reference to `dlerror'
/home/fong/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
dso_dlfcn.c:(.text+0x65d): undefined reference to `dlclose'
/home/fong/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
dso_dlfcn.c:(.text+0x712): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x77d): undefined reference to `dlclose'
dso_dlfcn.c:(.text+0x7a7): undefined reference to `dlerror'
collect2: error: ld returned 1 exit status
configure:3705: $? = 1

Any ideas what is wrong?

Thanks

@tinyheero
Copy link
Author

I was able to solve the issue by adding the "-ldl" linker flag. So I ran:

R CMD INSTALL --configure-args="LIBS=-ldl" git2r_0.13.1.tar.gz

Or from inside of R:

install.packages('git2r', configure.args="LIBS=-ldl")

This solved the problem.

@stewid
Copy link
Member

stewid commented Jan 20, 2016

@tinyheero Great that you were able to install git2r.

I have made several fixes to the configuration in the development version. Could you please help to test that it works to install.

git clone https://github.com/ropensci/git2r.git

There are several configuration variables you can assign, see

git2r/configure --help

Try to install with

R CMD INSTALL --configure-args="--with-libssl-include=/home/fong/usr/local/include/openssl --with-libssl-lib=/home/fong/usr/local/lib64" git2r

@tinyheero
Copy link
Author

Ran the command:

git clone https://github.com/ropensci/git2r.git
R CMD INSTALL --configure-args="--with-libssl-include=/home/fong/usr/local/include/openssl --with-libssl-lib=/home/fong/usr/local/lib64" git2r

But same errors as before:

* installing to library ‘/home/fong/usr/local/R/3.2.3/lib64/R/library’
* installing *source* package ‘git2r’ ...
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for library containing inflate... -lz
checking for library containing EVP_EncryptInit... no
configure: error: in `/home/fong/git2r':
configure: error:
  ---------------------------------------------
   The OpenSSL library that is required to
   build git2r was not found.

   Please install:
     libssl-dev    (package on e.g. Debian and Ubuntu)
     openssl-devel (package on e.g. Fedora, CentOS and RHEL)
     openssl       (Homebrew package on OS X)
   and try again.

   If the OpenSSL library is installed on
   your system but the git2r configuration
   is unable to find it, you can specify
   the include and lib path to OpenSSL with:
   R CMD INSTALL --configure-args='--with-libssl-include=INCLUDE_PATH --with-libssl-lib=LIB_PATH' git2r
  ---------------------------------------------
See `config.log' for more details
ERROR: configuration failed for package ‘git2r’
* removing ‘/home/fong/usr/local/R/3.2.3/lib64/R/library/git2r’
* restoring previous ‘/home/fong/usr/local/R/3.2.3/lib64/R/library/git2r’

The issue isn't that it can't find openssl, but rather the need to create a link against the libdl.so library I think due to the error messages in the config.log.

configure:3503: gcc -o conftest -g -O2 -I/home/fong/usr/local/include/openssl -I/usr/local/include  conftest.c -lcrypto  -L/home/fong/usr/local/lib64 -lz  >&5
/home/fong/usr/local/lib64/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x11): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x24): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x2f): undefined reference to `dlclose'

See this thread for more details. Running:

R CMD INSTALL --configure-args='LIBS=-ldl' git2r 

Resolves this problem (albeit it now complains about no libssh2? Thought it was optional?).

In any case, I think the error message is actually misleading...

@jeroen
Copy link
Member

jeroen commented Mar 20, 2016

@tinyheero The problem is that you should be linking against a shared library of openssl, not the static one.

@epipping
Copy link
Contributor

It would be nice if git2r used pkg-config to find openssl and the necessary dependent libs. openssl comes with a pkg-config file after all. This would automatically take care of all the issues described here. On a properly configured system(*), one can run pkg-config --libs libssl and pkg-config --cflags libssl to get the necessary values for LIBS and CFLAGS, respectively.

Here's what I get on my system, e.g.:

% pkg-config --cflags libssl
-I/home/mi/pipping/dune/inst/openssl-1.0.2g/include 
% pkg-config --libs libssl    
-L/home/mi/pipping/dune/inst/openssl-1.0.2g/lib -lssl 
% 

Since git2r uses autoconf, it's easy to add pkg-config support. That's what PKG_CHECK_MODULES is for, see e.g. https://autotools.io/pkgconfig/pkg_check_modules.html

I'm also willing to help in carrying out the necessary changes.

(*) What I mean by that is: If one installs a library to a nonstandard location, one needs to make sure that PKG_CONFIG_PATH contains a corresponding path.

@stewid
Copy link
Member

stewid commented Apr 20, 2016

Hi @Pipping, I agree with you and would appreciate your contribution to add pkg-config to find openssl.

Cheers

@epipping
Copy link
Contributor

@stewid Great. I've now opened #231 for this purpose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants