libretro / libretro-super

Super repo for other libretro projects. Fetches, builds and installs.
MIT License
389 stars 276 forks source link

[linux]: Unable to build pcsx2 core #1682

Closed lggomez closed 1 year ago

lggomez commented 1 year ago

I'm unable to build the pcsx2 core, either via the libretro-build.sh or directly via the recipe script (regardless of NOCLEAN and EXIT_ON_ERROR params):

SINGLE_CORE=pcsx2 FORCE=YES NOCLEAN=1 EXIT_ON_ERROR=1 ./libretro-buildbot-recipe.sh recipes/linux/cores-linux-x64-generic

My distro is the following:

Linux pop-os 5.19.8-xanmod1 #0~20220908.git42d221f SMP Thu Sep 8 20:47:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

Build console output can be seen here:

BUILD CMD:  cmake -DLIBRETRO=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_QT=OFF -DCMAKE_LINK_WHAT_YOU_USE=TRUE -DCMAKE_VERBOSE_MAKEFILE=ON
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/lib/ccache/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/ccache/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Disabling the inclusion of the binary compile date.
-- Building with GNU GCC
-- Enable the building of po files by default in Release build !!!
-- Cross compilation is disabled.
-- Compiling a x86_64 build on a x86_64 host.
-- Could NOT find PCAP (missing: PCAP_LIBRARY PCAP_INCLUDE_DIR) 
-- Performing Test PCAP_LINKS_SOLO
-- Performing Test PCAP_LINKS_SOLO - Success
-- Looking for pcap_get_pfring_id
-- Looking for pcap_get_pfring_id - not found
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.13") 
-- Found Gettext: /usr/bin/msgmerge (found version "0.21") 
-- Found Git: /usr/bin/git (found version "2.34.1") 
-- Looking for lzma_auto_decoder in /usr/lib/x86_64-linux-gnu/liblzma.so
-- Looking for lzma_auto_decoder in /usr/lib/x86_64-linux-gnu/liblzma.so - found
-- Looking for lzma_easy_encoder in /usr/lib/x86_64-linux-gnu/liblzma.so
-- Looking for lzma_easy_encoder in /usr/lib/x86_64-linux-gnu/liblzma.so - found
-- Looking for lzma_lzma_preset in /usr/lib/x86_64-linux-gnu/liblzma.so
-- Looking for lzma_lzma_preset in /usr/lib/x86_64-linux-gnu/liblzma.so - found
-- Found LibLZMA: /usr/lib/x86_64-linux-gnu/liblzma.so (found version "5.2.5") 
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so   
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11") 
-- Found PNG: /usr/lib/x86_64-linux-gnu/libpng.so (found version "1.6.37") 
-- Found Libc: /usr/lib/x86_64-linux-gnu/librt.a;/usr/lib/x86_64-linux-gnu/libm.so  
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- AIO not found
-- Skip build of pcsx2 core: missing dependencies:check these libraries -> wxWidgets (>=3.0), gtk2, zlib (>=1.2.4), pcsx2 common libs
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    ENABLE_QT

-- Build files have been written to: /home/user/libretro-super/pcsx2/build
BUILD CMD:  cmake --build . --target pcsx2_libretro --config Release -- -j  32
gmake: *** No rule to make target 'pcsx2_libretro'.  Stop.
BUILD CMD /home/user/libretro-super/retrolink.sh ./pcsx2_libretro.so
readelf: Error: './pcsx2_libretro.so': No such file
readelf: Error: './pcsx2_libretro.so': No such file
strip: './pcsx2_libretro.so': No such file
COPY CMD: cp ./pcsx2_libretro.so /home/user/libretro-super/dist/unix//pcsx2_libretro.so
cp: cannot stat './pcsx2_libretro.so': No such file or directory
cp: cannot stat './pcsx2_libretro.so': No such file or directory
buildbot job: pcsx2: [status: fail] [recipes/linux/cores-linux-x64-generic]
buildbot message: pcsx2: [status: fail] [recipes/linux/cores-linux-x64-generic]
Cleaning repo state after build https://github.com/libretro/pcsx2.git...
warning: failed to remove ./: Invalid argument
Removing ./CMakeFiles
Removing ./cmake_install.cmake
Removing ./common
Removing ./plugins
Removing ./arch.c
Removing ./3rdparty
Removing ./CMakeCache.txt
Removing ./Makefile

buildbot job finished at: Sat Oct  1 19:45:53 -03 2022
lggomez commented 1 year ago

In my case the reason seems to be on the dependencies:

Skip build of pcsx2 core: missing dependencies:check these libraries -> wxWidgets (>=3.0), gtk2, zlib (>=1.2.4), pcsx2 common libs

Is this something that can have a workaround? I see that the ENABLE_QT gets ignored and the build goes with wxWidgets, for starters

lggomez commented 1 year ago

Ok, aside from the beforementioned quesiton about the ENABLE_QT flag I managed to build the core:

wxWidgets, gtk2

sudo apt install build-essential libgtk2.0-dev libaio libaio-dev

zlib

This one is trickier, given than jammy repositories only are up to version 1.1.x, so the library must be upgraded manually or using LD_PRELOAD for each build process that requires this. Following this answer, once zlib 1.2.9 is downloaded run the following (disclamer: as the author mentions, consider the risks of upgrading system-wide):

tar -xvf ~/Downloads/zlib-1.2.9.tar.gz
cd zlib-1.2.9
sudo -s
./configure; make; make install
cd /lib/x86_64-linux-gnu
ln -s -f /usr/local/lib/libz.so.1.2.9/lib libz.so.1
cd ~
rm -rf zlib-1.2.9
exit

Might be worth updating the docs or the core README with this, but closing for now

lggomez commented 1 year ago

PS: the core still fails via libretro-build.sh, so for now the workaround is to run the build recipe manually