luasocket 3.0,undefined symbol:lua_callk - luajit

I'm using luajit 2.0.3,and I want to use luasocket in myproject.When require socket in jit, it reported an error
"error loading module 'socket.core' from file '/usr/local/lib/lua/5.1/socket/core.so': /usr/local/lib/lua/5.1/socket/core.so: undefined symbol: lua_callk.
I compiled luasocket 3.0 in debian 5.0 with lua5.1.
I searched a lot of answers ,but none helped. I compiled luasocket 3.0 in debian 5.0 with lua5.1.

LuaJIT is ABI-compatible with Lua 5.1, that means, you can compile a C module against the standard Lua headers and either load it from Lua or from LuaJIT.
Judging from the error message, LuaSocket requires the function lua_callk, however, as for today, this function is not implemented in LuaJIT. There has been requests of implementing this function as well as lua_pcallk and lua_yieldk but doing it so would require LuaJIT to switch to the Lua 5.2 ABI [1].
I would suggest you to switch to an older version of LuaSocket (2.0.2, for instance) or check whether LuaSocket can be compiled keeping 5.1 ABI compatibility.
[1] http://www.freelists.org/post/luajit/Yielding-across-C-boundaries,3

Related

Building Boost on Mac OS M1 chipset

I tried almost a hundred things to make this works but nothing seems to be working.
I recently acquire a Mac book pro M1 MAX (so arm64 architecture), system provided by default with clang g++.
I wanted to install boost library. Using homebrew the 1.80 version was installed but I need to work on a project with the 1.65.1 version (I tried compiling my project with 1.80 version and tons of undefined symbols and errors were raised from boost library even if I have all of them, so I'm guessing I need to install the exact same version required)
so I decided to build and compile boost by myself following the boost guide
https://www.boost.org/doc/libs/1_65_1/more/getting_started/unix-variants.html
Following section 5.1 I tried to use the bootstrap script and this one fails using Darwin toolset. (apparently some Clang warning caused error). I resolve then by changing the boost source code like this :
https://github.com/boostorg/build/commit/48e9017139dd94446633480661e5447c7e0d8b1b
But there's still lot of issues during the compilation
I don't know what to do to be able to compile with clang, I don't even know if this will be compiled for arm64 architecture.
anyway I install gcc compiler and tried with gcc toolset.
./bootstrap --with-toolset=gcc
The bootstraps works but then running the b2 script cause a segmentation fault instantly and on every commands I tried (even the --help options raised an exception...).
Why is building boost so complicated on arm chipset ?
What can I do to build boost (either clang or gcc, arm or cross compiled universal library) ?
I'm desperate at this point.
Thanks for the help.
I tried everything
with clang (darwin)
with gcc
with options to add arm64 as architecture
changing the source code of boost to fix

Compile to a specific OpenMP version

I'm compiling a piece of C-code that uses OpenMP with GCC 5.4 (Ubuntu 16.04). The compiled code works fine when executed on the same machine and the OpenMP parts also works fine.
The problem is that I want to move the compiled binaries to a Centos 6.5 machine. Currently I get an error which says:
/usr/lib64/libgomp.so.1: version 'GOMP_4.0' not found (required by ...)
I understand that GCC 5.4 (which I compile my code with) supports OpenMP 4.0 but is there a way to force GCC5.4 to compile my code to a target which dosen't forces the OpenMP 4.0 support? The CentOS machine includes GCC4.3 (and thus OpenMP 3.0). Or is there another solution to my problem?

run using KLEE error

I am new to Klee, so I started to make the tutorials.
If for compilation I use:
llvm-gcc --emit-llvm -c -g get_sign.c and then I try to run using klee get_sign.o I get the error : KLEE: ERROR: error loading program 'get_sign.o': Invalid MODULE_CODE_GLOBALVAR record . The error is defined in the BitcodeReader.cpp file http://llvm.org/docs/doxygen/html/BitcodeReader_8cpp_source.html at line 01594.
clang (that I have used succesfully for my LLVM passes), it appears that is not possible to use it: KLEE: ERROR: error loading program 'get_sign.o': Invalid bitcode signature .
Do you know what I can do?
Also, it would be nice to give Klee inputs compiled with Clang that I already use for my passes, but as the error suggest, it is possible?
Thank you in advance !
The problem is that I installed Klee over LLVM 3.1. In the instructions from http://klee.llvm.org/GetStarted.html it is mentioned that Klee is fully compatible with LLVM 2.9. It is mentioned : "KLEE is currently tested only on Linux x86-32 and x86-64 targets, using LLVM 2.9. KLEE will not work with older LLVM versions (e.g., 2.5), and might not work with newer versions (e.g., 3.0).".
I installed Klee on LLVM 2.9 and it is working perfectly.

has anyone successfully built qt 5.0.0 from source on windows 32-bit, on mysis, using mingw 4.72?

I have been programming in c++ for sometime now, but mainly console programs. i have learnt several data structures, pointers and i'm sure i'm capable of developing some simple software. so i decided to download qt and start learning how to create UIs, but the problem is that i have mingw 4.72 and qt 5.0 complained that it only works with win32API version 3.13 while my mingw installation has 3.17. so i decided to build qt 5.0.0 from source using the mingw 4.72,, but i'm getting compiler errors such as this
c:/qt-everywhere-opensource-src-5.0.0/qtbase/qmake/library/qmakeevaluator.cpp: in
member function 'void QMakeEvaluator::loadDefaults()':
c:/qt-everywhere-opensource-src-5.0.0/qtbase/qmake/library/qmakeevaluator.cpp:968:43:
error: cannot convert 'wchar_t*' to 'LPSTR {aka char*}' for argument '1' to 'BOOL
GetComputerNameA(LPSTR, PDWORD)'
make.exe: *** [qmakeevaluator.o] Error 1 *** qtbase/configure exited with non-zero
status..
so my question is this, has anybody successfully built a stable qt 5.0 for 32-bit windows 7, using mingw 4.72? i have all the prerequisites, perl, ruby and python....
i decided to go with version 4.8.4, and the configuring has gone smoothly. yet to to type mingw-make since i have been told it takes a while to finish. there is a good guide here http://wiki.batcom-it.net/index.php?title=Building_Qt_on_Windows_%28MinGW%29. i hope it helps someone...

OS X runtime linker finding wrong version of lib

I have a C++ shared library being called from my Python program. The C++ lib is compiled with HDF5 which I installed using homebrew on OS X, so it resides in /usr/local/lib. Now the problem is that I also have PyTables installed, which includes an older version of libhdf5, installed somewhere in /Library/Frameworks/EPD64.framework/Versions/Current/...
I can compile and link my library just fine, and otool -L indeed points to /usr/local/lib/libhdf5.dylib. However, when I try to run it from Python, there is a version mismatch error. Somehow the runtime linker is loading the older hdf5 library instead.
One workaround is to build hdf5 as a static library instead, but I'd like to find a neater solution - how can I persuade the runtime linker to use the newer library? I already tried setting DYLD_LIBRARY_PATH but that just broke everything else (Python and MacVim wouldn't start).
Can you provide more info? I have a few alternatives (and questions).
If I understood correctly, you have a library that uses lib_ver_a.dyld and pyTables that uses lib_ver_b.dyld. I.e. the same library but different version.
You could either:
Compile your library to use the same version as pyTables (DYLD_LIB... while you compile) and run your program with pyTables library: DYLD_LIBRARY_PATH=/correct/path/lib python myprog.py
Upgrade your xcode (which version you have? also which osx version?). This upgrades your libraries and pyTables (be careful, newest is not necessary the most stable)
You should also check which python you are calling (a custom one or apple one).
There is also a possibility to define a specific dyld while linking (Do you use gcc or ld for linking? I might miss some options here):
gcc /path/lib1.dyld myLib.c -o myLib.o
This way your library is linked to certain version of the library (caution! I don't remember the exact details, but I can dig them out).
I hope this helps.
br,
Juha

Resources