firedrakeproject / firedrake

Firedrake is an automated system for the portable solution of partial differential equations using the finite element method (FEM)
https://firedrakeproject.org
Other
498 stars 157 forks source link

Install fails on macOS (PETSc related issue) #1412

Closed nicole-spillane closed 5 years ago

nicole-spillane commented 5 years ago

firedrake-install.log

Hi, I am trying to install Firedrake on my macbook (OS is Mojave 10.14.4) with the help of Loïc @gouarin . I have attached the log file. The error may be related to an incompatibility between the versions of PETSc and PETSc4py: " In file included from src/PETSc.c:4: src/petsc4py.PETSc.c:3193:70: error: unknown type name 'PCPatchConstructType' static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PCPatchConstructType(PCPatchConstructType value); "

Could you please help us out ?

Best regards, Nicole.

wence- commented 5 years ago

Dear Nicole,

normally firedrake-install arranges an installation of PETSc and petsc4py with compatible versions.

We did this here, but it looks like your anaconda environment has a PETSc as well that is providing a header file that is mismatching.

The relevant compile command is:

mpicc -Wall -Wwrite-strings -Wno-strict-aliasing -Wno-unknown-pragmas -Qunused-arguments -g -O3 -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Users/Nicole/miniconda3/include -arch x86_64 -I/Users/Nicole/miniconda3/include -arch x86_64 -DPETSC_DIR=/Users/Nicole/Research/190404Firedrake.d/firedrake/lib/python3.6/site-packages/petsc -I/opt/X11/include -I/Users/Nicole/Research/190404Firedrake.d/firedrake/lib/python3.6/site-packages/petsc/include/eigen3 -I/Users/Nicole/Research/190404Firedrake.d/firedrake/lib/python3.6/site-packages/petsc/include -Isrc/include -I/Users/Nicole/Research/190404Firedrake.d/firedrake/lib/python3.6/site-packages/numpy/core/include -I/Users/Nicole/Research/190404Firedrake.d/firedrake/include -I/Users/Nicole/miniconda3/include/python3.6m -c src/PETSc.c -o build/temp.macosx-10.7-x86_64-3.6/src/PETSc.o

I think this part is the problem -I/Users/Nicole/miniconda3/include

If I see some of the errors it's something like:

  src/petsc4py.PETSc.c:256896:230: error: too few arguments to function call, expected 11, have 10
    __pyx_t_1 = __pyx_f_8petsc4py_5PETSc_CHKERR(DMPlexCreateSection(__pyx_v_self->__pyx_base.dm, NULL, __pyx_v_icomp, __pyx_v_idof, __pyx_v_nbc, __pyx_v_bcfield, __pyx_v_bccomps, __pyx_v_bcpoints, __pyx_v_cperm, (&__pyx_v_sec->sec))); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(45, 557, __pyx_L1_error)
                                                ~~~~~~~~~~~~~~~~~~~                                                                                                                                                                    ^
  /Users/Nicole/miniconda3/include/petscdmplex.h:259:1: note: 'DMPlexCreateSection' declared here

The problem here is that the include file: /Users/Nicole/miniconda3/include/petscdmplex.h is "wrong" for the PETSc we installed (which should be -I/Users/Nicole/Research/190404Firedrake.d/firedrake/lib/python3.6/site-packages/petsc/include).

I'm not up to speed on how conda provides PETSc builds, but perhaps you can make a conda environment which doesn't have PETSc?

gouarin commented 5 years ago

Thanks @wence-. I didn't read carefully the log file ;).

Is it possible to restart the installation of firedrake without reinstall everything?

Did you try to make a conda package for firedrake? It would improve the installation process a lot!

I can help.

nicole-spillane commented 5 years ago

Thanks Lawrence for a quick and efficient reply, I now get: "Successfully installed Firedrake." !

conda remove petsc petsc4py before running firedrake-install did the trick.

Nicole.

wence- commented 5 years ago

Thanks @wence-. I didn't read carefully the log file ;).

Is it possible to restart the installation of firedrake without reinstall everything?

Sadly no, because we don't know what state you were in when it failed.

Did you try to make a conda package for firedrake? It would improve the installation process a lot!

We haven't done this for a variety of reasons. Primarily, my experience is that too many different installation routes add an excessive load on the development and testing. Right now, all of the developers use the firedrake-install approach, so if there are breakages, we notice them. Because we might not necessarily have conda (or do not want to require it on, e.g., supercomputers) offering conda packages means that I need to maintain two build/install mechanisms.

I can help.

If it is very low-effort, perhaps it is worthwhile. Our virtualenv installation approach is reasonably robust to other packages getting in the way because it is self-contained. How does conda play, for example, with multiple conflicting versions of the same package?

gouarin commented 5 years ago

conda is actually not made for use on supercomputers. The advantage is to be able to quickly install firedrake to test it for users who haven't good knowledge in the installation process. Petsc, petsc4py, slepc, slepc4py and mpi4py are already available on conda-forge for the installation of fenics. I have to check if all the packages installed during the petsc build are available. I'm not sure about that but we can add them easily.

You can create a conda environment which makes the same thing that a virtalenv. During the build of the conda recipe, you can fix the version dependencies of each package needed for firedrake. Thus, you are sure that your installation will work on linux, macos and windows.

dham commented 5 years ago

Firedrake has very particular PETSc configure requirements, so the existing package probably won’t cut it. We’re quite close to having usable Docker containers for Firedrake, which get built by running our existing install script. I think that is probably a better way to achieve a quick install for test users (and as an alternative for users whose environment doesn’t support Firedrake).

Regards,

David

-- Dr David Ham Department of Mathematics Imperial College London https://www.imperial.ac.uk/people/david.ham

From: Loic Gouarin notifications@github.com Reply-To: firedrakeproject/firedrake reply@reply.github.com Date: Tuesday, 16 April 2019 at 09:07 To: firedrakeproject/firedrake firedrake@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [firedrakeproject/firedrake] Install fails on macOS (PETSc related issue) (#1412)

conda is actually not made for use on supercomputers. The advantage is to be able to quickly install firedrake to test it for users who haven't good knowledge in the installation process. Petsc, petsc4py, slepc, slepc4py and mpi4py are already available on conda-forge for the installation of fenics. I have to check if all the packages installed during the petsc build are available. I'm not sure about that but we can add them easily.

You can create a conda environment which makes the same thing that a virtalenv. During the build of the conda recipe, you can fix the version dependencies of each package needed for firedrake. Thus, you are sure that your installation will work on linux, macos and windows.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/firedrakeproject/firedrake/issues/1412#issuecomment-483556476, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AAzw54ywMURI4r6heexrhGkp6necmEmzks5vhYTZgaJpZM4csVRp.

gouarin commented 5 years ago

I propose to make a POC on my conda channel. This way, you could judge the work required to have a conda package and if it's interesting to maintain it.

wence- commented 5 years ago

Dear @gouarin, cool, that sounds useful. I'll close this issue for now, but give us a ping if you have any issues and/or questions.