LLNL / pysaber

Python package for a systems approach to blur estimation and reduction
MIT License
4 stars 3 forks source link

pip install . not work in lassen opence-1.9.1 environment. #3

Open DamonLee5 opened 10 months ago

DamonLee5 commented 10 months ago

I am experiencing an issue while attempting to install pysaber in my environment. The installation process fails when trying to install scikit-learn due to a dependency issue related to OpenBLAS.

Currently Loaded Modules: 1) StdEnv (S) 2) gcc/12.2.1 3) spectrum-mpi/rolling-release 4) cuda/11.8.0

Below is the relevant part of the error log for pip install . :

... Run-time dependency openblas found: NO (tried pkgconfig and cmake)

../scipy/meson.build:169:9: ERROR: Dependency "OpenBLAS" not found, tried pkgconfig and cmake

A full log can be found at /tmp/[temporary-path]/meson-logs/meson-log.txt ...

The issue seems to stem from the OpenBLAS dependency not being found during the build process of scipy, which is a dependency of scikit-learn.

Environment details:

Environment name: opence-1.9.1 in lassen Python version: 3.9 GCC version: 12.2.1 I attempted to install pysaber via pip install . command in my environment. It seems that the requirement for OpenBLAS is not being met or located correctly.

DamonLee5 commented 9 months ago

To fix scipy compile.

Currently Loaded Modules: 1) StdEnv (S) 2) cuda/11.8.0 3) cmake/3.23.1 4) gcc/12.2.1 5) spectrum-mpi/rolling-release

conda install -c conda-forge openblas
export PKG_CONFIG_PATH=$CONDA_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH

After doing this, scipy can be installed successfully. However, matplotlib is still not installed by pypi. Below can be reproduce by pip install matplotlib.

/p/gpfs1/li93/anaconda/envs/SimpleITK/bin/powerpc64le-conda-linux-gnu-cc -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O3 -Wall -mcpu=power8 -fPIC -O3 -isystem /p/gpfs1/li93/anaconda/envs/SimpleITK/include -mcpu=power8 -fPIC -O3 -isystem /p/gpfs1/li93/anaconda/envs/SimpleITK/include -mcpu=power8 -mtune=power8 -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -pipe -isystem /p/gpfs1/li93/anaconda/envs/SimpleITK/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /p/gpfs1/li93/anaconda/envs/SimpleITK/include -fPIC -I/p/gpfs1/li93/anaconda/envs/SimpleITK/include/python3.10 -c /var/tmp/tmp0zw4d2sg.cpp -o var/tmp/tmp0zw4d2sg.o -flto
      error: Failed to download any of the following: ['https://downloads.sourceforge.net/project/freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz', 'https://download.savannah.gnu.org/releases/freetype/freetype-2.6.1.tar.gz', 'https://download.savannah.gnu.org/releases/freetype/freetype-old/freetype-2.6.1.tar.gz'].  Please download one of these urls and extract it into 'build/' at the top-level of the source repository.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for matplotlib
Successfully built pysaber
Failed to build matplotlib
ERROR: Could not build wheels for matplotlib, which is required to install pyproject.toml-based projects

Remove matplotlib from setup.py and using conda install can solve this issue.