Hi,
I'm trying to build v.4.1 with CONFIG+=HEADLESS from the source code and I'm facing an issue with luaWrapper.cpp.
I have lua 5.3.0 installed from source and added the followings to config.pri file:
/opt/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04/CoppeliaSimLib/sourceCode/luaScripting/luaWrapper.cpp: In function ‘int luaWrapGet_LUA_GLOBALSINDEX()’:
/opt/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04/CoppeliaSimLib/sourceCode/luaScripting/luaWrapper.cpp:396:12: error: ‘LUA_GLOBALSINDEX’ was not declared in this scope
396 | return(LUA_GLOBALSINDEX);
| ^~~~~~~~~~~~~~~~
/opt/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04/CoppeliaSimLib/sourceCode/luaScripting/luaWrapper.cpp: In function ‘int luaWrap_lua_sethook(luaWrap_lua_State*, luaWrap_lua_Hook, int, int)’:
/opt/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04/CoppeliaSimLib/sourceCode/luaScripting/luaWrapper.cpp:426:23: error: void value not ignored as it ought to be
426 | return(lua_sethook((lua_State*)L,(lua_Hook)func,mask,cnt)); [495/1917] | ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04/CoppeliaSimLib/sourceCode/luaScripting/luaWrapper.cpp: In function ‘size_t luaWrap_lua_objlen(luaWrap_lua_State*, int)’:
/opt/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04/CoppeliaSimLib/sourceCode/luaScripting/luaWrapper.cpp:690:12: error: ‘lua_objlen’ was not declared in this scope; did you mean ‘lua_len’?
690 | return(lua_objlen((lua_State*)L,idx));
| ^~~~~~~~~~
| lua_len
make[2]: *** [CMakeFiles/coppeliaSim.dir/build.make:1798: CMakeFiles/coppeliaSim.dir/sourceCode/luaScripting/luaWrapper.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/coppeliaSim.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
my best guess is that those are deprecated items from Lua 5.1, that have been removed in Lua 5.3 (CoppeliaSim V4.1 still uses Lua 5.1)
Cheers
Thanks for your reply. Downgrading lua to lua5.1 solved the previous issue. I would recommend to mention this on the compiling guide for various versions.
After solving the previous issue, now I'm facing a new error with compiling with HEADLESS mode:
/opt/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04/CoppeliaSimLib/sourceCode/various/app.cpp: In constructor ‘App::App(bool)’:
/opt/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04/CoppeliaSimLib/sourceCode/various/app.cpp:298:5: error: ‘QCoreApplication’ has not been declared
298 | QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL,true);
| ^~~~~~~~~~~~~~~~
/opt/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04/CoppeliaSimLib/sourceCode/various/app.cpp: In static member function ‘static void App::__logMsg(const char*, int, const char*, int, int)’:
/opt/CoppeliaSim_Edu_V4_1_0_Ubuntu20_04/CoppeliaSimLib/sourceCode/various/app.cpp:1612:42: warning: format not a string literal and no format arguments [-Wformat-security]
1612 | printf(consoleTxt.c_str());
| ^
make[2]: *** [CMakeFiles/coppeliaSim.dir/build.make:2386: CMakeFiles/coppeliaSim.dir/sourceCode/various/app.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/coppeliaSim.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
I've also sent you an email using contact form to ask for binary installation of pure headless mode as you mentioned here. Can you send me the binary?
coppelia wrote: ↑07 Jul 2020, 13:50
Another solution would be:
compile CoppeliaSimLib as headless (i.e if you compile with Qt, add CONFIG += HEADLESS at the top of the coppeliaSimLib.pro project file). You may also get that binary from us.
set all vision sensors you want to use the images from to render as Pov-Ray
This will compile without OpenGl dependencies, and will render those vision sensor images with the PovRay plugin (software only rendering, ray-tracing). This is much slower, but the quality is also nicer and that should work fine in any situation normally.
If you need some of the CoppeliaSim plugins, try to use up-to-date binaries from the beta version of next release.
By setting WITH_OPENGL=FALSE and WITH_QT=FALSE I successfully compiled the library. However, running ./coppeliaSim.sh stucks at using IK plugin.
Is there any fix to this issue?