Kitware / fletch

Computer Vision Software Development Environment
63 stars 54 forks source link

[Linux, Flatpak] Cannot build TeleSculptor. undefined reference to `curl_easy_reset' etc #689

Open kevinsmia1939 opened 3 years ago

kevinsmia1939 commented 3 years ago

Describe the bug I am trying to package TeleSculptor as Flatpak app for Linux. Flatpak is one way to distribute binary apps on Linux distros. I intend to submit this to Flathub. https://www.flatpak.org/ https://flathub.org/home

I could not build TeleSculptor using super-build.

I encounter the error below.

To Reproduce Steps to reproduce the behavior: Lets setup flatpak.

  1. Since this use Flatpak to build, one must first install up-to-date version of flatpak and flatpak-builder. Make sure that flatpak and flatpak-builder package is up-to-date. Follow this instruction https://flatpak.org/setup/
  2. sudo apt/zypper/dnf/etc install flatpak flatpak-builder
  3. Add Flathub repository, we need this to install kde sdk and runtime because it provide Qt.flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
  4. Install KDE Sdk and runtime. flatpak install org.kde.Sdk org.kde.Sdk choose version 5.15.
  5. Download my flatpak manifest file for TeleSculptor. git clone --recursive git@github.com:kevinsmia1939/com.github.Kitware.TeleSculptor.git
  6. Start building flatpak TeleSculptor. flatpak-builder --install --force-clean --user build com.github.Kitware.TeleSculptor
  7. The error should occurred as below.

The manifest file is com.github.Kitware.TeleSculptor.yaml which provide all instruction for build the app.

These are the dependencies I use. Kwiver v1.5.1 TeleSculptor commit: 35dd1f705dee55b44c39958946ad04ad8191d7ed (master) Fletch commit: cf4538470395204a2233930d66f6bf2d75550319

I also install curl 7.77 because freedesktop provide 7.71, but still error. The header file is present.

Running: ls -l /app/include/curl
total 232
-rw-r--r-- 3 kev users 119683 Jan  1  1970 curl.h
-rw-r--r-- 2 kev users   3035 Jan  1  1970 curlver.h
-rw-r--r-- 3 kev users   3980 Jan  1  1970 easy.h
-rw-r--r-- 3 kev users   2069 Jan  1  1970 mprintf.h
-rw-r--r-- 3 kev users  17207 Jan  1  1970 multi.h
-rw-r--r-- 3 kev users   2379 Jan  1  1970 options.h
-rw-r--r-- 2 kev users   1339 Jan  1  1970 stdcheaders.h
-rw-r--r-- 3 kev users  19028 Jan  1  1970 system.h
-rw-r--r-- 3 kev users  42747 Jan  1  1970 typecheck-gcc.h
-rw-r--r-- 3 kev users   4486 Jan  1  1970 urlapi.h
Running: ls -l /app/lib/pkgconfig
total 28
... etc.
-rw-r--r-- 2 kev users 1748 Jan  1  1970 libcurl.pc
Running: ls -l /app/lib
total 16044
.. etc.
-rwxr-xr-x 2 kev users  558648 Jan  1  1970 libcurl.so

When installing KDE runtime and Sdk, it also install Freedesktop runtime and Sdk. Which provide these basic dependencies. But I install the new curl myself as stated above. gcc (GCC) 10.2.0 cmake version 3.20.2 curl 7.77.0 (Linux) libcurl/7.77.0 OpenSSL/1.1.1k zlib/1.2.11

In the TeleScultor manifest, I create stamps file with touch command to prevent Fletch form connecting to network because Flatpak-builder does not allow network connection when building.

I also tried passing env

LIBRARY_PATH: "/app/lib:/usr/lib"
LD_LIBRARY_PATH: "/app/lib:/usr/lib"

No progress.

Provide error log

[ 99%] Linking CXX shared library lib/libpdal_base.so
make[8]: Leaving directory '/run/build/TeleSculptor-prebuild/build/external/fletch-build/build/src/PDAL-build'
[ 99%] Built target pdal_base
make[8]: Entering directory '/run/build/TeleSculptor-prebuild/build/external/fletch-build/build/src/PDAL-build'
make[8]: Leaving directory '/run/build/TeleSculptor-prebuild/build/external/fletch-build/build/src/PDAL-build'
make[8]: Entering directory '/run/build/TeleSculptor-prebuild/build/external/fletch-build/build/src/PDAL-build'
[ 99%] Building CXX object apps/CMakeFiles/pdal.dir/pdal.cpp.o
In file included from /run/build/TeleSculptor-prebuild/build/external/fletch-build/install/include/ogr_api.h:45,
                 from /run/build/TeleSculptor-prebuild/build/external/fletch-build/install/include/gdal.h:50,
                 from /run/build/TeleSculptor-prebuild/build/external/fletch-build/install/include/gdal_priv.h:60,
                 from /run/build/TeleSculptor-prebuild/build/external/fletch-build/build/src/PDAL/pdal/GDALUtils.hpp:51,
                 from /run/build/TeleSculptor-prebuild/build/external/fletch-build/build/src/PDAL/apps/pdal.cpp:36:
/run/build/TeleSculptor-prebuild/build/external/fletch-build/install/include/ogr_core.h: In member function ‘void OGREnvelope::Intersect(const OGREnvelope&)’:
/run/build/TeleSculptor-prebuild/build/external/fletch-build/install/include/ogr_core.h:122:33: warning: implicitly-declared ‘OGREnvelope& OGREnvelope::operator=(const OGREnvelope&)’ is deprecated [-Wdeprecated-copy]
  122 |             *this = OGREnvelope();
      |                                 ^
/run/build/TeleSculptor-prebuild/build/external/fletch-build/install/include/ogr_core.h:68:9: note: because ‘OGREnvelope’ has user-provided ‘OGREnvelope::OGREnvelope(const OGREnvelope&)’
   68 |         OGREnvelope(const OGREnvelope& oOther) :
      |         ^~~~~~~~~~~
/run/build/TeleSculptor-prebuild/build/external/fletch-build/install/include/ogr_core.h: In member function ‘void OGREnvelope3D::Intersect(const OGREnvelope3D&)’:
/run/build/TeleSculptor-prebuild/build/external/fletch-build/install/include/ogr_core.h:229:35: warning: implicitly-declared ‘OGREnvelope3D& OGREnvelope3D::operator=(const OGREnvelope3D&)’ is deprecated [-Wdeprecated-copy]
  229 |             *this = OGREnvelope3D();
      |                                   ^
/run/build/TeleSculptor-prebuild/build/external/fletch-build/install/include/ogr_core.h:169:9: note: because ‘OGREnvelope3D’ has user-provided ‘OGREnvelope3D::OGREnvelope3D(const OGREnvelope3D&)’
  169 |         OGREnvelope3D(const OGREnvelope3D& oOther) :
      |         ^~~~~~~~~~~~~
[100%] Linking CXX executable ../bin/pdal
/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: ../lib/libpdal_base.so.7.0.2: undefined reference to `curl_easy_reset'
/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: ../lib/libpdal_base.so.7.0.2: undefined reference to `curl_slist_append'
/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: ../lib/libpdal_base.so.7.0.2: undefined reference to `curl_easy_perform'
/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: ../lib/libpdal_base.so.7.0.2: undefined reference to `curl_easy_init'
/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: ../lib/libpdal_base.so.7.0.2: undefined reference to `curl_global_init'
/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: ../lib/libpdal_base.so.7.0.2: undefined reference to `curl_easy_cleanup'
/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: ../lib/libpdal_base.so.7.0.2: undefined reference to `curl_easy_setopt'
/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: ../lib/libpdal_base.so.7.0.2: undefined reference to `curl_easy_getinfo'
/usr/lib/gcc/x86_64-unknown-linux-gnu/10.2.0/../../../../x86_64-unknown-linux-gnu/bin/ld: ../lib/libpdal_base.so.7.0.2: undefined reference to `curl_slist_free_all'
collect2: error: ld returned 1 exit status
make[8]: *** [apps/CMakeFiles/pdal.dir/build.make:101: bin/pdal] Error 1

Machine details (please complete the following information): The Linux distro should not matter, since Flatpak is sandbox apps, so Flatpak version should be more important.

flatpak --version
Flatpak 1.11.2
flatpak-builder --version
flatpak-builder 1.0.12
Operating System: openSUSE Tumbleweed 20210626
KDE Plasma Version: 5.22.1
KDE Frameworks Version: 5.83.0
Qt Version: 5.15.2
Kernel Version: 5.12.12-1-default (64-bit)
Graphics Platform: X11
Processors: 12 × AMD Ryzen 5 4600H with Radeon Graphics
Memory: 7.1 GiB of RAM
Graphics Processor: GeForce GTX 1650 Ti/PCIe/SSE2

Additional context Original thread. https://github.com/Kitware/TeleSculptor/issues/425