Building otp27.2.1 with OpenSSL fails with "neither static nor dynamic crypto library found"

Hi everyone!

I’m trying to build the Erlang following the official instruction from here: https://www.erlang.org/doc/system/install-win32.html on WSL Ubuntu/Ubuntu24.04
As recommended , i downloaded and installed OpenSSL into C:/OpenSSL-Win64.
I have the \include\openssl folder with *.h files
I have \lib\ with fips.lib, libcrypto.lib and libssl.lib
I have \bin\ with libcrypto-3-x64.dll, libssl-3-x64.dll and openssl.exe files (all version 3.4.0)

I tried to build with command “./otp_build configure --srcdir=/mnt/c/opt/otp” - it finished the build successfully, but with following:

*********************  APPLICATIONS DISABLED  *********************
crypto         : No usable OpenSSL found
jinterface     : No Java compiler found
ssh            : No usable OpenSSL found
ssl            : No usable OpenSSL found
*********************  APPLICATIONS INFORMATION  ******************
crypto         : Static linking with OpenSSL 3.0 *MAY* require special configuring of the cryptolib.

i tried to provide the path to OpenSSL with following flags (1 by 1, combinations, together...)
*--with-ssl=/mnt/c/OpenSSL-Win64 *
*--with-ssl-rpath=/mnt/c/OpenSSL-Win64/bin *
*--with-ssl-lib-subdir=lib* 
*--enable-fips*  //it not getting to the stage of fips, so it can be present or not - same result
But it always result in the same error:
*...*
*checking for OpenSSL header in /mnt/c/OpenSSL-Win64... yes*
*checking for OpenSSL in /mnt/c/OpenSSL-Win64... configure: error: neither static nor dynamic crypto library found in /mnt/c/OpenSSL-Win64*
*ERROR: /mnt/c/opt/otp/lib/crypto/configure failed!*

based on checking for OpenSSL header in /mnt/c/OpenSSL-Win64… yes - it finds the headers, but not the libs…

Any idea what is wrong and how make it work? What is it looking for?
(I checked, OpenSSL also installed on Ubuntu: openssl version -v
OpenSSL 3.0.13 30 Jan 2024 (Library: OpenSSL 3.0.13 30 Jan 2024)

Hello! Can you post the entire printout from running configure?

@dgud sais that he remembers something about the OpenSSL installer having changed how it the files are structured and thus our configure cannot find it. We use 3.1.1 in CI and that works, so maybe try that and see if that works? Then you know that it is the OpenSSL version that is the problem.

I found that inside configure script decides if there are ssl libs by searching for a file with name “crypto_lib_name=libcrypto${lib_bits}MD” (means something like libcrypto64MD.lib)
From what I understand, such format was in OpenSSL version 0.98, maybe 1.1.0
Now the result of compilation OpneSSL 3.4.x is file with name libcrypto.lib
Fixing the configure script allowed to succesfully finish the compilation…
just not sure this is ligimit fix, as looks to me more like hack :slight_smile: