【问题标题】:Unable to build surround360_render - CMake issue无法构建环绕 360_render - CMake 问题
【发布时间】:2018-11-26 01:48:30
【问题描述】:

背景 我在全新安装的 Kubuntu 16.04.04 LTS 上运行它。 我正在尝试根据以下代码和说明构建环绕360_render:https://github.com/facebook/Surround360/tree/master/surround360_render

  • 除了 python、numpy、pip 的说明外,我都按照说明进行操作。 gooey,pil 安装(我不需要 python)。
  • 根据此处的说明安装 ceres,而不是 ceres git 页面上的说明。
  • 已安装 llvm、Halide 以使用加速 ISP

在制作 ...360_render 时出现以下错误:

[ 92%] Linking CXX executable bin/Unpacker
//usr/local/lib/libfolly.a(Conv.cpp.o): In function `folly::Expected<float, folly::ConversionCode> folly::detail::str_to_floating<float>(folly::Range<char const*>*)':
/home/rinka/bin/fb-lib/folly/folly/folly/Conv.cpp:354: undefined reference to `double_conversion::StringToDoubleConverter::StringToDouble(char const*, int, int*) const'
//usr/local/lib/libfolly.a(Conv.cpp.o): In function `folly::Expected<double, folly::ConversionCode> folly::detail::str_to_floating<double>(folly::Range<char const*>*)':
/home/rinka/bin/fb-lib/folly/folly/folly/Conv.cpp:354: undefined reference to `double_conversion::StringToDoubleConverter::StringToDouble(char const*, int, int*) const'
//usr/local/lib/libfolly.a(dynamic.cpp.o): In function `double_conversion::DoubleToStringConverter::ToShortest(double, double_conversion::StringBuilder*) const':
/usr/local/include/double-conversion/double-conversion.h:158: undefined reference to `double_conversion::DoubleToStringConverter::ToShortestIeeeNumber(double, double_conversion::StringBuilder*, double_conversion::DoubleToStringConverter::DtoaMode) const'
//usr/local/lib/libfolly.a(dynamic.cpp.o): In function `std::enable_if<std::is_floating_point<double>::value&&folly::IsSomeString<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::value, void>::type folly::toAppend<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, double>(double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, double_conversion::DoubleToStringConverter::DtoaMode, unsigned int)':
/home/rinka/bin/fb-lib/folly/folly/folly/Conv.h:704: undefined reference to `double_conversion::DoubleToStringConverter::ToFixed(double, int, double_conversion::StringBuilder*) const'
/home/rinka/bin/fb-lib/folly/folly/folly/Conv.h:708: undefined reference to `double_conversion::DoubleToStringConverter::ToPrecision(double, int, double_conversion::StringBuilder*) const'
//usr/local/lib/libfolly.a(Format.cpp.o): In function `folly::FormatValue<double, void>::formatHelper(folly::basic_fbstring<char, std::char_traits<char>, std::allocator<char>, folly::fbstring_core<char> >&, int&, folly::FormatArg&) const':
/home/rinka/bin/fb-lib/folly/folly/folly/Format.cpp:162: undefined reference to `double_conversion::DoubleToStringConverter::ToFixed(double, int, double_conversion::StringBuilder*) const'
/home/rinka/bin/fb-lib/folly/folly/folly/Format.cpp:181: undefined reference to `double_conversion::DoubleToStringConverter::ToExponential(double, int, double_conversion::StringBuilder*) const'
collect2: error: ld returned 1 exit status
CMakeFiles/TestRenderStereoPanorama.dir/build.make:112: recipe for target 'bin/TestRenderStereoPanorama' failed
make[2]: *** [bin/TestRenderStereoPanorama] Error 1
CMakeFiles/Makefile2:556: recipe for target 'CMakeFiles/TestRenderStereoPanorama.dir/all' failed
make[1]: *** [CMakeFiles/TestRenderStereoPanorama.dir/all] Error 2
[ 96%] Built target Unpacker
[ 96%] Built target GeometricCalibration
Makefile:83: recipe for target 'all' failed

到目前为止我所做的尝试

  • 我尝试实现https://github.com/facebook/Surround360/issues/253 失败。我收到以下消息:

    [ 98%] Generating folly_dep.cpp
    Scanning dependencies of target folly
    [ 98%] Building CXX object CMakeFiles/folly.dir/folly_dep.cpp.o
    [ 99%] Linking CXX shared library libfolly.so
    /usr/bin/ld: CMakeFiles/folly_base.dir/folly/ClockGettimeWrappers.cpp.o: relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
    CMakeFiles/folly_base.dir/folly/ClockGettimeWrappers.cpp.o: error adding symbols: Bad value
    collect2: error: ld returned 1 exit status
    CMakeFiles/folly.dir/build.make:514: recipe for target 'libfolly.so' failed
    make[2]: *** [libfolly.so] Error 1
    CMakeFiles/Makefile2:180: recipe for target 'CMakeFiles/folly.dir/all' failed
    make[1]: *** [CMakeFiles/folly.dir/all] Error 2
    Makefile:127: recipe for target 'all' failed
    
  • 假设 apt 安装的标准 double-conversion-dev 库有问题,我卸载了它,使用以下说明重新编译了 double-conversion:

    git clone https://github.com/google/double-conversion.git
    cd double-conversion
    cmake -DBUILD_SHARED_LIBS=ON .
    make -j $(nproc)
    sudo make install
    
  • 并重建愚蠢如下:

    $ cmake configure ..
    $ make -j $(nproc)
    

没用。重做 cmake & make

    $ cmake configure "-DCMAKE_INCLUDE_PATH=$HOME/bin/fb-lib/double-conversion/build/include" "-DCMAKE_LIBRARY_PATH=$HOME/bin/fb-lib/double-conversion/build//lib" ..
    $ make -j $(nproc)

我收到以下错误:

    CMake Error at CMakeLists.txt:201 (find_package):
        Could not find a package configuration file provided by "double-conversion"
        with any of the following names:

        double-conversionConfig.cmake
        double-conversion-config.cmake

    Add the installation prefix of "double-conversion" to CMAKE_PREFIX_PATH or
    set "double-conversion_DIR" to a directory containing one of the above
    files.  If "double-conversion" provides a separate development package or
    SDK, be sure it has been installed.

【问题讨论】:

  • 嗯...好的。我解决了这个问题。我修改了环绕360_render 中的“CMakeLists.txt”。我添加了“双重转换”作为要链接的附加库,它可以工作。这是 FB 需要改进的缺陷……

标签: c++ linux facebook cmake folly


【解决方案1】:

问题是因为“双重转换”没有作为库包含在环绕360_render 的各个模块中。为解决问题,修改surround360_render目录下的CMakeLists.txt如下:

添加:

双重转换

到失败的各种模块的 TARGET_LINK_LIBRARIES 部分。就我而言,失败的模块是:TestRenderStereoPanorama、TestHyperPreview、TestPoleRemoval、TestColorCalibration、TestVignettingCalibration、TestVignettingDataAcquisition 和 GeometricCalibration

之所以列出这些,是因为模块比这些多,这就是为什么不需要添加双重转换作为要链接的默认库的原因。

将其放在这里以防其他人遇到类似问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-18
    • 1970-01-01
    • 2017-10-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多