easybuilders / easybuild-easyconfigs

A collection of easyconfig files that describe which software to build using which build options with EasyBuild.
https://easybuild.io
GNU General Public License v2.0
383 stars 704 forks source link

compiling AMPL-3.1.0 with GCC-6.4.0 #9380

Open ANaumann85 opened 5 years ago

ANaumann85 commented 5 years ago

I tried to compile the package AMPL-MP-3.1.0 with foss-2017a and easybuild 4.0.1. With the original sources, I got the compiler error messages

In file included from /LOCAL2/Software_EasyBuild/software/GCCcore/6.4.0/lib/gcc/x86_64-pc-linux-gnu/6.4.0/include-fixed/limits.h:168:0, from /LOCAL2/Software_EasyBuild/software/GCCcore/6.4.0/lib/gcc/x86_64-pc-linux-gnu/6.4.0/include-fixed/syslimits.h:7, from /LOCAL2/Software_EasyBuild/software/GCCcore/6.4.0/lib/gcc/x86_64-pc-linux-gnu/6.4.0/include-fixed/limits.h:34, from /LOCAL2/Software_EasyBuild/software/GCCcore/6.4.0/include/c++/6.4.0/climits:42, from /LOCAL2/Software_EasyBuild/build/AMPLMP/3.1.0/GCCcore-6.4.0/mp-3.1.0/test/safeint-test.cc:30: /LOCAL2/Software_EasyBuild/build/AMPLMP/3.1.0/GCCcore-6.4.0/mp-3.1.0/include/mp/format.h: In Elementfunktion void fmt::internal::ArgFormatterBase<Impl, Char>::visit_char(int): /LOCAL2/Software_EasyBuild/build/AMPLMP/3.1.0/GCCcore-6.4.0/mp-3.1.0/include/mp/format.h:1750:20: Fehler: expected unqualified-id before numeric constant const unsigned CHAR_WIDTH = 1; ^ test/CMakeFiles/safeint-test.dir/build.make:65: recipe for target 'test/CMakeFiles/safeint-test.dir/safeint-test.cc.o' failed make[2]: *** [test/CMakeFiles/safeint-test.dir/safeint-test.cc.o] Error 1

I renamed the variable from CHAR_WIDTH to CHAR_WIDTH_AMPL_FORMAT_H , which solved the problem for me. The changes are documented in the appended patch.

charWidth.patch.zip

boegel commented 5 years ago

@ANaumann85 Can you provide some more information about the OS on which you're seeing this problem?

ANaumann85 commented 5 years ago

It is an ubuntu 18.04.3, easybuild version is 4.0.1, framework and easyblocks give the same version numbers

zao commented 5 years ago

If I remember correctly, this is one of the things that the glibc version in Ubuntu 18.04 does, where it defines CHAR_WIDTH and friends whenever the build is sufficiently GNU-ish.

See: https://sourceware.org/ml/libc-alpha/2016-09/msg00225.html https://github.com/ampl/mp/issues/108 https://github.com/fmtlib/fmt/issues/398 https://github.com/fmtlib/fmt/commit/abbefd71666055daac9e14e78262620f9e845850

Renaming the names in the embedded fmtlib seems to be upstream's solution.