git building of PDF4QT;QT6 missing.

Technical issues/questions of an intermediate or advanced nature.
User avatar
francois
Contributor
Contributor
Posts: 6435
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

git building of PDF4QT;QT6 missing.

Post#1 by francois » 11 Oct 2023, 08:56

Trying to build on my Toshiba satellite z930, following the instructions from the maintainer in the readme:
https://github.com/JakubMelka/PDF4QT#readme

Under my xfce desktop environment, the only missing library was ft2demos-2.11.1-x86_64-1salix15.0.
After a first run there was an error message at the end only:

Code: Select all

The package zlib is compatible with built-in CMake targets:

    find_package(ZLIB REQUIRED)
    target_link_libraries(main PRIVATE ZLIB::ZLIB)

The package libpng is compatible with built-in CMake targets:

    find_package(PNG REQUIRED)
    target_link_libraries(main PRIVATE PNG::PNG)

freetype is compatible with built-in CMake targets:

    find_package(Freetype REQUIRED)
    target_link_libraries(main PRIVATE Freetype::Freetype) # since CMake 3.10

The package lcms provides CMake targets:

    find_package(lcms2 CONFIG REQUIRED)
    target_link_libraries(main PRIVATE lcms2::lcms2)

openjpeg provides CMake targets:

  # this is heuristically generated, and may not be correct
  find_package(OpenJPEG CONFIG REQUIRED)
  target_link_libraries(main PRIVATE openjp2)

The package openssl is compatible with built-in CMake targets:

    find_package(OpenSSL REQUIRED)
    target_link_libraries(main PRIVATE OpenSSL::SSL OpenSSL::Crypto)

tbb provides CMake targets:

  # this is heuristically generated, and may not be correct
  find_package(TBB CONFIG REQUIRED)
  target_link_libraries(main PRIVATE TBB::tbb TBB::tbbmalloc)

-- Running vcpkg install - done
-- The CXX compiler identification is GNU 11.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at /home/guest/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package):
  By not providing "FindQt6.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt6", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt6" with any of
  the following names:

    Qt6Config.cmake
    qt6-config.cmake

  Add the installation prefix of "Qt6" to CMAKE_PREFIX_PATH or set "Qt6_DIR"
  to a directory containing one of the above files.  If "Qt6" provides a
  separate development package or SDK, be sure it has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:46 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/guest/PDF4QT/build/CMakeFiles/CMakeOutput.log".
So qt6 missing.
However, it seems that PDF4QT needs QT6 also.

According to spman sbo builder and package manager, it needed the following dependencies which I fetch with getmod and activated in my module folder:
-double-conversion-3.2.0-x86_64-1gv
-html5lib-1.0.1-x86_64-2salix15.0
-md4c-0.4.8-x86_64-1salix15.0
-nodejs-17.9.0-x86_64-1salix15.0
-python3-webencodings-0.5.1-x86_64-2salix15.0

Trying to build qt6 with spman, I get the following error:

Code: Select all

spman -q --install
...

...
x libclang/bin/llvm-pdbutil
x libclang/bin/llvm-profdata
x libclang/bin/llvm-profgen
x libclang/bin/llvm-rc
x libclang/bin/llvm-readobj
x libclang/bin/llvm-reduce
x libclang/bin/llvm-rtdyld
x libclang/bin/llvm-sim
x libclang/bin/llvm-size
x libclang/bin/llvm-split
x libclang/bin/llvm-stress
x libclang/bin/llvm-strings
x libclang/bin/llvm-symbolizer
x libclang/bin/llvm-tapi-diff
x libclang/bin/llvm-tblgen
x libclang/bin/llvm-undname
x libclang/bin/llvm-xray
x libclang/bin/modularize
x libclang/bin/opt
x libclang/bin/pp-trace
x libclang/bin/sancov
x libclang/bin/sanstats
x libclang/bin/split-file
x libclang/bin/verify-uselistorder
chown: invalid group: ‘root:root’

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Package qt6: build error. Continue? (y/n): n
Prendre son temps, profiter de celui qui passe.

beny
Full of knowledge
Full of knowledge
Posts: 2098
Joined: 02 Jan 2011, 11:33
Location: italy

git building of PDF4QT;QT6 missing.

Post#2 by beny » 11 Oct 2023, 15:17

hi francois you make thing too easy...you need also the vcpkg software or you have to build from source and place inside the pdf4qt directory and the qt6,is a big work to do,you need also the devel package i have done a try but with a current, porteus5 is too old i think,but...you know maybe i am wrong

User avatar
francois
Contributor
Contributor
Posts: 6435
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

git building of PDF4QT;QT6 missing.

Post#3 by francois » 11 Oct 2023, 20:56

Hello beny.
I think I am not so far.

I did built from source thru git as reccommended.

vcpkg is in there:

Code: Select all

oot@porteus:/home/guest# locate vcpkg
/home/guest/vcpkg
/home/guest/Downloads/pdf4qt/PDF4QT-master/vcpkg.json
/home/guest/Downloads/pdf4qt/PDF4QT-master/vcpkg_with_qt.json
/home/guest/PDF4QT/vcpkg.json
/home/guest/PDF4QT/vcpkg_with_qt.json
/home/guest/PDF4QT/build/vcpkg-manifest-install.log
/home/guest/PDF4QT/build/vcpkg_installed
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg
/home/guest/PDF4QT/build/vcpkg_installed/x64-linux
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/updates
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info/brotli_1.1.0_x64-linux.list
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info/bzip2_1.0.8_x64-linux.list
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info/freetype_2.12.1_x64-linux.list
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info/ijg-libjpeg_9e_x64-linux.list
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info/lcms_2.14_x64-linux.list
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info/libpng_1.6.39_x64-linux.list
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info/openjpeg_2.5.0_x64-linux.list
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info/openssl_3.1.3_x64-linux.list
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info/tbb_2021.10.0_x64-linux.list
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info/vcpkg-cmake-config_2022-02-06_x64-linux.list
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info/vcpkg-cmake-get-vars_2023-03-02_x64-linux.list
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info/vcpkg-cmake_2023-05-04_x64-linux.list
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/info/zlib_1.3_x64-linux.list
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/updates/0000000000
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/updates/0000000001
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/updates/0000000002
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/updates/0000000003
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/updates/0000000004
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/updates/0000000005
/home/guest/PDF4QT/build/vcpkg_installed/vcpkg/updates/0000000006
...

...

/home/guest/vcpkg/versions/y-/yato.json
/home/guest/vcpkg/versions/y-/yoga.json
/home/guest/vcpkg/versions/y-/yomm2.json
/home/guest/vcpkg/versions/y-/yyjson.json
/home/guest/vcpkg/versions/z-/z3.json
/home/guest/vcpkg/versions/z-/z4kn4fein-semver.json
/home/guest/vcpkg/versions/z-/z85.json
/home/guest/vcpkg/versions/z-/zeroc-ice.json
/home/guest/vcpkg/versions/z-/zeromq.json
/home/guest/vcpkg/versions/z-/zfp.json
/home/guest/vcpkg/versions/z-/zint.json
/home/guest/vcpkg/versions/z-/zkpp.json
/home/guest/vcpkg/versions/z-/zlib-ng.json
/home/guest/vcpkg/versions/z-/zlib.json
/home/guest/vcpkg/versions/z-/zlmediakit.json
/home/guest/vcpkg/versions/z-/zookeeper.json
/home/guest/vcpkg/versions/z-/zopfli.json
/home/guest/vcpkg/versions/z-/zpp-bits.json
/home/guest/vcpkg/versions/z-/zserge-webview.json
/home/guest/vcpkg/versions/z-/zstd.json
/home/guest/vcpkg/versions/z-/zstr.json
/home/guest/vcpkg/versions/z-/ztd-text.json
/home/guest/vcpkg/versions/z-/zug.json
/home/guest/vcpkg/versions/z-/zxing-cpp.json
/home/guest/vcpkg/versions/z-/zycore.json
/home/guest/vcpkg/versions/z-/zydis.json
/home/guest/vcpkg/versions/z-/zyre.json
/home/guest/vcpkg/versions/z-/zziplib.json
/root/.cache/vcpkg
/root/.cache/vcpkg/archives
/root/.cache/vcpkg/archives/0b
/root/.cache/vcpkg/archives/0c
/root/.cache/vcpkg/archives/4f
/root/.cache/vcpkg/archives/76
/root/.cache/vcpkg/archives/7a
/root/.cache/vcpkg/archives/81
/root/.cache/vcpkg/archives/93
/root/.cache/vcpkg/archives/94
/root/.cache/vcpkg/archives/a3
/root/.cache/vcpkg/archives/af
/root/.cache/vcpkg/archives/cb
/root/.cache/vcpkg/archives/ef
/root/.cache/vcpkg/archives/fd
/root/.cache/vcpkg/archives/0b/0bfa07b15995584dfb60dfd18201f038fbb23978d16425dbb9a5738b0490b72c.zip
/root/.cache/vcpkg/archives/0c/0c7fb320879fd823bffabf89e716ef1786059659f58531704b3ae358c58ebc39.zip
/root/.cache/vcpkg/archives/4f/4f364a4268039fb2e60b22b466866a9d77eb3f7c90adde2f1efab6930b7157f3.zip
/root/.cache/vcpkg/archives/76/7653c7c10b7f9fece1c9f37ab493cb78aa394c8461d7e4369592a5f8e492b774.zip
/root/.cache/vcpkg/archives/7a/7a4badecc274fc5c0256def79b53f1f49f220a28b088b30e7f8ea21c8a432772.zip
/root/.cache/vcpkg/archives/81/812c07b9eca03b1d98b4d8ff2e087859b8cd3b546c5df5abe2ea97fb13037e67.zip
/root/.cache/vcpkg/archives/93/9396c34ad0f8f2ec4d235876cd946155e23c7415be9095d456830e3cf49d6ed3.zip
/root/.cache/vcpkg/archives/94/94fc993a170cd9a0f1415e8b0f6ee043e7fd5b33b2c107e37e645768e3a130d7.zip
/root/.cache/vcpkg/archives/a3/a315966325ddbcdcc13d3afeb093e75a55eb6cedfa14abc74ab65446a6fd082e.zip
/root/.cache/vcpkg/archives/af/af84ae6ec100ae56757a367a6fc891be35b1d08b20997488f624eaa336356f31.zip
/root/.cache/vcpkg/archives/cb/cb296ebb5df6519458cb153bd49ca82bd145245861d535a6795417ae46a1aaf2.zip
/root/.cache/vcpkg/archives/ef/efaafeff0e03c7d6e23d5da6c8715595bcc17b1e3ce058e7539960f6a3cac308.zip
/root/.cache/vcpkg/archives/fd/fd5952c98e82d8b437a43f9bc583ccb9de5fd3ca535a847b737a94d1c81f4ef3.zip
I will have to check all the following dependencies:

Code: Select all

Slackware 15.0's version of clang fails to compile qt6, due to the
following error:

Linking CXX executable qtbase/lib64/bin/lupdate
/usr/bin/ld: CMakeFiles/lupdate.dir/cpp_clang.cpp.o: undefined
  reference to symbol '_ZTIN5clang7tooling21FrontendActionFactoryE'
/usr/bin/ld: /usr/lib64/libclangTooling.so.13: error adding symbols:
  DSO missing from command line
clang-13: error: linker command failed with exit code 1

To remedy this, Qt provides a prebuilt clang package that we bootstrap
against.

Qt6 will compile with multiple optional dependencies, such as:

  assimp
  (*)db2
  (*)cerence
  (*)directfb
  (*)gn
  (*)interbase
  libb2
  (*)litehtml
  (*)lttn-ust
  mold
  postgresql
  (*)sensorfw
  (*)s-log2
  snappy
  (*)tslib
  xmlstarlet

  ...and possibly others.

(*) = not available from SBo at the time of writing.
Prendre son temps, profiter de celui qui passe.

User avatar
francois
Contributor
Contributor
Posts: 6435
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

git building of PDF4QT;QT6 missing.

Post#4 by francois » 19 Oct 2023, 04:35

@beny:
You are wise. I have made an other try with more information
https://doc.qt.io/qt-6/linux-building.html

I realised that qt6 needed python3 in addition to the other libraries I had used yet. So the needed libraries are:

Code: Select all

guest@porteus:/mnt/sdb3/50_porteus/xfce/qt6$ ls
double-conversion-3.2.0-x86_64-1gv.xzm
html5lib-1.0.1-x86_64-2salix15.0.xzm
md4c-0.4.8-x86_64-1salix15.0.xzm
nodejs-17.9.0-x86_64-1salix15.0.xzm
python3-3.9.18-x86_64-1_slack15.0.xzm
python3-webencodings-0.5.1-x86_64-2salix15.0.xzm
guest@porteus:/mnt/sdb3/50_porteus/xfce/qt6$
The other requirements needed to build qt6 were already present in porteus 5.0 according to the doc.qt.io link above.

Code: Select all

CMake 3.16 and newer (3.21 and newer for -static builds).
Ninja
python3, already mentionned above

And qt6 was built:

Code: Select all

...
Verifying package qt6-6.5.2-x86_64-1_SBo.txz.
Installing package qt6-6.5.2-x86_64-1_SBo.txz:
PACKAGE DESCRIPTION:
# qt6 (Application Development Framework)
#
# Qt is a cross-platform application development framework for desktop,
# embedded and mobile. Supported Platforms include Linux, OS X,
# Windows, VxWorks, QNX, Android, iOS, BlackBerry, Sailfish OS and
# others. 
#
# Homepage: https://qt.io
#
Executing install script for qt6-6.5.2-x86_64-1_SBo.txz.
Package qt6-6.5.2-x86_64-1_SBo.txz installed.
root@porteus:/mnt/sdb3/50_porteus/xfce/qt6# 
:showoff:

User avatar
francois
Contributor
Contributor
Posts: 6435
Joined: 28 Dec 2010, 14:25
Distribution: xfce plank porteus nemesis
Location: Le printemps, le printemps, le printemps... ... l'hiver s'essoufle.

git building of PDF4QT;QT6 missing.

Post#5 by francois » 19 Oct 2023, 05:21

Building PDF4QT new error message:

Code: Select all

...
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
CMAKE_PREFIX_PATH = /home/guest/PDF4QT/build/vcpkg_installed/x64-linux/debug/home/guest/PDF4QT/build/vcpkg_installed/x64-linux
CMAKE_TOOLCHAIN_FILE = /home/guest/vcpkg/scripts/buildsystems/vcpkg.cmake
CMake Warning at CMakeLists.txt:137 (message):
  Set variable PDF4QT_QT_ROOT to Qt6 root directory


-- Configuring done
-- Generating done
-- Build files have been written to: /home/guest/PDF4QT/build
guest@porteus:~/PDF4QT$ 
We are almost there.
Any cue?
Prendre son temps, profiter de celui qui passe.

beny
Full of knowledge
Full of knowledge
Posts: 2098
Joined: 02 Jan 2011, 11:33
Location: italy

git building of PDF4QT;QT6 missing.

Post#6 by beny » 19 Oct 2023, 10:42

Code: Select all

  ## 7. COMPILING

This software can be compiled on both Windows and Linux. A compiler supporting the C++20 standard is needed.

On Windows, you can use Visual Studio 2022 or MinGW.

On Linux, a GCC version >= 8 should work, altough we tested it with GCC 11.

### Compiling from sources

1. Install [vcpkg](https://vcpkg.io/en/getting-started.html)

        git clone https://github.com/Microsoft/vcpkg.git
        ./vcpkg/bootstrap-vcpkg.sh -disableMetrics
        VCPKG_ROOT=$(pwd)/vcpkg

    Check that vcpkg path is correct: `$VCPKG_ROOT/vcpkg --version`.

2. Build PDF4QT

    2.1 Clone repo

        git clone https://github.com/JakubMelka/PDF4QT
        cd PDF4QT

    2.2 Configure

        cmake -B build -S . -DPDF4QT_INSTALL_QT_DEPENDENCIES=0 -DCMAKE_TOOLCHAIN_FILE=$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX='/'

    For a debug build, append `-DCMAKE_BUILD_TYPE=Debug`.

    2.3 Build

        cmake --build build

    Use the [`-j` switch](https://cmake.org/cmake/help/latest/manual/cmake.1.html#cmdoption-cmake-build-j) to build multiple files in parallel.

    2.4 Install

        sudo cmake --install build

    To uninstall, run `sudo xargs rm < ./build/install_manifest.txt`.

### Using Qt Creator (both Windows/Linux)
1. Download Qt 6.4 or higher, and VCPKG package manager (https://vcpkg.io/en/index.html)
2. Open Qt Creator and configure the project
3. Build
                                                                                                                               

Post Reply