【问题标题】:fblualib installation with luarocks使用 luarocks 安装 fblualib
【发布时间】:2018-08-10 23:14:59
【问题描述】:

我正在尝试安装 fblualib,但遇到了我无法找到解决方法的问题。

我发出了以下命令:

git clone https://github.com/facebook/fblualib.git
cd fblualib/fblualib/python
luarocks make rockspec/*

并有以下输出:非常感谢任何帮助,因为我真的陷入了这个错误。

        cmake -E make_directory build &&
        cd build &&
        cmake -DROCKS_PREFIX=/home/ubuntu/usr/local/torch/install/lib/luarocks/rocks/fbpython/0.1-1 \
              -DROCKS_LUADIR=/home/ubuntu/usr/local/torch/install/lib/luarocks/rocks/fbpython/0.1-1/lua \
              -DROCKS_LIBDIR=/home/ubuntu/usr/local/torch/install/lib/luarocks/rocks/fbpython/0.1-1/lib \
              .. &&
        make

-- Found Torch7 in /home/ubuntu/usr/local/torch/install
-- Boost version: 1.58.0
-- Found the following Boost libraries:
--   thread
--   chrono
--   system
--   date_time
--   atomic
-- Found PythonInterp: /usr/local/bin/python2.7 (found suitable version "2.7.14", minimum required is "2.7") 
-- Found PythonInterp: /usr/local/bin/python2.7 (found version "2.7.14") 
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/usr/src/fblualib/fblualib/python/build
[ 11%] Linking CXX shared module lib.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
CMakeFiles/lua_module.dir/build.make:283: recipe for target 'lib.so' failed
make[2]: *** [lib.so] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/lua_module.dir/all' failed
make[1]: *** [CMakeFiles/lua_module.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

【问题讨论】:

    标签: torch luarocks


    【解决方案1】:

    所以基本上我发现了这个问题,通过在 python 编译期间添加--enable-shared 解决了所有问题。所以我再次重新编译了python并且它工作了。希望它可以帮助其他人并防止他们花费相同的时间。

    【讨论】:

      猜你喜欢
      • 2013-08-03
      • 2017-05-10
      • 1970-01-01
      • 2015-12-25
      • 2014-02-14
      • 2016-03-22
      • 2021-02-09
      • 2018-11-08
      • 2016-06-10
      相关资源
      最近更新 更多