From 876d2c65e190b8981ca5313001f542ca55953787 Mon Sep 17 00:00:00 2001 From: Chris Jefferson Date: Thu, 29 Sep 2022 16:58:14 +0100 Subject: [PATCH 1/2] Add BIGENDIAN_CPU to GAPInfo.KernelInfo --- src/gap.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gap.c b/src/gap.c index 6fde152bef..618e3cab15 100644 --- a/src/gap.c +++ b/src/gap.c @@ -1150,6 +1150,12 @@ static Obj FuncKERNEL_INFO(Obj self) AssPRec(res, r, False); #endif +#ifdef WORDS_BIGENDIAN + AssPRec(res, RNamName("BIGENDIAN_CPU"), True); +#else + AssPRec(res, RNamName("BIGENDIAN_CPU"), False); +#endif + MakeImmutable(res); return res; From 25f3e8f92e8ab541d7b8bc73d20a0f9a82206e81 Mon Sep 17 00:00:00 2001 From: Chris Jefferson Date: Thu, 29 Sep 2022 17:00:00 +0100 Subject: [PATCH 2/2] Add warning on startup about unsupported GAP configurations --- lib/init.g | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/init.g b/lib/init.g index 39de0a0251..4574cd8297 100644 --- a/lib/init.g +++ b/lib/init.g @@ -421,7 +421,7 @@ end ); BindGlobal( "ShowKernelInformation", function() local sysdate, linelen, indent, btop, vert, bbot, print_info, - config, str, gap; + config, str, gap, warnings; linelen:= SizeScreen()[1] - 2; print_info:= function( prefix, values, suffix ) @@ -474,6 +474,22 @@ BindGlobal( "ShowKernelInformation", function() Print( " Maximum concurrent threads: ", GAPInfo.KernelInfo.NUM_CPUS, "\n"); fi; + + # Warn about poorly tested, or unsupported, variants of GAP + warnings := []; + + if GAPInfo.BytesPerVariable = 4 then + Add( warnings, "32-bit CPUs"); + fi; + if GAPInfo.KernelInfo.BIGENDIAN_CPU then + Add( warnings, "Big-endian CPUs"); + fi; + + if warnings <> [] then + print_info("\n **** Warning, this copy of GAP was built for: ", warnings, + "\n **** This configuration is not officially supported or tested \n\n"); + fi; + # For each library or configuration setting, print some info. config:= []; # always mention GMP