pymoab install doesn't work on Arch
On Archlinux (docker image below), compiling from source with
git clone https://bitbucket.org/fathomteam/moab/src/master/
cd master
mkdir build && cd build
cmake .. -DENABLE_HDF5=ON \
-DENABLE_NETCDF=ON \
-DENABLE_PYMOAB=ON \
-DENABLE_FORTRAN=OFF \
-DBUILD_SHARED_LIBS=ON \
-DENABLE_BLASLAPACK=OFF \
-DCMAKE_INSTALL_PREFIX=/opt/moab
make
gives the following error:
Error compiling Cython file:
------------------------------------------------------------
...
tag_size = self.get_length()
dtype = self.get_dtype()
cdef np.ndarray arr = np.empty((tag_size,), dtype = dtype)
cdef const void* data_ptr = self.inst.get_default_value()
arr.data = <char *> data_ptr
^
------------------------------------------------------------
pymoab/tag.pyx:61:11: Assignment to a read-only property
Reproducible via the attached dockerfile
Comments (8)
-
-
@Patrick Shriwise @gonuke I don’t understand the failures after the new Cython upgrade to 3.0. I started a branch at vijaysm/fix-pymoab that has some fixes but I am now stuck with Cython not understanding overloaded methods like
get_entities_by_dimension
etc that take either aRange&
or astd::vector<EntityHandle>&
as arguments. Clearly, the translate object to reference is confusing Cython but I don't see anything specific in release notes for the newer version that indicate the problem. Thoughts? -
We’ve noticed this and my quick fix has been to limit the cython version to <3, until I have time to figure out what is going on.
@Patrick Shriwise and I have been talking for a while on reviewing/revising the PyMOAB build/install process and maybe this can part of it?
-
Ok, I might have to push that constraint near term. Nevertheless, I am perplexed by the build error with Cython 3 (if you use the branch above) due to overloaded function arguments. If you have any pointers there, would help fix this issue cleanly and more permanently.
Definitely open to revisiting the build/installation process as well.
-
reporter So I found that by ignoring the
as_list
case, it would compile, i.e. replacingif as_list: err = self.inst.get_entities_by_type(<unsigned long> meshset, typ, hvec, recur) check_error(err, exceptions) return hvec else: err = self.inst.get_entities_by_type(<unsigned long> meshset, typ, deref(entities.inst), recur) check_error(err, exceptions) return entities
with
err = self.inst.get_entities_by_type(<unsigned long> meshset, typ, deref(entities.inst), recur) check_error(err, exceptions) return entities
where applicable. So I suspect there is some type mismatch with the hvec argument. Haven’t had time to look into it further yet.
-
Thanks Luke. That was basically where I stopped as well. But I didn’t want to comment out the
as_list
branch as this might break existing downstream code. Unfortunately, without understanding why it fails to recognize the overloaded method in Cython3, we may be stuck with downgrading the version for now. -
Luke, can you try MOAB master now? Patrick and I worked on some fixes and they have been merged now. It will show up in the next minor release but would like to confirm if it resolves your build issues on arch.
-
- changed status to resolved
MOAB 5.5.1 addressed issues related to Cython 3.0 upgrade
- Log in to comment
Luke, thank you for raising this issue. I just noticed this failure myself on Ubuntu. We will push a fix in a few days.
@Patrick Shriwise