为什么当我在 MacO 上从源代码安装 openssl 时没有安装 libCrypto?

问题描述 投票:0回答:4

我正在从源代码编译 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”

我错过了什么?

ls -af
/usr/local/lib
显示...

-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
postgresql macos openssl
4个回答
2
投票

我将配置命令更改为

./configure --with-openssl --with-includes=/usr/local/include --with-libraries=/usr/local/lib
。在我运行这个
export LDFLAGS="-L/usr/local/lib"
之前,这可能有帮助,也可能没有帮助。现在看来有效了。


2
投票

在 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 


2
投票

我在 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/

0
投票

谢谢@YardXi,这实际上有助于在 Python 3.13 上安装 pymupdf。 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

在 MacOS 上,pymupdf 不会安装在 Python 3.13 上,但可以在 3.12 上安装得很好。错误是它找不到“加密货币”。你的评论引导我尝试添加这些符号链接(它们指向由brew安装的库,但想法是相同的)。

最好的,

马蒂亚斯

© www.soinside.com 2019 - 2024. All rights reserved.