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

Current State Of Linux Builds #1

Closed
Crementif opened this issue Aug 23, 2022 · 204 comments · Fixed by #75
Closed

Current State Of Linux Builds #1

Crementif opened this issue Aug 23, 2022 · 204 comments · Fixed by #75
Labels
build related Tags for build related issues, discussions and requests

Comments

@Crementif
Copy link
Member

Crementif commented Aug 23, 2022

Linux builds of Cemu are not recommended yet for beginners, since currently it lacks a few things:

  • There's only prebuilt binaries for ubuntu 20.04, which means that for other distros (or versions) you'll have to compile it yourself.
    • In the future the plan is to also distribute appimages and/or flatpak releases using the CI.
  • Cemu currently requires all files to be placed in a case-insensitive filesystem
  • Cemu utilizes GTK3 using wxWidgets and xlib for it's Linux port currently. Wayland support should work but other environments aren't tested.

You can use this issue to share your experiences, issues or build tips!

@ethannij
Copy link

One thing I notice, being on Gentoo running OpenRC, is that the binary, and compilation seem to hard require systemd. Not sure if there's a CMAKE flag included to disable systemd support or not. To be clear, not saying you need to support openrc at all, but maybe a compile flag to disable the systemd stuff would be nice. (I'm not very experienced with CMAKE so maybe there is a way I'm just not aware of).

@liamwhite
Copy link

It is unusual that the project requires the entire Vulkan SDK, as opposed to just the headers. Any comment on this?

@lunaneff
Copy link

For Flatpak, would you mind if I tried to make a package? I can't guarantee anything, but I could see if I can get something working later today

@Zopolis4
Copy link
Contributor

Also-- Is there a reason vcpkg is used on linux? vcpkg is, no matter what microsoft says, designed for windows, and it doesn't make a ton of sense to have to compile all of the dependencies when they are already available in the various package managers.

@Crementif
Copy link
Member Author

Crementif commented Aug 24, 2022

For Flatpak, would you mind if I tried to make a package? I can't guarantee anything, but I could see if I can get something working later today

Sure, although we'd like to have an official flatpak package. I'm not sure if/how other emulators do that with their continuous builds, but maybe worrying about that is a later step and you should see if it requires some source code changes first.

@Exzap
Copy link
Member

Exzap commented Aug 24, 2022

It is unusual that the project requires the entire Vulkan SDK, as opposed to just the headers. Any comment on this?

I ran into compilation issues on Windows when trying to compile with headers only after we switched from VS solution to cmake. I forgot where exactly the dependency comes from but it was meant as a quick and dirty fix to just add the whole thing. In general there are a lot of dependencies that could probably be optimized out.

Also-- Is there a reason vcpkg is used on linux? vcpkg is, no matter what microsoft says, designed for windows, and it doesn't make a ton of sense to have to compile all of the dependencies when they are already available in the various package managers.

I like it because it generally seems to be the most hassle free across platforms. But yes, ideally we would conditionally use system libraries if present. Will look into this

@Anuskuss
Copy link

I sadly couldn't get this to compile on Arch so I'm sharing my steps in case somebody else wants to give it a whirl:

  1. Install dependencies
sudo pacman -S --needed gtk3 libsecret libgcrypt systemd-libs freeglut nasm
  1. I had clang-14.0.6-2 installed on my system so I decided to downgrade everything to v12 just in case
yay -S downgrade
sudo downgrade clang llvm llvm-libs
  1. Install VulkanSDK
cd ~
mkdir vulkan
cd vulkan
curl https://sdk.lunarg.com/sdk/download/1.3.224.0/linux/vulkansdk-linux-x86_64-1.3.224.0.tar.gz | tar xz
cd 1.3.224.0
source setup-env.sh
  1. Get Cemu
cd ~
git clone --recursive https://github.com/cemu-project/Cemu
cd Cemu
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja
  1. Compile
ninja
  1. First issue
FAILED: dependencies/cubeb/CMakeFiles/cubeb.dir/src/cubeb_resampler.cpp.o
/usr/bin/clang++ -DENABLE_DISCORD_RPC -DHAS_CUBEB=1 -DVK_NO_PROTOTYPES -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR -D_UNICODE -D__WXGTK3__ -D__WXGTK__ -I/home/user/Cemu/build/src/Cafe -I/home/user/Cemu/src/Cafe -I/home/user/vulkan/1.3.224.0/x86_64/include -I/home/user/Cemu/src/Cafe/. -I/home/user/Cemu/src/Cafe/.. -I/home/user/Cemu/dependencies/cubeb/include -I/home/user/Cemu/build/exports -I/home/user/Cemu/dependencies/ZArchive/include -isystem /home/user/Cemu/build/vcpkg_installed/x64-linux/include -isystem /home/user/Cemu/build/vcpkg_installed/x64-linux/include/SDL2 -isystem /home/user/Cemu/build/vcpkg_installed/x64-linux/lib/wx/include/gtk3-unicode-static-3.2 -isystem /home/user/Cemu/build/vcpkg_installed/x64-linux/include/wx-3.2 -O3 -DNDEBUG   -fms-extensions -fms-compatibility-version=19.14 -fdelayed-template-parsing -maes -Wno-switch -Wno-ignored-attributes -Wno-deprecated-enum-enum-conversion -Wno-ambiguous-reversed-operator -std=gnu++20 -Winvalid-pch -Xclang -include-pch -Xclang /home/user/Cemu/build/src/Cafe/CMakeFiles/CemuCafe.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /home/user/Cemu/build/src/Cafe/CMakeFiles/CemuCafe.dir/cmake_pch.hxx -MD -MT src/Cafe/CMakeFiles/CemuCafe.dir/Account/Account.cpp.o -MF src/Cafe/CMakeFiles/CemuCafe.dir/Account/Account.cpp.o.d -o src/Cafe/CMakeFiles/CemuCafe.dir/Account/Account.cpp.o -c /home/user/Cemu/src/Cafe/Account/Account.cpp
In file included from <built-in>:451:
In file included from /home/user/Cemu/build/src/Cafe/CMakeFiles/CemuCafe.dir/cmake_pch.hxx:5:
In file included from /home/user/Cemu/src/Cafe/../Common/precompiled.h:10:
In file included from /home/user/Cemu/build/vcpkg_installed/x64-linux/include/fmt/core.h:13:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../include/c++/12.2.0/functional:64:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/stl_algo.h:65:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/uniform_int_dist.h:250:31: error: expected unqualified-id
          static_assert(!_Up_traits::__is_signed, "U must be unsigned");
                                     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../include/c++/12.2.0/bits/uniform_int_dist.h:251:31: error: expected unqualified-id
          static_assert(!_Wp_traits::__is_signed, "W must be unsigned");
                                     ^
2 errors generated.

Temporary solution: Turn lines 250 and 251 into comments in /usr/include/c++/12.2.0/bits/uniform_int_dist.h

  1. Second issue
FAILED: src/Cafe/CMakeFiles/CemuCafe.dir/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp.o 
/usr/bin/clang++ -DENABLE_DISCORD_RPC -DHAS_CUBEB=1 -DVK_NO_PROTOTYPES -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR -D_UNICODE -D__WXGTK3__ -D__WXGTK__ -I/home/user/Cemu/build/src/Cafe -I/home/user/Cemu/src/Cafe -I/home/user/vulkan/1.3.224.0/x86_64/include -I/home/user/Cemu/src/Cafe/. -I/home/user/Cemu/src/Cafe/.. -I/home/user/Cemu/dependencies/cubeb/include -I/home/user/Cemu/build/exports -I/home/user/Cemu/dependencies/ZArchive/include -isystem /home/user/Cemu/build/vcpkg_installed/x64-linux/include -isystem /home/user/Cemu/build/vcpkg_installed/x64-linux/include/SDL2 -isystem /home/user/Cemu/build/vcpkg_installed/x64-linux/lib/wx/include/gtk3-unicode-static-3.2 -isystem /home/user/Cemu/build/vcpkg_installed/x64-linux/include/wx-3.2 -O3 -DNDEBUG   -fms-extensions -fms-compatibility-version=19.14 -fdelayed-template-parsing -maes -Wno-switch -Wno-ignored-attributes -Wno-deprecated-enum-enum-conversion -Wno-ambiguous-reversed-operator -std=gnu++20 -Winvalid-pch -Xclang -include-pch -Xclang /home/user/Cemu/build/src/Cafe/CMakeFiles/CemuCafe.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /home/user/Cemu/build/src/Cafe/CMakeFiles/CemuCafe.dir/cmake_pch.hxx -MD -MT src/Cafe/CMakeFiles/CemuCafe.dir/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp.o -MF src/Cafe/CMakeFiles/CemuCafe.dir/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp.o.d -o src/Cafe/CMakeFiles/CemuCafe.dir/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp.o -c /home/user/Cemu/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp
/home/user/Cemu/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp:13:10: fatal error: 'SPIRV/Logger.h' file not found
#include <SPIRV/Logger.h>
         ^~~~~~~~~~~~~~~~
1 error generated.

Workaround: Change line 10 into #if true in ~/Cemu/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp

  1. Third issue
FAILED: src/Cafe/CMakeFiles/CemuCafe.dir/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp.o 
/usr/bin/clang++ -DENABLE_DISCORD_RPC -DHAS_CUBEB=1 -DVK_NO_PROTOTYPES -DVK_USE_PLATFORM_XCB_KHR -DVK_USE_PLATFORM_XLIB_KHR -D_UNICODE -D__WXGTK3__ -D__WXGTK__ -I/home/user/Cemu/build/src/Cafe -I/home/user/Cemu/src/Cafe -I/home/user/vulkan/1.3.224.0/x86_64/include -I/home/user/Cemu/src/Cafe/. -I/home/user/Cemu/src/Cafe/.. -I/home/user/Cemu/dependencies/cubeb/include -I/home/user/Cemu/build/exports -I/home/user/Cemu/dependencies/ZArchive/include -isystem /home/user/Cemu/build/vcpkg_installed/x64-linux/include -isystem /home/user/Cemu/build/vcpkg_installed/x64-linux/include/SDL2 -isystem /home/user/Cemu/build/vcpkg_installed/x64-linux/lib/wx/include/gtk3-unicode-static-3.2 -isystem /home/user/Cemu/build/vcpkg_installed/x64-linux/include/wx-3.2 -O3 -DNDEBUG   -fms-extensions -fms-compatibility-version=19.14 -fdelayed-template-parsing -maes -Wno-switch -Wno-ignored-attributes -Wno-deprecated-enum-enum-conversion -Wno-ambiguous-reversed-operator -std=gnu++20 -Winvalid-pch -Xclang -include-pch -Xclang /home/user/Cemu/build/src/Cafe/CMakeFiles/CemuCafe.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /home/user/Cemu/build/src/Cafe/CMakeFiles/CemuCafe.dir/cmake_pch.hxx -MD -MT src/Cafe/CMakeFiles/CemuCafe.dir/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp.o -MF src/Cafe/CMakeFiles/CemuCafe.dir/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp.o.d -o src/Cafe/CMakeFiles/CemuCafe.dir/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp.o -c /home/user/Cemu/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp
In file included from /home/user/Cemu/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp:19:
In file included from /home/user/Cemu/src/Cafe/../Cafe/HW/Latte/Renderer/Vulkan/VulkanRenderer.h:5:
In file included from /home/user/Cemu/src/Cafe/../Cafe/HW/Latte/Renderer/Vulkan/LatteTextureVk.h:7:
/home/user/Cemu/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp:134:18: error: excess elements in scalar initializer
        /* .limits = */ {
                        ^
1 error generated.

Workaround: Remove the curly brackets in line 134 and 144 in ~/Cemu/src/Cafe/HW/Latte/Renderer/Vulkan/RendererShaderVk.cpp

  1. Final boss
FAILED: /home/user/Cemu/bin/Cemu 
/usr/bin/clang++ -O3 -DNDEBUG  src/CMakeFiles/CemuBin.dir/main.cpp.o src/CMakeFiles/CemuBin.dir/mainLLE.cpp.o -o /home/user/Cemu/bin/Cemu  vcpkg_installed/x64-linux/lib/libboost_program_options.a  vcpkg_installed/x64-linux/lib/libboost_filesystem.a  vcpkg_installed/x64-linux/lib/libboost_nowide.a  /usr/lib/libSM.so  /usr/lib/libICE.so  /usr/lib/libX11.so  /usr/lib/libXext.so  vcpkg_installed/x64-linux/lib/libSDL2.a  vcpkg_installed/x64-linux/lib/libSDL2main.a  vcpkg_installed/x64-linux/lib/libSDL2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_core-3.2.a  vcpkg_installed/x64-linux/lib/libwx_baseu-3.2.a  dependencies/cubeb/libcubeb.a  src/Common/libCemuCommon.a  src/Cemu/libCemuComponents.a  src/Cafe/libCemuCafe.a  src/config/libCemuConfig.a  src/gui/libCemuGui.a  src/audio/libCemuAudio.a  src/input/libCemuInput.a  src/util/libCemuUtil.a  src/asm/libCemuAsm.a  vcpkg_installed/x64-linux/lib/libssl.a  vcpkg_installed/x64-linux/lib/libz.a  vcpkg_installed/x64-linux/lib/libwx_baseu-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_core-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_adv-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_aui-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_html-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_propgrid-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_ribbon-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_stc-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_xrc-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_gl-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_qa-3.2.a  vcpkg_installed/x64-linux/lib/libwx_baseu_xml-3.2.a  vcpkg_installed/x64-linux/lib/libcurl.a  vcpkg_installed/x64-linux/lib/libimgui.a  vcpkg_installed/x64-linux/lib/libpugixml.a  src/Common/libCemuCommon.a  src/audio/libCemuAudio.a  src/input/libCemuInput.a  src/Cemu/libCemuComponents.a  src/Cafe/libCemuCafe.a  src/config/libCemuConfig.a  src/gui/libCemuGui.a  src/imgui/libimguiImpl.a  src/Common/libCemuCommon.a  src/input/libCemuInput.a  src/Cemu/libCemuComponents.a  src/Cafe/libCemuCafe.a  src/resource/libCemuResource.a  src/gui/libCemuGui.a  src/asm/libCemuAsm.a  src/Cemu/libCemuComponents.a  dependencies/discord-rpc/src/libdiscord-rpc.a  -lpthread  src/Cafe/libCemuCafe.a  vcpkg_installed/x64-linux/lib/libglslang.a  vcpkg_installed/x64-linux/lib/libSPIRV.a  vcpkg_installed/x64-linux/lib/libMachineIndependent.a  vcpkg_installed/x64-linux/lib/libOGLCompiler.a  vcpkg_installed/x64-linux/lib/libOSDependent.a  vcpkg_installed/x64-linux/lib/libGenericCodeGen.a  dependencies/ih264d/libih264d.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_adv-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_aui-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_propgrid-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_ribbon-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_stc-3.2.a  vcpkg_installed/x64-linux/lib/libwxscintilla-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_xrc-3.2.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_html-3.2.a  /usr/lib/libmspack.so  vcpkg_installed/x64-linux/lib/libwx_gtk3u_gl-3.2.a  /usr/lib/libGLU.so  /usr/lib/libGLX.so  /usr/lib/libEGL.so  /usr/lib/libOpenGL.so  -lffi  vcpkg_installed/x64-linux/lib/libwx_gtk3u_qa-3.2.a  vcpkg_installed/x64-linux/lib/libwx_baseu_xml-3.2.a  src/resource/libCemuResource.a  dependencies/ZArchive/libzarchive.a  vcpkg_installed/x64-linux/lib/libzstd.a  vcpkg_installed/x64-linux/lib/libzip.a  vcpkg_installed/x64-linux/lib/libssl.a  vcpkg_installed/x64-linux/lib/libz.a  vcpkg_installed/x64-linux/lib/libcrypto.a  vcpkg_installed/x64-linux/lib/libpugixml.a  dependencies/cubeb/libcubeb.a  vcpkg_installed/x64-linux/lib/libboost_program_options.a  vcpkg_installed/x64-linux/lib/libboost_filesystem.a  vcpkg_installed/x64-linux/lib/libboost_nowide.a  vcpkg_installed/x64-linux/lib/libSDL2.a  -lwayland-egl  -lwayland-client  -lwayland-cursor  -lEGL  -lxkbcommon  /usr/lib/libXss.so  /usr/lib/libXxf86vm.so  -ldbus-1  -lunwind  -lunwind-generic  -lrt  -Wl,--no-undefined  -pthread  vcpkg_installed/x64-linux/lib/libSDL2main.a  vcpkg_installed/x64-linux/lib/libwx_gtk3u_core-3.2.a  -lm  /usr/lib/libgtk-3.so  /usr/lib/libgdk-3.so  /usr/lib/libz.so  -lm  /usr/lib/libpcre.so  /usr/lib/libffi.so  /usr/lib/libbz2.so  /usr/lib/libbrotlicommon.so  /usr/lib/libgraphite2.so  /usr/lib/libglib-2.0.so  /usr/lib/libgio-2.0.so  /usr/lib/libgobject-2.0.so  /usr/lib/libgmodule-2.0.so  /usr/lib/libblkid.so  /usr/lib/libfribidi.so  /usr/lib/libdatrie.so  /usr/lib/libfreetype.so  /usr/lib/libbrotlidec.so  /usr/lib/libXrender.so  /usr/lib/libpthread.a  /usr/lib/libxcb.so  /usr/lib/libXau.so  /usr/lib/libdl.a  /usr/lib/liblzo2.so  /usr/lib/libpangocairo-1.0.so  /usr/lib/libpango-1.0.so  /usr/lib/libcairo.so  /usr/lib/libharfbuzz-gobject.so  /usr/lib/libfontconfig.so  vcpkg_installed/x64-linux/lib/libpng16.a  /usr/lib/libcairo-gobject.so  /usr/lib/libXcomposite.so  /usr/lib/libXdamage.so  /usr/lib/libwayland-client.so  /usr/lib/librt.a  /usr/lib/libepoxy.so  /usr/lib/libcloudproviders.so  /usr/lib/libatk-1.0.so  /usr/lib/libgdk_pixbuf-2.0.so  vcpkg_installed/x64-linux/lib/libtiff.a  vcpkg_installed/x64-linux/lib/libjpeg.a  vcpkg_installed/x64-linux/lib/liblzma.a  /usr/lib/libatk-bridge-2.0.so  /usr/lib/libsystemd.so  /usr/lib/libatspi.so  /usr/lib/libdbus-1.so  /usr/lib/libXtst.so  /usr/lib/libxkbcommon.so  /usr/lib/libwayland-cursor.so  /usr/lib/libwayland-egl.so  /usr/lib/libGL.so  /usr/lib/libEGL.so  /usr/lib/libpangoft2-1.0.so  /usr/lib/libthai.so  /usr/lib/libXft.so  /usr/lib/libxcb-render.so  /usr/lib/libxcb-shm.so  /usr/lib/libXdmcp.so  /usr/lib/libpixman-1.so  /usr/lib/libharfbuzz.so  /usr/lib/libmount.so  /usr/lib/libsysprof-capture-4.a  /usr/lib/libz.so  -lm  /usr/lib/libpcre.so  /usr/lib/libffi.so  /usr/lib/libbz2.so  /usr/lib/libbrotlicommon.so  /usr/lib/libgraphite2.so  /usr/lib/libglib-2.0.so  /usr/lib/libgio-2.0.so  /usr/lib/libgobject-2.0.so  /usr/lib/libgmodule-2.0.so  /usr/lib/libblkid.so  /usr/lib/libfribidi.so  /usr/lib/libdatrie.so  /usr/lib/libfreetype.so  /usr/lib/libbrotlidec.so  /usr/lib/libXrender.so  /usr/lib/libpthread.a  /usr/lib/libxcb.so  /usr/lib/libXau.so  /usr/lib/libdl.a  /usr/lib/liblzo2.so  /usr/lib/libpangocairo-1.0.so  /usr/lib/libpango-1.0.so  /usr/lib/libcairo.so  /usr/lib/libharfbuzz-gobject.so  /usr/lib/libfontconfig.so  vcpkg_installed/x64-linux/lib/libpng16.a  /usr/lib/libcairo-gobject.so  /usr/lib/libXcomposite.so  /usr/lib/libXdamage.so  /usr/lib/libwayland-client.so  /usr/lib/librt.a  /usr/lib/libepoxy.so  /usr/lib/libcloudproviders.so  /usr/lib/libatk-1.0.so  /usr/lib/libgdk_pixbuf-2.0.so  vcpkg_installed/x64-linux/lib/libtiff.a  vcpkg_installed/x64-linux/lib/libjpeg.a  vcpkg_installed/x64-linux/lib/liblzma.a  /usr/lib/libatk-bridge-2.0.so  /usr/lib/libsystemd.so  /usr/lib/libatspi.so  /usr/lib/libdbus-1.so  /usr/lib/libXtst.so  /usr/lib/libxkbcommon.so  /usr/lib/libwayland-cursor.so  /usr/lib/libwayland-egl.so  /usr/lib/libGL.so  /usr/lib/libEGL.so  /usr/lib/libpangoft2-1.0.so  /usr/lib/libthai.so  /usr/lib/libXft.so  /usr/lib/libxcb-render.so  /usr/lib/libxcb-shm.so  /usr/lib/libXdmcp.so  /usr/lib/libpixman-1.so  /usr/lib/libharfbuzz.so  /usr/lib/libmount.so  /usr/lib/libsysprof-capture-4.a  /usr/lib/libXcursor.so  /usr/lib/libXrandr.so  /usr/lib/libXinerama.so  /usr/lib/libXi.so  /usr/lib/libXfixes.so  vcpkg_installed/x64-linux/lib/libexpat.a  /usr/lib/libSM.so  /usr/lib/libICE.so  /usr/lib/libX11.so  /usr/lib/libXext.so  /usr/lib/libgspell-1.so  vcpkg_installed/x64-linux/lib/libwx_baseu-3.2.a  vcpkg_installed/x64-linux/lib/libz.a  -lc  -ldl  /usr/lib/libspeexdsp.so
/usr/bin/ld: src/CMakeFiles/CemuBin.dir/main.cpp.o: in function `std::__cxx11::basic_string<char8_t, std::char_traits<char8_t>, std::allocator<char8_t> > fmt::v7::detail::vformat<char8_t, 0>(fmt::v7::basic_string_view<char8_t>, fmt::v7::basic_format_args<fmt::v7::basic_format_context<fmt::v7::detail::buffer_appender<fmt::v7::type_identity<char8_t>::type>, fmt::v7::type_identity<char8_t>::type> >)':
main.cpp:(.text._ZN3fmt2v76detail7vformatIDuLi0EEENSt7__cxx1112basic_stringIT_St11char_traitsIS5_ESaIS5_EEENS0_17basic_string_viewIS5_EENS0_17basic_format_argsINS0_20basic_format_contextINS1_15buffer_appenderINS0_13type_identityIS5_E4typeEEESH_EEEE[_ZN3fmt2v76detail7vformatIDuLi0EEENSt7__cxx1112basic_stringIT_St11char_traitsIS5_ESaIS5_EEENS0_17basic_string_viewIS5_EENS0_17basic_format_argsINS0_20basic_format_contextINS1_15buffer_appenderINS0_13type_identityIS5_E4typeEEESH_EEEE]+0x6e): undefined reference to `void std::__cxx11::basic_string<char8_t, std::char_traits<char8_t>, std::allocator<char8_t> >::_M_construct<char8_t const*>(char8_t const*, char8_t const*, std::forward_iterator_tag)'
clang-12: error: linker command failed with exit code 1 (use -v to see invocation)

@lunaneff
Copy link

Sure, although we'd like to have an official flatpak package.

Even if I haven't been involved in Cemu before, if you approve of it, wouldn't that make it official? Also, when it's ready for publishing I could ask to have you added as collaborators on the repo, so you could make changes as well

I'm not sure if/how other emulators do that with their continuous builds

Flatpaks are almost always compiled from source on Flathub's servers if the code is available. The only exception I can think of is osu, where it's because a small bit of code that's required for online functionality is proprietary to avoid cheaters.

you should see if it requires some source code changes first.

A .desktop file (for app menus) and a metadata file (for app stores) will be required. These can also be added in the flatpak instead of upstream, but upstreaming is preferred since these aren't Flatpak-specific and are also useful for other distribution methods. You can find info about these at these links:

@Drakonas
Copy link

Drakonas commented Aug 24, 2022

fatal error: 'SPIRV/Logger.h' file not found

@Anuskuss looks like you're missing these headers. On Ubuntu, you can get them from this package: glslang-dev. I am unsure about Arch, but I would make sure the -devel packages are getting installed if they exist, so you have the required development packages, not the release packages.

Commenting include lines is probably not going to net any positive results. I would focus on fixing missing dependencies or why functions are missing. Most likely the required development files are not installed. (I'm not sure if this package was overlooked on the dependencies, but Exzap did say the linux build needs work.

FYI it looks like pacman has an apt-file search alternative, pacman -F. This allows searching for packages that provide a specific file, including searching the relative path, like SPIRV/Logger.h.

@Anuskuss
Copy link

@Drakonas I appreciate you trying to help but I'm not really looking for support. I'll just wait for the AUR/AppImage/Flatpak.

looks like you're missing these headers.

Oh no, they are there. Don't know why CMake can't find them though.

$ locate SPIRV/Logger.h
/home/user/vulkan/1.3.224.0/source/glslang/SPIRV/Logger.h
/home/user/vulkan/1.3.224.0/x86_64/include/glslang/SPIRV/Logger.h
/usr/include/glslang/SPIRV/Logger.h

@Anuskuss
Copy link

I think most people have figured this out already but the precompiled binary is way easier to get going. Just need to install libselinux and symlink the missing libraries:

yay -S libselinux
sudo ln -s /usr/lib/libffi.so.8 /usr/lib/libffi.so.7
sudo ln -s /usr/lib/libpcre.so.1 /usr/lib/libpcre.so.3
sudo ln -s /usr/lib/libsepol.so.2 /usr/lib/libsepol.so.1

Unfortunately audio doesn't seem to work and it can't read WUD/WUX but it's a start. Will investigate more tomorrow. Although I did try manually installing the packages (from Debian) and that still didn't work...

@Lithium64
Copy link

Lithium64 commented Aug 24, 2022

I can't running any game here on ubuntu 22.04, when i try to add the mlc01 or a game folder it crash, i workaround this crash editing settings.xml but when i try to run a game i get another crash.

Crash when adding folders

./Cemu

(Cemu:16143): Gtk-CRITICAL **: 07:03:12.328: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar

(Cemu:16143): Gtk-WARNING **: 07:03:15.429: Could not load a pixbuf from /com/ubuntu/themes/Yaru/3.0/assets/bullet-symbolic.symbolic.png.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Yaru/16x16/status/image-missing.png: Erro fatal ao ler o arquivo de imagem PNG: Invalid IHDR data (gdk-pixbuf-error-quark, 0)
Bail out! Gtk:ERROR:../../../../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /usr/share/icons/Yaru/16x16/status/image-missing.png: Erro fatal ao ler o arquivo de imagem PNG: Invalid IHDR data (gdk-pixbuf-error-quark, 0)
Abortado (imagem do núcleo gravada)

Crash when i start a game with vulkan backend

./Cemu

(Cemu:16305): Gtk-CRITICAL **: 07:08:10.075: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar

(Cemu:16305): Gtk-WARNING **: 07:08:12.420: Could not load a pixbuf from /com/ubuntu/themes/Yaru/3.0/assets/bullet-symbolic.symbolic.png.
This may indicate that pixbuf loaders or the mime database could not be found.
SIGSEGV!
Error: signal 11:
./Cemu[0x533e87]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f656922f520]
./Cemu[0x5d0aab]
./Cemu[0x726eb8]
/lib/x86_64-linux-gnu/libc.so.6(+0x5a180)[0x7f6569247180]
terminate called without an active exception
Abortado (imagem do núcleo gravada)

Crash when i start a game with opengl backend

./Cemu

(Cemu:16233): Gtk-CRITICAL **: 07:07:57.881: gtk_box_gadget_distribute: assertion 'size >= 0' failed in GtkScrollbar
SIGSEGV!
Error: signal 11:
./Cemu[0x533e87]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f2732d79520]
./Cemu[0x5d0aab]
./Cemu[0x726eb8]
/lib/x86_64-linux-gnu/libc.so.6(+0x5a180)[0x7f2732d91180]
SIGSEGV!
Error: signal 11:
./Cemu[0x533e87]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f2732d79520]
/lib/x86_64-linux-gnu/libnvidia-eglcore.so.515.65.01(+0xe03c78)[0x7f25eea03c78]
/lib/x86_64-linux-gnu/libnvidia-eglcore.so.515.65.01(+0xecc69b)[0x7f25eeacc69b]
/lib/x86_64-linux-gnu/libnvidia-eglcore.so.515.65.01(+0xe82a35)[0x7f25eea82a35]
/lib/x86_64-linux-gnu/libnvidia-eglcore.so.515.65.01(+0xb47ba5)[0x7f25ee747ba5]
./Cemu[0x80e85d]
./Cemu[0x81225a]
./Cemu[0x62e36f]
/lib/x86_64-linux-gnu/libstdc++.so.6(+0xdc2c3)[0x7f2732be72c3]
/lib/x86_64-linux-gnu/libc.so.6(+0x94b43)[0x7f2732dcbb43]
/lib/x86_64-linux-gnu/libc.so.6(+0x126a00)[0x7f2732e5da00]
terminate called without an active exception
Abortado (imagem do núcleo gravada)

@amayra
Copy link

amayra commented Aug 24, 2022

i hope we see AUR support soon

@tinyzimmer
Copy link

@Anuskuss I'm going through almost identical steps as you and getting the same issues more or less. I am, however, trying to avoid modifying source. One thing I'm curious about, are you sure downgrade is actually downgrading to clang-12? I'm suspecting issues with clang-14.

@aquova
Copy link

aquova commented Aug 24, 2022

I attempting to compile on Arch Linux as well, although still on clang 14, and I saw these same issues. For others looking to try, it should be noted that I also needed the vulkan-headers package installed and needed to set up the environment variable via export VULKAN_SDK=/usr in order to get that far.

@tinyzimmer
Copy link

@aquova The alternative to that (which would also be more cross-platform if to be added to documentation) is just downloading the headers:

sudo mkdir -p /opt/vulkansdk
curl -JLO https://sdk.lunarg.com/sdk/download/1.3.224.0/linux/vulkansdk-linux-x86_64-1.3.224.0.tar.gz
sudo tar -C /opt/vulkansdk/ -xf vulkansdk-linux-x86_64-1.3.224.0.tar.gz
rm vulkansdk-linux-x86_64-1.3.224.0.tar.gz

Then you can set VULKAN_SDK to /opt/vulkansdk/1.3.224.0/x86_64/.

However, it is definitely easier to use pacman on Arch.

@Lithium64
Copy link

Tried to compile it here on ubuntu 22.04, but i'm getting a error on the final of the build

error2.txt

@ToddAWalter
Copy link

Also-- Is there a reason vcpkg is used on linux? vcpkg is, no matter what microsoft says, designed for windows, and it doesn't make a ton of sense to have to compile all of the dependencies when they are already available in the various package managers.

It's not unheard of; blender-git ships siloed library trees (although via optional script, not a hard dependency) as they aren't shy about deploying fixes ahead of upstream. For code with frequent releases it's also helps avoid the packaging delay. Vulkan-headers are a month behind on Gentoo, for example.

@Jhackler
Copy link

't been involved in Cemu before, if you approve of it, wouldn't that make it official? Also, when it's ready for

saying it is allowed does not mean they want to provide support thus it is not official, just put community build or unofficial build in the name on flathub. You can also always submit your work back to the official project so they can choose weather to use some of your work in the official build or not.

@ryzendew
Copy link
Contributor

ryzendew commented Aug 24, 2022

Fedora is stuck here

`CMake Warning at buildtrees/versioning_/versions/openssl/557ff31f9a64f01cd0d98dd44793ce3c7fd32893/portfile.cmake:7 (message):
openssl currently requires the following library from the system package
manager:

  linux-headers

It can be installed on alpine systems via apk add linux-headers.
Call Stack (most recent call first):
scripts/ports.cmake:147 (include)

-- Using cached openssl-openssl-openssl-3.0.5.tar.gz.
-- Cleaning sources at /home/matt/Cemu/dependencies/vcpkg/buildtrees/openssl/src/nssl-3.0.5-30ecfd0d02.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /home/matt/Cemu/dependencies/vcpkg/downloads/openssl-openssl-openssl-3.0.5.tar.gz
-- Using source at /home/matt/Cemu/dependencies/vcpkg/buildtrees/openssl/src/nssl-3.0.5-30ecfd0d02.clean
-- Configuring x64-linux
-- Building x64-linux-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:129 (message):
Command failed: /home/matt/Cemu/dependencies/vcpkg/downloads/tools/cmake-3.24.0-linux/cmake-3.24.0-linux-x86_64/bin/cmake --build . --config Debug --target install -- -v -j13
Working Directory: /home/matt/Cemu/dependencies/vcpkg/buildtrees/openssl/x64-linux-dbg
See logs for more information:
/home/matt/Cemu/dependencies/vcpkg/buildtrees/openssl/install-x64-linux-dbg-out.log

Call Stack (most recent call first):
/home/matt/Cemu/build/vcpkg_installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
/home/matt/Cemu/build/vcpkg_installed/x64-linux/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
buildtrees/versioning_/versions/openssl/557ff31f9a64f01cd0d98dd44793ce3c7fd32893/unix/portfile.cmake:21 (vcpkg_cmake_install)
buildtrees/versioning_/versions/openssl/557ff31f9a64f01cd0d98dd44793ce3c7fd32893/portfile.cmake:39 (include)
scripts/ports.cmake:147 (include)

error: building openssl:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest port files with git pull and vcpkg update.
Then check for known issues at:
https://github.com/microsoft/vcpkg/issues?q=is%3Aissue+is%3Aopen+in%3Atitle+openssl
You can submit a new issue at:
https://github.com/microsoft/vcpkg/issues/new?template=report-package-build-failure.md&title=[openssl]+Build+error
Include '[openssl] Build error' in your bug report title, the following version information in your bug description, and attach any relevant failure logs from above.
vcpkg-tool version: 2022-07-21-a0e87e227afb536c62188c11ad029954f28fdb22
vcpkg-scripts version: 1b0252ca 2022-08-22 (2 days ago)

You can also use the prefilled template from /home/matt/Cemu/build/vcpkg_installed/vcpkg/issue_body.md.

-- Running vcpkg install - failed
CMake Error at dependencies/vcpkg/scripts/buildsystems/vcpkg.cmake:860 (message):
vcpkg install failed. See logs for more information:
/home/matt/Cemu/build/vcpkg-manifest-install.log
Call Stack (most recent call first):
/usr/share/cmake/Modules/CMakeDetermineSystem.cmake:124 (include)
CMakeLists.txt:18 (project)
`
small note vcpkg is installed and so are the kernel-headers

@WryOpussum
Copy link

Having the same issue on Fedora aswell.

@bbaster
Copy link

bbaster commented Aug 24, 2022

@ryzendew @WryOpussum

What's the output of cat $HOME/Cemu/dependencies/vcpkg/buildtrees/openssl/install-x64-linux-dbg-out.log and cat $HOME/Cemu/build/vcpkg-manifest-install.log?

@HurricanePootis
Copy link

HurricanePootis commented Aug 24, 2022

So, I am writing a PKGBUILD for the Arch Linux AUR, and I am currently getting errors linking to wxwidgets and imgui.

/home/hurricane/cemu/src/Cemu/src/imgui/imgui_impl_vulkan.cpp:45:10: fatal error: 'imgui.h' file not found
#include "imgui.h"
         ^~~~~~~~~
/home/hurricane/cemu/src/Cemu/src/imgui/imgui_impl_opengl3.cpp:68:10: fatal error: 'imgui.h' file not found
#include "imgui.h"
         ^~~~~~~~~
In file included from /home/hurricane/cemu/src/Cemu/src/input/emulated/EmulatedController.cpp:1:
In file included from /home/hurricane/cemu/src/Cemu/src/input/../input/emulated/EmulatedController.h:6:
In file included from /home/hurricane/cemu/src/Cemu/src/input/../input/motion/MotionSample.h:3:
In file included from /home/hurricane/cemu/src/Cemu/src/input/../util/math/quaternion.h:4:
In file included from /usr/include/wx-3.2/wx/math.h:16:
In file included from /usr/include/wx-3.2/wx/defs.h:45:
/usr/include/wx-3.2/wx/platform.h:159:10: fatal error: 'wx/setup.h' file not found
#include "wx/setup.h"
         ^~~~~~~~~~~~

So I looked and say Arch Linux installs its headers for the package wxwidgets-common at /usr/include/wx-3.2/, so I added to my CMake command -DCMAKE_CXX_FLAGS="$CXXFLAGS -I/usr/include/wx-3.2", but then that leads to another error and so forth.

So, is this an issue with how Arch packages its headers for wxwidgets, or what?

Also, it looks y'all didn't set your C++ and C standard cause I had to manually set them as I had problems with some things being missing from the std.

	-DCMAKE_CXX_STANDARD=20 
	-DCMAKE_C_STANDARD=17 

Here is my cmake command btw

	cmake \
	../src \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_MAKE_PROGRAM=/usr/bin/make \
	-DCMAKE_C_COMPILER=clang \
	-DCMAKE_CXX_COMPILER=clang++ \
	-DCMAKE_CXX_STANDARD=20 \
	-DCMAKE_C_STANDARD=17 \
	-DCMAKE_CXX_FLAGS="$CXXFLAGS -I/usr/include/wx" \
	-DCMAKE_C_FLAGS="$CFLAGS -I/usr/include/wx"

And, here are the build dependencies and make dependencies

depends=('vulkan-driver' 'opengl-driver' 'gtk3' 'libsecret' 'libgcrypt' 'freeglut' 'glibc' 'openssl' 'zlib' 'curl' 'pugixml' 'glslang' 'x264' 'libzip')
makedepends=('cmake' 'vulkan-headers' 'spirv-tools' 'vulkan-validation-layers' 'nasm' 'boost' 'glm' 'wxwidgets-common')

@Jhackler
Copy link

So, I am writing a PKGBUILD for the Arch Linux AUR, and I am currently getting errors linking to wxwidgets and imgui.

/home/hurricane/cemu/src/Cemu/src/imgui/imgui_impl_vulkan.cpp:45:10: fatal error: 'imgui.h' file not found
#include "imgui.h"
         ^~~~~~~~~
/home/hurricane/cemu/src/Cemu/src/imgui/imgui_impl_opengl3.cpp:68:10: fatal error: 'imgui.h' file not found
#include "imgui.h"
         ^~~~~~~~~
In file included from /home/hurricane/cemu/src/Cemu/src/input/emulated/EmulatedController.cpp:1:
In file included from /home/hurricane/cemu/src/Cemu/src/input/../input/emulated/EmulatedController.h:6:
In file included from /home/hurricane/cemu/src/Cemu/src/input/../input/motion/MotionSample.h:3:
In file included from /home/hurricane/cemu/src/Cemu/src/input/../util/math/quaternion.h:4:
In file included from /usr/include/wx-3.2/wx/math.h:16:
In file included from /usr/include/wx-3.2/wx/defs.h:45:
/usr/include/wx-3.2/wx/platform.h:159:10: fatal error: 'wx/setup.h' file not found
#include "wx/setup.h"
         ^~~~~~~~~~~~

So I looked and say Arch Linux installs its headers for the package wxwidgets-common at /usr/include/wx-3.2/, so I added to my CMake command -DCMAKE_CXX_FLAGS="$CXXFLAGS -I/usr/include/wx-3.2", but then that leads to another error and so forth.

So, is this an issue with how Arch packages its headers for wxwidgets, or what?

Also, it looks y'all didn't set your C++ and C standard cause I had to manually set them as I had problems with some things being missing from the std.

	-DCMAKE_CXX_STANDARD=20 
	-DCMAKE_C_STANDARD=17 

Here is my cmake command btw

	cmake \
	../src \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_MAKE_PROGRAM=/usr/bin/make \
	-DCMAKE_C_COMPILER=clang \
	-DCMAKE_CXX_COMPILER=clang++ \
	-DCMAKE_CXX_STANDARD=20 \
	-DCMAKE_C_STANDARD=17 \
	-DCMAKE_CXX_FLAGS="$CXXFLAGS -I/usr/include/wx" \
	-DCMAKE_C_FLAGS="$CFLAGS -I/usr/include/wx"

And, here are the build dependencies and make dependencies

depends=('vulkan-driver' 'opengl-driver' 'gtk3' 'libsecret' 'libgcrypt' 'freeglut' 'glibc' 'openssl' 'zlib' 'curl' 'pugixml' 'glslang' 'x264' 'libzip')
makedepends=('cmake' 'vulkan-headers' 'spirv-tools' 'vulkan-validation-layers' 'nasm' 'boost' 'glm' 'wxwidgets-common')

I am not a member of the cemu team, however I imagine reporting issues with other peoples packages is not helpful. I would comment on the aur package

@WryOpussum
Copy link

@ryzendew @WryOpussum

What's the output of cat $HOME/Cemu/dependencies/vcpkg/buildtrees/openssl/install-x64-linux-dbg-out.log and cat $HOME/Cemu/build/vcpkg-manifest-install.log?

I got it fixed by installing the openssl build dependencies.

@bbaster
Copy link

bbaster commented Aug 24, 2022

@Jhackler

HurricanePootis is having errors with creating an AUR package, not with someone else's package

@Jhackler
Copy link

is having errors with creating an AUR package, not with someone else's package

ah ok got it lol.

@tinyzimmer
Copy link

So, I am writing a PKGBUILD for the Arch Linux AUR, and I am currently getting errors linking to wxwidgets and imgui.

/home/hurricane/cemu/src/Cemu/src/imgui/imgui_impl_vulkan.cpp:45:10: fatal error: 'imgui.h' file not found
#include "imgui.h"
         ^~~~~~~~~
/home/hurricane/cemu/src/Cemu/src/imgui/imgui_impl_opengl3.cpp:68:10: fatal error: 'imgui.h' file not found
#include "imgui.h"
         ^~~~~~~~~
In file included from /home/hurricane/cemu/src/Cemu/src/input/emulated/EmulatedController.cpp:1:
In file included from /home/hurricane/cemu/src/Cemu/src/input/../input/emulated/EmulatedController.h:6:
In file included from /home/hurricane/cemu/src/Cemu/src/input/../input/motion/MotionSample.h:3:
In file included from /home/hurricane/cemu/src/Cemu/src/input/../util/math/quaternion.h:4:
In file included from /usr/include/wx-3.2/wx/math.h:16:
In file included from /usr/include/wx-3.2/wx/defs.h:45:
/usr/include/wx-3.2/wx/platform.h:159:10: fatal error: 'wx/setup.h' file not found
#include "wx/setup.h"
         ^~~~~~~~~~~~

So I looked and say Arch Linux installs its headers for the package wxwidgets-common at /usr/include/wx-3.2/, so I added to my CMake command -DCMAKE_CXX_FLAGS="$CXXFLAGS -I/usr/include/wx-3.2", but then that leads to another error and so forth.

So, is this an issue with how Arch packages its headers for wxwidgets, or what?

Also, it looks y'all didn't set your C++ and C standard cause I had to manually set them as I had problems with some things being missing from the std.

	-DCMAKE_CXX_STANDARD=20 
	-DCMAKE_C_STANDARD=17 

Here is my cmake command btw

	cmake \
	../src \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_MAKE_PROGRAM=/usr/bin/make \
	-DCMAKE_C_COMPILER=clang \
	-DCMAKE_CXX_COMPILER=clang++ \
	-DCMAKE_CXX_STANDARD=20 \
	-DCMAKE_C_STANDARD=17 \
	-DCMAKE_CXX_FLAGS="$CXXFLAGS -I/usr/include/wx" \
	-DCMAKE_C_FLAGS="$CFLAGS -I/usr/include/wx"

And, here are the build dependencies and make dependencies

depends=('vulkan-driver' 'opengl-driver' 'gtk3' 'libsecret' 'libgcrypt' 'freeglut' 'glibc' 'openssl' 'zlib' 'curl' 'pugixml' 'glslang' 'x264' 'libzip')
makedepends=('cmake' 'vulkan-headers' 'spirv-tools' 'vulkan-validation-layers' 'nasm' 'boost' 'glm' 'wxwidgets-common')

Any reason you are using make instead of ninja?

@aquova
Copy link

aquova commented Aug 24, 2022

So, is this an issue with how Arch packages its headers for wxwidgets, or what?

It looks like the filepath for setup.h is /usr/include/wx-3.2/wx/gtk/setup.h (seen by running pacman -Fl wxwidgets-common | grep setup.h).

@HurricanePootis
Copy link

So, I am writing a PKGBUILD for the Arch Linux AUR, and I am currently getting errors linking to wxwidgets and imgui.

/home/hurricane/cemu/src/Cemu/src/imgui/imgui_impl_vulkan.cpp:45:10: fatal error: 'imgui.h' file not found
#include "imgui.h"
         ^~~~~~~~~
/home/hurricane/cemu/src/Cemu/src/imgui/imgui_impl_opengl3.cpp:68:10: fatal error: 'imgui.h' file not found
#include "imgui.h"
         ^~~~~~~~~
In file included from /home/hurricane/cemu/src/Cemu/src/input/emulated/EmulatedController.cpp:1:
In file included from /home/hurricane/cemu/src/Cemu/src/input/../input/emulated/EmulatedController.h:6:
In file included from /home/hurricane/cemu/src/Cemu/src/input/../input/motion/MotionSample.h:3:
In file included from /home/hurricane/cemu/src/Cemu/src/input/../util/math/quaternion.h:4:
In file included from /usr/include/wx-3.2/wx/math.h:16:
In file included from /usr/include/wx-3.2/wx/defs.h:45:
/usr/include/wx-3.2/wx/platform.h:159:10: fatal error: 'wx/setup.h' file not found
#include "wx/setup.h"
         ^~~~~~~~~~~~

So I looked and say Arch Linux installs its headers for the package wxwidgets-common at /usr/include/wx-3.2/, so I added to my CMake command -DCMAKE_CXX_FLAGS="$CXXFLAGS -I/usr/include/wx-3.2", but then that leads to another error and so forth.
So, is this an issue with how Arch packages its headers for wxwidgets, or what?
Also, it looks y'all didn't set your C++ and C standard cause I had to manually set them as I had problems with some things being missing from the std.

	-DCMAKE_CXX_STANDARD=20 
	-DCMAKE_C_STANDARD=17 

Here is my cmake command btw

	cmake \
	../src \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_MAKE_PROGRAM=/usr/bin/make \
	-DCMAKE_C_COMPILER=clang \
	-DCMAKE_CXX_COMPILER=clang++ \
	-DCMAKE_CXX_STANDARD=20 \
	-DCMAKE_C_STANDARD=17 \
	-DCMAKE_CXX_FLAGS="$CXXFLAGS -I/usr/include/wx" \
	-DCMAKE_C_FLAGS="$CFLAGS -I/usr/include/wx"

And, here are the build dependencies and make dependencies

depends=('vulkan-driver' 'opengl-driver' 'gtk3' 'libsecret' 'libgcrypt' 'freeglut' 'glibc' 'openssl' 'zlib' 'curl' 'pugixml' 'glslang' 'x264' 'libzip')
makedepends=('cmake' 'vulkan-headers' 'spirv-tools' 'vulkan-validation-layers' 'nasm' 'boost' 'glm' 'wxwidgets-common')

Any reason you are using make instead of ninja?

Honestly, I just use make to have one less dependency (as it shouldn't change anything with CMake), but I will try with ninja to see if it changes everything

@Tachi107
Copy link
Contributor

Could somebody check if #1 is working for them? I'm encountering linking issues related to some missing wxWidgets symbols. Compilation requires wxWidgets 3.2, which is not available on Debian-based distros.

Here are the commands to download and build that work in progress branch; you'll have to install all the required dependencies yourself. Please do not report issues here, but report them on #75.

$ git clone --branch=build-linux https://github.com/Tachi107/Cemu.git
$ cd Cemu
$ git submodule update --init dependencies/ZArchive
$ CC=clang CXX=clang++ cmake -G Ninja -B build -DENABLE_VCPKG=false
$ cmake --build build

@bbaster
Copy link

bbaster commented Aug 27, 2022

@Tachi107 Newest wxWidgets version is available for Debian-based with this repo: https://docs.codelite.org/wxWidgets/repo320/#ubuntu-and-debian

@Tachi107
Copy link
Contributor

Tachi107 commented Aug 27, 2022

@Tachi107 Newest wxWidgets version is available for Debian-based with this repo: https://docs.codelite.org/wxWidgets/repo320/#ubuntu-and-debian

Please don't install deb packages from random places. The official Debian package for wxWidgets 3.2 has already been completed, but it has not been uploaded to Debian because the review process is long.

If you want to install the official wxWidgets 3.2 package on Debian, you have to build it yourself (for the time being).

But please don't do this if you have no idea what you are doing. And remember to remove the packages you have built yourself after finishing using them.

$ cd $(mktemp --directory)
# apt install git-buildpackage build-essential
$ gbp clone https://salsa.debian.org/freewx-team/wxwidgets3.2.git
$ cd wxwidgets3.2
# apt build-dep --mark-auto .
$ DEB_BUILD_OPTIONS=nocheck gbp buildpackage
$ cd ..
# apt install --mark-auto ./libwxbase3.2-0_*.deb ./libwxgtk3.2-0_*.deb ./libwxgtk3.2-dev_*.deb ./wx3.2-headers_*.deb

@Anuskuss
Copy link

Anuskuss commented Aug 28, 2022

Excited to see that the last secret has been cracked. Time to clean up the PKGBUILD.

Changes:

  • GCC support
  • Clang support (any version) through workaround patch
  • Removed Ninja dependency
  • Submodules as sources
  • Fixed "Cemu is a directory" linker error (don't know what triggers it but it finally happend to me)
  • Fixed install (because of permissions and lack of XDG support I decided to dump it into ~/.local for now)
  • Added VCPKG cache directory (everything is contained in one folder now)
  • Cleaned up depends/makedepends
  • Added optdepends (apparently sdl2 isn't needed)
  • Wrote pkgver

Future:

  • Reintroduce Clang (dependency) if it's measurably faster than GCC
  • Desktop file (GDK_BACKEND=x11)
  • What's up with libpng / libpulse / libdecor?
  • Coredump on exit

Right now, it's pulling from tomlally/Cemu, but once #80 is merged, I think it's ready for prime time and we¹ can submit it to the AUR.

This of course wouldn't have been possible without the help of the community, particulary @zjeffer (debug mode), @Rubo3 (license/format-security), @robertkirkman (python dep), @bscubed (submodules), @abouvier (linker error) and @tomlally (gcc).


¹ If nobody steps forward as a potential maintainer, I'll do it but I'd rather not because I have no experience in that regard.

@ghost ghost mentioned this issue Aug 28, 2022
Merged
@robertkirkman
Copy link

robertkirkman commented Aug 28, 2022

@Anuskuss there is already cemu-git in AUR that avoids vcpkg unlike yours. Currently yours builds in a clean chroot (given the addition of git dependency) but at the moment cemu-git is outdated and does not. Personally, I see the value in having at least two Cemu source packages in the AUR, with at least one of them using vcpkg and at least one of them providing an alternative build method, so that AUR users can easily choose whichever they prefer. This seems to me like an independent variable from the release/development branches distinction (cemu vs cemu-git). The only potential obstacle I see to placing a package on the AUR that uses vcpkg is that it might not be considered as compliant with the portion of Arch Packaging Guidelines that says a lot of things like "sources should be signed and verified (by makepkg)", etc. I'm also not sure whether there is any actual guarantee that ~/.cache be writable during the time makepkg builds packages. I do hope to see a vcpkg build option on the AUR for greater user choice and because Exzap says it is the only officially recommended method, I just hope it will be allowed.

@n0toose
Copy link
Contributor

n0toose commented Aug 28, 2022

vcpkg can still be very useful for compiling things by yourself, but in any place other than potentially Arch (e.g. Gentoo, I am not aware of any Arch packages that do that), vcpkg will absolutely not be used simply because of sandboxing and I am aware of a couple of projects that have had such integrations patched out.

@Somaxa8
Copy link

Somaxa8 commented Aug 28, 2022

image
when compiling i get this error, does anyone have an idea?

@bbaster
Copy link

bbaster commented Aug 28, 2022

@Somaxa8 Try building with gcc instead, to do that replace -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 with -DCMAKE_C_COMPILER=/usr/bin/gcc -DCMAKE_CXX_COMPILER=/usr/bin/g++ in the cmake command

@Somaxa8
Copy link

Somaxa8 commented Aug 28, 2022

@bbaster it worked, thanks!

@Anuskuss
Copy link

there is already cemu-git in AUR

I didn't know that. I thought this was a team effort but congrats to @abouvier for being the first I guess. Me personally, I wouldn't feel comfortable publishing some half-assed mess to the AUR but that's just me.

that avoids vcpkg unlike yours

Well my plan was to also get rid of vcpkg because it downloads a bunch of crap which I don't need because it's either already installed or can be installed and thereby shared with other programs. I'm following #75 and once that's sorted out, I would try to get my PKGBUILD working with -DENABLE_VCPKG=false.

Currently yours builds in a clean chroot (given the addition of git dependency)

I removed git because it's a dependency of any AUR helper but you're right that people could be makepkging themselves so I added it back.

Personally, I see the value in having at least two Cemu source packages in the AUR, with at least one of them using vcpkg and at least one of them providing an alternative build method, so that AUR users can easily choose whichever they prefer.

I don't really see a point in that. I don't even know if I should continue my PKGBUILD now that abouvier beat me to it. They certainely have good ideas (getting rid of vcpkg, mounting the cemu directory instead of putting it in ~/.local/share) but I find it sketchy that they didn't communicate with the rest of us at all, kept their improvements for themselves (instead of PRing or helping out in #75) and that they uploaded it to the AUR in this state. My PKGBUILD looks and functions much better and I still wouldn't want to publish it until it's perfect.

Regardless, I'd still like to run some benchmarks to see which compiler and flag combination is the best (it currently runs worse than wine AFAIK). No point really fixing the vcpkg situation and getting rid of the patch(es) because I'm not interested in publishing this as cemu-git-alt or whatever.

@Tachi107
Copy link
Contributor

Tachi107 commented Aug 28, 2022 via email

@ThatOneCalculator
Copy link

I maintain a couple popular AUR packages, would the devs mind if for now I made a cemu-git package?

@Anuskuss
Copy link

I maintain a couple popular AUR packages, would the devs mind if for now I made a cemu-git package?

Ah yes, a third one. Just kidding of course but we already have a public and a semi-public one.

@ThatOneCalculator
Copy link

Ah, gotcha.

Tachi107 added a commit to Tachi107/Cemu that referenced this issue Aug 28, 2022
This is a big rework of how dependencies are handled internally. All the
calls to CMake functions changing directory-wide properties that were
previously used to link to external and internal dependencies have been
replaced with their "target_" counterparts. This makes it possible to
express more clearly the relationships between different targets and
should also make the build script more robust in general.

In doing this, I've also made it possible to link to system libraries if
so desired; the versioned calls to find_package() will make sure that
the found dependencies are compatible with the ones required by Cemu,
and will abort the build otherwise.

Cemu's internal targets are deeply interconnected, making it hard to
fully benefit from a target-based approach. Nonetheless, I did my best
to mark PUBLIC dependencies as such, for example when an internal target
like CemuGui exposes a dependency as part of its API, i.e. it includes
a third party header in one of its public headers.

This will significantly help with improving the build experience on
Linux, thus helping a bit with the resolution of cemu-project#1.
@Anuskuss
Copy link

Here are my results from a quick (and unscientific) benchmark*:

GCC12 Clang14
-DCMAKE_BUILD_TYPE=Release 60 59¹
-DPUBLIC_RELEASE=ON 62 64
-march=native -mtune=native 62 65
-O3 62 65

* Values are in FPS and each line contains each arguments above it

As expected the flags don't really do much (except -DPUBLIC_RELEASE=ON because that's actually disabling some code). But surprisingly enough Clang performs better than GCC which while generally true should not be the case for emulators (because the majority of the time the emulator is doing JIT stuff).

For comparison, this is the Clang v12 build before and after release mode worked and the precompiled binary:

Clang12
Debug 59
Release² 61
Download 62³

Meaning your self-compiled Clang (v14) build beats the pre-combiled "Ubuntu" build.

But unfortunately it's all behind Windows currently:

Windows
v1.26.2 96
v2.0 87

Although seeing that v2.0 is worse than v1.26.2 gives me hope that we can get some of the performance back in the future.

Last but not least (even though it's not related to Linux per se): If you're wondering if Vulkan beats OpenGL on NVIDIA GPUs:

OpenGL Vulkan
Linux 53 65
Windows 71 87

Conclusion: Because Clang performs measurably better than GCC I decided to prefer it (use if Clang is installed but not the default compiler) in my PKGBUILD but because GCC works and Clang is only marginally faster, I decided against depending on it. I will however leave the CFLAGS/CXXFLAGS alone.


¹ First time running the Clang build Cemu crashed. It only happend once though and never again.

SIGSEGV!
Error: signal 11:
/home/user/.local/share/cemu/Cemu(+0x548b8f)[0x555f174abb8f]
/usr/lib/libc.so.6(+0x38a40)[0x7f251b0ffa40]
/home/user/.local/share/cemu/Cemu(+0x12d6a74)[0x555f18239a74]
/home/user/.local/share/cemu/Cemu(+0x124c01f)[0x555f181af01f]
/home/user/.local/share/cemu/Cemu(+0x11de1b3)[0x555f181411b3]
/home/user/.local/share/cemu/Cemu(+0x11c8987)[0x555f1812b987]
/home/user/.local/share/cemu/Cemu(+0x11c8c5a)[0x555f1812bc5a]
/home/user/.local/share/cemu/Cemu(+0x9c7116)[0x555f1792a116]
/usr/lib/libstdc++.so.6(+0xd62f3)[0x7f251af4f2f3]
/usr/lib/libc.so.6(+0x8678d)[0x7f251b14d78d]
/usr/lib/libc.so.6(__clone+0x44)[0x7f251b1ce8e4]
terminate called without an active exception

² Everything enabled (CFLAGS="-march=native -mtune=native -O3" CXXFLAGS="$CFLAGS" cmake -DCMAKE_BUILD_TYPE=Release -DPUBLIC_RELEASE=ON)

³ No audio.

@edisionnano
Copy link

Try -ofast

@Anuskuss
Copy link

Try -ofast

Unlikely to improve performance. Would probably just break stuff and lead to undesired issue reports.

@robertkirkman
Copy link

robertkirkman commented Aug 29, 2022

Here are my results from a quick (and unscientific) benchmark*:

this is great except could you please state what hardware specs this was done with because that is of course the biggest factor of all that impacts performance, and people won't know whether they should be having more or less FPS compared to you when they try to copy one of your optimization configurations, unless they know whether their hardware is considered more or less powerful than yours

EDIT: also what game is that because that's probably the only other thing you didn't say that could be argued to have an even bigger effect on the resulting FPS than the hardware

@Exzap Exzap closed this as completed in #75 Aug 29, 2022
@Crementif Crementif reopened this Aug 29, 2022
@Exzap Exzap unpinned this issue Aug 29, 2022
@cemu-project cemu-project locked as resolved and limited conversation to collaborators Aug 29, 2022
@Exzap
Copy link
Member

Exzap commented Aug 29, 2022

Continued in #107 since the useful info got burried.

@Exzap Exzap closed this as completed Aug 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build related Tags for build related issues, discussions and requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.