Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failed on Ubuntu 20.04 #6

Closed
dottokuya opened this issue Mar 22, 2021 · 7 comments
Closed

Build failed on Ubuntu 20.04 #6

dottokuya opened this issue Mar 22, 2021 · 7 comments
Labels

Comments

@dottokuya
Copy link

Running cmake -G Ninja .. I got

-- [global] target architecture is x86_64 and compiler is clang
-- [nanoem] branch prediction is enabled
-- [nanoem] JSON extension is enabled
-- [nanoem] mutable API extension is enabled
-- [nanoem] NMD motion extension is enabled
-- [nanoem] PMM document extension is enabled
-- [global] glm is located at /home/dongdv/nanoem/dependencies/glm
-- [nanoem] bullet is located at /home/dongdv/nanoem/dependencies/bullet3
-- [nanoem] physics simulation using bullet extension is enabled
-- [nanoem] ICU unicode string conversion is enabled
-- [global] glm is located at /home/dongdv/nanoem/dependencies/glm
-- [global] zlib is located at /home/dongdv/nanoem/dependencies/zlib
-- [emapp] minizip is located at /home/dongdv/nanoem/dependencies/minizip
-- [emapp] nanomsg is located at /home/dongdv/nanoem/dependencies/nanomsg
-- [emapp/bundle] setup emapp bundle
-- [emapp] setup "sokol_noop" as installing plugin to plugins
-- [emapp/bundle] setup sokol noop backend renderer plugin
-- [emapp] setup "sokol_glcore33" as installing plugin to plugins
-- [emapp/bundle] setup sokol OpenGL 3.3 Core Profile backend renderer plugin
-- [emapp] setup "sokol_gles3" as installing plugin to plugins
-- [emapp/bundle] setup sokol OpenGL ES 3.0 backend renderer plugin
-- [emapp/resources] yaml-cpp is located at /home/dongdv/nanoem/dependencies/yaml-cpp
-- [emapp/resources] setup emarb font
-- [emapp/resources] setup emarb protobuf
-- [emapp/resources] setup emarb shaders
-- [emapp/resources] setup emarb toon
-- [emapp/resources] setup emarb translation
-- [emapp/resource] setup emarb credits
-- [emapp] tbb is located at /home/dongdv/nanoem/dependencies/tbb
-- [emapp] TBB is enabled
-- [emapp] setup "plugin_effect" as installing plugin to plugins
-- [emapp] setup "plugin_ffmpeg" as installing plugin to plugins
-- [emapp] setup "plugin_lsmash" as installing plugin to plugins
-- [emapp] setup "plugin_model" as installing plugin to plugins
-- [emapp] setup "plugin_motion" as installing plugin to plugins
CMake Warning (dev) at /usr/share/cmake-3.16/Modules/FindOpenGL.cmake:275 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  emapp/CMakeLists.txt:102 (find_package)
  sapp/CMakeLists.txt:11 (nanoem_emapp_link_executable)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- [emapp] setup linkage of "nanoem_sapp"
CMake Warning (dev) at /usr/share/cmake-3.16/Modules/FindOpenGL.cmake:275 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  emapp/CMakeLists.txt:102 (find_package)
  glfw/st/CMakeLists.txt:8 (nanoem_emapp_link_executable)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- [emapp] setup linkage of "nanoem_glfw_st"
CMake Warning (dev) at /usr/share/cmake-3.16/Modules/FindOpenGL.cmake:275 (message):
  Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
  available.  Run "cmake --help-policy CMP0072" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  FindOpenGL found both a legacy GL library:

    OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

  and GLVND libraries for OpenGL and GLX:

    OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
    OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

  OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
  compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
  emapp/CMakeLists.txt:102 (find_package)
  CMakeLists.txt:316 (nanoem_emapp_link_executable)
  CMakeLists.txt:373 (nanoem_build_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- [emapp] setup linkage of "nanoem_test"
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
/home/dongdv/nanoem/emapp/MINIZIP_INCLUDE_DIR
   used as include directory in directory /home/dongdv/nanoem/emapp
/home/dongdv/nanoem/emapp/ZLIB_INCLUDE_DIR
   used as include directory in directory /home/dongdv/nanoem/emapp
/home/dongdv/nanoem/nanoem/BULLET_INCLUDE_DIR
   used as include directory in directory /home/dongdv/nanoem
   used as include directory in directory /home/dongdv/nanoem/nanoem
   used as include directory in directory /home/dongdv/nanoem/emapp
   used as include directory in directory /home/dongdv/nanoem/emapp
   used as include directory in directory /home/dongdv/nanoem/emapp
   used as include directory in directory /home/dongdv/nanoem/emapp
   used as include directory in directory /home/dongdv/nanoem/sapp
   used as include directory in directory /home/dongdv/nanoem/glfw/st
MINIZIP_LIBRARY_DEBUG (ADVANCED)
    linked by target "nanoem_test" in directory /home/dongdv/nanoem
    linked by target "nanoem_sapp" in directory /home/dongdv/nanoem/sapp
    linked by target "nanoem_glfw_st" in directory /home/dongdv/nanoem/glfw/st
MINIZIP_LIBRARY_RELEASE (ADVANCED)
    linked by target "nanoem_test" in directory /home/dongdv/nanoem
    linked by target "nanoem_sapp" in directory /home/dongdv/nanoem/sapp
    linked by target "nanoem_glfw_st" in directory /home/dongdv/nanoem/glfw/st

-- Configuring incomplete, errors occurred!
See also "/home/dongdv/nanoem/out/core/CMakeFiles/CMakeOutput.log".

I did run git clone --recursive to get all dependencies and followed both the minimum build instruction and Github Actions build command, they yield the same errror

@dottokuya
Copy link
Author

Update: Tried again, this time I removed cleanup command from scripts/build.cmake and it built successfully. Running well on VM (20.04). However running the binary on 20.10 (my main machine) threw a segfault.

@hkrn
Copy link
Owner

hkrn commented Mar 26, 2021

What the stacktrace produces after gdb -ex r nanoem and bt are executed? (CMAKE_BUILD_TYPE=Debug at building nanoem is required to produce the stacktrace correctly)

On Linux platform, nanoem requires OpenGL 3.3 Core Profile to run (see also sokol's prerequisite).

@dottokuya
Copy link
Author

dottokuya commented Mar 29, 2021

Using build script from GitHub Workflow, with CMAKE_BUILD_TYPE=Debug enabled.

With nanoem_test:

Reading symbols from nanoem_test...
Starting program: /home/dongdv/build/core/nanoem_test 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x000000000054156c in nanoemTestSuiteRun (argc=1, argv=0x7fffffffde28)
    at ../../emapp/test/common/entrypoint.cc:36
#2  0x00000000007580c2 in main (argc=1, argv=0x7fffffffde28)
    at ../../emapp/test/main.cc:12

With sapp/nanoem:

[New Thread 0x7ffff44b0640 (LWP 10282)]
[New Thread 0x7ffff3caf640 (LWP 10283)]
[New Thread 0x7ffff34ae640 (LWP 10284)]
[New Thread 0x7ffff2cad640 (LWP 10285)]

Thread 1 "nanoem" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007ffff23be5d7 in _sg_gl_setup_backend (desc=0x7ffff23da7d8 <_sg+8>)
    at ../../dependencies/sokol/sokol_gfx.h:5658
#2  0x00007ffff23b3fd5 in _sg_setup_backend (desc=0x7ffff23da7d8 <_sg+8>)
    at ../../dependencies/sokol/sokol_gfx.h:12292
#3  0x00007ffff23b39ee in sg_setup (desc=0x7fffffffb5c8)
    at ../../dependencies/sokol/sokol_gfx.h:14334
#4  0x00007ffff23bd7fd in sgx_setup (desc=0x7fffffffb5c8)
    at ../../emapp/bundle/sokol/sokol_glcore33.c:38
#5  0x000000000043de65 in nanoem::BaseApplicationService::handleCommandMessage (
    this=0x13bca18, command=0x13f0b90, project=0x0, error=...)
    at ../../emapp/src/BaseApplicationService.cc:2804
#6  0x000000000043b5a1 in nanoem::BaseApplicationService::dispatchCommandMessage (
    this=0x13bca18, data=0x13feb90 "\bЊ\233\003RJ\b", size=81, project=0x0, 
    forceUndo=false) at ../../emapp/src/BaseApplicationService.cc:2396
#7  0x0000000000416500 in nanoem::sapp::ApplicationService::consumeDispatchAllCommandMessages (this=0x13bca18) at ../../sapp/src/ApplicationService.cc:189
#8  0x0000000000417737 in nanoem::sapp::MainWindow::draw (this=0x13bc990)
    at ../../sapp/src/MainWindow.cc:60
#9  0x000000000040dca8 in sokol_main::$_2::operator() (this=0x7)
    at ../../sapp/main.cc:105
#10 0x000000000040dc89 in sokol_main::$_2::__invoke () at ../../sapp/main.cc:105
#11 0x00000000004151d2 in _sapp_call_frame ()
    at ../../dependencies/sokol/sokol_app.h:2465
#12 0x0000000000411f32 in _sapp_frame () at ../../dependencies/sokol/sokol_app.h:2641
#13 0x000000000040f347 in _sapp_linux_run (desc=0x7fffffffd9b0)
    at ../../dependencies/sokol/sokol_app.h:10098
#14 0x000000000040f14b in main (argc=1, argv=0x7fffffffdb58)
    at ../../dependencies/sokol/sokol_app.h:10121

@hkrn
Copy link
Owner

hkrn commented Mar 31, 2021

From the result of nanoem_test it seems running nanoem_test from unexpected path. Running nanoem_test directly is not recommended due to such path problem, instead cmake --build . --target test (GitHub Action uses this method) or ninja test should be used.

From the result of sapp/nanoem it seems glGetError function pointer cannot be resolved from libGL.so. Does ldconfig -p | grep libGL.so present?

@dottokuya
Copy link
Author

Here's what I got

dottokuya@dottokuya-Lenovo:/media/dottokuya/Storage/Setup/build/core/sapp$ ldconfig -p | grep libGL.so
        libGL.so.1 (libc6,x86-64) => /lib/x86_64-linux-gnu/libGL.so.1
        libGL.so.1 (libc6) => /lib/i386-linux-gnu/libGL.so.1

I think Ubuntu 20.10 and later version might broke some libraries compability, though it's unsure

@hkrn
Copy link
Owner

hkrn commented Apr 4, 2021

I don't know why this happens honestly, at least this is not the problem of nanoem. To isolate the problem, you should build and run sokol-samples. If you don't run sokol-samples, nanoem will not be able to run also.

@stale
Copy link

stale bot commented Oct 15, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix label Oct 15, 2021
@stale stale bot closed this as completed Oct 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants