首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用luarocks安装fblualib

使用luarocks安装fblualib
EN

Stack Overflow用户
提问于 2018-03-03 01:21:23
回答 1查看 530关注 0票数 2

我正在尝试安装fblualib,面对这个问题,我一直无法找到解决它的方法。

我发出了以下命令:

代码语言:javascript
复制
git clone https://github.com/facebook/fblualib.git
cd fblualib/fblualib/python
luarocks make rockspec/*

并有以下输出:非常感谢任何帮助,因为我真的被困在这个错误中。

代码语言:javascript
复制
        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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-03-03 02:46:49

所以基本上我找到了这个问题,通过在python编译过程中添加--enable-shared修复了这个问题。所以我再次重新编译了python,它起作用了。希望它能帮助别人,并防止他们花费同样的时间。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49074214

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档