mesh-adaptation / animate

Anisotropic mesh adaptation toolkit for Firedrake
MIT License
5 stars 0 forks source link

Docker build fails #85

Closed ddundo closed 4 months ago

ddundo commented 4 months ago

While investigating test suite failures in https://github.com/pyroteus/goalie/pull/128 , I noticed a few things:

  1. The mfe.py scipt that you sent me in this comment indeed fails on the docker image jwallwork/firedrake-parmmg. However, it works on firedrakeproject/firedrake-vanilla:latest, which is the base image of your image
  2. I tried building the Docker image using the Dockerfile here in animate/docker, but it fails:
              --with-suitesparse-dir=/home/firedrake/petsc/packages did not work
*********************************************************************************************
  File "/home/firedrake/petsc/config/configure.py", line 462, in petsc_configure
    framework.configure(out = sys.stdout)
  File "/home/firedrake/petsc/config/BuildSystem/config/framework.py", line 1449, in configure
    self.processChildren()
  File "/home/firedrake/petsc/config/BuildSystem/config/framework.py", line 1437, in processChildren
    self.serialEvaluation(self.childGraph)
  File "/home/firedrake/petsc/config/BuildSystem/config/framework.py", line 1412, in serialEvaluation
    child.configure()
  File "/home/firedrake/petsc/config/BuildSystem/config/package.py", line 1338, in configure
    self.executeTest(self.configureLibrary)
  File "/home/firedrake/petsc/config/BuildSystem/config/base.py", line 138, in executeTest
    ret = test(*args,**kargs)
  File "/home/firedrake/petsc/config/BuildSystem/config/package.py", line 1021, in configureLibrary
    for location, directory, lib, incl in self.generateGuesses():
  File "/home/firedrake/petsc/config/BuildSystem/config/package.py", line 644, in generateGuesses
    raise RuntimeError('--with-'+self.package+'-dir='+self.argDB['with-'+self.package+'-dir']+' did not work')
  1. I replaced --with-suitesparse-dir=/home/firedrake/petsc/packages in reconfigure-default.py with --download-suitesparse and ./reconfigure-default.py worked. Then I did make all and after that finished make PETSC_DIR=/home/firedrake/petsc PETSC_ARCH=default check to verify the installation. It returned this:
    *******************Error detected during compile or link!*******************
    See https://petsc.org/release/faq/
    /home/firedrake/petsc/src/snes/tutorials ex19
    *********************************************************************************
    /home/firedrake/petsc/packages/bin/mpicc -Wall -Wwrite-strings -Wno-unknown-pragmas -Wno-lto-type-mismatch -Wno-stringop-overflow -fstack-protector -fvisibility=hidden -O3  -I/home/firedrake/petsc/include -I/home/firedrake/petsc/default/include -I/home/firedrake/petsc/packages/include -I/home/firedrake/petsc/default/include/eigen3     -Wl,-export-dynamic ex19.c  -Wl,-rpath,/home/firedrake/petsc/default/lib -L/home/firedrake/petsc/default/lib -Wl,-rpath,/home/firedrake/petsc/packages/lib -L/home/firedrake/petsc/packages/lib -Wl,-rpath,/home/firedrake/petsc/default/lib -L/home/firedrake/petsc/default/lib -Wl,-rpath,/usr/lib/gcc/x86_64-linux-gnu/11 -L/usr/lib/gcc/x86_64-linux-gnu/11 -lpetsc -lHYPRE -lspqr -lumfpack -lklu -lcholmod -lbtf -lccolamd -lcolamd -lcamd -lamd -lsuitesparseconfig -ldmumps -lmumps_common -lpord -lpthread -lscalapack -lpastix -lsuperlu_dist -lml -lfftw3_mpi -lfftw3 -llapack -lblas -lparmmg -lmmg -lmmg3d -lptesmumps -lptscotchparmetisv3 -lptscotch -lptscotcherr -lesmumps -lscotch -lscotcherr -lmetis -lnetcdf -lpnetcdf -lhdf5_hl -lhdf5 -lchaco -ltriangle -ltet -lm -lz -lhwloc -lX11 -lmpifort -lmpi -lgfortran -lm -lgfortran -lm -lgcc_s -lquadmath -lstdc++ -lquadmath -o ex19
    /usr/bin/ld: warning: libspqr.so.4, needed by /home/firedrake/petsc/default/lib/libpetsc.so, may conflict with libspqr.so.2
    /usr/bin/ld: warning: libumfpack.so.6, needed by /home/firedrake/petsc/default/lib/libpetsc.so, may conflict with libumfpack.so.5
    /usr/bin/ld: warning: libklu.so.2, needed by /home/firedrake/petsc/default/lib/libpetsc.so, may conflict with libklu.so.1

After all that, the mfe.py script no longer worked (returned ImportError: /home/firedrake/firedrake/lib/python3.10/site-packages/petsc4py/lib/default/PETSc.cpython-310-x86_64-linux-gnu.so: undefined symbol: TaoMonitorCancel).

And here I got stuck. Could you please take over @jwallwork23? In summary, it looks like rebuilding PETSc is the big culprit here.

ddundo commented 4 months ago

I tried changing the entire reconfigure-default.py to be the same as the one I have on my local install (which I installed using the install script here in animate/install a month ago). It basically has all configure options like this

configure_options = [
    '--download-bison',
    '--download-chaco',
    '--download-cmake',
    ...

instead of '--with-bison', '--with-chaco-dir=/home/firedrake/petsc/packages', etc., as in the current one. It reconfigured and installed everything it seems, and took quite a while (like a fresh petsc install does). The make PETSC_DIR=/home/firedrake/petsc PETSC_ARCH=default check then returned fewer errors, and all with ex19 (but nothing in red font like the above errors, which I guess is worse :) ). But again got the same import error when trying mfe.py from Joe.

jwallwork23 commented 4 months ago

Thanks for looking into this @ddundo.

If possible, I'd like to avoid downloading packages all over again - it would slow things down significantly. (When I rebuild the Docker image locally it only takes 10 minutes with the current approach.)

jwallwork23 commented 4 months ago

Closing as duplicate of #79.