f3d icon indicating copy to clipboard operation
f3d copied to clipboard

Cannot build F3D 1.3.1 Flatpak

Open kevinsmia1939 opened this issue 3 years ago • 4 comments
trafficstars

Describe the bug I was trying to update F3D to 1.3.1 but encounter an error.

[ 85%] Built target libf3d
[ 87%] Generating F3DIcon.h, F3DIcon.cxx
[ 91%] Building CXX object application/CMakeFiles/f3d.dir/F3DIcon.cxx.o
[ 93%] Building CXX object application/CMakeFiles/f3d.dir/F3DOptionsParser.cxx.o
[ 93%] Building CXX object application/CMakeFiles/f3d.dir/F3DConfigFileTools.cxx.o
[ 97%] Building CXX object application/CMakeFiles/f3d.dir/F3DStarter.cxx.o
[ 97%] Building CXX object application/CMakeFiles/f3d.dir/main.cxx.o
[100%] Linking CXX executable ../bin/f3d
/usr/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../../../x86_64-unknown-linux-gnu/bin/ld: cannot find -lstdc++fs
collect2: error: ld returned 1 exit status
make[2]: *** [application/CMakeFiles/f3d.dir/build.make:170: bin/f3d] Error 1
make[1]: *** [CMakeFiles/Makefile2:448: application/CMakeFiles/f3d.dir/all] Error 2
make: *** [Makefile:156: all] Error 2

I look into it a bit, it seems like it need g++. But g++ is already available

g++ (GCC) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

To Reproduce Full error log https://buildbot.flathub.org/#/builders/35/builds/13200/steps/6/logs/stdio

Flatpak PR https://github.com/flathub/io.github.f3d_app.f3d/pull/9#issuecomment-1243091779

System Information: Operating System: openSUSE Tumbleweed 20220907 KDE Plasma Version: 5.25.4 KDE Frameworks Version: 5.97.0 Qt Version: 5.15.5 Kernel Version: 5.19.7-1-default (64-bit) Graphics Platform: X11 Processors: 12 × AMD Ryzen 5 4600H with Radeon Graphics Memory: 7.6 GiB of RAM Graphics Processor: NVIDIA GeForce GTX 1650 Ti/PCIe/SSE2 Manufacturer: LENOVO Product Name: 82B5 System Version: Lenovo Legion 5 15ARH05 flatpak-builder --version flatpak-builder 1.2.2

F3D Information Building from source 1.3.1

Do you have some clue on to this? Thanks.

kevinsmia1939 avatar Sep 12 '22 22:09 kevinsmia1939

std::filesystem is supported by gcc since version 8, can you check it is present in your build system ?

[glow@frollo ~/]$ locate stdc++fs
/usr/lib/libstdc++fs.a
/usr/lib32/libstdc++fs.a

mwestphal avatar Sep 13 '22 02:09 mwestphal

Using this library may require additional compiler/linker options. GNU implementation prior to 9.1 requires linking with -lstdc++fs and LLVM implementation prior to LLVM 9.0 requires linking with -lc++fs

Source: https://en.cppreference.com/w/cpp/filesystem

@mwestphal maybe we should check the GCC version

@kevinsmia1939 In the meantime you can patch F3D when building the package by commenting out this line: https://github.com/f3d-app/f3d/blob/faf2cb11dc699458547ce578f7b2e53e9d3fba4d/application/CMakeLists.txt#L33

Meakk avatar Sep 13 '22 13:09 Meakk

Indeed, that looks like the right approach.

mwestphal avatar Sep 14 '22 13:09 mwestphal

I commented the line like above, it can be build now.

kevinsmia1939 avatar Sep 15 '22 18:09 kevinsmia1939

@kevinsmia1939 A new cmake option has been added, F3D_APPLICATION_LINK_FILESYSTEM, that you should be able to turn off in the next release.

mwestphal avatar Sep 27 '22 16:09 mwestphal