OpenSSL header does not match current version when compiling - header

When trying to compile freeRADIUS server 2.2.3, I've gotten the following error message:
checking for OpenSSL version >= 0.9.7... yes
checking OpenSSL library and header version consistency... library: 90819f header: 90812f... no
configure: error: in `/Users/tyrexionibus/Downloads/freeradius-server-2.2.3':
configure: error: OpenSSL library version does not match header version
Actually, the openSSL version is:
tyrexionibus$ openssl version
OpenSSL 1.0.1f 6 Jan 2014
And the header, located in /usr/include/openssl/opensslv.h contains:
#define OPENSSL_VERSION_NUMBER 0x0090819fL
Editing it doesn't solve the issue.
How do I solve this?

try to remove libssl-dev and install libssl1.0-dev
sudo apt remove libssl-dev
sudo apt install libssl1.0-dev
That worked for me

The problem is that often the compiler and linker search paths aren't consistent.
By default (unless modified with -isystem or -I) the GCC search path is:
/usr/local/include
libdir/gcc/target/version/include
/usr/target/include
/usr/include
By default (unless modified with -L) Apple's linker's search path is:
/usr/lib
/usr/local/lib
and by default (at least with 2.23.52.20130913 on Ubuntu 13.04) (unless modified with -L) the GNU linker's search path is:
/usr/local/lib:
/lib/x86_64-linux-gnu:
/usr/lib/x86_64-linux-gnu:
/usr/lib/x86_64-linux-gnu/mesa:
/lib:
/usr/lib:
The linker and the compiler may pick up completely different versions of the library's headers and binaries when multiple versions are installed on the system. The compiler may then emit code which is incompatible with the library's ABI, with undefined and usually undesirable behaviour. This is why the check was added.
To ensure consistency you should pass the --with-openssl-includes= and --with-openssl-libraries= flags to the configure script. These directories will then be searched first by the compiler and linker.
./configure --with-openssl-includes=/usr/include --with-openssl-libraries=/usr/lib
will result in the bundled or packaged OpenSSL libraries/headers being used on most systems.
Another option is to set LD_LIBRARY_PATH at configure time, though you'll also need to set this in your init scripts, else the runtime version check (yes, we were thorough) will fail.

In OSX 10.10 (Yosemite), I have to custom install openssl using brew.
$ brew update
$ brew install openssl
$ brew link --force openssl
Verify the version.
$ openssl version
OpenSSL 1.0.2 22 Jan 2015
I can see which library it is linked to.
$ otool -L /usr/local/bin/openssl
/usr/local/bin/openssl:
/usr/local/Cellar/openssl/1.0.2/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/Cellar/openssl/1.0.2/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
In my configure script I can then specify the OpenSSL path.
$ ./configure --with-ssl-dir=/usr/local/Cellar/openssl/1.0.2

You should probably check config.log generated by configure (in the same folder): it seems like you have at least 2 or even 3 versions of OpenSSL: 0.9.8r, 0.9.8y and 1.0.1f.
Explanation:
1) OPENSSL_VERSION_NUMBER = 0x0090819f in /usr/include/openssl/opensslv.h means 0.9.8y is installed into /usr;
2) output of command openssl version suggests that you have 1.0.1f somewhere in your PATH, but 1.0.1f defines OPENSSL_VERSION_NUMBER as 0x1000106fL, not 0x0090819f, so it's a different copy from the 1) above.
tyrexionibus$ openssl version
OpenSSL 1.0.1f 6 Jan 2014
3) 90812f in the output of configure means 0.9.8r.
You may also find an OpenSSL version matrix useful to match version numbers in hex (from opensslv.h) with human-readable version strings.

Just don't forget to add line into /etc/ld.so.conf
/usr/local/ssl/lib
and run ldconfig.
Without this step your libssl uses system lybcrypto instead of yours one.
Compare
BEFORE:
=======
[root]/usr/local/ssl/lib> ldd ./libssl.so
linux-vdso.so.1 (0x00007ffe4c93f000)
libcrypto.so.1.0.0 => /lib64/libcrypto.so.1.0.0 (0x00007febbdcd3000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007febbdacf000)
libc.so.6 => /lib64/libc.so.6 (0x00007febbd702000)
/lib64/ld-linux-x86-64.so.2 (0x0000558484e69000)
AFTER:
======
[root]/usr/local/ssl/lib> ldd ./libssl.so
linux-vdso.so.1 (0x00007ffcec2aa000)
libcrypto.so.1.0.0 => /usr/local/ssl/lib/libcrypto.so.1.0.0 (0x00007fa347db5000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fa347bb0000)
libc.so.6 => /lib64/libc.so.6 (0x00007fa3477e4000)
/lib64/ld-linux-x86-64.so.2 (0x00005567459c7000)
I was really happy when discovered this :=)

try this
./configure --with-openssl-lib-dir=/usr/local/openssl/lib/ --with-openssl-include-dir=/usr/local/openssl/include/

This fixed it for me...
sudo apt-get install libssl-dev

Related

Intel OneAPI 2022 - libimf.so No such file or directory - during openMPI compilation

trying to compile openmpi with intel oneapi 2022.0.1 compilers
OS is 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
I got the intel compilers as follows (just to make sure I didn't mess anything up at that step)
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt install intel-basekit
sudo apt install intel-hpckit
Configuring openmpi with:
./configure --prefix=${HPCX_HOME}/ompi-icc CC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icc CXX=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icpc F77=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort FC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort --with-ucx=/usr --with-platform=contrib/platform/mellanox/optimized
my .bashrc has (root has the same .bashrc)
source /opt/intel/oneapi/setvars.sh
export LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin
After configure I do : sudo make all install and get the following error:
ld: /opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/../../bin/intel64/../../lib/icx-lto.so: error loading plugin: libimf.so: cannot open shared object file: No such file or directory
There is no ifortvars.sh with this new version of oneAPI which seems to have solved similar issues for others in the past.
libimf.so is in:
/opt/intel/oneapi/itac/2021.5.0/bin/rtlib/libimf.so
/opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin/libimf.so
/opt/intel/oneapi/intelpython/python3.9/pkgs/intel-cmplr-lib-rt-2022.0.1-intel_3633/lib/libimf.so
/opt/intel/oneapi/intelpython/python3.9/lib/libimf.so
/opt/intel/oneapi/intelpython/python3.9/envs/2022.0.1/lib/libimf.so
Any help and/or advice regarding compiling openmpi with recent intel compilers would be appreciated.
Here is the solution I found but doubt that this is the most elegant way of doing this:
OS is 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
my .bashrc has (root has the same .bashrc)
source /opt/intel/oneapi/setvars.sh
created intel_libs.conf in
/etc/ld.so.conf.d/ and added the line /opt/intel/oneapi/compiler/2022.0.1/linux/compiler/lib/intel64_lin this is where the libimf.so lives.
sudo ldconfig
compiled openmpi with intel compilers fine after that using:
./configure --prefix={HPCX_HOME}/ompi-icc CC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icc CXX=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/icpc F77=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort FC=/opt/intel/oneapi/compiler/2022.0.1/linux/bin/intel64/ifort --with-ucx=/usr --with-platform=contrib/platform/mellanox/optimized
sudo make all
sudo make install
I hope this helps someone else and please let me know if there is a better way of doing this. Cheers
I am also facing similar issue not exactly. I installed the new ifort using the following command lines:
wget https://registrationcenter-download.intel.com/akdlm/irc_nas/18236/l_BaseKit_p_2021.4.0.3422.sh
sudo bash l_BaseKit_p_2021.4.0.3422.sh
wget https://registrationcenter-download.intel.com/akdlm/irc_nas/18211/l_HPCKit_p_2021.4.0.3347.sh
sudo bash l_HPCKit_p_2021.4.0.3347.sh
There is no file called setvars.sh inside the source /opt/intel/oneapi/, also while compiling any mpiifort file it is throwing me an error saying:
error loading plugin: libimf.so: cannot open shared object file: No such file or directory
Not even sure, if this is related to this thread or not, but any further guidance would be very helpful, thanks in advance.

Error using cmake to configure and build Axiros AXACT: OpenSSL Directory Not Found [duplicate]

I am trying to install a software that uses cmake to install itself. When I run cmake .. on the command line, it gives me following error in the CMakeLists.txt on the line that says find_package(OpenSSL REQUIRED):
-- Could NOT find Git (missing: GIT_EXECUTABLE)
ZLib include dirs: /usr/include
ZLib libraries: /usr/lib/arm-linux-gnueabihf/libz.so
Compiling with SSL support
CMake Error at /usr/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:97 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:291 (_FPHSA_FAILURE_MESSAGE)
/usr/local/share/cmake-2.8/Modules/FindOpenSSL.cmake:313 (find_package_handle_standard_args)
CMakeLists.txt:436 (find_package)
Here is the part of the file CMakeLists.txt where the error is coming from:
#
# OpenSSL
#
if (WITH_SSL)
message("Compiling with SSL support")
if (USE_CYASSL)
# Use CyaSSL as OpenSSL replacement.
# TODO: Add a find_package command for this also.
message("CyaSSL include dir: ${CYASSL_INCLUDE_DIRS}")
message("CyaSSL libraries: ${CYASSL_LIB}")
# Additional to the root directory we need to include
# the cyassl/ subdirectory which contains the OpenSSL
# compatability layer headers.
foreach(inc ${CYASSL_INCLUDE_DIRS})
include_directories(${inc} ${inc}/cyassl)
endforeach()
list(APPEND LIB_LIST ${CYASSL_LIB})
else()
# TODO: Add support for STATIC also.
find_package(OpenSSL REQUIRED)
message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")
include_directories(${OPENSSL_INCLUDE_DIR})
list(APPEND LIB_LIST ${OPENSSL_LIBRARIES})
endif()
endif(WITH_SSL)
I have OpenSSL installed here:
ssl header is here -- > /usr/local/ssl/include/openssl/
ssl library is here -- > /usr/local/ssl/lib/libssl.a
/usr/local/ssl/lib/libcrypto.a
openssl is here -- > /usr/local/ssl/bin
I have in my .profile:
export LD_LIBRARY_PATH=/usr/local/ssl/include/openssl:/usr/lib:/usr/local/lib:/usr/lib/pkgconfig:/usr/local/include/wx-2.8/wx:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=/usr/lib/pkgconfig
export OPENSSL_ROOT_DIR=/usr/local/ssl
export OPENSSL_LIBRARIES=/usr/local/ssl/lib/
PATH = /usr/local/ssl/bin:$PATH
How can I resolve this error?
EDIT:
Now I am getting this error
/usr/local/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_globallookup':
dso_dlfcn.c:(.text+0x10): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x24): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x30): undefined reference to `dlclose'
I had the same problem (openssl) and this worked for me on Ubuntu 14.04.1 LTS. The solution is the same up to Ubuntu 18.04 (tested).
sudo apt-get install libssl-dev
fixed it on macOS using
brew install openssl
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl -DOPENSSL_LIBRARIES=/usr/local/opt/openssl/lib
Same problem, and fixed it on my CentOS 6.5 using the following command:
yum install openssl-devel
Please install openssl from below link:
https://code.google.com/p/openssl-for-windows/downloads/list
then set the variables below:
OPENSSL_ROOT_DIR=D:/softwares/visualStudio/openssl-0.9.8k_WIN32
OPENSSL_INCLUDE_DIR=D:/softwares/visualStudio/openssl-0.9.8k_WIN32/include
OPENSSL_LIBRARIES=D:/softwares/visualStudio/openssl-0.9.8k_WIN32/lib
If you are using macOS then follow the below steps.
brew upgrade openssl
brew link --force openssl
pkg-config --modversion openssl
#1.1.1l
Clear the cmake build folder and rerun the cmake ..
As mentioned by others, on Ubuntu you should run
sudo apt install libssl-dev
But for me that was not enough, because although the libraries needed for building were installed, they still could not be found. What I had to install in addition was
sudo apt install pkg-config
If you can use pkg-config: pkg_search_module() can find OpenSSL for you.
# Search OpenSSL
find_package(PkgConfig REQUIRED)
pkg_search_module(OPENSSL REQUIRED openssl)
if( OPENSSL_FOUND )
include_directories(${OPENSSL_INCLUDE_DIRS})
message(STATUS "Using OpenSSL ${OPENSSL_VERSION}")
else()
# Error; with REQUIRED, pkg_search_module() will throw an error by it's own
endif()
target_link_libraries(${YOUR_TARGET_HERE} ${OPENSSL_LIBRARIES})
Just for fun, I'll post an alternative working answer for the OP's question:
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ -DOPENSSL_CRYPTO_LIBRARY=/usr/local/opt/openssl/lib/
Just in case...this works for me. Sorry for specific version of OpenSSL, but might be desirable.
# On macOS, search Homebrew for keg-only versions of OpenSSL
# equivalent of # -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ -DOPENSSL_CRYPTO_LIBRARY=/usr/local/opt/openssl/lib/
if (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
execute_process(
COMMAND brew --prefix OpenSSL
RESULT_VARIABLE BREW_OPENSSL
OUTPUT_VARIABLE BREW_OPENSSL_PREFIX
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if (BREW_OPENSSL EQUAL 0 AND EXISTS "${BREW_OPENSSL_PREFIX}")
message(STATUS "Found OpenSSL keg installed by Homebrew at ${BREW_OPENSSL_PREFIX}")
set(OPENSSL_ROOT_DIR "${BREW_OPENSSL_PREFIX}/")
set(OPENSSL_INCLUDE_DIR "${BREW_OPENSSL_PREFIX}/include")
set(OPENSSL_LIBRARIES "${BREW_OPENSSL_PREFIX}/lib")
set(OPENSSL_CRYPTO_LIBRARY "${BREW_OPENSSL_PREFIX}/lib/libcrypto.dylib")
endif()
endif()
...
find_package(OpenSSL REQUIRED)
if (OPENSSL_FOUND)
# Add the include directories for compiling
target_include_directories(${TARGET_SERVER} PUBLIC ${OPENSSL_INCLUDE_DIR})
# Add the static lib for linking
target_link_libraries(${TARGET_SERVER} OpenSSL::SSL OpenSSL::Crypto)
message(STATUS "Found OpenSSL ${OPENSSL_VERSION}")
else()
message(STATUS "OpenSSL Not Found")
endif()
you are having the FindOpenSSL.cmake file in the cmake module(path usr/shared.cmake-3.5/modules)
# Search OpenSSL
find_package(OpenSSL REQUIRED)
if( OpenSSL_FOUND )
include_directories(${OPENSSL_INCLUDE_DIRS})
link_directories(${OPENSSL_LIBRARIES})
message(STATUS "Using OpenSSL ${OPENSSL_VERSION}")
target_link_libraries(project_name /path/of/libssl.so /path/of/libcrypto.so)
Note for Fedora 27 users: I had to install openssl-devel package to run the cmake successfully.
sudo dnf install openssl-devel
On WSL I still got the error after running sudo apt install libssl-dev.
I had to run whereis openssl and then updated the commented out lines in CMakeCache.txt:
#OPENSSL_CRYPTO_LIBRARY:FILEPATH=OPENSSL_CRYPTO_LIBRARY-NOTFOUND
OPENSSL_CRYPTO_LIBRARY:FILEPATH=/usr/bin/openssl
#OPENSSL_INCLUDE_DIR:PATH=OPENSSL_INCLUDE_DIR-NOTFOUND
OPENSSL_INCLUDE_DIR:PATH=/usr/include/openssl
In addition to the accepted answer, I'm posting some extra information that could have saved me two full days' work and a complete CMake tear up. My machine runs Ubuntu 20.04
Installing libssl-dev as suggested includes two libraries: libssl and libcrypto. The find_package directive in my cmake project was eliminating the reference errors in my project, but it still couldn't find the libraries. That's because all of the accepted answers around tell you to use these lines:
find_package(OpenSSL REQUIRED)
target_link_libraries(MyExecutable OpenSSL Crypto)
Cmake will look for libraries with names libOpenSSL and libCrypto. Both failed due to capitalization, and libopenssl doesn't exist because the file is actually just named libssl. Indeed, check the contents of the libssl-dev package by using:
apt-file list libssl-dev
So, in my case, the solution was to use this cmake directive instead:
target_link_libraries(MyExecutable ssl crypto)
#Morwenn is right.
You need to config the openssl DIR.
Before that you may need to make sure you have it.
you should check whether you have it.
first run openssl version,then if you have it you can win + r run openssl
and you win find the core dir since it may not name as openssl in your system.
This is what I added in the CMakeList.txt (which worked):
# https://cmake.org/cmake/help/latest/command/find_package.html
# in the above link, it states:
# "In Module mode, CMake searches for a file called Find<PackageName>.cmake.
# The file is first searched in the CMAKE_MODULE_PATH, then among the Find
# Modules provided by the CMake installation. If the file is found, it is
# read and processed by CMake. It is responsible for finding the package,
# checking the version, and producing any needed messages. Some find-modules
# provide limited or no support for versioning; check the module documentation."
#
# FindOpenSSL.cmake can be found in path/to/cmake/Modules
#
# https://cmake.org/cmake/help/latest/module/FindOpenSSL.html
#
find_package(OpenSSL REQUIRED)
if (OPENSSL_FOUND)
# Add the include directories for compiling
target_include_directories(${PROJECT_NAME} PUBLIC ${OPENSSL_INCLUDE_DIR})
# Add the static lib for linking
target_link_libraries(${PROJECT_NAME} OpenSSL::SSL OpenSSL::Crypto)
message(STATUS "Found OpenSSL ${OPENSSL_VERSION}")
else()
message(STATUS "OpenSSL Not Found")
endif()
I'm using macOS and I preferred to set the environmental variable OPENSSL_ROOT_DIR
brew install openssl#1.1
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl#1.1/
The answer actually depends on the status of your system and the program you are using cmake on. Based on the second errors you are getting, you might need an extra openssl package that is not currently installed on your system. You can search packages using the aptitude search command. I recommend searching for "ssl" rather than "openssl" as the packages sometimes don't contain the word "open".
Another thing you can do to check which packages to install is to find if the manual or documentation of the product you are installing contains information about which packages to install.
Like the other posts comment, one of such packages is libssl-dev, but your program might need some other packages as well.

Loaded runtime CuDNN library: 7.1.2 but source was compiled with: 7.6.0; Ubuntu 18.04

I am trying to address the issue in the title:
Loaded runtime CuDNN library: 7.1.2 but source was compiled with: 7.6.0. CuDNN library major and minor version needs to match or have higher minor version in case of CuDNN 7.0 or later version
I have read several other posts (example: Loaded runtime CuDNN library: 5005 (compatibility version 5000) but source was compiled with 5103 (compatibility version 5100))
that basically tells me that my machine has CuDNN 7.1.2 but I need 7.6.0. The answer is then to download and install 7.6.*
the only issue is that I thought I did that by following the instructions on nvidia archive (https://developer.nvidia.com/rdp/cudnn-archive)
and if I go to /usr/local/cuda/include and read cudnn.h it shows
#if !defined(CUDNN_H_)
#define CUDNN_H_
#define CUDNN_MAJOR 7
#define CUDNN_MINOR 6
#define CUDNN_PATCHLEVEL 4
Currently I have CUDA-10.0, 10.1, and 10.2 installed with my .bashrc set to 10.0 (although nvcc --version states I have cuda 9.1 --another issue I cant seem to fix).
Any suggestions? I have been trying to tackle this for days but no luck.
UPDATE:
Here are the paths I have
export PATH=$PATH:/usr/local/cuda-10.0/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.0/lib64
export CUDA_HOME=/usr/local/cuda
Before this is closed could you help with either suggesting a proper path to set or to find old cudnn please?
I hit a very similar error:
Loaded runtime CuDNN library: 7.1.4 but source was compiled with: 7.6.5. CuDNN library major and minor version needs to match or have higher minor version in case of CuDNN 7.0 or later version. If using a binary install, upgrade your CuDNN library. If building from sources, make sure the library loaded at runtime is compatible with the version specified during compile configuration.
and tracked it down to accidentally having an older CuDNN in my ldconfig:
$ sudo ldconfig -p | grep libcudnn
libcudnn.so.7 (libc6,x86-64) => /usr/local/cuda-9.0/lib64/libcudnn.so.7
libcudnn.so.7 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcudnn.so.7
libcudnn.so (libc6,x86-64) => /usr/local/cuda-9.0/lib64/libcudnn.so
libcudnn.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libcudnn.so
The libcudnn.so.7 file in the cuda-9.0 directory was pointing to the older version:
ls -alh /usr/local/cuda-9.0/lib64/libcudnn.so.7
lrwxrwxrwx 1 root root 17 Dec 16 2018 /usr/local/cuda-9.0/lib64/libcudnn.so.7 -> libcudnn.so.7.1.4
But I had compiled tensorflow against the newer version:
ls -alh /usr/lib/x86_64-linux-gnu/libcudnn.so.7
lrwxrwxrwx 1 root root 17 Oct 27 2019 /usr/lib/x86_64-linux-gnu/libcudnn.so.7 -> libcudnn.so.7.6.5
Since ldconfig uses /etc/ld.so.conf to determine where to look for libraries (I guess in conjunction with LD_LIBRARY_PATH), I checked it and it showed:
include /etc/ld.so.conf.d/*.conf
When I listed the files in that directory, I spotted the problem file and removed it:
$ cat /etc/ld.so.conf.d/cuda9.conf
/usr/local/cuda-9.0/lib64
$ sudo rm /etc/ld.so.conf.d/cuda9.conf
After that I re-ran ldconfig to reload the config, and then everything worked as expected and the error disappeared.

How can I find out the version of MSYS2 from its bash shell

I would like to find out which version of MSYS2 is currently running, from within its bash shell.
For example, is there a command, similar to Windows "ver", or or a specific package that denotes the entire MSYS2 installation?
In case it matters, I am using the MSYS subsystem of MSYS2.
$ cat /proc/version
MINGW32_NT-10.0-22000 version 3.3.4-341.x86_64 (runneradmin#fv-az448-481) (gcc version 11.2.0 (GCC) ) 2022-02-15 17:24 UTC
or
$ uname -a
MINGW32_NT-10.0-22000 LAPTOP-FJNTRVPC 3.3.4-341.x86_64 2022-02-15 17:24 UTC x86_64 Msys
MSYS2 is basically just a collection of packages installed on your computer, managed by a package manager, which is itself a package. There is no overall version number. You can find out the versions of all your packages by running:
pacman -Q
If they msys is installed as the part of Ruby, then one can do
C:\>ridk exec pacman -Q
autoconf 2.69-5
autogen 5.18.16-1
automake-wrapper 11-1
automake1.10 1.10.3-4
automake1.11 1.11.6-4
automake1.12 1.12.6-4
automake1.13 1.13.4-5
automake1.14 1.14.1-4
automake1.15 1.15.1-2
automake1.16 1.16.2-2
automake1.6 1.6.3-3
automake1.7 1.7.9-3
automake1.8 1.8.5-4
automake1.9 1.9.6-3
base 2020.05-2
bash 4.4.023-2
bash-completion 2.10-1
brotli 1.0.7-4
bsdtar 3.4.3-1
bzip2 1.0.8-2
ca-certificates 20190110-1
coreutils 8.32-1
curl 7.71.1-1
dash 0.5.11.1-2
db 5.3.28-3
diffutils 3.7-1
file 5.39-1
filesystem 2020.02-7
findutils 4.7.0-1
gawk 5.1.0-1
gcc-libs 9.3.0-1
gdbm 1.18.1-3
getent 2.18.90-2
gettext 0.19.8.1-1
glib2 2.54.3-3
gmp 6.2.0-1
gnupg 2.2.23-1
grep 3.0-2
gzip 1.10-1
heimdal-libs 7.7.0-2
icu 67.1-1
inetutils 1.9.4-2
info 6.7-3
less 551-1
libargp 20110921-2
libasprintf 0.19.8.1-1
libassuan 2.5.3-1
libatomic_ops 7.6.10-1
libbz2 1.0.8-2
libcrypt 2.1-2
libcurl 7.71.1-1
libdb 5.3.28-3
libedit 20191231_3.1-1
libexpat 2.2.9-1
libffi 3.3-1
libgc 8.0.4-1
libgcrypt 1.8.6-1
libgdbm 1.18.1-3
libgettextpo 0.19.8.1-1
libgnutls 3.6.14-1
libgpg-error 1.38-1
libgpgme 1.14.0-2
libguile 2.2.7-1
libhogweed 3.6-1
libiconv 1.16-2
libidn2 2.3.0-1
libintl 0.19.8.1-1
libksba 1.4.0-1
libltdl 2.4.6-9
liblz4 1.9.2-1
liblzma 5.2.5-1
libmetalink 0.1.3-3
libnettle 3.6-1
libnghttp2 1.41.0-1
libnpth 1.6-1
libopenssl 1.1.1.g-3
libp11-kit 0.23.20-2
libpcre 8.44-1
libpcre2_8 10.35-1
libpsl 0.21.0-1
libreadline 8.0.004-1
libsqlite 3.33.0-2
libssh2 1.9.0-1
libtasn1 4.16.0-1
libtool 2.4.6-9
libunistring 0.9.10-1
libutil-linux 2.35.2-1
libxml2 2.9.10-6
libxslt 1.1.34-3
libzstd 1.4.5-2
m4 1.4.18-2
make 4.3-1
mingw-w64-x86_64-binutils 2.35.1-2
mingw-w64-x86_64-crt-git 8.0.0.6001.98dad1fe-1
mingw-w64-x86_64-expat 2.2.9-1
mingw-w64-x86_64-gcc 10.2.0-3
mingw-w64-x86_64-gcc-libs 10.2.0-3
mingw-w64-x86_64-gettext 0.19.8.1-9
mingw-w64-x86_64-gmp 6.2.0-1
mingw-w64-x86_64-headers-git 8.0.0.6001.98dad1fe-1
mingw-w64-x86_64-isl 0.22.1-1
mingw-w64-x86_64-libiconv 1.16-1
mingw-w64-x86_64-libmangle-git 8.0.0.6001.98dad1fe-1
mingw-w64-x86_64-libwinpthread-git 8.0.0.6001.98dad1fe-3
mingw-w64-x86_64-make 4.3-1
mingw-w64-x86_64-mpc 1.2.0-1
mingw-w64-x86_64-mpfr 4.1.0-2
mingw-w64-x86_64-pkg-config 0.29.2-2
mingw-w64-x86_64-readline 8.0.004-1
mingw-w64-x86_64-sqlite3 3.33.0-1
mingw-w64-x86_64-tcl 8.6.10-1
mingw-w64-x86_64-termcap 1.3.1-6
mingw-w64-x86_64-tools-git 8.0.0.6001.98dad1fe-1
mingw-w64-x86_64-windows-default-manifest 6.4-3
mingw-w64-x86_64-winpthreads-git 8.0.0.6001.98dad1fe-3
mingw-w64-x86_64-zlib 1.2.11-7
mingw-w64-x86_64-zstd 1.4.5-1
mintty 1~3.4.0-1
mpfr 4.1.0-1
msys2-keyring r21.b39fb11-1
msys2-launcher 1.0-1
msys2-runtime 3.1.7-2
ncurses 6.2-1
nettle 3.6-1
openssl 1.1.1.g-3
p11-kit 0.23.20-2
pacman 5.2.2-4
pacman-contrib 1.3.0-1
pacman-mirrors 20200329-1
patch 2.7.6-1
perl 5.32.0-2
pinentry 1.1.0-2
pkg-config 0.29.2-1
rebase 4.4.4-2
sed 4.8-1
tar 1.32-1
tcl 8.6.10-1
texinfo 6.7-3
texinfo-tex 6.7-3
tftp-hpa 5.2-3
time 1.9-1
tzcode 2020a-1
util-linux 2.35.2-1
wget 1.20.3-1
which 2.21-2
xz 5.2.5-1
zlib 1.2.11-1
zstd 1.4.5-2

undefined reference to 'SHA512#OPENSSL_0.9.8'

I'm trying to link my code against a shared library ("libX.so") which depends on libcrypto.so. I have libcrypto.so.1.0.0 installed, but it seems to specifically require libcrypto.so.0.9.8. Is there a way to get it to link against 1.0.0? I can't install 0.9.8 on my system (archlinux) without breaking other packages.
/usr/bin/ld: warning: libcrypto.so.0.9.8, needed by /usr/local/lib/libX.so, not found (try using -rpath or -rpath-link)
/usr/local/lib/libX.so: undefined reference to `SHA512#OPENSSL_0.9.8'
...
EDIT:
I should probably add more information. I have tried compiling openssl 0.9.8 and installing to the prefix /usr/local. But even though it seems to find this library, there are still errors when building:
/usr/local/lib/libX.so: undefined reference to `SHA512#OPENSSL_0.9.8'
...
libcrypto does seem to define this:
$ nm /usr/local/ssl/lib/libcrypto.so.0.9.8 | grep SHA512
000000000006f9b0 T SHA512
...
I am using the following script to compile:
export LD_LIBRARY_PATH+=:/usr/local/ssl/lib
gcc -I/usr/local/include/ test.c -o test -lX
And this is the output of ldd on libX:
$ ldd /usr/local/lib/libX.so
/usr/local/lib/libX.so: /usr/local/ssl/lib/libcrypto.so.0.9.8: no version information available (required by /usr/local/lib/libX.so)
libssl.so.0.9.8 => /usr/local/ssl/lib/libssl.so.0.9.8 (0x00007f9c4e329000)
libcrypto.so.0.9.8 => /usr/local/ssl/lib/libcrypto.so.0.9.8 (0x00007f9c4df99000)
...
refer to http://forums.gentoo.org/viewtopic-t-835256-start-0.html
openssl-0.9.8l-sym-version-felixrabe.patch work fine for me!
Because the original OpenSSL library was built with a version script. This is a feature so you can have different versions of the the library and still get the right symbol.
You can add your own looking like this:
OPENSSL_0.9.8 {
*;
};
And then link with --version-script
To make OpenSSL do this you probably need to edit the Makefile.