[SOLVED] Compiling ElmerFEM from source on a Raspberry 4B

Discussion about building and installing Elmer
Post Reply
thomasatelmer
Posts: 47
Joined: 18 Jan 2019, 18:18
Antispam: Yes

[SOLVED] Compiling ElmerFEM from source on a Raspberry 4B

Post by thomasatelmer »

Hi,

I took off on a quite crazy endeavour by trying to get ElmerFEM running on a Raspberry 4B. So far no luck... But maybe with the help of the people in this forum, this might change - as this is one of the most responsive forums that I know !!

The subject: On the Raspberry, there is Ubuntu 18.04 in the variant for the armhf architecture running. First, I tried Launchpad installation by PPA after including the repositories from launchpad:

Code: Select all

ubuntu@ubuntu:~$ sudo apt-get install elmerfem-csc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package elmerfem-csc
I assume, for the ARM architecture, there is no proper package. So I decided to build myself... I followed the build instrutions in Github: https://github.com/ElmerCSC/elmerfem/Readme.adoc

The already installed packages are attached in file packages_installed.txt.

The build runs fairly smooth, only a handful of warnings. Installation is also unsuspicious. After this procedure, I can access e.g. ElmerGrid from anywhere, and also ElmerSolver is found. However, when I have (on the Raspberry) ElmerSolver run on a existing project that was copied from another computer (also with Ubuntu 18.04, also a 64bit architecture, but no ARM), it crashes with the statement

Code: Select all

mpiuser@ubuntu:~/Elmer_workdir/mesh_1$ ElmerSolver
ELMER SOLVER (v 9.0) STARTED AT: 2021/04/17 23:04:09
ParCommInit:  Initialize #PEs:            1
MAIN: OMP_NUM_THREADS not set. Using only 1 thread per task.
MAIN: 
MAIN: =============================================================
MAIN: ElmerSolver finite element software, Welcome!
MAIN: This program is free software licensed under (L)GPL
MAIN: Copyright 1st April 1995 - , CSC - IT Center for Science Ltd.
MAIN: Webpage http://www.csc.fi/elmer, Email elmeradm@csc.fi
MAIN: Version: 9.0 (Rev: b5db42ac, Compiled: 2021-04-17)
MAIN:  Running one task without MPI parallelization.
MAIN:  Running with just one thread per task.
MAIN: =============================================================
LoadInputFile: Trying to read "Run Control" section only
MAIN: 
MAIN: 
MAIN: -------------------------------------
MAIN: Reading Model: case.sif
LoadInputFile: Scanning input file: case.sif
LoadInputFile: Scanning only size info
LoadInputFile: First time visiting
LoadInputFile: Reading base load of sif file
LoadInputFile: Loading input file: case.sif
LoadInputFile: Reading base load of sif file
LoadInputFile: Number of BCs: 2
LoadInputFile: Number of Body Forces: 1
LoadInputFile: Number of Initial Conditions: 1
LoadInputFile: Number of Materials: 1
LoadInputFile: Number of Equations: 1
LoadInputFile: Number of Solvers: 2
LoadInputFile: Number of Bodies: 1

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
Segmentation fault (core dumped)
The project is being solved correctly on the other machine. Running the cmake tests that come with the source on the Raspberry, all of them fail with the same pattern. It seems as if ElmerSolver does not compute (or crashes every time), and therefore this TEST.PASSED file is never generated:

Code: Select all

13: -----------------------
13: Loading the geometry from file 'beam.grd'.
13: Loading ElmerGrid file version: 210903
13: Defining the coordinate system (2-DIM).
13: Loading 1 subcell sizes in X-direction
13: Loading 1 subcell sizes in Y-direction
13: Loading material structure
13: LoadElmergrid: materials interval is [1,1]
13: Loading boundary conditions
13: Found 4 boundaries
13: Reached the end of command file
13: Found 1 divisions for grid
13: 
13: Loading ElmerGrid commands from file 'beam.grd'.
13: Reached the end of command file
13: Read commands from a file
13: 
13: Elmergrid creating and manipulating meshes:
13: -------------------------------------------
13: 1 cells were created.
13: Numbered 303 knots in 200 4-node elements.
13: Numbering order was <x><y> and max levelwidth 103.
13: 100 element sides between materials -1 and 1 were located to type 1.
13: 2 element sides between materials -2 and 1 were located to type 2.
13: 100 element sides between materials -3 and 1 were located to type 3.
13: 2 element sides between materials -4 and 1 were located to type 4.
13: Coordinates defined in 2 dimensions
13: 
13: Elmergrid saving data with method 2:
13: -------------------------------------
13: Saving mesh in ElmerSolver format to directory beam.
13: Saving 303 coordinates to mesh.nodes.
13: Saving 200 element topologies to mesh.elements.
13: Saving boundary elements to mesh.boundary.
13: Saving header info to mesh.header.
13: 
13: Thank you for using Elmergrid!
13: Send bug reports and feature wishes to elmeradm@csc.fi
13: -- BINARY_DIR = /home/ubuntu/elmerfem/build
13: -- Extra library directories 
13: CMake Error at /home/ubuntu/elmerfem/cmake/Modules/test_macros.cmake:156 (FILE):
13:   FILE failed to open for reading (No such file or directory):
13: 
13:     /home/ubuntu/elmerfem/build/fem/tests/AnalyticalTest/TEST.PASSED
13: Call Stack (most recent call first):
13:   /home/ubuntu/elmerfem/fem/tests/AnalyticalTest/runtest.cmake:3 (RUN_ELMER_TEST)
13: 
13: 
 13/739 Test  #13: AnalyticalTest ..........................................***Failed   30.97 sec
I also tried ElmerSolver_mpi on my data, but it's the same result, just as often as there are threads :-) During my search for any clue, I have ran across a few posts in this forum that describe similar problems, but often its just not having all libraries, or not setting environment variables. I am already passed those issues.

I attach my testcase.zip that contains the project to be run. I can also furnish screendumps of build, install and test procedure, if wanted.

I am looking forward to any new clues as to what else still to try - personally, I am at a loss. Thank you!

Thomas.
Attachments
Testcase.zip
(161.75 KiB) Downloaded 177 times
Packages_installed.txt
(64.89 KiB) Downloaded 172 times
Last edited by thomasatelmer on 18 Apr 2021, 18:15, edited 1 time in total.
kevinarden
Posts: 2237
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: Compiling ElmerFEM from source on a Raspberry 4B

Post by kevinarden »

The test case works on my Linux Mint 19.1 OS.

You can increase the number on
Max Output Level = 5

to 20 and perhaps you may get more diagnostic information
thomasatelmer
Posts: 47
Joined: 18 Jan 2019, 18:18
Antispam: Yes

Re: Compiling ElmerFEM from source on a Raspberry 4B

Post by thomasatelmer »

Good afternoon,

Thank you Kevin for checking this, even on a Sunday - appreciate this! In the meantime, after sleeping over this issue, I got a creeping thought in my mind that it might be linked to the armhf architecture, that I used in the Ubuntu kernel. I setup a new SD card with Ubuntu with arm64 architecture and did the whole thing once again. Sure enough, now everything operates as expected :shock:
So this issue is closed before even been discussed in full length, but I hope it helps maybe others along the way.

Thanks for the spontaneous support!
Thomas.
Post Reply