OSError: libGLU.so.1:

Hi, I have followed the instructions for fenics on Docker. But when I was trying to run my host python code, it came up with the following error:

OSError Traceback (most recent call last)
in
2 from efit import efit
3 import matplotlib.pyplot as plt
----> 4 from mesh.plasmah_mesh_with_down_divertor import *
5 from plasmah.poisson import *
6 import os

~/shared/Documents/tokamak_python_codes/mesh/plasmah_mesh_with_down_divertor.py in
----> 1 import gmsh
2 import sys
3
4 class PlasamHMesh:
5 def init(self, efit):

~/.local/lib/python3.6/site-packages/gmsh-4.8.4-Linux64-sdk/lib/gmsh.py in
38 libpath = find_library(“gmsh”)
39
—> 40 lib = CDLL(libpath)
41
42 use_numpy = False

/usr/lib/python3.6/ctypes/init.py in init(self, name, mode, handle, use_errno, use_last_error)
346
347 if handle is None:
→ 348 self._handle = _dlopen(self._name, mode)
349 else:
350 self._handle = handle

OSError: libGLU.so.1: cannot open shared object file: No such file or directory

Is there anyone who can help me with this problem? Thank you in advance. :slight_smile:

Gmsh requires some Extra packages you can install in your container.

    apt-get -y install \
    libglu1 \
    libxcursor-dev \
    libxft2 \
    libxinerama1 \
    libfltk1.3-dev \ 
    libfreetype6-dev  \
    libgl1-mesa-dev \
    libocct-foundation-dev \
    libocct-data-exchange-dev 

You might need to add a sudo ahead of apt-get

thank you! But it seems some other errors:

root@ad1a7e795d62:~# apt-get -y install libglu1 libxcursor-dev libxft2 libxinerama1 libfltk1.3-dev libfreetype6-dev libgl1-mesa-dev libocct-foundation-dev libocct-data-exchange-dev
Reading package lists… Done
Building dependency tree
Reading state information… Done
Note, selecting ‘libglu1-mesa’ instead of ‘libglu1’
E: Unable to locate package libocct-foundation-dev
E: Unable to locate package libocct-data-exchange-dev

Anyway, thank you again

You do not need libocct-foundation-dev libocct-data-exchange-dev and can just skip them.

thank you. This error is solved. But another error comes up:

Error : Can’t open display: (FLTK internal error)

That is because you are trying to launch the Gmsh gui inside a docker container. To Get this to work, you Need to configure your docker container. See for instance: Running a graphical app in a Docker container, on a remote server | Yet another enthusiast blog!
Please note that the errors you are referring to is due to how you use plasmah_mesh_with_…py which is not a FEniCS script. I would suggest you to modify this script to be used in a docker container (I.e. do not try to launch gmsh). But use other plotting tools to visualize the mesh inside the notebook once loaded into dolfin.

1 Like