Closed dohyun-cse closed 7 months ago
I also have the same problem as above. I have tried running both commands:
pip install mfem pip install mfem --no-binary mfem
I can not reproduce this error on my Mac. My operating system is older (Monterey), but I am suspecting this may relating to the version of setuptools, since in my environment, it does not call chrpath. I used python -m pip install ./
Okay, I did some digging into setup.py
.
chrpath
is only run if do_bdist_wheel==True
do_bdist_wheel==True
only if configure_bdist()
is runconfigure_bidst()
is only run if haveWheel==True
haveWheel==True
only if from wheel.bdist_wheel import bdist_wheel
on line 38
has no import error.Thus, if wheel
is installed and has bdist_wheel
, setup.py
will try to build a wheel, and will fail if chrpath
is not installed.
Looking at the CI scripts:
testrelease_binary.yml
wheel
is installed but chrpath
is also installed on line 73
via yum
.test_with_MFEM_*.yml
, the installation for wheel
is commented out.@dohyun-cse and @andy9t7 can you try adding the flag haveWheel=False
in setup.py
after line 41
where it is set? I am guessing you are running into this error but @sshiraiwa is not because you already have wheel
installed. This needs to be fixed and made more robust, but I don't believe building the wheel is necessary, so the easiest hot-fix for now is to just set the flag to False
.
I think we should start moving towards libraries like scikit-build to help simplify some of the build logic.
Thank you @justinlaughlin for digging into this. I commented out the if statement and just set haveWheel=False
, and tried to run
python setup.py install
In a fresh virtual environment with packages in requirements.txt
, the above command installed mfem
without any issues and examples run seamlessly. After installing mpi4py
, I also succeeded to install its parallel version.
I just downloaded
PyMFEM
master branch and tried to install withpython setup.py install
. But it failed withchrpath command not found
.python -m pip install mfem
also fails witherror: [Errno 2] No such file or directory: 'chrpath'
.I searched for
chrpath
package in mac, but it seems that it only supports Linux. An equivalent command can bewhere
patchelf
can be installed withbrew install patchelf
.This patch works fine for both serial and parallel version when
python setup.py install
is used. But it still fails withpip install .
(patchelf: not an ELF executable
)...I'm not that familiar with python wrappers, so I'm not sure whether I'm on a right path or not. Please let me know if I'm doing something wrong.
Also, I noticed that many examples are broken in the master branch, e.g.,
ex18p.py
hangs atDenseMatrix::[][]
and uses<< flush
which should be changed tosout.flush()
.ex5p.py
usesMPI.Barrier()
which should be changed toMPI.COMM_WORLD.Barrier()
Is this because I'm using MacOS, or the examples are not tested before merging?
My device setting is
M1 Mac (14.2.1 (23C71)) Python 3.9.6 Swig 4.2.1 PyMFEM branch: master