PyMFEM icon indicating copy to clipboard operation
PyMFEM copied to clipboard

Difficulty installing parallel PyMFEM on linux

Open Topher37 opened this issue 1 year ago • 4 comments

I'm trying to install the parallel version of PyMFEM on a system running rhel 9.4 using a conda environment.

I tried using "python setup.py install --with-parallel --user." In a different conda environment, tried downgrading pip to 22.3 (so --install-option would work) and using the 'python -m pip install ./ --install-option="--with-parallel" --install-option="--mfem-branch=master" ' command that's in the PyMFEM README.md.

In both installation attempts, the serial version installed and seems to run successfully, but the parallel version errors out when I try to import it.

Error message for pip command:

import mfem.par as mfem Traceback (most recent call last): File "", line 1, in File "/fslhome/topher37/miniconda3/envs/pipmfemtest1/lib/python3.11/site-packages/mfem/par.py", line 11, in from mfem._par.cpointers import * ModuleNotFoundError: No module named 'mfem._par.cpointers'

Error message for setup.py install:

import mfem.par as mfem Traceback (most recent call last): File "", line 1, in File "/home/topher37/.local/lib/python3.9/site-packages/mfem/par.py", line 11, in from mfem._par.cpointers import * ModuleNotFoundError: No module named 'mfem._par.cpointers'

The install logs for both installations are attached.

installdoc_pip.txt installdoc_setup_py.txt

Thanks for your help.

Topher37 avatar Nov 22 '24 21:11 Topher37

@Topher37 Hi, I'm having the same problem. Did you ever find a solution?

t0masGutierrez avatar Nov 17 '25 19:11 t0masGutierrez

@t0masGutierrez This error happens when wrapper code was not properly built. Also install procedure was modernized in order to work with newer setupstools. To diagnose the error, can you do something like

pip install . --verbose &> install_log.txt

and inspect install_log.txt? If you upload the file here, I maybe able to tell what is going on.

sshiraiwa avatar Nov 18 '25 04:11 sshiraiwa

Thanks. I don't use conda environment and can not tell how it happens. But, according to the error log, it seems that MPI compiler is broken or missing. With -C"with-parallel=Yes", it build METIS, HYPRE, and MFEM with source. It succeeded to build METIS (which doesn't use MPI), then it stopped when building HYPRE. The error indicates MPI C compiler is not found.

Here is a section from your log.

 CMake Error at /private/var/folders/_s/h2d9wsxs4fx7txb0ft1pq67c0000gn/T/pip-build-env-f8w_jehc/overlay/lib/python3.13/site-packages/cmake/data/share/cmake-4.1/Modules/CMakeTestCCompiler.cmake:67 (message):
    The C compiler

      "/opt/miniconda3/envs/tomas/bin/mpicc"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: '/Users/tgut03/GitHub/PyMFEM/external/hypre/src/cmbuild/CMakeFiles/CMakeScratch/TryCompile-EnMJuo'

      Run Build Command(s): /private/var/folders/_s/h2d9wsxs4fx7txb0ft1pq67c0000gn/T/pip-build-env-f8w_jehc/overlay/lib/python3.13/site-packages/cmake/data/bin/cmake -E env VERBOSE=1 /usr/bin/make -f Makefile cmTC_9e3e2/fast
      /Library/Developer/CommandLineTools/usr/bin/make  -f CMakeFiles/cmTC_9e3e2.dir/build.make CMakeFiles/cmTC_9e3e2.dir/build
      Building C object CMakeFiles/cmTC_9e3e2.dir/testCCompiler.c.o
      /opt/miniconda3/envs/tomas/bin/mpicc   -fPIC  -arch arm64 -o CMakeFiles/cmTC_9e3e2.dir/testCCompiler.c.o -c /Users/tgut03/GitHub/PyMFEM/external/hypre/src/cmbuild/CMakeFiles/CMakeScratch/TryCompile-EnMJuo/testCCompiler.c
      --------------------------------------------------------------------------
      The Open MPI wrapper compiler was unable to find the specified compiler
      arm64-apple-darwin20.0.0-clang in your PATH.

      Note that this compiler was either specified at configure time or in
      one of several possible environment variables.
      --------------------------------------------------------------------------
      make[1]: *** [CMakeFiles/cmTC_9e3e2.dir/testCCompiler.c.o] Error 1
      make: *** [cmTC_9e3e2/fast] Error 2

sshiraiwa avatar Nov 18 '25 15:11 sshiraiwa