fbertola / bgfx-python

Python 3.7+ wrapper for the BGFX library. 🐍
BSD 2-Clause "Simplified" License
123 stars 6 forks source link

Ubuntu 20.04.3 LTS Cannot Build From Source #25

Open agoessling opened 2 years ago

agoessling commented 2 years ago

When following the instructions in the README to build from source, during the python setup.py install step I get a cmake error complaining about several missing dependencies (cppyy, libcling, libclang):

Configuring Project
  Working directory:
    /home/agoessling/bgfx-python/_skbuild/linux-x86_64-3.8/cmake-build
  Command:
    cmake /home/agoessling/bgfx-python/src -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/home/agoessling/bgfx-python/_skbuild/linux-x86_64-3.8/cmake-install -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DPYTHON_VERSION_STRING:STRING=3.8.10 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 -DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/home/agoessling/.local/lib/python3.8/site-packages/skbuild/resources/cmake -DLIBCLANG_LIBRARY=/usr/lib/llvm-10/lib/libclang.so -DLIBCLANG_INCLUDE_DIR=/usr/lib/llvm-10/include/ -DCMAKE_BUILD_TYPE:STRING=Release

-- Could NOT find Cppyy (missing: Cppyy_EXECUTABLE Cppyy_DIR Cppyy_INCLUDE_DIRS CPPYY_MODULE_PATH)
-- CPPYY_FOUND = FALSE
-- BX_DIR = /home/agoessling/bgfx-python/src/../dependencies/bx
-- BIMG_DIR = /home/agoessling/bgfx-python/src/../dependencies/bimg
-- BGFX_DIR = /home/agoessling/bgfx-python/src/../dependencies/bgfx
Building configurations...
Running action 'gmake'...
Done. Generated 0/19 projects.
make -R -C .build/projects/gmake-linux config=release64
make[1]: Entering directory '/home/agoessling/bgfx-python/dependencies/bgfx/.build/projects/gmake-linux'
==== Building bx (release64) ====
==== Building bgfx (release64) ====
==== Building bimg (release64) ====
==== Building bgfx-shared-lib (release64) ====
==== Building bimg_decode (release64) ====
==== Building bimg_encode (release64) ====
==== Building example-common (release64) ====
==== Building example-glue (release64) ====
==== Building fcpp (release64) ====
==== Building geometryc (release64) ====
==== Building geometryv (release64) ====
==== Building glsl-optimizer (release64) ====
==== Building glslang (release64) ====
==== Building spirv-opt (release64) ====
==== Building spirv-cross (release64) ====
==== Building shaderc (release64) ====
==== Building texturec (release64) ====
==== Building texturev (release64) ====
make[1]: Leaving directory '/home/agoessling/bgfx-python/dependencies/bgfx/.build/projects/gmake-linux'
CMake Error at CMakeLists.txt:106 (file):
  file COPY cannot find "/lib/libCling.so": No such file or directory.

CMake Error at CMakeLists.txt:107 (file):
  file COPY cannot find "/lib/libCoreLegacy.so": No such file or directory.

CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find LibClang (missing: LibClang_LIBRARY)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  cmake_modules/FindLibClang.cmake:156 (find_package_handle_standard_args)
  cmake_modules/FindCppyy.cmake:212 (find_package)
  CMakeLists.txt:161 (cppyy_add_bindings)

After manually installing cppyy (pip3 install cppyy), the error only complains about libclang:

onfiguring Project
  Working directory:
    /home/agoessling/bgfx-python/_skbuild/linux-x86_64-3.8/cmake-build
  Command:
    cmake /home/agoessling/bgfx-python/src -G Ninja -DCMAKE_INSTALL_PREFIX:PATH=/home/agoessling/bgfx-python/_skbuild/linux-x86_64-3.8/cmake-install -DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 -DPYTHON_VERSION_STRING:STRING=3.8.10 -DPYTHON_INCLUDE_DIR:PATH=/usr/include/python3.8 -DPYTHON_LIBRARY:FILEPATH=/usr/lib/x86_64-linux-gnu/libpython3.8.so -DSKBUILD:INT
ERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/home/agoessling/.local/lib/python3.8/site-packages/skbuild/resources/cmake -DLIBCLANG_LIBRARY=/usr/lib/llvm-10/lib/libclang.so -DLIBCLANG_INCLUDE_DIR=/usr/lib/llvm-10/include/ -DCMAKE_BUILD_TYPE:STRING=Release

-- Found Cppyy: /home/agoessling/.local/bin/rootcling (found version "6.20.04") 
-- CPPYY_FOUND = TRUE
-- BX_DIR = /home/agoessling/bgfx-python/src/../dependencies/bx
-- BIMG_DIR = /home/agoessling/bgfx-python/src/../dependencies/bimg
-- BGFX_DIR = /home/agoessling/bgfx-python/src/../dependencies/bgfx
Building configurations...
Running action 'gmake'...
Done. Generated 0/19 projects.
make -R -C .build/projects/gmake-linux config=release64
make[1]: Entering directory '/home/agoessling/bgfx-python/dependencies/bgfx/.build/projects/gmake-linux'
==== Building bx (release64) ====
==== Building bgfx (release64) ====
==== Building bimg (release64) ====
==== Building bgfx-shared-lib (release64) ====
==== Building bimg_decode (release64) ====
==== Building bimg_encode (release64) ====
==== Building example-common (release64) ====
==== Building example-glue (release64) ====
==== Building fcpp (release64) ====
==== Building geometryc (release64) ====
==== Building geometryv (release64) ====
==== Building glsl-optimizer (release64) ====
==== Building glslang (release64) ====
==== Building spirv-opt (release64) ====
==== Building spirv-cross (release64) ====
==== Building shaderc (release64) ====
==== Building texturec (release64) ====
==== Building texturev (release64) ====
make[1]: Leaving directory '/home/agoessling/bgfx-python/dependencies/bgfx/.build/projects/gmake-linux'
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find LibClang (missing: LibClang_LIBRARY)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  cmake_modules/FindLibClang.cmake:156 (find_package_handle_standard_args)
  cmake_modules/FindCppyy.cmake:212 (find_package)
  CMakeLists.txt:161 (cppyy_add_bindings)

Running ldconfig -p | grep libclang shows libclang is present:

        libclang-10.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libclang-10.so.1
        libclang-cpp.so.10 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libclang-cpp.so.10
stuaxo commented 1 year ago

There are some clues in .github/workflows/build.xml I'm having a play with this, and for the moment using act to run the github build workflow locally, in docker.

I think the ubuntu instructions need fleshing out.

stuaxo commented 1 year ago

I got a little further in Ubuntu by adding 11 as a version to the src/cmake_modules/FindLibClang.cmake

I eventually got stuck with this error, it's all a bit hard to debug TBH as I mostly do python dev + not native.

-- Build files have been written to: /home/stu/projects/external/libraries/bgfx-projects/bgfx-python/src
Error: could not load cache