![](/img/trans.png)
[英]Why postgresql@11 service failed instantly after i installed with brew on macos?
[英]Why is libCrypto not being installed when I install openssl from source on MacOs?
我正在从源代码编译 openssl...
https://github.com/openssl/openssl
cd openssl
./config
make
sudo make install
然后我将.zshrc
文件设置为包含...
export OPENSSL_DIR=/usr/local
但是当我从postgres 源目录运行./configure --with-openssl
时,我得到了
配置:错误:OpenSSL 需要库“crypto”
我错过了什么?
/usr/local/lib
的ls -af
显示...
-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
我将配置命令更改为./configure --with-openssl --with-includes=/usr/local/include --with-libraries=/usr/local/lib
。 在我运行这个export LDFLAGS="-L/usr/local/lib"
之前,它可能有帮助,也可能没有帮助。 现在它似乎工作了。
在 MacOS 上,以下步骤对我有用。
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
我在 MacOS 上也遇到过这个问题
configure: error: library 'crypto' is required for OpenSSL
它对我有用
ln -s /usr/local/opt/openssl/lib/libcrypto.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.dylib /usr/local/lib/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.