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.com] Building OpenFOAM V1912 on armh8/arm64 (https://www.cfd-online.com/Forums/openfoam-installation/226568-building-openfoam-v1912-armh8-arm64.html)

EternalSeekerX May 1, 2020 02:48

Building OpenFOAM V1912 on armh8/arm64
 
Dear FOAMERS,

I am attemping to build up openfoam v1912 and I ran into a hitch.

I was following this website: https://gitlab.com/arm-hpc/packages/...rsion-1912-arm

I wget both the openfoam and thirparty archives and then extracted it into my /opt/OpenFOAM directory.

I then edited bashrc to point to this directory.

When I source the bashrc I get this error:

Code:

root@localhost:/opt/OpenFoam/OpenFOAM-v1912# source etc/bashrc
[localhost:08533] opal_ifinit: ioctl(SIOCGIFHWADDR) failed with errno=13
No completion added for /opt/OpenFoam/OpenFOAM-v1912/platforms/linuxARM64ArmDPInt64Opt/bin
... incorrect platform, or not yet compiled?
root@localhost:/opt/OpenFoam/OpenFOAM-v1912#]

I went back into bashrc and changed these lines:

Code:

#------------------------------------------------------------------------------
# Configuration environment variables.
# Override with <prefs.sh> instead of editing here.

# [WM_COMPILER_TYPE] - Compiler location:
# = system | ThirdParty
export WM_COMPILER_TYPE=system

# [WM_COMPILER] - Compiler:
# = Gcc | Gcc4[8-9] | Gcc5[1-5] | Gcc6[1-5] | Gcc7[1-4] | Gcc8[12] |
#  Clang | Clang3[7-9] | Clang[4-6]0 | Icc | Cray | Arm | Pgi
export WM_COMPILER=Arm

# [WM_PRECISION_OPTION] - Floating-point precision:
# = DP | SP | SPDP
export WM_PRECISION_OPTION=DP

# [WM_LABEL_SIZE] - Label size in bits:
# = 32 | 64
export WM_LABEL_SIZE=64

# [WM_COMPILE_OPTION] - Optimised(default), debug, profiling, other:
# = Opt | Debug | Prof
# Other is processor or packaging specific (eg, OptKNL)
export WM_COMPILE_OPTION=Opt

# [WM_MPLIB] - MPI implementation:
# = SYSTEMOPENMPI | OPENMPI | SYSTEMMPI | MPI | MPICH | MPICH-GM |
#  HPMPI | CRAY-MPICH | FJMPI | QSMPI | SGIMPI | INTELMPI | USERMPI
# Also possible to use INTELMPI-xyz etc and define your own wmake rule
export WM_MPLIB=SYSTEMOPENMPI


#------------------------------------------------------------------------------
# (advanced / legacy)

# [WM_PROJECT] - This project is "OpenFOAM" - do not change
export WM_PROJECT=OpenFOAM

# [projectDir] - directory containing this OpenFOAM version.
# \- When this file is located as $WM_PROJECT_DIR/etc/bashrc, the next lines
#    should work when sourced by BASH or ZSH shells. If this however fails,
#    set one of the fallback values to an appropriate path.
#
#    This can be removed if an absolute path is provided for WM_PROJECT_DIR
#    later on in this file
# --
projectDir="${BASH_SOURCE:-${ZSH_NAME:+$0}}";
[ -n "$projectDir" ] && projectDir="$(\cd $(dirname $projectDir)/.. && \pwd -L)" ||\
# projectDir="$HOME/OpenFOAM/OpenFOAM-$WM_PROJECT_VERSION"
projectDir="/opt/openFoam/OpenFOAM-$WM_PROJECT_VERSION"
# projectDir="/usr/local/OpenFOAM/OpenFOAM-$WM_PROJECT_VERSION"
################################################################################

Then i proceed to run foamsyscheck:
Code:

root@localhost:/opt/OpenFoam/OpenFOAM-v1912# foamSystemCheck

Checking basic system...
-----------------------------------------------------------------------
Shell:         
ERROR: Cannot identify the current shell.
      OpenFOAM v1912 is compatible
      with csh, tcsh, ksh and bash.

Host:            localhost
OS:              Linux version 4.9.186-17655189
User:            root


System check: FAIL
==================
Your system is not currently compatible with OpenFOAM installation
requirements. Review the error messages and consult the documentation
for further instructions.

root@localhost:/opt/OpenFoam/OpenFOAM-v1912#

I looked around and some people have said system check is stringent so i just went ahead with Allmake:

Code:

root@localhost:/opt/OpenFoam/OpenFOAM-v1912# ./Allwmake -j -s -l
Logging wmake -all output to 'log.linuxARM64ArmDPInt64Opt'

Compiling enabled on 8 cores
gcc=/bin/gcc
clang=
mpirun=/bin/mpirun
make=/bin/make
cmake=/bin/cmake
wmake=/opt/OpenFoam/OpenFOAM-v1912/wmake/wmake
m4=/bin/m4
flex=/bin/flex

compiler=unknown

========================================
2020-05-01 02:44:49 -0400
Starting compile OpenFOAM-v1912 Allwmake
  Arm system compiler
  linuxARM64ArmDPInt64Opt, with SYSTEMOPENMPI openmpi-system
========================================

    lemon: lemon.c
armclang -mcpu=native -DOPENFOAM=1912 -DWM_DP -DWM_LABEL_SIZE=64 -Wall -ffp-contract=fast -ffast-math -O3 -armpl  -fPIC lemon.c -o /opt/OpenFoam/OpenFOAM-v1912/wmake/platforms/linuxARM64Arm/lemon
make: armclang: Command not found
make: *** [Makefile:88: /opt/OpenFoam/OpenFOAM-v1912/wmake/platforms/linuxARM64Arm/lemon] Error 127
Done logging to 'log.linuxARM64ArmDPInt64Opt'
root@localhost:/opt/OpenFoam/OpenFOAM-v1912#

So based on that It seems like compiler type and clang is missing. Idk where I can find out which compiler I need for arm64 and which clang to choose. Anyone built openfoam on arm64 that knows the flags i need and where to specify?

Thanks!

Bonus: I assume these same configuration should be used for OpenFoam V7 and foam-extend?

HPE May 1, 2020 03:56

Could you please report the error in one of the issue trackers? The links below may help.

EternalSeekerX May 1, 2020 18:28

Reported the error to gitlab linked in your sig
 
Quote:

Originally Posted by HPE (Post 768163)
Could you please report the error in one of the issue trackers? The links below may help.

Hello HPE,

I reported the error. Is this a bug you think?

HPE May 2, 2020 05:43

some answer thereat: https://develop.openfoam.com/Develop...am/issues/1695

olesen May 4, 2020 15:17

Quote:

Originally Posted by EternalSeekerX (Post 768158)
Dear FOAMERS,

I am attemping to build up openfoam v1912 and I ran into a hitch.

I was following this website: https://gitlab.com/arm-hpc/packages/...rsion-1912-arm


Please note that the information given on the ARM site is for using the armclang compiler. This is a clang-based compiler with ARM-specific optimizations, but is not the same as running a regular clang on an ARM system. If the command "armclang" is accessible on your system, you can use it, otherwise stick to gcc or clang which you quite likely do have on your system.
I cannot say if the armclang performance is significantly different to what regular gcc or clang provide.

EternalSeekerX May 5, 2020 16:46

I see
 
Quote:

Originally Posted by olesen (Post 768674)
Please note that the information given on the ARM site is for using the armclang compiler. This is a clang-based compiler with ARM-specific optimizations, but is not the same as running a regular clang on an ARM system. If the command "armclang" is accessible on your system, you can use it, otherwise stick to gcc or clang which you quite likely do have on your system.
I cannot say if the armclang performance is significantly different to what regular gcc or clang provide.

So I understood what you said. I decided to redownload the tar and start fresh.

I untar into /opt/OpenFOAM.
Edited bashrc to point to that directory.
Sourced etc/bashrc
And then ran. /Allwmake -j

It was running until this error:

Code:

In file included from /opt/OpenFoam/OpenFOAM-v1912/src/OpenFOAM/lnInclude/VectorSpace.H:270,                                    from /opt/OpenFoam/OpenFOAM-v1912/src/OpenFOAM/lnInclude/Field.H:50,                                            from /opt/OpenFoam/OpenFOAM-v1912/src/OpenFOAM/lnInclude/scalarField.H:41,                                      from /opt/OpenFoam/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dimensionSet.H:48,                                    from /opt/OpenFoam/OpenFOAM-v1912/src/OpenFOAM/lnInclude/dimensionedType.H:43,                                  from lnInclude/ddtScheme.H:45,                          from finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtScheme.H:50,                                            from finiteVolume/ddtSchemes/boundedDdtScheme/boundedDdtSchemes.C:28:                          /opt/OpenFoam/OpenFOAM-v1912/src/OpenFOAM/lnInclude/VectorSpaceI.H:346:13: note: because ‘Foam::SymmTensor<double>’ has user-provided ‘void Foam::VectorSpace<Form, Cmpt, Ncmpts>::operator=(const Foam::VectorSpace<Form, Cmpt, Ncmpts>&) [with Form = Foam::SymmTensor<double>; Cmpt = double; unsigned char Ncmpts = 6]’                      346 | inline void Foam::VectorSpace<Form, Cmpt, Ncmpts>::operator=                                                  |            ^~~~                                g++: fatal error: Killed signal terminated program cc1plus                                                      compilation terminated.                                make: *** [/opt/OpenFoam/OpenFOAM-v1912/wmake/rules/General/transform:35: /opt/OpenFoam/OpenFOAM-v1912/build/linuxARM64GccDPInt32Opt/src/finiteVolume/finiteVolume/ddtSchemes/CrankNicolsonDdtScheme/CrankNicolsonDdtSchemes.o] Error 1                                                make: *** Waiting for unfinished jobs....              root@localhost:/opt/OpenFoam/OpenFOAM-v1912#
What could cause this fatal error?

I did notice this during build in the beginning:

Code:

========================================
KAHIP decomposition
./makeKAHIP: 64: local: -DWM_DP: bad variable name

    ---------------------------------------------------
    Optional component (KAHIP) had build issues
    OpenFOAM will nonetheless remain largely functional
    ---------------------------------------------------


========================================
METIS decomposition
Missing sources: 'metis-5.1.0'
Possible download locations for METIS :
    http://glaros.dtc.umn.edu/gkhome/metis/metis/overview
    http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-5.1.0.tar.gz

    ---------------------------------------------------
    Optional component (METIS) had build issues
    OpenFOAM will nonetheless remain largely functional
    ---------------------------------------------------


========================================
CGAL/boost
    CGAL  include: /opt/OpenFoam/ThirdParty-v1912/platforms/linuxARM64Gcc/CGAL-4.9.1/include
    CGAL  library: /opt/OpenFoam/ThirdParty-v1912/platforms/linuxARM64Gcc/CGAL-4.9.1/lib64
    boost include: /opt/OpenFoam/ThirdParty-v1912/platforms/linuxARM64Gcc/boost_1_64_0/include
    boost library: /opt/OpenFoam/ThirdParty-v1912/platforms/linuxARM64Gcc/boost_1_64_0/lib64

========================================
FFTW
    fftw include: /opt/OpenFoam/ThirdParty-v1912/platforms/linuxARM64Gcc/fftw-3.3.7/include
    fftw library: /opt/OpenFoam/ThirdParty-v1912/platforms/linuxARM64Gcc/fftw-3.3.7/lib64

========================================
ADIOS2
./makeAdios2: 64: local: -DWM_DP: bad variable name

    ---------------------------------------------------
    Optional component (ADIOS2) had build issues
    OpenFOAM will nonetheless remain largely functional
    ---------------------------------------------------


========================================
Done ThirdParty Allwmake
========================================


EternalSeekerX May 6, 2020 19:41

Fixed the Issue!
 
Great news, I was able to compile and install OpenFOAM-v1912 arm64 directly inside my Ubuntu 19.10 install inside a Proot Container running on an Android Phone.

So what I did differently this time was:

-First made sure give termux (my terminal to launch the container) wakelock such that android doesn't kill the session
-Downloading the latest tar file named OpenFOAM-v1912200314.tar.gz (kept the original Thirdparty-v1912.tar.gz as it was unchanged)
-Untar into my new directory located in /opt/OpenFOAM
- [Optional: I hear its not needed as this is automated] I did go into the etc/bashrc and un-commented the build directory pointing to openfoam in opt and commented the build directory pointing to openfoam in $Home
- sourced etc/bashrc in terminal (my terminal was already in the OpenFOAM-v1912 directory)
- Did foamSystemCheck command and noticed that for me that openfoam cannot figure out which shell I am using (I am using bash), and this is due to permissions with proot containers (it shouldn't be an issue)
- ran ./Allwmake -j4 -l (I chose 4 because anything higher would cause resource issues with my soc)
- It build correctly and I was able to run foamInstallationTest and even commands such as blockMesh/simpleFoam/etc.
-Finally i edited in my bashrc in my home directory with this line:
Code:

alias of1912='source /opt/OpenFOAM/OpenFOAM-v1912/etc/bashrc';
And voila I was done, now whenever i launch terminal, i just type in of1912 and i can use openfoam.

I created a run directory and then copied over a few tutorials to test.
elbow, pitzDaily, airFOIL2D, simpleCar, rotarDisk all ran using both manual commands and there Allrun scripts.

ParaFoam worked out of the box with my Paraview 5.8.0 (installed from Ubuntu Repo using apt-get)

I was able to visualize this all on a phone:
https://imgur.com/Ph62I0z

The only issue I have is that motorBike didn't run correctly with Allrun, it ran to quickly and when I tried to open results, paraview didn't have the data for p,U,nu,etc. I even ran it manually using blockMesh > snappyHexMesh (it took around 800 seconds to run) > SimpleFoam, and it still couldnt find the proper results in paraview. I chalk this down to openmpi support for my device.

However largely everything else works :D


All times are GMT -4. The time now is 06:21.