Open SethosII opened 6 years ago
@SethosII The Illegal instruction
error is a strong suggestion that GMP was built for a different processor architecture than the one you are currently running on?
@boegel Thank you for the suggestion. I compiled it with --optarch=march=corei7
which corresponds to our oldest architecture but it doesn't work there. Here is a overview:
processor | architecture | works? | compiled here? |
---|---|---|---|
E5645 | westmere | no | no |
E5-2620 v2 | ivybridge | no | no |
E5-2630 v3 | haswell | yes | yes |
The naming scheme for the march options changed in GCC 5 (from this to that) but the old options are still accepted and the replacement for corei7
westmere
is the same, only with some additional optimizations:
> module load foss/2016b
> diff -u <(echo | gcc -dM -E - -march=corei7) <(echo | gcc -dM -E - -march=westmere)
--- /dev/fd/63 2017-12-21 08:11:31.073452904 +0100
+++ /dev/fd/62 2017-12-21 08:11:31.077452881 +0100
@@ -103,6 +103,7 @@
#define __nehalem__ 1
#define __INT_FAST64_TYPE__ long int
#define __DBL_MIN__ ((double)2.22507385850720138309e-308L)
+#define __PCLMUL__ 1
#define __tune_corei7__ 1
#define __LP64__ 1
#define __DECIMAL_BID_FORMAT__ 1
@@ -237,6 +238,7 @@
#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
#define __INT16_C(c) c
#define __STDC__ 1
+#define __AES__ 1
#define __PTRDIFF_TYPE__ long int
#define __ATOMIC_SEQ_CST 5
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1
If the option was unknown gcc
would report an error:
> echo | gcc -dM -E - -march=wrong
cc1: error: bad value (wrong) for -march= switch
The option also seems to be passed correctly. Here is the build log: easybuild-GMP-6.1.1-20170110.135654.log (hooray for traceable builds provided by EasyBuild :)).
@SethosII The problem is probably that GMP doesn't honour what EasyBuild tells it, and it goes an builds for the system architecture you are on anyway.
There may be a configure option to tell it not to.
@boegel Seems like that. Allthough, the march flag is passed correctly to gcc. I wrote to the developers of GMP. Lets see what they say.
@boegel I got an answer (it basically was: No bug, RTFM!). It runs config.guess
and uses the output from this to set the architecture. So I need to add --build=westmere-pc-linux-gnu
to configure
or just build it on the oldest architecture ...
Should we add a note on this in the EasyConfig?
@SethosII I'm not sure if adding a comment in every GMP
easyconfig we have is the best approach here.
We could consider adding a custom easyblock for GMP
that recognises a custom optarch
value and tries to do the right thing, but I'm not sure that's worth the effort.
@boegel Or maybe adding a list of known software ignoring the optarch flag here: http://easybuild.readthedocs.io/en/latest/Controlling_compiler_optimization_flags.html#build-environment-vs-hardcoding-in-build-scripts?
For a generic building of GMP, I use --enable-fat
option :
Using --enable-fat selects a “fat binary” build on x86, where optimized low level subroutines are chosen at runtime according to the CPU detected. This means more code, but gives good performance on all x86 chips. (This option might become available for more architectures in the future.)
Reference : https://gmplib.org/manual/Build-Options.html
It seems there is some prolem with GMP. A reproducible crash occures when using
curl
(/usr/bin/curl
) to get a website over https after loadingGMP/6.1.1-foss-2016b
:I guess there may be problems with other software using GMP. This is the first I encountered. Has someone else encountered any problems with GMP?
OS: Ubuntu 16.04 system libgmp version: 6.1.0 (so I can't see why GMP 6.1.1 from EasyBuild shouldn't work) curl version: 7.47.0