Requirements for alignment since v8.0?

Hi,

I am using swivm to install SWI-Prolog in a CI environment to test my Prolog programs against the latest stable version of SWI-Prolog. Recently, the tests are failing because the installation of v8.0.1 fails with this message (e.g., here):

CMake Error at cmake/AlignOf.cmake:42 (MESSAGE):
  Check alignment: unable to compile test program.
Call Stack (most recent call first):
  cmake/Config.cmake:98 (alignof)
  src/CMakeLists.txt:26 (include)

I assume this is due to a missing prerequisite introduced with v8. Has anyone a hint which package is missing to run the check for alignment?

The test doesn’t demand any packages. It does require the C compiler to support __alignof though. A quick search suggests support is at least GCC 4.6. In your logs there is The C compiler identification is GNU 4.8.4, which is pretty old. You should have a look at compiling cmake/CheckAlignment.c using this compiler. Possibly some declaration is needed?

Hi Jan. Thank you for the quick reply. Telling Travis CI to use a more up-to-date environment with dist: xenial, the installation of SWI-Prolog is successful again.

Which one did you have before? Even Trusty works (used to run the SWI-Prolog website up to a few weeks ago).

The default Linux environment on Travis CI is Ubuntu Trusty 14.04, which ships with GCC 4.8.2.

I see. Guess I never re-ran a full CMake after this problem was introduced. Turns out the code uses for(int i = 0; ..., which is a C99 construct and gcc 4 requires a flag to support C99. Modified the test to compile with non-C99 compilers.

Trusty is out of support shortly, but there are surely other platforms using ancient gcc versions.

Related commit to just keep the things aligned (pun intended ^^): https://github.com/SWI-Prolog/swipl-devel/commit/6b8c96f103415234e4d709abec8c26b640ef5103

edit: Woah, this is really cool!