1

I have recently been using the gnatcoll library on CentOS 7 and Debian 9, the installation process for both operating systems has been the same.

When I attempt this install on CentOS 8, I recieve the following error msg:

[lloyd@localhost sql]$ PATH=/home/lloyd/opt/GNAT/2020/bin:$PATH
[lloyd@localhost sql]$ make setup
[lloyd@localhost sql]$ make
gprbuild -p -m --target=x86_64-linux  -j0 -XGNATCOLL_VERSION=0.0 -XBUILD=PROD  -XLIBRARY_TYPE=static -XXMLADA_BUILD=static -XGPR_BUILD=static \
    gnatcoll_sql.gpr
Compile
   [Ada]          gnatcoll-sql_impl.adb
   [Ada]          gnatcoll-sql_fields.adb
   [Ada]          gnatcoll-sql.adb
   [Ada]          gnatcoll-sql-orm.adb
gnatcoll-sql_impl.adb:1679:44: "UTC_Time_Offset" is not visible (more references follow)
gnatcoll-sql_impl.adb:1679:44: non-visible declaration at a-catizo.ads:28
gnatcoll-sql_impl.adb:1679:44: non-visible declaration at a-calend.ads:403
gnatcoll-sql_impl.adb:1679:44: "UTC_Time_Offset" is not visible (more references follow)
gnatcoll-sql_impl.adb:1679:44: non-visible declaration at a-catizo.ads:28
gnatcoll-sql_impl.adb:1679:44: non-visible declaration at a-calend.ads:403
gnatcoll-sql_impl.adb:1679:44: "UTC_Time_Offset" is not visible (more references follow)
gnatcoll-sql_impl.adb:1679:44: non-visible declaration at a-catizo.ads:28
gnatcoll-sql_impl.adb:1679:44: non-visible declaration at a-calend.ads:403

   compilation of gnatcoll-sql.adb failed
   compilation of gnatcoll-sql_fields.adb failed
   compilation of gnatcoll-sql_impl.adb failed

gprbuild: *** compilation phase failed
make: *** [Makefile:116: build-static] Error 4

[lloyd@localhost sql]$ gcc --version
gcc (GCC) 9.3.1 20200430 (for GNAT Community 2020 20200818)
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
See your AdaCore support agreement for details of warranty and support.
If you do not have a current support agreement, then there is absolutely
no warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

Any advice on how to resolve this issue and install the library would be much appreciated.

Thanks, Lloyd

Lloyd Thomas
  • 345
  • 2
  • 12

1 Answers1

2

My former answer was slightly off: so you can't build it with GNAT CE 2020 out-of-the-box as the version of GNATCOLL-core that ships with GNAT CE 2020 is behind. GNATCOLL-db depends on GNATCOLL-core, and the latter has been updated.

So, you first have to build and install the updated GNATCOLL-core and then build GNATCOLL-db. However still, if you're in a hurry, you can also checkout and build a slightly older branch (e.g. 20.2).

DeeDee
  • 5,654
  • 7
  • 14
  • 1
    The offending section of code was committed 2020-06-11. That said, I don’t see how it's supposed to work even with the [Ada 202x time zone/formatting](http://www.ada-auth.org/standards/2xrm/html/RM-9-6-1.html) version; can’t see any `function "-" (time, integral-type) return time` – Simon Wright Sep 24 '20 at 19:20
  • 2
    Ow, it's due to a change in `GNATCOLL.Utils` (see [here](https://github.com/AdaCore/gnatcoll-core/blob/master/src/gnatcoll-utils.ads#L305)). – DeeDee Sep 24 '20 at 19:36
  • 1
    Updated my answer. – DeeDee Sep 24 '20 at 19:45
  • Thanks a lot @DeeDee 20.2 built successfully! Really appreciate the help, as always :) – Lloyd Thomas Sep 24 '20 at 20:10
  • 1
    @DeeDee, I really _hate_ the way that AdaCore `use` almost every package directly in the context clause. – Simon Wright Sep 25 '20 at 10:32
  • 2
    @SimonWright, well, at least it doesn't really help the more distant reader of the code in this case. I personally would've made the reference to `GNATCOLL.Utils.UTC_Time_Offset` more explicit in order to make this part of the code more conformant to the [Principle of Least Astonishment](https://en.wikipedia.org/wiki/Principle_of_least_astonishment) (although that principle is usually related to UX / software feature design, it should be applied to code as well IMHO). – DeeDee Sep 25 '20 at 11:19