Package Details: elmerfem 9.0-6

Git Clone URL: https://aur.archlinux.org/elmerfem.git (read-only, click to copy)
Package Base: elmerfem
Description: A finite element software for multiphysical problems
Upstream URL: http://www.elmerfem.org
Keywords: CFD FEM simulation
Licenses: GPL
Conflicts: elmerfem-git
Submitter: saxonbeta
Maintainer: None
Last Packager: rmsc
Votes: 12
Popularity: 0.000000
First Submitted: 2015-08-18 13:50 (UTC)
Last Updated: 2025-05-23 21:15 (UTC)

Pinned Comments

rmsc commented on 2025-05-23 21:37 (UTC)

I patched this as much as I could, but it's still not compiling due an error in one of the solvers, which is written in Fortran. Help is really welcome.

That said, this release is so old that it's probably best to just use the git version.

Latest Comments

1 2 3 4 Next › Last »

a6rippa commented on 2025-10-31 12:59 (UTC)

Using the patch provided by anvil0779, I'm getting "malformed line at line 70, which leads to fix_second_gettimeofday.patch not being created. Does this patch still work for other people that apply it using patch --strip=1 --input=aur.patch?

ledynamique commented on 2025-10-28 16:20 (UTC) (edited on 2025-10-28 16:21 (UTC) by ledynamique)

The patch provided by anvil0779 works for me:

--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,14 +19,18 @@ source=("https://github.com/ElmerCSC/$pkgname/archive/release-$pkgver.tar.gz"
         "DCRComplexSolve.patch"
         "qwt_6.2.patch"
         "fix_mkl_gomp.patch"
-        "fix_gettimeofday.patch")
+        "fix_gettimeofday.patch"
+        "fix_second_gettimeofday.patch"
+        "fix_missing_m_pi_object.patch")
 sha256sums=('08c5bf261e87ff37456c1aa0372db3c83efabe4473ea3ea0b8ec66f5944d1aa0'
             'f4b39389e5f258c7860b8d7a6b171fb54bf849dc772f640ac5e7a12c7a384aca'
             '90287c988ac4f5beedf5221e81f624799ec3253c63a30695e1873044ac5a6515'
             'fe117a9d803b7a12525d144fae936e1d3d7a3444c5b5a5697f95f772486a2db0'
             'b6ed988029169a5af745187d6ffb3e73cb81f5287944aab273e4a1fdf50af91f'
             '61529ac78f2e8d1bd0515e4181a670cc2dc290783b6751c7cd73681d8baa4743'
-            '3006a50187839fe3e461690908e0c649e2a209e6bc1c31c382257e1eaeb31b86')
+            '3006a50187839fe3e461690908e0c649e2a209e6bc1c31c382257e1eaeb31b86'
+            'e8da6e5e61c2abcbf0a72576df4364395a55f4edbd215f1087f936f625b4d948'
+            'efae0f34ff0f19d7cb3f3bfe6160879561b891bd3ac27be95ce033ac0ac1918b')
 options=(!emptydirs !makeflags)

 prepare() {
@@ -37,6 +41,8 @@ prepare() {
   patch -p1 < "$srcdir/qwt_6.2.patch"
   patch -p0 < "$srcdir/fix_mkl_gomp.patch"
   patch -p0 < "$srcdir/fix_gettimeofday.patch"
+  patch -p0 < "$srcdir/fix_second_gettimeofday.patch"
+  patch -p0 < "$srcdir/fix_missing_m_pi_object.patch"
   sed -i '/#include <QPainter>/a #include <QPainterPath>' ElmerGUI/Application/twod/renderarea.cpp
   sed -i 's#mmg/mmg3d/libmmgtypesf.h#mmg/common/libmmgtypesf.h#g' elmerice/Solvers/CalvingRemeshMMG.F90
 }
diff --git a/fix_missing_m_pi_object.patch b/fix_missing_m_pi_object.patch
new file mode 100644
index 0000000..9fbee99
--- /dev/null
+++ b/fix_missing_m_pi_object.patch
@@ -0,0 +1,12 @@
+--- elmergrid/src/egdef.h
++++ elmergrid/src/egdef.h
+@@ -33,6 +33,9 @@ typedef int Integer;
+ #ifndef FM_PI
+ #define FM_PI 3.141592653
+ #endif
++#ifndef M_PI
++#define M_PI FM_PI  /* Fallback when math.h does not expose M_PI */
++#endif
+ #define NEARZERO 1.0e-50
+ 
+ /* the number and order of the axes */
diff --git a/fix_second_gettimeofday.patch b/fix_second_gettimeofday.patch
new file mode 100644
index 0000000..8439b13
--- /dev/null
+++ b/fix_second_gettimeofday.patch
@@ -0,0 +1,15 @@
+--- fem/src/view3d/second.c
++++ fem/src/view3d/second.c
+@@ -64,11 +64,10 @@ double second()
+ static struct tms t;
+ 
+ static struct timeval tp;
+-static struct timezone tzp;
+ 
+ double second( )
+ {
+-    gettimeofday(&tp,&tzp);
++    gettimeofday(&tp, NULL);
+     return tp.tv_sec + tp.tv_usec/1.0e6;
+ }
+ #endif

anvil0779 commented on 2025-09-23 16:19 (UTC)

I was able to build using the following commit diff

--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,14 +19,18 @@ source=("https://github.com/ElmerCSC/$pkgname/archive/release-$pkgver.tar.gz"
         "DCRComplexSolve.patch"
         "qwt_6.2.patch"
         "fix_mkl_gomp.patch"
-        "fix_gettimeofday.patch")
+        "fix_gettimeofday.patch"
+        "fix_second_gettimeofday.patch"
+        "fix_missing_m_pi_object.patch")
 sha256sums=('08c5bf261e87ff37456c1aa0372db3c83efabe4473ea3ea0b8ec66f5944d1aa0'
             'f4b39389e5f258c7860b8d7a6b171fb54bf849dc772f640ac5e7a12c7a384aca'
             '90287c988ac4f5beedf5221e81f624799ec3253c63a30695e1873044ac5a6515'
             'fe117a9d803b7a12525d144fae936e1d3d7a3444c5b5a5697f95f772486a2db0'
             'b6ed988029169a5af745187d6ffb3e73cb81f5287944aab273e4a1fdf50af91f'
             '61529ac78f2e8d1bd0515e4181a670cc2dc290783b6751c7cd73681d8baa4743'
-            '3006a50187839fe3e461690908e0c649e2a209e6bc1c31c382257e1eaeb31b86')
+            '3006a50187839fe3e461690908e0c649e2a209e6bc1c31c382257e1eaeb31b86'
+            'e8da6e5e61c2abcbf0a72576df4364395a55f4edbd215f1087f936f625b4d948'
+            'efae0f34ff0f19d7cb3f3bfe6160879561b891bd3ac27be95ce033ac0ac1918b')
 options=(!emptydirs !makeflags)

 prepare() {
@@ -37,6 +41,8 @@ prepare() {
   patch -p1 < "$srcdir/qwt_6.2.patch"
   patch -p0 < "$srcdir/fix_mkl_gomp.patch"
   patch -p0 < "$srcdir/fix_gettimeofday.patch"
+  patch -p0 < "$srcdir/fix_second_gettimeofday.patch"
+  patch -p0 < "$srcdir/fix_missing_m_pi_object.patch"
   sed -i '/#include <QPainter>/a #include <QPainterPath>' ElmerGUI/Application/twod/renderarea.cpp
   sed -i 's#mmg/mmg3d/libmmgtypesf.h#mmg/common/libmmgtypesf.h#g' elmerice/Solvers/CalvingRemeshMMG.F90
 }
diff --git a/fix_missing_m_pi_object.patch b/fix_missing_m_pi_object.patch
new file mode 100644
index 0000000..9fbee99
--- /dev/null
+++ b/fix_missing_m_pi_object.patch
@@ -0,0 +1,12 @@
+--- elmergrid/src/egdef.h
++++ elmergrid/src/egdef.h
+@@ -33,6 +33,9 @@ typedef int Integer;
+ #ifndef FM_PI
+ #define FM_PI 3.141592653
+ #endif
++#ifndef M_PI
++#define M_PI FM_PI  /* Fallback when math.h does not expose M_PI */
++#endif
+ #define NEARZERO 1.0e-50
+ 
+ /* the number and order of the axes */
diff --git a/fix_second_gettimeofday.patch b/fix_second_gettimeofday.patch
new file mode 100644
index 0000000..8439b13
--- /dev/null
+++ b/fix_second_gettimeofday.patch
@@ -0,0 +1,15 @@
+--- fem/src/view3d/second.c
++++ fem/src/view3d/second.c
+@@ -64,11 +64,10 @@ double second()
+ static struct tms t;
+ 
+ static struct timeval tp;
+-static struct timezone tzp;
+ 
+ double second( )
+ {
+-    gettimeofday(&tp,&tzp);
++    gettimeofday(&tp, NULL);
+     return tp.tv_sec + tp.tv_usec/1.0e6;
+ }
+ #endif

rmsc commented on 2025-05-23 21:37 (UTC)

I patched this as much as I could, but it's still not compiling due an error in one of the solvers, which is written in Fortran. Help is really welcome.

That said, this release is so old that it's probably best to just use the git version.

lhy7889678 commented on 2024-06-13 14:37 (UTC)

In newer versions of GCC, implicit function declaration in C code is regarded as error by default. -Wno-error=implicit-function-declaration is required to compile Elmer FEM successfully.

OpusOne commented on 2024-03-25 20:28 (UTC)

ElmerGUI doesn't terminate when we exit it. We have to kill the process.

javalsai commented on 2024-02-02 18:45 (UTC)

For some reason, some tests were failing for me, then I checked the logfile at the end of the output and found a ompi error that led me here: https://github.com/open-mpi/ompi/issues/5613.

Even tho it's closed, I modified my $PATH to remove /bin (so command which is forced to use /usr/bin) and for some reason it worked.

greyltc commented on 2023-11-26 06:58 (UTC)

@rmsc, if you depend on mumps-cmake, you can build this with -D WITH_Mumps=ON

doofus_drummer commented on 2023-09-21 07:00 (UTC)

@rmsc thankyou! this worked for me!

rmsc commented on 2023-08-09 15:44 (UTC) (edited on 2023-08-09 15:44 (UTC) by rmsc)

I think it's best to just fix the PKGBUILD. Just add this line at the end of the prepare() function:

  sed -i 's#mmg/mmg3d/libmmgtypesf.h#mmg/common/libmmgtypesf.h#g' elmerice/Solvers/CalvingRemeshMMG.F90