Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 242
Jackie Avatar asked Sep 18 '25 12:09

Jackie


2 Answers

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 

like image 166
Rj_N Avatar answered Sep 21 '25 00:09

Rj_N


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.

like image 27
Jackie Avatar answered Sep 21 '25 00:09

Jackie