Question

I'm trying to install numlua with luarocks:

luarocks make numlua-0.3-1.rockspec

but am getting the following error:

/usr/bin/ld: numlua.o: relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC
numlua.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
cp: cannot stat `numlua.so': No such file or directory

I'm guessing I need to add the -fPIC argument as a flag but not being great with compilers and a first-timer with luaRocks I'm not sure how or where to add this, or, if there is something else I'm doing wrong. Any help would be appreciated!

Was it helpful?

Solution

Per this mailing list discussion, it looks like LuaRocks is configured for a 32-bit system while actually running on a 64-bit system. It's likely that you installed it via a package manager, as this shouldn't happen when installed from source.

Find your luarocks/config.lua file. On my Ubuntu 11.10 system, it was located at /usr/share/lua/5.1/luarocks/config.lua. Find the line that says LUAROCKS_UNAME_M and change the i686 to x86_64.

Now that luarocks knows it's on a 64-bit machine, numlua should compile fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top