Jackie
Jackie

Reputation: 23607

Why is libCrypto not being installed when I install openssl from source on MacOs?

I am compiling openssl from source like...

https://github.com/openssl/openssl
cd openssl
./config
make
sudo make install

Then I set the .zshrc file to include...

export OPENSSL_DIR=/usr/local

But when I run ./configure --with-openssl from the postgres source directory I get

configure: error: library 'crypto' is required for OpenSSL

What am I missing?

ls -af of the /usr/local/lib shows...

-rwxr-xr-x   1 root  wheel    2608216 Jun 22 13:34 libcrypto.1.1.dylib
-rwxr-xr-x   1 root  wheel    3898256 Jun 17 08:47 libcrypto.3.dylib
-rw-r--r--   1 root  wheel    4258256 Jun 22 13:34 libcrypto.a
lrwxr-xr-x   1 root  wheel         19 Jun 22 13:34 libcrypto.dylib -> libcrypto.1.1.dylib

Upvotes: 3

Views: 6282

Answers (4)

eMaX
eMaX

Reputation: 1

Thanks, @YardXi, this actually helped installing pymupdf on Python 3.13. FWIW:

sudo ln -s /opt/local/lib/libcrypto.dylib /usr/local/lib/
sudo ln -s /opt/local/lib/libssl.dylib /usr/local/lib/
pip install --force-reinstall pymupdf

On MacOS, pymupdf would not install on Python 3.13, but would install just fine on 3.12. The error was that it could not find 'crypto'. Your comment led me to try adding those symbolic links (they point to libraries installed by brew, but the idea is the same).

Best,

Matthias

Upvotes: 0

YardXi
YardXi

Reputation: 21

I also had this problem on MacOS

configure: error: library 'crypto' is required for OpenSSL

It work for me

ln -s /usr/local/opt/openssl/lib/libcrypto.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.dylib /usr/local/lib/

Upvotes: 2

Rj_N
Rj_N

Reputation: 204

On MacOS below steps worked for me.

brew install openssl-devel


export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
export CPPFLAGS="-I/usr/local/opt/openssl@3/include"

./configure --with-openssl

./configure --with-openssl  > log
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1


postgresql-12.7 % tail log
config.status: src/include/pg_config.h is unchanged
config.status: creating src/include/pg_config_ext.h
config.status: src/include/pg_config_ext.h is unchanged
config.status: creating src/interfaces/ecpg/include/ecpg_config.h
config.status: src/interfaces/ecpg/include/ecpg_config.h is unchanged
config.status: linking src/backend/port/tas/dummy.s to src/backend/port/tas.s
config.status: linking src/backend/port/sysv_sema.c to src/backend/port/pg_sema.c
config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c
config.status: linking src/include/port/darwin.h to src/include/pg_config_os.h
config.status: linking src/makefiles/Makefile.darwin to src/Makefile.port

sudo make install 

Upvotes: 2

Jackie
Jackie

Reputation: 23607

I changed the configure command to ./configure --with-openssl --with-includes=/usr/local/include --with-libraries=/usr/local/lib. Before I ran this export LDFLAGS="-L/usr/local/lib" which may or may not have helped. Now it seems to work.

Upvotes: 2

Related Questions