CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Installation (https://www.cfd-online.com/Forums/openfoam-installation/)
-   -   [OpenFOAM.org] Error compiling OpenFOAM-6 on ARMv7 (https://www.cfd-online.com/Forums/openfoam-installation/217421-error-compiling-openfoam-6-armv7.html)

Time4Tea May 11, 2019 15:24

Hi,


I'm trying to compile OpenFOAM-6 on an ARMv7 Chromebook running Parabola GNU/Linux. After I start compiling, I very quickly run into the following error:


Code:

$ ./Allwmake -j
Compiling enabled on 4 cores
Allwmake /home/lee/OpenFOAM/OpenFOAM-6
gcc -DlinuxARM7 -DWM_ARCH_OPTION=32 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -O3 -floop-optimize -falign-loops -falign-labels -falign-functions -falign-jumps -fprefetch-loop-arrays -mcpu=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=softfp  -fPIC dirToString.c -o /home/lee/OpenFOAM/OpenFOAM-6/wmake/platforms/linuxARM7Gcc/dirToString
In file included from /usr/include/features.h:452,
                from /usr/include/bits/libc-header-start.h:33,
                from /usr/include/stdio.h:27,
                from dirToString.c:43:
/usr/include/gnu/stubs.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
 # include <gnu/stubs-soft.h>
          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:68: /home/lee/OpenFOAM/OpenFOAM-6/wmake/platforms/linuxARM7Gcc/dirToString] Error 1

Does anyone have any idea how I can resolve this? What does this 'stubs-soft.h' header relate to?

Perhaps something to do with the -mfloat-abi=softfp compiler option?

wyldckat May 11, 2019 19:58

Quick answer: Very likely, yes, it's related to using softfp by default...

A quick review online for this topic on what I saw in the past and with ARM, there are a ton of FPUs out there... I'm not sure how we can figure out which ones are better or should be used... for example, in post #2 here: https://www.cfd-online.com/Forums/op...tml#post534662 - each ARM uses or can use its own FPU type...

A bit more researching online and it's not entirely clear to me if the problem you're having is due to an incomplete GCC installation or if the ARMv7 model you have does not support softfp...

Running:
Code:

cat /proc/cpuinfo
should tell you more details about the exact CPU model and any additional extensions it has.


edit: Another example of compile flags customization needed for ARM: https://openfoamwiki.net/index.php/I...rchitecture.29

Time4Tea May 12, 2019 06:51

@wyldckat:

Thanks for the info. I actually managed to figure it out (I think):

The info pages for gcc indicate that -mfloat-abi seems to be an ARM-specific compiler flag that has something to do with floating point operations. My /usr/include/gnu folder has a stubs-hard.h, but not a stubs-soft.h. So, I changed the flag to -mfloat-abi=hard (in the settings in $WM_DIR/rules) and that seemed to resolve it. It compiled fine and, as far as I can tell, OF seems to be working.

I have no idea what stubs-soft vs stubs-hard means, or what (if any) effect it would have on OF ...

wyldckat May 12, 2019 14:48

Quick answer: "soft" and "hard" refer to which FPU to use:
  • "soft" means that it will have to do mathematical calculations using the CPU, which is slower.
  • "hard" means that it will use the hardware FPU, namely a chip that is specialized for mathematical operations and can process them a lot faster than the CPU.
And again, ARM has a fairly broad range of implementations, with and without a hardware FPU and other possibly hardware features... so there are more build options than the more conventional x86/x86_64 CPUs.

Time4Tea May 13, 2019 07:32

Ok, that makes sense. Thanks again for your help.

sew234 April 22, 2020 10:54

Installing OpenFOAM to raspberry pi
 
Hi,

I am aware this is an old thread however am having a similar issue.

I am very new to Linux and OpenFOAM and am trying to install it to a raspberry pi 4 using the following instructions.

http://www.wolfdynamics.com/images/r...nFOAM-RPI3.pdf

When I reach the last step and try to compile I am getting the same error as the person above.

If anyone has any advice on how to solve it would be greatly appreciated.


All times are GMT -4. The time now is 03:32.