8
responses

Dear,

Attempting to compile nxlog-ce on Arch Linux i hit a snag.

./configure
results in
checking for openssl/evp.h... yes
checking for EVP_CIPHER_CTX_init in -lcrypto... no
configure: error: libcrypto not found

-- the configure: error is generated on

#define HAVE_LIBCRYPTO 1
_ACEOF

LIBS="-lcrypto $LIBS"

else
as_fn_error $? "libcrypto not found" "$LINENO" 5
fi

I doubt if i want to modify ./configure to skip this. What can i do to fix this ?

lib is installed

/usr/lib/libressl/libcrypto.so
/usr/lib/libressl/libcrypto.so.46
/usr/lib/libressl/libcrypto.so.46.0.1
/usr/lib/libressl/pkgconfig/libcrypto.pc
/usr/lib/libcryptopp.so
/usr/lib/libcryptopp.so.8
/usr/lib/libcryptopp.so.8.2.0
/usr/lib/libcrypto.so
/usr/lib/libcrypto.so.1.1

Br,

Joris

AskedMay 27, 2020 - 1:59am

Comments (6)

  • saifi's picture

    @Joris

    ArchLinux is not only cutting edge distro but also flexible. I use ArchLinux for just about everything including heavy duty server applications and running 60+ VMs.

    As to your question, here are the steps to follow

    mkdir src_hack
    # extract the nxlog-ce tar gz

    git clone https://github.com/openssl/openssl
    cd openssl

    # EVP_CIPHER_CTX_init is available in openssl 1.0.2
    git branch my_openssl_102 OpenSSL_1_0_2
    git checkout my_openssl_102

    # create a custom config
    # use absolute PATH/build_openssl_102 pattern for ease of scripting)
    mkdir build_openssl_102
    ./config -d --prefix=./build_openssl_102 --openssldir=./build_openssl_102 shared
    make
    make install

    # directory structure should look like
    $ cd build_openssl_102/
    $ ls
    bin/ certs/ include/ lib/ man/ misc/ openssl.cnf private/

    # update environment variables (create a script for repetitive usage if you can)
    # update CPATH
    # update LD_LIBRARY_PATH
    # PATH

    # verify the symbol EVP_CIPHER_CTX_init
    $ nm libcrypto.so.1.0.0 | grep EVP_CIPHER_CTX_init
    000000000014bea3 T EVP_CIPHER_CTX_init

    now you are all set to compile NXlog-ce and explore stuff ahead !

    warm regards
    Saifi.

Answer (1)

Found the issue by mere chance, this happened in Debian 10 (sid) but confirmed it in Debian 10 (Buster) and Ubuntu 18.04 LTS.

The libssl-dev library installed by default in .deb based systems is not correct, use libssl1.0-dev instead and this will work as intended, I am just compiling this in a Raspberry Pi and it is working without an issue.

Cheers.

Comments (1)

  • AM_263121's picture

    For Centos 8:
    Build your own openssl v1.0.2 with
    ./config --prefix=/usr/local --shared
    make
    make test
    sudo make install
    Now, needed libraries are in /usr/local/lib64 and no problems with "checking for EVP_CIPHER_CTX_init in -lcrypto... no" and "libcrypto not found".