Skip to content

DCNv2

https://github.com/CharlesShang/DCNv2 https://github.com/lbin/DCNv2/tree/pytorch_2.0.1

Installation

pip install torch==2.0.1 torchvision==0.15.2 --index-url https://download.pytorch.org/whl/cu118

sudo apt-get install libcrypt-dev

conda install -c conda-forge gcc=11 gxx=11 libxcrypt -y
cp /usr/include/crypt.h /home/konghaomin/.conda/envs/FairMOT/include/python3.8/

# cp /usr/include/crypt.h /opt/conda/include/python3.8/
# export CPATH=/opt/conda/include/


# /home/konghaomin/.conda/envs/FairMOT/compiler_compat/ld: cannot find /lib64/libpthread.so.0: 没有那个文件或目录
# /home/konghaomin/.conda/envs/FairMOT/compiler_compat/ld: cannot find /usr/lib64/libpthread_nonshared.a: 没有那个文件或目录
sudo apt-get install libc6-dev

sudo ln -s /usr/lib/x86_64-linux-gnu/libpthread.so.0 /lib64/libpthread.so.0
sudo ln -s /usr/lib/x86_64-linux-gnu/libc_nonshared.a /usr/lib64/libpthread_nonshared.a
sudo ln -s /usr/lib/x86_64-linux-gnu/libc_nonshared.a /usr/lib64/libc_nonshared.a
sudo ln -s /usr/lib/x86_64-linux-gnu/libc.so /lib64/libc.so.6

crypt.h:No such file or directory

https://blog.csdn.net/qq_37424778/article/details/138452953

apt install libcrypt
sudo apt-get update
sudo apt-get install libc6-dev

cp /usr/include/crypt.h /opt/conda/include/python3.8/
cp /usr/include/crypt.h /opt/conda/envs/mip-splatting/include/python3.8/crypt.h
conda install --channel=conda-forge libxcrypt

export CPATH=/opt/conda/include/

根据你提供的链接,这个问题出现在编译某些 C/C++ 程序时,报错信息为:

fatal error: crypt.h: No such file or directory

这是因为缺少 libxcrypt 相关的开发头文件。以下是整理优化后的 Markdown 技术文档,适合记录为解决方案笔记。


编译含有 #include <crypt.h> 的 C/C++ 程序时,出现如下错误:

fatal error: crypt.h: No such file or directory
compilation terminated.

📌 原因分析

此错误说明系统中缺少 crypt.h 头文件,具体缺失的是由 libxcrypt 提供的开发库。


💡 解决方案

✅ Ubuntu / Debian

安装 libxcrypt-dev

sudo apt update
sudo apt install libxcrypt-dev

✅ CentOS / RHEL / Fedora

Fedora 33+ 默认已分离 crypt 库,也需要安装开发包:

sudo dnf install libxcrypt-devel

或者:

sudo yum install libxcrypt-devel

✅ openSUSE

sudo zypper install libxcrypt-devel

cannot find /lib64/libpthread.so.0

https://github.com/NVIDIA/MinkowskiEngine/issues/606 https://github.com/ggml-org/llama.cpp/issues/9913#issuecomment-2532455253

sudo ln -s /usr/lib/x86_64-linux-gnu/libpthread.so.0 /lib64/libpthread.so.0
sudo ln -s /usr/lib/x86_64-linux-gnu/libc_nonshared.a /usr/lib64/libpthread_nonshared.a
sudo ln -s /usr/lib/x86_64-linux-gnu/libc_nonshared.a /usr/lib64/libc_nonshared.a
sudo ln -s /usr/lib/x86_64-linux-gnu/libc.so /lib64/libc.so.6