Skip to content

Cannot build on Debian #65

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

Open
gnusupport opened this issue Jun 6, 2023 · 8 comments
Open

Cannot build on Debian #65

gnusupport opened this issue Jun 6, 2023 · 8 comments

Comments

@gnusupport
Copy link

$ make
make  all-recursive
make[1]: Entering directory '/home/data1/protected/Programming/git/paps'
Making all in src
make[2]: Entering directory '/home/data1/protected/Programming/git/paps/src'
g++ -DHAVE_CONFIG_H -I. -I..  -DGETTEXT_PACKAGE='"paps"' -DDATADIR='"/package/tools/paps/share"'   -pthread -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16  -g -O2 -MT paps-paps.o -MD -MP -MF .deps/paps-paps.Tpo -c -o paps-paps.o `test -f 'paps.cc' || echo './'`paps.cc
In file included from paps.cc:42:
format_from_dict.h:30:23: error: ‘variant’ in namespace ‘std’ does not name a template type
   30 | using scalar_t = std::variant<int, std::string, double, std::time_t>;
      |                       ^~~~~~~
format_from_dict.h:30:18: note: ‘std::variant’ is only available from C++17 onwards
   30 | using scalar_t = std::variant<int, std::string, double, std::time_t>;
      |                  ^~~
format_from_dict.h:31:38: error: ‘scalar_t’ was not declared in this scope
   31 | using dict_t = std::map<std::string, scalar_t>;
      |                                      ^~~~~~~~
format_from_dict.h:31:46: error: template argument 2 is invalid
   31 | using dict_t = std::map<std::string, scalar_t>;
      |                                              ^
format_from_dict.h:31:46: error: template argument 4 is invalid
format_from_dict.h:36:30: error: ‘dict_t’ has not been declared
   36 |                              dict_t dict);
      |                              ^~~~~~
paps.cc:160:3: error: ‘dict_t’ does not name a type; did you mean ‘wint_t’?
  160 |   dict_t document_info;
      |   ^~~~~~
      |   wint_t
paps.cc:221:45: error: ‘dict_t’ has not been declared
  221 |                                             dict_t&           document_info,
      |                                             ^~~~~~
paps.cc:227:45: error: ‘dict_t’ has not been declared
  227 |                                             dict_t& document_info);
      |                                             ^~~~~~
paps.cc: In function ‘int output_pages(cairo_surface_t*, cairo_t*, GList*, PageLayout*, PangoContext*)’:
paps.cc:1396:3: error: ‘dict_t’ was not declared in this scope; did you mean ‘wint_t’?
 1396 |   dict_t document_info;
      |   ^~~~~~
      |   wint_t
paps.cc:1399:36: error: ‘document_info’ was not declared in this scope; did you mean ‘build_document_info’?
 1399 |   build_document_info(page_layout, document_info);
      |                                    ^~~~~~~~~~~~~
      |                                    build_document_info
paps.cc: At global scope:
paps.cc:1700:31: error: ‘dict_t’ has not been declared
 1700 |                               dict_t&          document_info,
      |                               ^~~~~~
paps.cc:1841:21: error: ‘dict_t’ has not been declared
 1841 |                     dict_t& document_info)
      |                     ^~~~~~
paps.cc: In function ‘void build_document_info(PageLayout*, int&)’:
paps.cc:1843:29: error: assignment of read-only location ‘"filename"[document_info]’
 1843 |   document_info["filename"] = page_layout->filename;
      |   ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
paps.cc:1844:25: error: assignment of read-only location ‘"path"[document_info]’
 1844 |   document_info["path"] = page_layout->filename_path;
      |   ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
paps.cc:1848:26: error: assignment of read-only location ‘"mtime"[document_info]’
 1848 |   document_info["mtime"] = (time_t)stat_buf.st_mtime;
      |                          ^
paps.cc:1849:24: error: assignment of read-only location ‘"now"[document_info]’
 1849 |   document_info["now"] = time(nullptr);
      |   ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
paps.cc:1851:16: error: ‘struct PageLayout’ has no member named ‘document_info’
 1851 |   page_layout->document_info["num_pages"] = page_layout->num_pages;
      |                ^~~~~~~~~~~~~
make[2]: *** [Makefile:451: paps-paps.o] Error 1
make[2]: Leaving directory '/home/data1/protected/Programming/git/paps/src'
make[1]: *** [Makefile:499: all-recursive] Error 1
make[1]: Leaving directory '/home/data1/protected/Programming/git/paps'
make: *** [Makefile:384: all] Error 2
@gnusupport
Copy link
Author

I have tried with meson too:

$ meson build
The Meson build system
Version: 0.56.2
Source dir: /home/data1/protected/Programming/git/paps
Build dir: /home/data1/protected/Programming/git/paps/build
Build type: native build
Project name: paps
Project version: 0.8.0
C compiler for the host machine: cc (gcc 10.2.1 "cc (Debian 10.2.1-6) 10.2.1 20210110")
C linker for the host machine: cc ld.bfd 2.35.2
C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (Debian 10.2.1-6) 10.2.1 20210110")
C++ linker for the host machine: c++ ld.bfd 2.35.2
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Run-time dependency fmt found: YES 7.1.3
Run-time dependency pangoft2 found: YES 1.46.2
Run-time dependency pangocairo found: YES 1.46.2
Run-time dependency glib-2.0 found: YES 2.66.8
Run-time dependency gobject-2.0 found: YES 2.66.8
Checking for function "memmove" : YES 
Checking for function "memset" : YES 
Checking for function "strdup" : YES 
Has header "stdlib.h" : YES 
Has header "string.h" : YES 
Has header "memory.h" : YES 
Has header "strings.h" : YES 
Has header "sys/times.h" : YES 
Has header "strings.h" : YES (cached)
Configuring config.h using configuration
Checking for size of "int" : 4
Build targets in project: 1

Found ninja-1.10.1 at /usr/bin/ninja
~/Programming/git/paps
$ cd build/
~/Programming/git/paps/build
$ ninja
[1/3] Compiling C++ object src/paps.p/format_from_dict.cc.o
FAILED: src/paps.p/format_from_dict.cc.o 
c++ -Isrc/paps.p -Isrc -I../src -I. -I.. -I/usr/include/pango-1.0 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/fribidi -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++17 -g -pthread -MD -MQ src/paps.p/format_from_dict.cc.o -MF src/paps.p/format_from_dict.cc.o.d -o src/paps.p/format_from_dict.cc.o -c ../src/format_from_dict.cc
../src/format_from_dict.cc: In function ‘std::string scalar_to_string(scalar_t, const string&)’:
../src/format_from_dict.cc:36:19: error: ‘runtime’ was not declared in this scope
   36 |     return format(runtime(format("{{:{}}}", spec)), val);
      |                   ^~~~~~~
../src/format_from_dict.cc:43:19: error: ‘runtime’ was not declared in this scope
   43 |     return format(runtime(format("{{:{}}}", spec)), val);
      |                   ^~~~~~~
../src/format_from_dict.cc:50:19: error: ‘runtime’ was not declared in this scope
   50 |     return format(runtime(format("{{:{}}}", spec)), val);
      |                   ^~~~~~~
../src/format_from_dict.cc:57:19: error: ‘runtime’ was not declared in this scope
   57 |     return format(runtime(format("{{:{}}}", spec)), fmt::localtime(val));
      |                   ^~~~~~~
[2/3] Compiling C++ object src/paps.p/paps.cc.o
ninja: build stopped: subcommand failed.

@dov
Copy link
Owner

dov commented Jun 6, 2023

Hi. Those are two different problems. The make failure is due to the lacking of the --std=c++17 flag. I have to define the c++ version in automake.

The meson compilation failure is different, and it seems like it is a libfmt compatibility problem as the compilation doesn't find https://fmt.dev/latest/api.html#_CPPv4N3fmt7runtimeE11string_view. For that we need to figure out how the meson dependencies work.

@gnusupport
Copy link
Author

How do I circumvent or solve it before you update it? How do I apply the flag?

@gnusupport
Copy link
Author

Hi. Those are two different problems. The make failure is due to the lacking of the --std=c++17 flag. I have to define the c++ version in automake.

The meson compilation failure is different, and it seems like it is a libfmt compatibility problem as the compilation doesn't find https://fmt.dev/latest/api.html#_CPPv4N3fmt7runtimeE11string_view. For that we need to figure out how the meson dependencies work.

libfmt-dev is already the newest version (7.1.3+ds1-5)

I am on Debian stable, and I cannot get it done.

@dov
Copy link
Owner

dov commented Jun 7, 2023

I'll have a look. I hope to get to it today.

@gnusupport
Copy link
Author

PKG_CONFIG_PATH=/package/lib/fmt/lib/pkgconfig:$PKG_CONFIG_PATH CXXFLAGS="-std=c++17" ./configure --prefix=/package/tools/paps

for now I have installed fresh fmt library and used the above flag to install paps but maybe you could look into it why it cannot be installed direct on Debian.

@dov
Copy link
Owner

dov commented Jun 8, 2023

I tried compiling on a bullseye system yesterday, and it compiled without any problem with meson from the HEAD of the git repo. Note however that my meson invocation used the wrap to download a fresh version of libfmt. I have no idea why...

$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
$ mkdir build
$ cd build
$ meson ..
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig'
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig'
The Meson build system
Version: 0.56.2
Source dir: /home/dov/git/paps
Build dir: /home/dov/git/paps/build
Build type: native build
Project name: paps
Project version: 0.8.0
C compiler for the host machine: cc (gcc 10.2.1 "cc (Debian 10.2.1-6) 10.2.1 20210110")
C linker for the host machine: cc ld.bfd 2.35.2
C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (Debian 10.2.1-6) 10.2.1 20210110")
C++ linker for the host machine: c++ ld.bfd 2.35.2
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Found CMake: /usr/bin/cmake (3.18.4)
Run-time dependency fmt found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency fmt
Downloading fmt source from https://github.com/fmtlib/fmt/archive/9.1.0.tar.gz
Download size: 837901
Downloading: ..........
Downloading fmt patch from https://wrapdb.mesonbuild.com/v2/fmt_9.1.0-1/get_patch
Download size: 1340
Downloading: ..........

|Executing subproject fmt method meson
|
|Project name: fmt
|Project version: 9.1.0
|C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (Debian 10.2.1-6) 10.2.1 20210110")
|C++ linker for the host machine: c++ ld.bfd 2.35.2
|Build targets in project: 1
|Subproject fmt finished.

Dependency fmt found: YES 9.1.0 (overridden)
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig'
Run-time dependency pangoft2 found: YES 1.46.2
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig'
Run-time dependency pangocairo found: YES 1.46.2
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig'
Run-time dependency glib-2.0 found: YES 2.66.8
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig'
Run-time dependency gobject-2.0 found: YES 2.66.8
Checking for function "memmove" : YES
Checking for function "memset" : YES
Checking for function "strdup" : YES
Has header "stdlib.h" : YES
Has header "string.h" : YES
Has header "memory.h" : YES
Has header "strings.h" : YES
Has header "sys/times.h" : YES
Has header "strings.h" : YES (cached)
Configuring config.h using configuration
Checking for size of "int" : 4
Build targets in project: 2

paps 0.8.0

  Subprojects
    fmt: YES

Found ninja-1.10.1 at /usr/bin/ninja
$ ninja
[0/1] Regenerating build files.
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig'
Using 'PKG_CONFIG_PATH' from environment with value: '/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig'
The Meson build system
Version: 0.56.2
Source dir: /home/dov/git/paps
Build dir: /home/dov/git/paps/build
Build type: native build
Project name: paps
Project version: 0.8.0
C compiler for the host machine: cc (gcc 10.2.1 "cc (Debian 10.2.1-6) 10.2.1 20210110")
C linker for the host machine: cc ld.bfd 2.35.2
C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (Debian 10.2.1-6) 10.2.1 20210110")
C++ linker for the host machine: c++ ld.bfd 2.35.2
Host machine cpu family: x86_64
Host machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Found CMake: /usr/bin/cmake (3.18.4)
Run-time dependency fmt found: NO (tried pkgconfig and cmake)
Looking for a fallback subproject for the dependency fmt

|Executing subproject fmt method meson
|
|Project name: fmt
|Project version: 9.1.0
|C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (Debian 10.2.1-6) 10.2.1 20210110")
|C++ linker for the host machine: c++ ld.bfd 2.35.2
|Build targets in project: 1
|Subproject fmt finished.

Dependency fmt found: YES 9.1.0 (overridden)
Dependency pangoft2 found: YES 1.46.2 (cached)
Dependency pangocairo found: YES 1.46.2 (cached)
Dependency glib-2.0 found: YES 2.66.8 (cached)
Dependency gobject-2.0 found: YES 2.66.8 (cached)
Checking for function "memmove" : YES (cached)
Checking for function "memset" : YES (cached)
Checking for function "strdup" : YES (cached)
Has header "stdlib.h" : YES (cached)
Has header "string.h" : YES (cached)
Has header "memory.h" : YES (cached)
Has header "strings.h" : YES (cached)
Has header "sys/times.h" : YES (cached)
Has header "strings.h" : YES (cached)
Configuring config.h using configuration
Checking for size of "int" : 4
Build targets in project: 2

paps 0.8.0

  Subprojects
    fmt: YES

Found ninja-1.10.1 at /usr/bin/ninja
[7/7] Linking target src/paps

@gnusupport
Copy link
Author

I understand you also used $PKG_CONFIG_PATH

I hope you will incorporate some changes that it goes automatically in future. paps is used on my side for teaching, consulting, it is great tool, but then I changed the system to Debian from Parabola which is based on Arch Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants