Skip to content
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

prebuilt binary fails because mysqlclient-dev, gmake source 2.6.2 fails building #29

Open
evanescente-ondine opened this issue Oct 11, 2024 · 9 comments

Comments

@evanescente-ondine
Copy link

Hello,
the prebuilt binary fails because the version of libmysqlclient-dev you use is outdated. It's not possible to get on debian it seems.
I get

spar: /lib/x86_64-linux-gnu/libmysqlclient.so.21: version `libmysqlclient_21.0' not found (required by spar)

I try to build from source, but I get, after gmake:

drm@84-47-09-37-40-35 ~/T/sparforte-2.6.2-src> gmake
gmake -C src
gmake[1] : on entre dans le répertoire « /home/drm/Téléchargements/sparforte-2.6.2-src/src »

---------------------------------------------------------------
  Compiling C Wrappers on Kernel and OS Library Functions
  To Make SparForte Portable
---------------------------------------------------------------

gcc  -I./adacgi-1.6/ -I./apq-2.1/  -I./pegasock/  -I/usr/include/SDL -D_GNU_SOURCE=1 -I./bdb/ -I./areadline/ -lpcre -Wall -Werror -fstack-protector -O1 -D_FORTIFY_SOURCE=2 -c c_os.c
gcc  -I./adacgi-1.6/ -I./apq-2.1/  -I./pegasock/  -I/usr/include/SDL -D_GNU_SOURCE=1 -I./bdb/ -I./areadline/ -lpcre -I/usr/include/SDL -D_GNU_SOURCE=1 -Wall -Werror -fstack-protector -O1 -D_FORTIFY_SOURCE=2 -c c_scanner.c
gcc  -DGSTREAMER -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I/usr/include/x86_64-linux-gnu -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0  -Wall -fstack-protector -O1 -D_FORTIFY_SOURCE=2 -c c_gstreamer.c
gcc  -lpcre -Wall -Werror -fstack-protector -O1 -D_FORTIFY_SOURCE=2 -c c_pcre.c
c_pcre.c:9:10: fatal error: pcre.h: No such file or directory
    9 | #include <pcre.h>
      |          ^~~~~~~~
compilation terminated.
gmake[1]: *** [GNUmakefile:168 : c_pcre.o] Erreur 1
gmake[1] : on quitte le répertoire « /home/drm/Téléchargements/sparforte-2.6.2-src/src »
gmake: *** [GNUmakefile:12 : all] Erreur 2
drm@84-47-09-37-40-35 ~/T/sparforte-2.6.2-src [2]> doas gmake
gmake -C src
gmake[1]: Entering directory '/home/drm/Téléchargements/sparforte-2.6.2-src/src'
gcc  -lpcre -Wall -Werror -fstack-protector -O1 -D_FORTIFY_SOURCE=2 -c c_pcre.c
c_pcre.c:9:10: fatal error: pcre.h: No such file or directory
    9 | #include <pcre.h>
      |          ^~~~~~~~
compilation terminated.
gmake[1]: *** [GNUmakefile:168: c_pcre.o] Error 1
gmake[1]: Leaving directory '/home/drm/Téléchargements/sparforte-2.6.2-src/src'
gmake: *** [GNUmakefile:12: all] Error 2
@kburtch
Copy link
Owner

kburtch commented Oct 12, 2024

This error indicates the Perl Compatible Regular Expression (PCRE) library or its header files (.h) are missing on your computer.

You may install them with your Linux's installation tool using the name libpcre-dev, libpcre-devel or a similar name then type gmake again. You can also turn off PCRE support with configure --without-pcre and SparForte will disable this feature and build without including it.

@evanescente-ondine
Copy link
Author

But I want PCREs. I have both libpcre2-dev (10.42-4+b1) and libpcre3-dev (2:8.39-15) installed. But I get the same:

gcc -I./adacgi-1.6/ -I./apq-2.1/ -I./pegasock/ -I/usr/include/SDL -D_GNU_SOURCE=1 -I./bdb/ -I./areadline/ -lpcre -I/usr/include/SDL -D_GNU_SOURCE=1 -Wall -Werror -fstack-protector -O1 -D_FORTIFY_SOURCE=2 -c c_rl.c
c_rl.c:4:10: fatal error: readline/readline.h: No such file or directory
4 | #include <readline/readline.h>
| ^~~~~~~~~~~~~~~~~~~~~

@kburtch
Copy link
Owner

kburtch commented Oct 12, 2024

As before, you are missing the GNU Readline library header (.h) files.

The C header files are equivalent to the Ada ".ads" package specification files. As you cannot build an Ada program without the specifications, you cannot compile C programs without the specifications in the headers. These are needed for building any project from sources, not just SparForte.

When you see an "include" error like this, it is because you are missing these C header files needed to compile sources, or in rare cases, the header file may be in an unusual location.

The provision.sh script installs all the necessary files if you don't already have them, if it is a version of Linux it recognizes. If you have none of the C specification files, you may also have to install them for mysql, postgres, libsdl and a few other standard C libraries.

You may install the missing specifications with your Linux's installation tool using the name libreadline-dev, libreadline-devel or similar. You may also disable readline with the configure script, although I wouldn't recommend that as the old command line has many missing features.

@evanescente-ondine
Copy link
Author

Sorry I had missed provision.sh. I ran it and now the only missing dependency is libmariadbclient-dev. On internet I can read:

The packagelibmariadbclient-dev has been removed in latest MariaDB 10.5 in Debian and Ubuntu, and installing libmariadbclient-dev will plain fail in the future. Thus in future you should start using the package libmariadb-dev instead to achieve the same thing.

Putting that aside, the configure script succeeds. Then gmake fails here:

/usr/include/mariadb/errmsg.h:40:31: error: initialization of 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]

So it doesn't seem something I can do without.

@kburtch
Copy link
Owner

kburtch commented Oct 13, 2024

This issue seems to be a bug in MariaDB, where they assign text to an integer variable. Newer versions of C do not allow this. I mention this issue on the website on the release announcement.

I don't have a workaround for this. You can use configure --without-mysql to disable MariaDB/MySQL support.

@evanescente-ondine
Copy link
Author

evanescente-ondine commented Oct 13, 2024

Understood, I did that and the error went away.
The newer, later one is :

gcc -c -O1 -march=athlon64 -gnat12 -gnatfaoN -gnatVaep -gnateEeEeF -fstack-protector -I./adacgi-1.6/ -I./apq-2.1/ -I./pegasock/ -I/usr/include/SDL -D_GNU_SOURCE=1 -I./bdb/ -I./areadline/ -lpcre parser_pragmas.adb
parser_memcache.adb:103:01: warning: type "aMemcacheClusterEntry" is frozen by body [enabled by default]
parser_memcache.adb:103:01: warning: an equality operator cannot be declared after this point [enabled by default]
parser_memcache.adb:108:10: error: equality operator must be declared before type "aMemcacheClusterEntry" is frozen (RM 4.5.2 (9.8)) (Ada 2012)
parser_memcache.adb:152:01: warning: type "aMemcacheDualClusterEntry" is frozen by body [enabled by default]
parser_memcache.adb:152:01: warning: an equality operator cannot be declared after this point [enabled by default]
parser_memcache.adb:157:10: error: equality operator must be declared before type "aMemcacheDualClusterEntry" is frozen (RM 4.5.2 (9.8)) (Ada 2012)
+===========================GNAT BUG DETECTED==============================+
| 14.2.0 (x86_64-pc-linux-gnu) GCC error: |
| in gnat_to_gnu_entity, at ada/gcc-interface/decl.cc:464 |
| Error detected at parser_pen.adb:4017:61 |
| Compiling parser_pen.adb |
| Please submit a bug report; see https://gcc.gnu.org/bugs/ . |
| Use a subject line meaningful to you and us to track the bug. |
| Include the entire contents of this bug box in the report. |
| Include the exact command that you entered. |
| Also include sources listed below. |
+==========================================================================+

My version of gnat is 14.2.1, if that helps, but I doubt it would. Those are a LOT of things not working from the get go. sparforte being on alire would help. Though I don't know how difficult the porting would be.

@kburtch
Copy link
Owner

kburtch commented Oct 14, 2024

I understand and share your frustration.

SparForte is tested and successfully built on Linux Mint (Ubuntu) 19, 20, 21, Red Hat 9, OpenSuse Linux 15 and Raspberry Pi (based on Debian 11)--successful except for the MariaDB issue. It is occasionally tested on FreeBSD and Windows, as I have time.

Most current stable versions of Linux use Gnat 12 and this is the version SparForte has been tested against. Gnat 14.2 is an advanced version of Ada that is is not yet generally available on stable releases of Linux. SparForte has not been tested on Gnat 14.

We reported this GCC Ada bug to the GCC Ada team, but they have indicated their intake process cannot handle a project as large as SparForte. The GCC Ada team have had bug reports opened for similar issues in recent versions of GCC Ada and they are working to resolve them. The "GNAT BUG DETECTED" message comes from the Ada compiler, not SparForte.

There have been attempts to add SparForte to Alire. SparForte is a mix of Ada and C which has been difficult to migrate to Alire.

To review:

Do not try to run the pre-built version of SparForte on a version of Linux it was built for.
Remember to install dependencies before trying to compile SparForte from sources.
There is a MariaDB bug that is not released to SparForte.
There is a bug in an unstable/advanced version of Ada compiler, and this bug is not related to SparForte. This bug is affecting other projects as well.

@kburtch
Copy link
Owner

kburtch commented Oct 14, 2024

There's no known solution for the GCC 14 issue. See #27.

I've added a warning to the website download page.

My only suggestion is to try building SparForte on an older version of Linux using GCC 12.

@kburtch
Copy link
Owner

kburtch commented Dec 19, 2024

SparForte is now building and passing tests on Linux Mint 22 / GCC 13.3, provided that the sound and graphics packages are disabled. That is, ./configure --without-sdl --without-opengl --without-sound. I have temporarily disabled the OpenGL variable length vertex functions which were causing the Ada bug while compiling lines using the standard Ada address_to_access_conversion package. I fixed an issue with a C standard library function which was moved to a new location in Debian Trixie. The sound package, when enabled, crashes my Linux Mint desktop. GCC 13.3 is known to have serious bugs around pointers and I have not tested against GCC 14.

When I copied those functions to a separate program for testing, they compiled without issue, making the issue hard to diagnose and difficult to submit to the GCC Ada team.

You can download the latest sources from GitHub. I will continue to look into it over the Christmas vacation.

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