Bug 25443 - OpenFOAM applications could not be launched
Summary: OpenFOAM applications could not be launched
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 7
Hardware: All Linux
Priority: Normal critical
Target Milestone: ---
Assignee: QA Team
QA Contact:
URL:
Whiteboard: MGA7-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks:
 
Reported: 2019-09-15 18:30 CEST by Cyril Levet
Modified: 2019-09-27 21:39 CEST (History)
5 users (show)

See Also:
Source RPM: openfoam-6-5.mga7.src.rpm
CVE:
Status comment:


Attachments
Broken links (121.43 KB, image/png)
2019-09-21 11:07 CEST, Cyril Levet
Details

Description Cyril Levet 2019-09-15 18:30:31 CEST
Description of problem: Installing openFOAM in Mageia 7 and trying to launch any of the applications gives a "symbol lookup error: /usr/lib64/openfoam/libOpenFOAM.so: undefined symbol: pthread_create"


Version-Release number of selected component (if applicable): 6


How reproducible: Always


Steps to Reproduce:
1. Load OpenFOAM environment variables by the "openfoam" command
2. Go to tutorials/incompressible/icoFoam/cavity/cavity
3. Launch blockMesh or icoFoam
Comment 1 Lewis Smith 2019-09-16 08:26:55 CEST
See also bug 25444. I do not think these are duplicates, even though the solution may prove to be common.

OpenFoam has no registered maintainer, so assigning this globally; CC'ing ChrisD who has seen it before.

CC: (none) => eatdirt
Assignee: bugsquad => pkg-bugs

Comment 2 Chris Denice 2019-09-16 11:47:30 CEST
Thanks for the report, I'll have a look to both bugs, certainly a missing -lpthreads at compilation time.

For paraview, yes, it is always a mess, openfoam is always lagging behing in terms of paraview versions. I'll have a look too, possibly by upgrading openfoam.
Comment 3 Chris Denice 2019-09-18 14:13:13 CEST
This is indeed a missing linkage coming from upstream, and it has been fixed in OpenFOAM-7. I've therefore pushed version 7 as a bug fix release. Moreover, our version of paraview-5.6 is officially supported only in OpenFOAM-7.

---

You can test the new version by installing both the openfoam and openfoam-tutorial packages and starting "openfoam" on the command line.
You end up in a new bash environment: As mentioned in the bug report, do:

cd tutorials/incompressible/icoFoam/cavity/cavity

and enter:

blockMesh

You should end up with an information message containing this kind of information

"
...
Creating block mesh from
    "/home/chris/OpenFOAM/chris-7/run/tutorials/incompressible/icoFoam/cavity/cavity/system/blockMeshDict"
Creating block edges
No non-planar block faces defined
Creating topology blocks
Creating topology patches
...
"

instead of the failure to start "blockMesh" reported in the bug report.


---

Suggested advisory:
========================

Updated OpenFOAM package fixing a missing dynamical linkage to the pthread library.

References:
https://bugs.mageia.org/show_bug.cgi?id=25443
========================

Updated packages in core/updates_testing:
========================
openfoam-7-3.mga7
openfoam-tutorials-7-3.mga7

Source RPMs: 
openfoam-7-3.mga7.src.rpm

Assignee: pkg-bugs => qa-bugs

Comment 4 Herman Viaene 2019-09-20 16:24:44 CEST
MGA7-64 Plassma on Lenovo B50
No installation issues, draws in a lot of development stuff.
At CLI:
$ openfoam 
/usr/share/OpenFOAM-7/etc/config.sh/mpi: regel 46: mpicc: opdracht niet gevonden
 i.e. command not found
installed mpicc but then
$ openfoam 
gcc: fout: unrecognized command line option ‘--showme:link’; did you mean ‘--force-link’?

CC: (none) => herman.viaene

Comment 5 Cyril Levet 2019-09-21 11:07:36 CEST
Created attachment 11289 [details]
Broken links

I have tried openfoam-7-3.mga7. the undefined symbol bug is corrected but, now there is a broken link bug so blockMesh cannot be launched. 

1. Go to tutorials/incompressible/icoFoam/cavity/cavity
2. Try Blockmesh

Broken links in the system directory.
Comment 6 Len Lawrence 2019-09-22 18:33:21 CEST
mga6, x86_64

Ran this update and saw the same errors as reported in comments 4 and 5.

Installed version 6 of openFOAM.
$ openfoam
/usr/share/OpenFOAM-6/etc/config.sh/mpi: line 46: mpicc: command not found

lcl@canopus:run $ cd tutorials/incompressible/icoFoam/cavity/cavity
lcl@canopus:cavity $ blockMesh
blockMesh: symbol lookup error: /usr/lib64/openfoam/libOpenFOAM.so: undefined symbol: pthread_create

Updated to version 7.

$ openfoam
/usr/share/OpenFOAM-7/etc/config.sh/mpi: line 46: mpicc: command not found

Installed mpicc.
lcl@canopus:run $ exit
lcl@canopus:~ $ sudo urpmi mpicc
mpicc-3.2.1-5.mga7.x86_64

lcl@canopus:~ $ openfoam
gcc: error: unrecognized command line option ‘--showme:link’; did you mean ‘--force-link’?
lcl@canopus:run $ cd tutorials/incompressible/icoFoam/cavity/cavity
lcl@canopus:cavity $ blockMesh
bash: blockMesh: command not found
lcl@canopus:cavity $ ls
0/  constant/  system/
lcl@canopus:cavity $ ls system
blockMeshDict  controlDict  fvSchemes  fvSolution

CC: (none) => tarazed25

Comment 7 Len Lawrence 2019-09-22 18:37:19 CEST
Addition to comment 6:
Ran printenv in the run shell and recorded most of the FOAM related values.
Comment 8 Len Lawrence 2019-09-22 18:51:45 CEST
One trial was successful but involved running the blockMesh command with its full path:
lcl@canopus:cavity $ pwd
/home/lcl/OpenFOAM/lcl-7/run/tutorials/incompressible/icoFoam/cavity/cavity
lcl@canopus:cavity $ /usr/libexec/openfoam/blockMesh
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 7
Exec   : /usr/libexec/openfoam/blockMesh
Date   : Sep 22 2019
Time   : 17:45:04
Host   : "canopus"
PID    : 20665
I/O    : uncollated
Case   : /home/lcl/OpenFOAM/lcl-7/run/tutorials/incompressible/icoFoam/cavity/cavity
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Creating block mesh from
    "/home/lcl/OpenFOAM/lcl-7/run/tutorials/incompressible/icoFoam/cavity/cavity/system/blockMeshDict"
Creating block edges
[...]
Writing polyMesh
----------------
Mesh Information
----------------
  boundingBox: (0 0 0) (0.1 0.1 0.01)
  nPoints: 882
  nCells: 400
  nFaces: 1640
  nInternalFaces: 760
----------------
Patches
----------------
  patch 0 (start: 760 size: 20) name: movingWall
  patch 1 (start: 780 size: 60) name: fixedWalls
  patch 2 (start: 840 size: 800) name: frontAndBack

End
Comment 9 Len Lawrence 2019-09-22 20:02:26 CEST
On no, senility strikes again!  Comments 6, 7, 8 refer to testing on a Mageia 7 system, not mga6.
Comment 10 Len Lawrence 2019-09-22 23:12:34 CEST
The point to be derived from comment 8 is that the exec path is not defined for the user.  In the new shell environment the path contains these additions:
/usr/bin:/home/lcl/OpenFOAM/lcl-7/platforms/linux64GccDPInt32Opt/bin
and
/usr/share/ThirdParty-7/platforms/linux64Gcc/gperftools-svn/bin
neither of which appear to be valid.

Comment 5 says there is a broken link somewhere.
Comment 11 Chris Denice 2019-09-24 14:17:09 CEST
Ok, let me try to fix what's fixable then... :-/
Comment 12 Chris Denice 2019-09-24 14:54:05 CEST
Ok, half done

1) There is a missing dep to openmpi-devel, that provides mpicc.
If you install mpicc from the package "mpicc", you'll get errors:

gcc: fout: unrecognized command line option ‘--showme:link’; did you mean ‘--force-link’?

because openfoam is compiled against openmpi and not mpich. I'll fix it.

2) I *cannot* reproduce both the broken link and the missing path to libexec!

Please do:
a) uninstall any openFoam version from your computer

b) delete the directory created when you previously started openfoam, it should be: /home/xxx/OpenFOAM

c) Reinstall openfoam-7-3.mga7 and openfoam-7-3-tutorials.mga7

d) open a new terminal

e) check out what is the script you are using:

which openfoam

should return:
/usr/bin/openfoam

cat /usr/bin/openfoam

should return this content, where the PATH contains libexec:
"
#!/usr/bin/sh
export VERSION=7
export PATH=$PATH:/usr/libexec/openfoam
export FOAM_INST_DIR=/usr/share/OpenFOAM-$VERSION
export PS1="OpenFOAM-$VERSION:\u@\h:\W: "
. /usr/share/OpenFOAM-$VERSION/etc/bashrc

if [ ! -d $FOAM_RUN ]; then
    mkdir -p $FOAM_RUN
    if [ -d $FOAM_TUTORIALS ]; then
        cp -r $FOAM_TUTORIALS $FOAM_RUN
    fi
fi

cd $FOAM_RUN
exec /bin/bash
"

f) run "openfoam" in *that* new terminal

then

cd tutorials/incompressible/icoFoam/cavity/cavity
blockMesh


Let me know the output of this please! Thanks!!

PS: I am able to reproduce some of the errors if I start "openfoam", within an already running openfoam session, which is easily done if one does not pay attention!
Comment 13 Len Lawrence 2019-09-24 16:12:12 CEST
Re comment 12; yes, all the openfoam sessions were started from scratch and finished with "exit".

OK, removed ~/OpenFOAM and the two packages and reinstalled from updates testing.

$ which openfoam
/usr/bin/openfoam
lcl@canopus:~ $ cat /bin/openfoam
#!/usr/bin/sh
export VERSION=7
export PATH=$PATH:/usr/libexec/openfoam
export FOAM_INST_DIR=/usr/share/OpenFOAM-$VERSION
export PS1="OpenFOAM-$VERSION:\u@\h:\W: "
. /usr/share/OpenFOAM-$VERSION/etc/bashrc

if [ ! -d $FOAM_RUN ]; then
    mkdir -p $FOAM_RUN
    if [ -d $FOAM_TUTORIALS ]; then 
        cp -r $FOAM_TUTORIALS $FOAM_RUN
    fi
fi

cd $FOAM_RUN
exec /bin/bash


lcl@canopus:~ $ openfoam
gcc: error: unrecognized command line option ‘--showme:link’; did you mean ‘--force-link’?
lcl@canopus:run $ cd tutorials/incompressible/icoFoam/cavity/cavity
lcl@canopus:cavity $ blockMesh
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
[...]
Patches
----------------
  patch 0 (start: 760 size: 20) name: movingWall
  patch 1 (start: 780 size: 60) name: fixedWalls
  patch 2 (start: 840 size: 800) name: frontAndBack

End

lcl@canopus:cavity $ exit 

So, apart from the gcc: error this looks good.
Comment 14 Len Lawrence 2019-09-24 16:57:06 CEST
Looks like I may have been wrong about the clean start in every case.
Tried openfoam then ran openfoam from the new shell.
lcl@canopus:run $ cd tutorials/incompressible/icoFoam/cavity/cavity
lcl@canopus:cavity $ blockMesh
bash: blockMesh: command not found
lcl@canopus:cavity $ exit
exit
lcl@canopus:run $ cd tutorials/incompressible/icoFoam/cavity/cavity
lcl@canopus:cavity $ blockMesh
/*---------------------------------------------------------------------------*\
  =========                 |

OK from this point.  

Shall try it all again when the missing dependency is fixed.
Thanks.
Comment 15 Chris Denice 2019-09-24 18:26:52 CEST
Cool Len, thanks!

I am pushing a new version to the build server that should fix the errors with mpicc. Please try again from a clean setup using:

openfoam-7-4.mga7
openfoam-tutorials-7-4.mga7

They will be landing in updates_testing, but in a while, openfoam takes ages to compile...
Comment 16 Len Lawrence 2019-09-25 10:25:20 CEST
mga7, x86_64

These packages were installed:

     1/14: lib64nl-nf3_200   
     2/14: lib64nl-cli3_200  
     3/14: lib64opencl-devel 
     4/14: opencl-headers    
     5/14: lib64hwloc-devel  
     6/14: lib64nl-idiag3_200
     7/14: lib64nl-xfrm3_200 
     8/14: lib64nl3-devel    
     9/14: lib64ibverbs-devel
    10/14: lib64rdmacm-devel 
    11/14: lib64torque-devel 
    12/14: openmpi           
    13/14: lib64openmpi-devel
    14/14: openfoam          
      1/1: openfoam-tutorials

$ openfoam
lcl@canopus:run $ ls
tutorials/
lcl@canopus:run $ cd tutorials/incompressible/icoFoam/cavity/cavity
lcl@canopus:cavity $ blockMesh

<blockMesh magic>

lcl@canopus:cavity $

All good.

Whiteboard: (none) => MGA7-64-OK

Comment 17 Chris Denice 2019-09-25 10:26:44 CEST
Great! Thank you!
Comment 18 Len Lawrence 2019-09-26 17:35:10 CEST
Validating; suggested advisory in comment 3.

Keywords: (none) => validated_update
CC: (none) => sysadmin-bugs

Thomas Backlund 2019-09-27 20:53:18 CEST

CC: (none) => tmb
Keywords: (none) => advisory

Comment 19 Mageia Robot 2019-09-27 21:39:23 CEST
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGAA-2019-0143.html

Resolution: (none) => FIXED
Status: NEW => RESOLVED


Note You need to log in before you can comment on or make changes to this bug.