Docker构建错误/usr/bin/ld:找不到-lstdc fedora29
docker build error /usr/bin/ld: cannot find -lstdc++ fedora29
我正在尝试使用以下dockerfile来构建docker容器:
FROM fedora:29
RUN dnf -y update && dnf install -y file gcc gcc-c++ git make wget which libtool python3-pip redhat-rpm-config python3-devel zlib-devel libstdc++ openmpi-devel
RUN cd /tmp &&
wget http://www.mpich.org/static/downloads/3.3/mpich-3.3.tar.gz &&
gzip -dc mpich-3.3.tar.gz | tar xf - &&
cd mpich-3.3 &&
./configure --disable-fortran --prefix=/usr/mpich-3.3 &&
make &&
make install
ENV PATH /usr/mpich-3.3/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/mpich-3.3/lib:${LD_LIBRARY_PATH}
RUN cd /usr && git clone https://github.com/Dowell-Lab/FStitch
RUN cd /usr/FStitch/src && make clean && make
RUN pip3 install FStitch-Bidir --user
ENV PATH /usr/FStitch/src:${PATH}
ENV PATH /root/.local/bin:${PATH}
RUN cd /usr && git clone https://github.com/Dowell-Lab/Tfit
RUN cd /usr/Tfit/src && make clean && make
ENV PATH /usr/Tfit/src:${PATH}
CMD /bin/bash
我要克隆的项目写在C 11中,而两个(TFIT)中的第二个需要OpenMPI/mpich。第一个程序成功编译了,但是第二个程序在编译器的最后一步中遇到以下错误:
/usr/bin/ld: cannot find -lstdc++
collect2: error: ld returned 1 exit status
make: *** [Makefile:20: NU_FIT] Error 1
我搜索并找到了这两个链接:
cpp:usr/bin/ld:找不到-l< nameofthelibrary>
usr/bin/ld:找不到-l< nameofthelibrary>
,但是这两个都没有解决这个问题,因为我猜我只是错过了库的依赖性/符号链接,但是我不确定如何在构建中实现这一目标。我可以在本地成功编译,但是我必须模块加载MPI/OpenMPI-X86_64才能这样做。我的猜测是,在设置LD_Library_path时,这是一个开放性问题,但不确定如何在Docker Build中解决此问题。
makefile的前几行如下:
CXX = mpic++
CXXFLAGS = -static-libstdc++ -static-libgcc -Wno-unused-variable -Wno-non-virtual-dtor -std=c++11 -fopenmp -Wno-write-strings -Wno-literal-suffix -D_GLIBCXX_USE_CXX11_ABI=0 -g
EXEC = ${PWD}/Tfit
ARCH = getconf LONG_BIT
CPP_FLAGS_32 = -D32_BIT
CPP_FLAGS_64 = -D64_BIT
GCCVERSION = $(shell ${CXX} -dumpversion)
NU_FIT: main.o load.o split.o model.o across_segments.o template_matching.o
read_in_parameters.o model_selection.o error_stdo_logging.o
MPI_comm.o density_profiler.o bootstrap.o prelim_main.o model_main.o select_main.o FDR.o BIC.o ParamWrapper.o old_template_matching.o
@printf "linking : "
@${CXX} ${CXXFLAGS} ${PWD}/main.o ${PWD}/load.o ${PWD}/model_selection.o
${PWD}/split.o ${PWD}/model.o ${PWD}/across_segments.o
${PWD}/template_matching.o ${PWD}/read_in_parameters.o
${PWD}/MPI_comm.o
${PWD}/bootstrap.o ${PWD}/density_profiler.o
${PWD}/prelim_main.o ${PWD}/model_main.o ${PWD}/BIC.o ${PWD}/FDR.o
${PWD}/select_main.o ${PWD}/error_stdo_logging.o ${PWD}/ParamWrapper.o ${PWD}/old_template_matching.o -o ${EXEC} -lmpi
@cp ${PWD}/Tfit ${PWD}/EMGU
任何帮助都将受到赞赏!
尝试在dnf install
列表中添加libstdc++-static
。(https://github.com/numenta/nupic/issues/1901)
相关文章:
- std::map<struct,struct>::find 找不到匹配项,但是如果我循环通过 begin() 到 end(),我在那里看到匹配项
- 找不到成员对象:没有名为get_event()的成员,也处理多态性和向量
- 为什么野牛仍在使用"int yylex(void)",却找不到"int yylex(YYS
- C++ Windows 驱动程序MSB3030无法复制该文件,因为它找不到
- 奇怪的(对我来说)返回声明 - 在谷歌上找不到任何关于它的信息
- 找不到QtResource文件中的文件
- VC++本机单元测试,找不到调试符号
- RegGetValue在当前用户下找不到名称
- 带有 -stdlib=libc++ 的 clang++ 9.0.1 找不到<optional>
- c++找不到具有相同哈希的无序集合元素
- 找不到以下加速库:boost_fiber
- 找不到 FLTK(缺少:FLTK_INCLUDE_DIR)
- 设置 Visual Studio for MPI: 找不到标识符错误
- "assimp/config.h"找不到,但它在文件夹中
- 链接器找不到在虚拟类 c++ 中访问的静态字段的符号
- C++系统找不到指定的文件错误
- FindPackageHandleStandardArgs.cmake:137 的 CMake 错误(消息):找不到 Boost (缺少:正则表达式)(找到合适的版本"1.72.0",
- OS X: ld: 找不到 -lstdc++ 的库
- 为什么“ld:找不到 -lstdc++ 的库”,当我使用 pybind11 为 c++ 库打包我的 python 绑定时
- Docker构建错误/usr/bin/ld:找不到-lstdc fedora29