pymoab install doesn't work on Arch

Issue #167 resolved
Luke Labrie-Cleary created an issue

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)

  1. Vijay M

    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

  2. Vijay M

    @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 a Range& or a std::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?

  3. Paul Wilson

    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?

  4. Vijay M

    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.

  5. Luke Labrie-Cleary reporter

    So I found that by ignoring the as_listcase, it would compile, i.e. replacing

    if 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.

  6. Vijay M

    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.

  7. Vijay M

    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.

  8. Log in to comment