Re: problems compiling G4 on Power9

From: Volker Springel <vspringel_at_MPA-Garching.MPG.DE>
Date: Thu, 3 Dec 2020 18:30:32 +0100

Hi Marco,

Ah, Power9 - fancy!

Thanks for pointing out this problem. Indeed, when EXPLICIT_VECTORIZATION is not set, there is no need to compile in vectorclass/instrset_detect.o, and then things should work with Power9.

Your change to the Makefile is basically fine, except that you need to use the more complicated expression


instead of


The reason is that the latter checks whether EXPLICIT_VECTORIZATION is defined in your general environment variables, but Gadget's configuration options don't actually appear independently as such variables. They can however be probed as part of the environment variable CONFIGVARS which enumerates them.

Things worked for your solution because you anyway wanted that
OBJS += vectorclass/instrset_detect.o
is not executed. However if you would activate EXPLICIT_VECTORIZATION in, it would not not properly compile any more on a x86 platform.

I have made the corresponding change in the Makefile.


> On 3. Dec 2020, at 16:23, Marco Baldi <> wrote:
> Dear Gadget4 list,
> I've had some troubles in compiling the code on the new Power9 cluster Marconi100 at Cineca.
> When trying to compile the code with the settings of one of the example simulations (the DM-L50-N128) one gets the following compilation error:
> /tmp/ccpDhXfN.s: Assembler messages:
> /tmp/ccpDhXfN.s:37: Error: unrecognized opcode: `cpuid'
> Apparently, this is is related to the vectorclass libraries, which are not supported for architectures different from x86_64. If I understand correctly from the Gadget4 user guide, these libraries are used only when the compilation flag EXPLICIT_VECTORIZATION is set in the Config. Nonetheless, the vectorclass directory and its contents are included in the compilation anyway, which generates the problem.
> I managed to solve the problem by bracketing the reference to the vectorclass source files within an ifdef statement in the Makefile:
> SUBDIRS += vectorclass
> OBJS += vectorclass/instrset_detect.o
> INCL +=
> endif
> With this change, I could compile the code on Power9 and the test DM-L50-N128 simulation seems to be running properly.
> I just wanted to ask whether this may be a safe (and reasonable) solution for this problem (in which case it may be ported into the public code version) or if it may generate other issues.
> Thanks a lot,
> Marco
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> with a subject of: unsubscribe gadget-list
> A web-archive of this mailing list is available here:
Received on 2020-12-03 18:30:33

This archive was generated by hypermail 2.3.0 : 2022-09-01 14:03:43 CEST