linuxdeploy / linuxdeploy-plugin-qt

Qt plugin for linuxdeploy, bundling Qt resources, plugins, QML files and a lot more.
https://github.com/linuxdeploy/linuxdeploy
MIT License
102 stars 36 forks source link

building for arm #151

Closed iltommi closed 8 months ago

iltommi commented 8 months ago

Since the linuxdeploy is now working for arm (big thanks!) I tried to compile the qt plugin, but run into some problem. I start with a arm fedora 34:

docker run --rm -i -t --platform linux/arm64 arm64v8/fedora:34 /bin/bash

then I do this to compile:

dnf -y install gcc gcc-c++ qconf libtiff-devel gsl-devel redhat-lsb-core blas-devel pandoc hdf-devel hdf5-devel cfitsio-devel fftw3-devel rpm-build qt6-* git wget patchelf CImg-devel libpng libjpeg libz locate

cd
git clone https://github.com/nlohmann/json
cd json
mkdir build
cd build/
cmake ..
make -j2 install

cd
git clone --recurse-submodules https://github.com/linuxdeploy/linuxdeploy-plugin-qt.git
cd linuxdeploy-plugin-qt
mkdir build
cd build/
cmake .. -DBUILD_TESTING=OFF -DSTATIC_BUILD=On
make -j2 install

and it fails at the end with:

[ 95%] Linking CXX executable ../bin/linuxdeploy-plugin-qt
/usr/bin/ld: cannot find -lpng16
/usr/bin/ld: cannot find -lz
/usr/bin/ld: cannot find -ljpeg
/usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
make[2]: *** [src/CMakeFiles/linuxdeploy-plugin-qt.dir/build.make:162: bin/linuxdeploy-plugin-qt] Error 1
make[1]: *** [CMakeFiles/Makefile2:646: src/CMakeFiles/linuxdeploy-plugin-qt.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Since it's probably a stupid error I run into, would it be possible to add the arm version of the plugin or it needs a big and deep work?

Thanks

TheAssassin commented 8 months ago

Working on official builds right now.

I have no idea why you have all these linking issues. You may need to install the corresponding packages. I cannot tell from the little bit of log you shared if that's the right advice. If the issue persists once official builds are available (and you even want to build your own builds then), you need to provide way more information such as a complete build log and details on your build system.

iltommi commented 8 months ago

I understand, it's a bit odd because I have almost all of those libs in /usr/lib64: libc.so libjpeg.so libm.so libpng.so libpthread.so libz.so It's missing the libstdc++ (which is there as /usr/lib64/libstdc++.so.6.0.29 but missing the symlink)

Anyway since you're working on that I'm going to close this issue.

Thanks a lot

TheAssassin commented 8 months ago

but missing the symlink

That could be the lack of a dev(el) package.

iltommi commented 8 months ago

FYI, I've continued to check wheter I was able to build it myself, and now I used a debian:stable docker image on arm platform. This is where the compilation stops:

[...]
[ 18%] Building CXX object lib/linuxdeploy/src/subprocess/CMakeFiles/linuxdeploy_subprocess.dir/subprocess.cpp.o
cd /linuxdeploy-plugin-qt/build/lib/linuxdeploy/src/subprocess && /usr/bin/c++  -I/linuxdeploy-plugin-qt/lib/linuxdeploy/include -O2 -g -DNDEBUG -std=gnu++17 -MD -MT lib/linuxdeploy/src/subprocess/CMakeFiles/linuxdeploy_subprocess.dir/subprocess.cpp.o -MF CMakeFiles/linuxdeploy_subprocess.dir/subprocess.cpp.o.d -o CMakeFiles/linuxdeploy_subprocess.dir/subprocess.cpp.o -c /linuxdeploy-plugin-qt/lib/linuxdeploy/src/subprocess/subprocess.cpp
/linuxdeploy-plugin-qt/lib/linuxdeploy/src/subprocess/subprocess.cpp: In member function 'linuxdeploy::subprocess::subprocess_result linuxdeploy::subprocess::subprocess::run() const':
/linuxdeploy-plugin-qt/lib/linuxdeploy/src/subprocess/subprocess.cpp:49:38: error: variable 'std::array<linuxdeploy::subprocess::subprocess::run() const::PipeState, 2> buffers' has initializer but incomplete type
   49 |             std::array<PipeState, 2> buffers = {
      |                                      ^~~~~~~
/linuxdeploy-plugin-qt/lib/linuxdeploy/src/subprocess/subprocess.cpp:98:85: error: no matching function for call to 'linuxdeploy::subprocess::subprocess_result::subprocess_result(<brace-enclosed initializer list>)'
   98 |             return subprocess_result{exit_code, buffers[0].buffer, buffers[1].buffer};
      |                                                                                     ^
In file included from /linuxdeploy-plugin-qt/lib/linuxdeploy/include/linuxdeploy/subprocess/subprocess.h:11,
                 from /linuxdeploy-plugin-qt/lib/linuxdeploy/src/subprocess/subprocess.cpp:11:
/linuxdeploy-plugin-qt/lib/linuxdeploy/include/linuxdeploy/subprocess/subprocess_result.h:23:13: note: candidate: 'linuxdeploy::subprocess::subprocess_result::subprocess_result(int, linuxdeploy::subprocess::subprocess_result_buffer_t, linuxdeploy::subprocess::subprocess_result_buffer_t)'
   23 |             subprocess_result(int exit_code, subprocess_result_buffer_t stdout_contents,
      |             ^~~~~~~~~~~~~~~~~
/linuxdeploy-plugin-qt/lib/linuxdeploy/include/linuxdeploy/subprocess/subprocess_result.h:23:13: note:   conversion of argument 2 would be ill-formed:
/linuxdeploy-plugin-qt/lib/linuxdeploy/include/linuxdeploy/subprocess/subprocess_result.h:16:15: note: candidate: 'linuxdeploy::subprocess::subprocess_result::subprocess_result(const linuxdeploy::subprocess::subprocess_result&)'
   16 |         class subprocess_result {
      |               ^~~~~~~~~~~~~~~~~
/linuxdeploy-plugin-qt/lib/linuxdeploy/include/linuxdeploy/subprocess/subprocess_result.h:16:15: note:   candidate expects 1 argument, 3 provided
/linuxdeploy-plugin-qt/lib/linuxdeploy/include/linuxdeploy/subprocess/subprocess_result.h:16:15: note: candidate: 'linuxdeploy::subprocess::subprocess_result::subprocess_result(linuxdeploy::subprocess::subprocess_result&&)'
/linuxdeploy-plugin-qt/lib/linuxdeploy/include/linuxdeploy/subprocess/subprocess_result.h:16:15: note:   candidate expects 1 argument, 3 provided
make[2]: *** [lib/linuxdeploy/src/subprocess/CMakeFiles/linuxdeploy_subprocess.dir/build.make:76: lib/linuxdeploy/src/subprocess/CMakeFiles/linuxdeploy_subprocess.dir/subprocess.cpp.o] Error 1
make[2]: Leaving directory '/linuxdeploy-plugin-qt/build'
make[1]: *** [CMakeFiles/Makefile2:507: lib/linuxdeploy/src/subprocess/CMakeFiles/linuxdeploy_subprocess.dir/all] Error 2
make[1]: Leaving directory '/linuxdeploy-plugin-qt/build'
make: *** [Makefile:136: all] Error 2