ElmerICE can't find ElmerIceUSF.so and ElmerIceUtils.so

Discussion about building and installing Elmer
Post Reply
rlaw
Posts: 9
Joined: 11 May 2021, 13:33
Antispam: Yes

ElmerICE can't find ElmerIceUSF.so and ElmerIceUtils.so

Post by rlaw »

Hi Elmer community,

I'm working a new cluster and am trying to get my scripts from a couple of years ago to run.

I have successfully installed ElmerIce and can run for example elmerice/Tests/Glen_2D with no problems.

However, I am having issues using user functions for my own scripts, and for example elmerice/Tests/Friction_Coulomb . From the Friction_Coulomb directory, running ElmerSolver ismip_coulomb.sif produces the following error:

Code: Select all

Real Procedure "ElmerIceUSF" "Friction_Coulomb"
Loading user function library: [ElmerIceUSF]...[Friction_Coulomb]
ElmerIceUSF: cannot open shared object file: No such file or directory
ElmerIceUSF.so: cannot open shared object file: No such file or directory
./ElmerIceUSF: cannot open shared object file: No such file or directory
./ElmerIceUSF.so: cannot open shared object file: No such file or directory
/home/rlaw/elmerice_idir/share/elmersolver/lib/ElmerIceUSF: cannot open shared object file: No such file or directory
ElmerIceUtils.so: cannot open shared object file: No such file or directory
These files *are* contained in /home/rlaw/elmerice_idir/share/elmersolver/lib/ and it seems like it is finding ElmerIceUSF.so before moving onto ElmerIceUtils.so .

I imagine there is a path variable I need to change to direct Elmer to search this directory, but I am not sure which path this should be!

Note that I had to change the install directory ('IDIR') in the configure file to my user area as I don't have sudo rights on this machine. This led to the problem outlined here viewtopic.php?t=3767 , which the same post helped me to fix by setting $ELMER_SOLVER_HOME to /home/rlaw/elmerice_idir/share/elmersolver . Possibly something related to this?

I have also already added /home/rlaw/elmerice_idir/share/elmersolver/lib to my PATH variable which does not fix the issue.

Thank you for any pointers!!!

Best,
Rob
kevinarden
Posts: 2313
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: ElmerICE can't find ElmerIceUSF.so and ElmerIceUtils.so

Post by kevinarden »

There is ELMER_HOME, ELMERGUI_HOME, and ELMER_LIB variables;

ELMER_HOME = where ever that is
ELMERGUI_HOME = %ELMER_HOME%\share\ElmerGUI
ELMER_LIB = %ELMER_HOME%\share\elmersolver\lib
PATH = %PATH%;%ELMER_HOME%\bin;%ELMER_HOME%\lib
rlaw
Posts: 9
Joined: 11 May 2021, 13:33
Antispam: Yes

Re: ElmerICE can't find ElmerIceUSF.so and ElmerIceUtils.so

Post by rlaw »

Hi Kevin,

Thanks for the reply.

I tried setting these variables and get the same error.

To rule out other errors I also completely removed and re-downloaded the elmer/ice source code from the git repository.

The configure script is as follows: '

Code: Select all

#!/bin/bash
#to ensure a full new out of tree build first remove the existing install directory

CMAKE=cmake

#installation directory (set these!)
ELMER_REV="elmerice_idir" #${TIMESTAMP}"
ELMERSRC="/home/rlaw/elmer/elmerfem"
#ELMERSRC="/home/rl491/elmerice_Glacio"
BUILDDIR="$ELMERSRC/elmerice"
IDIR="/home/rlaw/$ELMER_REV"

#update LD_LIBRARY_PATH
ISSM_DIR="/home/rlaw/svn/issm/trunk"
export LD_LIBRARY_PATH="$ISSM_DIR/externalpackages/petsc/install:$LD_LIBRARY_PATH"

echo "Building Elmer from within " ${BUILDDIR}
echo "installation into " ${IDIR}
cd ${BUILDDIR}
pwd
ls -ltr

echo $CMAKE $ELMERSRC

$CMAKE $ELMERSRC \
    -DCMAKE_INSTALL_PREFIX=$IDIR \
    -DCMAKE_C_COMPILER=/usr/bin/gcc \
    -DCMAKE_Fortran_COMPILER=/usr/bin/gfortran \
    -DWITH_MPI:BOOL=TRUE \
    -DWITH_Mumps:BOOL=TRUE \
    -DWITH_Hypre:BOOL=TRUE \
    -DWITH_Trilinos:BOOL=FALSE \
    -DWITH_ELMERGUI:BOOL=FALSE \
    -DWITH_ElmerIce:BOOL=TRUE \
    -DHypre_INCLUDE_DIR="/usr/include/hypre/" \
    -DNetCDF_INCLUDE_DIR="/usr/include" \
    -DNetCDF_LIBRARY="/usr/lib/x86_64-linux-gnu/libnetcdf.so" \
    -DNetCDFF_LIBRARY="/usr/lib/x86_64-linux-gnu/libnetcdff.so" 
#    -DBLAS_LIBRARIES="/usr/lib/x86_64-linux-gnu" 
#    -DLAPACK_LIBRARIES="/usr/lib/x86_64-linux-gnu" 
#    -DMUMPS_LIBRARIES="/usr/lib/x86_64-linux-gnu"

echo "cmake configured"


and I then run

Code: Select all

make -j8
and

Code: Select all

make install
from the ELMERSRC directory ("/home/rlaw/elmer/elmerfem").

At this stage I can confirm that examples/Test_Glen_2D/ works but Tests/Friction_Weertman/ does not.

I source the script:

Code: Select all

#!/bin/bash
#set elmer environment variables

export ELMER_HOME="/home/rlaw/elmerice_idir"
export ELMER_LIB="$ELMER_HOME/share/elmersolver/lib"
export ELMER_SOLVER_HOME="$ELMER_HOME/share/elmersolver"
export PATH="$ELMER_HOME/lib:$PATH"
export PATH="$ELMER_HOME/lbin:$PATH"
and then get the same errors :(

It still looks like it *is* finding ElmerIceUSF.so within "/home/rlaw/elmerice_idir/share/elmersolver/lib/" but then is unable to find ElmerIceUtils.so within the same directory.

Next I can try to run the script without specifying an install directory using sudo, but I don't think that will be a long-term solution.

Thanks again,
Rob
kevinarden
Posts: 2313
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: ElmerICE can't find ElmerIceUSF.so and ElmerIceUtils.so

Post by kevinarden »

after reinstall/compile did you verify ElmerIceUtils.so exists?
rlaw
Posts: 9
Joined: 11 May 2021, 13:33
Antispam: Yes

Re: ElmerICE can't find ElmerIceUSF.so and ElmerIceUtils.so

Post by rlaw »

Hi Kevin,

Yes, confirmed that ElmerIceUtils.so exists. Below are the entire contents of that directory.

Code: Select all

rlaw@patagonia:~/elmerice_idir/share/elmersolver/lib$ ls
Acoustics.so                  ModelPDE.so
AdvectionDiffusion.so         NodeToEdgeSolver.so
AdvectionReaction.so          NonphysicalMeshSolve.so
AllocateSolver.so             NormalSolver.so
ArteryOutlet.so               OdeSolver.so
ArtificialCompressibility.so  OpenFoam2ElmerIO.so
BatterySolver.so              ParStokes.so
BeamSolver3D.so               ParallelRemesh.so
CahnHillard.so                ParticleAdvector.so
CahnHilliard.so               ParticleDynamics.so
CircuitsAndDynamics.so        PartitionMesh.so
CoilSolver.so                 PhaseChangeSolve.so
CompressibleNS.so             Poisson.so
CoordinateTransform.so        PoissonBEM.so
CoupledNSUpdate.so            PoissonBoltzmannSolve.so
CraigBamptonSolver.so         PoissonDG.so
CyclicConvergence.so          PressurePrecond.so
DCRComplexSolve.so            PressureUpdate.so
DFTSolver.so                  ProjectToPlane.so
DataToFieldSolver.so          RateOfChange.so
DirectionSolver.so            ReloadData.so
DistanceSolve.so              ReloadInput.so
DistributeSource.so           ResultOutputSolve.so
DivProjection.so              ReynoldsSolver.so
DivergenceSolver.so           RichardsSolver.so
EMWaveSolver.so               RigidBodyReduction.so
ElasticSolve.so               RigidMeshMapper.so
ElectricForce.so              SOLVER.KEYWORDS
Electrokinetics.so            SSTKomega.so
ElementSizeSolver.so          SaveData.so
ElementStats.so               SaveGridData.so
EliminateDirichlet.so         SaveMesh.so
EliminatePeriodic.so          ScalarPotentialSolver.so
Elmer2OpenFoamIO.so           ScannedFieldSolver.so
ElmerIceSolvers.so            ShallowWaterNS.so
ElmerIceUSF.so                ShearrateSolver.so
ElmerIceUtils.so              ShellSolver.so
EnergyRelease.so              SimpleCircuits.so
FDiffusion.so                 Smitc.so
FDiffusion3D.so               Spalart-Allmaras.so
FacetShellSolve.so            SpringAssembly.so
FilmFlowSolver.so             StatCurrentSolve.so
FilterTimeSeries.so           StatCurrentSolveVec.so
FindOptimum.so                StatElecBoundary.so
FixTangentVelo.so             StatElecSolve.so
FlowSolve.so                  StatElecSolveVec.so
FluidicForce.so               StatMagSolve.so
FluxSolver.so                 SteadyPhaseChange.so
FourierLoss.so                Stokes.so
FreeSurfaceReduced.so         StreamSolver.so
FreeSurfaceSolver.so          StressSolve.so
GmshOutputReader.so           StructuredFlowLine.so
HarmonicSignals.so            StructuredMeshMapper.so
HeatSolve.so                  StructuredProjectToPlane.so
HeatSolveVec.so               ThermoElectricSolver.so
HelmholtzBEM.so               TransientCost.so
HelmholtzProjection.so        TransientPhaseChange.so
HelmholtzSolve.so             TransportEquation.so
IncompressibleNSVec.so        UMATLib.so
Isosurface.so                 V2FSolver.so
KESolver.so                   VectorHelmholtz.so
Komega.so                     VectorHelmholtzLumping.so
LevelSet.so                   VectorHelmholtzNodal.so
MagneticSolve.so              VelocityPrecond.so
MagnetoDynamics.so            ViscousCompressibility.so
MagnetoDynamics2D.so          VorticitySolver.so
MarchingODESolver.so          WPotentialSolver.so
Mesh2MeshSolver.so            WVectorFix.so
MeshChecksum.so               WaveSolver.so
MeshSolve.so                  elements.def
ModelMixedPoisson.so          permafrostmaterialdb.dat
Any other info required just let me know, puzzled by this one!

Thanks,
Rob
kevinarden
Posts: 2313
Joined: 25 Jan 2019, 01:28
Antispam: Yes

Re: ElmerICE can't find ElmerIceUSF.so and ElmerIceUtils.so

Post by kevinarden »

I would try
export PATH="$ELMER_HOME:$PATH"
export PATH="$ELMER_LIB:$PATH"
after setting the values
rlaw
Posts: 9
Joined: 11 May 2021, 13:33
Antispam: Yes

Re: ElmerICE can't find ElmerIceUSF.so and ElmerIceUtils.so

Post by rlaw »

Hi Kevin,

Thanks for the continued suggestions, but I'm afraid I tried that previously (and again, just now) but to no avail.

I also can't find any particularly useful information from the outputs of grep -rI "ElmerIceUtils" from the ELMER_HOME directory.

for example, in elmerice/UserFunctions/CMakeLists.txt there is

Code: Select all

TARGET_LINK_LIBRARIES(ElmerIceUSF elmersolver ElmerIceUtils)
INSTALL(TARGETS ElmerIceUSF LIBRARY DESTINATION "share/elmersolver/lib"
            RUNTIME DESTINATION "share/elmersolver/lib")
suggesting it all is installed and then goes to the same (and correct) runtime destination.

Looking at the outputs of "make" and "make install" commands. After make ElmerIceUtils is built no problem:

Code: Select all

grep -rI "ElmerIceUtils" 
after make install:

Code: Select all

-- Installing: /home/rlaw/elmerice_idir/share/elmersolver/lib/ElmerIceUtils.so
-- Set runtime path of "/home/rlaw/elmerice_idir/share/elmersolver/lib/ElmerIceUtils.so" to "$ORIGIN/../lib/elmersolver:/home/rlaw/elmerice_idir/share/elmersolver/lib/"


which does have a minor distinction than the runtime path of ElmerIceUSF.so :

Code: Select all

-- Installing: /home/rlaw/elmerice_idir/share/elmersolver/lib/ElmerIceUSF.so
-- Set runtime path of "/home/rlaw/elmerice_idir/share/elmersolver/lib/ElmerIceUSF.so" to "$ORIGIN/../lib/elmersolver"
but to me this seems like iẗ́'s merely adding a further directory to look in for ElmerIceUtils.so .

Anyway, I'm off on holiday for a week, I'll leave this here for now, and try a fresh install into the default usr/ directory when I get back to see if that sorts it out. Thanks!
rlaw
Posts: 9
Joined: 11 May 2021, 13:33
Antispam: Yes

Re: ElmerICE can't find ElmerIceUSF.so and ElmerIceUtils.so

Post by rlaw »

Came back with a new set of eyes and found the flag that worked, setting:

Code: Select all

export ELMER_HOME="/home/rlaw/elmerice_install"
export PATH="$PATH:$ELMER_HOME/bin"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ELMER_HOME/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ELMER_HOME/lib/elmersolver"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$ELMER_HOME/share/elmersolver/lib"
did the trick for me.

Thanks!
Post Reply