Headless compilation failed v4.1

Typically: "How do I... ", "How can I... " questions
Post Reply
hsnfirooz
Posts: 3
Joined: 12 Jan 2024, 10:55

Headless compilation failed v4.1

Post by hsnfirooz »

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:

Code: Select all

LUA_INCLUDEPATH = "/usr/local/include/"
LUA_LIBS = "/usr/local/lib/liblua.a"
Here is the `ls` for the above folders:

Code: Select all

ls /usr/local/lib/
liblua.a  lua  python3.8
and:

Code: Select all

ls /usr/local/include/
lauxlib.h  luaconf.h  lua.h  lua.hpp  lualib.h
Using

Code: Select all

qmake CONFIG+=HEADLESS
is successful, but the

Code: Select all

make
raises the following error:

Code: Select all

/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
Do you have any tips?

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Headless compilation failed v4.1

Post by coppelia »

Hello,

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

hsnfirooz
Posts: 3
Joined: 12 Jan 2024, 10:55

Re: Headless compilation failed v4.1

Post by hsnfirooz »

coppelia wrote: 12 Jan 2024, 14:00 Hello,

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:

Code: Select all

/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.
  • use the Pov-Ray plugin. Binaries are here.
  • 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.

Cheers

hsnfirooz
Posts: 3
Joined: 12 Jan 2024, 10:55

Re: Headless compilation failed v4.1

Post by hsnfirooz »

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?

Code: Select all

[CoppeliaSimClient]    loading the CoppeliaSim library...
[CoppeliaSimClient]    done.
[CoppeliaSimClient:loadinfo]   launching CoppeliaSim...
[CoppeliaSim:loadinfo]   CoppeliaSim V4.1.0., (rev. 1), flavor: 1
[CoppeliaSim:loadinfo]   Legacy machine ID: 5000-9DEB-FFC4-9CEC-F7E3-841D
[CoppeliaSim:loadinfo]   Machine ID: 32F5-7365-F565-0000-B660-0101
[CoppeliaSim:loadinfo]   using the default Lua library.
[CoppeliaSim:loadinfo]   simulator launched.
[CoppeliaSim:loadinfo]   plugin 'DynamicsBullet-2-78': loading...
[CoppeliaSim:loadinfo]   plugin 'DynamicsBullet-2-78': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'DynamicsBullet-2-83': loading...
[CoppeliaSim:loadinfo]   plugin 'DynamicsBullet-2-83': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'DynamicsNewton': loading...
[CoppeliaSim:loadinfo]   plugin 'DynamicsNewton': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'DynamicsOde': loading...
[CoppeliaSim:loadinfo]   plugin 'DynamicsOde': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'DynamicsVortex': loading...
[CoppeliaSim:loadinfo]   plugin 'DynamicsVortex': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'Geometric': loading...
[CoppeliaSim:loadinfo]   plugin 'Geometric': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'Assimp': loading...
[CoppeliaSim:loadinfo]   plugin 'Assimp': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'BlueZero': loading...
[CoppeliaSim:loadinfo]   plugin 'BlueZero': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'BubbleRob': loading...
[CoppeliaSim:loadinfo]   plugin 'BubbleRob': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'Bwf': loading...
[CoppeliaSim:loadinfo]   plugin 'Bwf': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'CodeEditor': loading...
[simExtCodeEditor:error]   cannot load in headless mode
[CoppeliaSim:error]   plugin 'CodeEditor': load failed (failed initialization).
[CoppeliaSim:loadinfo]   plugin 'Collada': loading...
[simExtCollada:error]   CoppeliaSim runs in headless mode. Cannot start the plugin.
[CoppeliaSim:error]   plugin 'Collada': load failed (failed initialization).
[CoppeliaSim:loadinfo]   plugin 'ConvexDecompose': loading...
[CoppeliaSim:loadinfo]   plugin 'ConvexDecompose': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'CustomUI': loading...
[simExtCustomUI:error]   doesn't work in headless mode
[CoppeliaSim:error]   plugin 'CustomUI': load failed (failed initialization).
[CoppeliaSim:loadinfo]   plugin 'ExternalRenderer': loading...
[CoppeliaSim:loadinfo]   plugin 'ExternalRenderer': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'GLTF': loading...
[CoppeliaSim:loadinfo]   plugin 'GLTF': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'ICP': loading...
[CoppeliaSim:loadinfo]   plugin 'ICP': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'IK': loading...
[CoppeliaSim:loadinfo]   plugin 'IK': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'Image': loading...
[CoppeliaSim:loadinfo]   plugin 'Image': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'K3': loading...
[CoppeliaSim:loadinfo]   plugin 'K3': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'LuaCommander': loading...
[simExtLuaCommander:error]   cannot find the statusbar widget
[CoppeliaSim:error]   plugin 'LuaCommander': load failed (failed initialization).
[CoppeliaSim:loadinfo]   plugin 'LuaRemoteApiClient': loading...
[CoppeliaSim:loadinfo]   plugin 'LuaRemoteApiClient': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'Mtb': loading...
[CoppeliaSim:loadinfo]   plugin 'Mtb': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'OMPL': loading...
[CoppeliaSim:loadinfo]   plugin 'OMPL': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'OpenGL3Renderer': loading...
[CoppeliaSim:loadinfo]   plugin 'OpenGL3Renderer': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'OpenMesh': loading...
[CoppeliaSim:loadinfo]   plugin 'OpenMesh': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'Qhull': loading...
[CoppeliaSim:loadinfo]   plugin 'Qhull': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'ROS2Interface': loading...
[CoppeliaSim:error]   plugin 'ROS2Interface': load failed (could not load). The plugin probably couldn't load dependency libraries. For additional infos, modify the script 'libLoadErrorCheck.sh', run
it and inspect the output.
[CoppeliaSim:loadinfo]   plugin 'ROSInterface': loading...
[CoppeliaSim:error]   plugin 'ROSInterface': load failed (could not load). The plugin probably couldn't load dependency libraries. For additional infos, modify the script 'libLoadErrorCheck.sh', run i
t and inspect the output.
[CoppeliaSim:loadinfo]   plugin 'RRS1': loading...
[CoppeliaSim:loadinfo]   plugin 'RRS1': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'ReflexxesTypeII': loading...
[CoppeliaSim:loadinfo]   plugin 'ReflexxesTypeII': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'RemoteApi': loading...
[simExtRemoteApi:loadinfo]   starting a remote API server on port 19997
[CoppeliaSim:loadinfo]   plugin 'RemoteApi': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'SDF': loading...
[simExtSDF:error]   doesn't work in headless mode
[CoppeliaSim:error]   plugin 'SDF': load failed (failed initialization).
[CoppeliaSim:loadinfo]   plugin 'SurfaceReconstruction': loading...
[CoppeliaSim:loadinfo]   plugin 'SurfaceReconstruction': load succeeded.
[CoppeliaSim:loadinfo]   plugin 'URLDrop': loading...
[simExtURLDrop:error]   cannot start in headless mode
[CoppeliaSim:error]   plugin 'URLDrop': load failed (failed initialization).
[CoppeliaSim:loadinfo]   plugin 'Urdf': loading...
[CoppeliaSim:error]   plugin 'Urdf': load failed (failed initialization).
[CoppeliaSim:loadinfo]   plugin 'Vision': loading...
[CoppeliaSim:loadinfo]   plugin 'Vision': load succeeded.
[CoppeliaSim:loadinfo]   using the 'Geometric' plugin.
[CoppeliaSim:loadinfo]   using the 'IK' plugin.

coppelia
Site Admin
Posts: 10375
Joined: 14 Dec 2012, 00:25

Re: Headless compilation failed v4.1

Post by coppelia »

Unfortunately version 4.1 is already quite old and not supported anymore..

How do you launch CoppeliaSim? If you do not start a simulation or load a scene, you won't see any activity in the terminal window. Try running with

./coppeliaSim.sh -s1000 -q

to see if CoppeliaSim is really stuck

Cheers

Post Reply