Closed davidcasasnovas closed 1 month ago
Make sure to following the instructions at https://multiphenics.github.io/installing.html , concerning in particular Installation against DOLFINx development version
vs Installation against DOLFINx releases
.
My suspicion is that you are either installing the development of version of multiphenicsx against a dolfinx release, or that you did install everything correctly but are running the tutorials of the other verison.
Thank you Francesco. I've followed the instructons for Installation against DOLFINx releases, but it seems to install dev version. I've the following commands for installation:
cd multiphenicsx DOLFINX_VERSION=$(python3 -c 'import dolfinx; print(dolfinx.version)') git checkout dolfinx-v${DOLFINX_VERSION} if [ -f setup.cfg ]; then python3 -m pip install '.[tutorials]' else python3 -m pip install --check-build-dependencies --no-build-isolation '.[tutorials]' fi
I've also attached the installation's output (log file). Thanks in advance log_install.log
Can you tell me which version of nanobind you have installed, and how you did install it? Or even better, prepare a dockerfile that shows how you installed fenicsx with miniforge?
Please make sure to use "```" when posting the code, otherwise it may be difficult to read or format wrongly.
A simple attempt could be to change
restriction_V = multiphenicsx.fem.DofMapRestriction(V.dofmap, dofs_V)
in
restriction_V = multiphenicsx.fem.DofMapRestriction(V.dofmap, dofs_V).tolist()
to force the output type to be a list, since there seems to be a mismatch between the last type (list vs array). I'd be very surprised if that is the issue, considering that it doesn't show up on our CI.
I think it's much more likely that the issue is that somehow you upgraded nanobind. For it to work properly you must have the same nanobind as it was used to build dolfinx on miniforge3. This typically means that if for whatever reason you pip installed a nanobind you'll probably need to uninstall that.
EDIT: the same goes for the compiler. If dolfinx was built on conda with a gcc version and suddenly some other package that you have on your miniforge env force an upgrade of gcc that will typically break nanobind wrapped objects.
You may also want to track answers to https://fenicsproject.discourse.group/t/typeerror-init-incompatible-function-arguments/15889 , because it seems like a question with roughly the same issue,, with both questions being asked suspiciously close in time.
Hi Francesco,
many thanks for your replies, it's solved the problem. I've done the following:
conda install -c conda-forge fenics-dolfinx mpich pyvista
mamba upgrade gxx=13 fenics-dolfinx
conda install nanobind=1.9.2
conda install scikit-build-core[pyproject]
And now all works! Many thanks
Great! The incompatibility with gxx=13
with be fixed soon in conda. Marking this as fixed.
When I execute the tutorial, rise the following error (installation with dolfinx 0.8):
TypeError Traceback (most recent call last) Cell In[13], line 4 2 dofs_V = np.arange(0, V.dofmap.index_map.size_local + V.dofmap.index_map.num_ghosts) 3 dofs_M_Gamma = dolfinx.fem.locate_dofs_topological(M, boundaries.dim, facets_Gamma) ----> 4 restriction_V = multiphenicsx.fem.DofMapRestriction(V.dofmap, dofs_V) 5 restriction_M_Gamma = multiphenicsx.fem.DofMapRestriction(M.dofmap, dofs_M_Gamma) 6 restriction = [restriction_V, restriction_M_Gamma]
File ~/miniforge3/envs/fenicsx-env/lib/python3.12/site-packages/multiphenicsx/fem/dofmap_restriction.py:31, in DofMapRestriction.init(self, dofmap, restriction) 29 except AttributeError: # pragma: no cover 30 _dofmap = dofmap ---> 31 super().init(_dofmap, restriction)
TypeError: init(): incompatible function arguments. The following argument types are supported:
Invoked with types: multiphenicsx.fem.dofmap_restriction.DofMapRestriction, dolfinx.cpp.fem.DofMap, ndarray