arpack-ng icon indicating copy to clipboard operation
arpack-ng copied to clipboard

Building pyarpack fails on 32-bit arch: virtual memory exhausted

Open badshah400 opened this issue 4 years ago • 26 comments

Expected behavior

Running make -jN after cmake -DPYTHON3=ON should work and compile arpack + pyarpack, no matter the machine architecture.

Actual behavior

[  164s] virtual memory exhausted: Operation not permitted
[  164s] make[2]: *** [CMakeFiles/pyarpack.dir/build.make:1255: CMakeFiles/pyarpack.dir/EXAMPLES/PYARPACK/pyarpack.cpp.o] Error 1
[  164s] make[2]: Leaving directory '/home/abuild/rpmbuild/BUILD/arpack-ng-3.8.0/build'
[  164s] make[1]: *** [CMakeFiles/Makefile2:388: CMakeFiles/pyarpack.dir/all] Error 2
[  164s] make[1]: Leaving directory '/home/abuild/rpmbuild/BUILD/arpack-ng-3.8.0/build'
[  164s] make: *** [Makefile:185: all] Error 2

even though I am building this on a VM with 28 GB memory allocated to it, and have no problems building pyarpack for 64-bit architectures. Full log here: https://paste.opensuse.org/32848229.

Where/how to reproduce the problem

  • arpack-ng: 3.8.0
  • OS: openSUSE Linux
  • compiler: GCC 10.2.1
  • environment:
[    8s] -- Configuration summary for arpack-ng-3.8.0:
[    8s]    -- prefix: /usr
[    8s]    -- MPI: OFF
[    8s]    -- ICB: ON
[    8s]    -- INTERFACE64: 0
[    8s]    -- FC:      /usr/bin/gfortran
[    8s]    -- FCFLAGS: -O2 -g -DNDEBUG -fomit-frame-pointer -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clas
h-protection -Werror=return-type -flto=auto -g -fPIC -DNDEBUG
[    8s]    -- CC:      /var/lib/build/ccache/bin/cc
[    8s]    -- CCFLAGS: -O2 -g -DNDEBUG -fomit-frame-pointer -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clas
h-protection -Werror=return-type -flto=auto -g -fPIC -DNDEBUG
[    8s]    -- CXX:      /var/lib/build/ccache/bin/c++
[    8s]    -- CXXFLAGS: -O2 -g -DNDEBUG -fomit-frame-pointer -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-cla
sh-protection -Werror=return-type -flto=auto -g -fPIC -DNDEBUG
[    8s]    -- BLAS:
[    8s]       -- link:    /usr/lib/libblas.so
[    8s]    -- LAPACK:
[    8s]       -- link:    /usr/lib/liblapack.so
[    8s]    -- EIGEN3:
[    8s]       -- compile: /usr/include/eigen3
[    8s]    -- PYTHON:
[    8s]       -- compile: /usr/include/python3.8
[    8s]       -- link:    /usr/lib/libpython3.8.so
[    8s]       -- exe:     /usr/bin/python3
[    8s]    -- BOOST:
[    8s]       -- compile: /usr/include
[    8s]       -- link:    Boost::python
[    8s]       -- link:    Boost::numpy

Steps to reproduce the problem

  • Configure with -DPYTHON3=ON on i586
  • Run make.

Notes, remarks

When pyarpack is disabled, the build proceeds fine.

badshah400 avatar Dec 16 '20 01:12 badshah400

"VM with 28 GB" => the issue is probably triggered by limitation of i386. Doesn't matter how much memory you have on the system

I guess this is this command:

[   97s] /var/lib/build/ccache/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_NUMPY_DYN_LINK -DBOOST_PYTHON_DYN_LINK -DPY_MAJOR_VERSION=\"3\" -Dpyarpack_EXPORTS -I/home/abuild/rpmbuild/BUILD/arpack-ng-3.8.0/build -I/home/abuild/rpmbuild/BUILD/arpack-ng-3.8.0 -I/home/abuild/rpmbuild/BUILD/arpack-ng-3.8.0/ICB -I/home/abuild/rpmbuild/BUILD/arpack-ng-3.8.0/EXAMPLES/MATRIX_MARKET -I/home/abuild/rpmbuild/BUILD/arpack-ng-3.8.0/EXAMPLES/PYARPACK -I/usr/include/eigen3 -I/usr/include/python3.8 -fomit-frame-pointer -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -DNDEBUG -O2 -g -DNDEBUG -fPIC -std=gnu++11 -o CMakeFiles/pyarpack.dir/EXAMPLES/PYARPACK/pyarpack.cpp.o -c /home/abuild/rpmbuild/BUILD/arpack-ng-3.8.0/EXAMPLES/PYARPACK/pyarpack.cpp

A few ideas:

  • Try to use a different option of "-g"
  • Try split-dwarf
  • Don't build this example

sylvestre avatar Dec 16 '20 08:12 sylvestre

Run make, not make -jN. pyarpack is based on BOOST templates which is known to consume memory and slow down compilation: this is one of the dark sides you need to pay to get "template genericity". Note: I tried to compile this with an --enable-python option in autotools configure : more than 1h of compilation on my laptop (a few minutes with cmake).

fghoussen avatar Dec 16 '20 21:12 fghoussen

Disabling that example + example MATRIX_MARKET also means we have to disable all the pyarpack tests. For example, builds work after the following patch:

Index: arpack-ng-3.8.0/CMakeLists.txt
===================================================================
--- arpack-ng-3.8.0.orig/CMakeLists.txt
+++ arpack-ng-3.8.0/CMakeLists.txt
@@ -586,75 +586,15 @@ if(ICB)
   target_link_libraries(icb_arpack_cpp arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
   add_test(icb_arpack_cpp_tst ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_arpack_cpp)
 
-  if (ICBEXMM)
-    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/EXAMPLES/MATRIX_MARKET)
-
-    add_executable(arpackmm EXAMPLES/MATRIX_MARKET/arpackmm.cpp)
-    target_include_directories(arpackmm PUBLIC ${PROJECT_SOURCE_DIR}/ICB ${EIGEN3_INCLUDE_DIR}) # Get arpack.h + eigen
-    target_link_libraries(arpackmm arpack BLAS::BLAS LAPACK::LAPACK ${EXTRA_LDFLAGS})
-    configure_file(EXAMPLES/MATRIX_MARKET/As.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/As.mtx)
-    configure_file(EXAMPLES/MATRIX_MARKET/An.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/An.mtx)
-    configure_file(EXAMPLES/MATRIX_MARKET/Az.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Az.mtx)
-    configure_file(EXAMPLES/MATRIX_MARKET/B.mtx  ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/B.mtx)
-    configure_file(EXAMPLES/MATRIX_MARKET/Bz.mtx ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Bz.mtx)
-    configure_file(EXAMPLES/MATRIX_MARKET/arpackmm.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/arpackmm.sh)
-    add_test(NAME arpackmm_tst WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND ${BASH_PROGRAM} arpackmm.sh)
-  endif()
-
   if (PYTHON3)
-    python_add_module(pyarpack ${arpackutil_STAT_SRCS} ${arpacksrc_STAT_SRCS} ${arpacksrc_ICB} ${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpack.cpp)
+    python_add_module(pyarpack ${arpackutil_STAT_SRCS} ${arpacksrc_STAT_SRCS} ${arpacksrc_ICB})
     target_compile_definitions(pyarpack PRIVATE PY_MAJOR_VERSION="3")
-    set(pyarpack_HDR ${PROJECT_SOURCE_DIR}/ICB ${PROJECT_SOURCE_DIR}/EXAMPLES/MATRIX_MARKET ${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK)
+    set(pyarpack_HDR ${PROJECT_SOURCE_DIR}/ICB)
     target_include_directories(pyarpack PUBLIC ${pyarpack_HDR} ${EIGEN3_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})
     target_link_libraries(pyarpack BLAS::BLAS LAPACK::LAPACK ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
     install(TARGETS pyarpack
             ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages
             LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages)
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseBiCGDiag.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseBiCGDiag.py" @ONLY)
-    add_test(NAME pyarpackSparseBiCGDiag_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseBiCGDiag.py)
-    set_tests_properties(pyarpackSparseBiCGDiag_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseBiCGILU.py.in"  "${CMAKE_BINARY_DIR}/pyarpackSparseBiCGILU.py" @ONLY)
-    add_test(NAME pyarpackSparseBiCGILU_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseBiCGILU.py)
-    set_tests_properties(pyarpackSparseBiCGILU_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseCGDiag.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseCGDiag.py" @ONLY)
-    add_test(NAME pyarpackSparseCGDiag_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseCGDiag.py)
-    set_tests_properties(pyarpackSparseCGDiag_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseCGILU.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseCGILU.py" @ONLY)
-    add_test(NAME pyarpackSparseCGILU_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseCGILU.py)
-    set_tests_properties(pyarpackSparseCGILU_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseLLT.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseLLT.py" @ONLY)
-    add_test(NAME pyarpackSparseLLT_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseLLT.py)
-    set_tests_properties(pyarpackSparseLLT_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseLDLT.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseLDLT.py" @ONLY)
-    add_test(NAME pyarpackSparseLDLT_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseLDLT.py)
-    set_tests_properties(pyarpackSparseLDLT_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseLU.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseLU.py" @ONLY)
-    add_test(NAME pyarpackSparseLU_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseLU.py)
-    set_tests_properties(pyarpackSparseLU_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackSparseQR.py.in" "${CMAKE_BINARY_DIR}/pyarpackSparseQR.py" @ONLY)
-    add_test(NAME pyarpackSparseQR_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackSparseQR.py)
-    set_tests_properties(pyarpackSparseQR_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseLLT.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseLLT.py" @ONLY)
-    add_test(NAME pyarpackDenseLLT_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseLLT.py)
-    set_tests_properties(pyarpackDenseLLT_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseLDLT.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseLDLT.py" @ONLY)
-    add_test(NAME pyarpackDenseLDLT_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseLDLT.py)
-    set_tests_properties(pyarpackDenseLDLT_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseLURR.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseLURR.py" @ONLY)
-    add_test(NAME pyarpackDenseLURR_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseLURR.py)
-    set_tests_properties(pyarpackDenseLURR_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseQRRR.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseQRRR.py" @ONLY)
-    add_test(NAME pyarpackDenseQRRR_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseQRRR.py)
-    set_tests_properties(pyarpackDenseQRRR_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseLUPP.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseLUPP.py" @ONLY)
-    add_test(NAME pyarpackDenseLUPP_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseLUPP.py)
-    set_tests_properties(pyarpackDenseLUPP_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackDenseQRPP.py.in" "${CMAKE_BINARY_DIR}/pyarpackDenseQRPP.py" @ONLY)
-    add_test(NAME pyarpackDenseQRPP_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackDenseQRPP.py)
-    set_tests_properties(pyarpackDenseQRPP_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
-    configure_file("${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpackRestart.py.in" "${CMAKE_BINARY_DIR}/pyarpackRestart.py" @ONLY)
-    add_test(NAME pyarpackRestart_tst COMMAND ${PYTHON_EXECUTABLE} pyarpackRestart.py)
-    set_tests_properties(pyarpackRestart_tst PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/lib:$ENV{PYTHONPATH})
   endif()
 
   if (MPI)

badshah400 avatar Dec 16 '20 21:12 badshah400

Run make, not make -jN. pyarpack is based on BOOST templates which is known to consume memory and slow down compilation: this is one of the dark sides you need to pay to get "template genericity". Note: I tried to compile this with an --enable-python option in autotools configure : more than 1h of compilation on my laptop (a few minutes with cmake).

I tried using make -j1. Still no luck on i586 with pyarpack enabled.

badshah400 avatar Dec 16 '20 21:12 badshah400

Disabling that example + example MATRIX_MARKET also means we have to disable all the pyarpack tests.

You need to disable both ICBEXMM and PYTHON3 : PYTHON3 needs (and set) ICBEXMM. Run cmake .. instead of cmake -DICBEXMM=ON [and/or] -DPYTHON3=ON ..

fghoussen avatar Dec 16 '20 21:12 fghoussen

So, on i586 this means our only option is to disable the python bindings entirely, correct?

badshah400 avatar Dec 16 '20 21:12 badshah400

did you try https://github.com/opencollab/arpack-ng/issues/289#issuecomment-745891320 ?

You could also disable the binding only for this arch.

sylvestre avatar Dec 16 '20 21:12 sylvestre

did you try #289 (comment) ?

Haven't yet tried the split-dwarf. A different -g level didn't help and disabling the pyarpack example alone didn't either (only if I disabled also the MATRIX_MARKET did I get anywhere).

You could also disable the binding only for this arch.

Yes, might end up doing that. Thanks for the responses.

badshah400 avatar Dec 16 '20 22:12 badshah400

So, on i586 this means our only option is to disable the python bindings entirely, correct?

Yes, sounds unfortunatelly possible... Not even sure explicit template instanciation may help here.

fghoussen avatar Dec 16 '20 22:12 fghoussen

How do I even build/install pyarpack Python module ? For some reason, its sources are in EXAMPLES/PYARPACK/. With autotools, there is not even an option to build it. With cmake, apparently one needs to turn PYTHON3 and EXAMPLES (sic!) on.

I don't know anything about cmake support for building Python modules, but normally speaking, Python module source should come with e.g. setup.py file. Here it's just a bunch of C++ and "normal" Python files.

dimpase avatar Jun 15 '22 12:06 dimpase

Probably legacy. don't hesitate to propose patches to improve the situation

sylvestre avatar Jun 15 '22 12:06 sylvestre

With autotools, there is not even an option to build it.

pyarpack is not provided by autotools because of this: https://github.com/opencollab/arpack-ng/pull/254 @dimpase: if you have a solution to fix #254, feel free to reopen it (I guess there's no solution: libtool is super crazy slow)

How do I even build/install pyarpack Python module ?

https://github.com/opencollab/arpack-ng/blob/5eafea4328f1631eab28b1a20e757d1f0e21f8a6/.github/workflows/jobs.yml#L120

fghoussen avatar Jun 16 '22 19:06 fghoussen

How do I even build/install pyarpack Python module ?

@dimpase: There is no setup.py to run since this python module is created with boost-python. boost-python creates libpyarpack.so AFAIR, then, make install will install this so in /path/to/prefix/lib/... Then you need to add in your PYTHONPATH the path where the so is. And now finally, you can import pyarpack from a python prompt.

fghoussen avatar Jun 18 '22 07:06 fghoussen

OK, but what does it do with .py files? Or there are no .py parts in the pyarpack package?

dimpase avatar Jun 18 '22 07:06 dimpase

pyarpack is just the libpyarpack.so C++ library created by boost-python. This so is installed by make install.

EXAMPLES\PYARPACK have .py.in files that are meant to generate .py files: these .py are just regular python files used to test pyarpack running python script.

@dimpase: feel free to improve the pyarpack section in the README.md. I probably missed to explain how to install and run pyarpack. If you are testing this and checkout out how it works, would be good to improve the doc.

fghoussen avatar Jun 18 '22 07:06 fghoussen

Also, I can't see how to specify what BLAS/LAPACK to use. E.g. on macOS one might want to use OpenBLAS rather than Apple's BLAS.

dimpase avatar Jun 18 '22 07:06 dimpase

Check out installation and usage sections in EXAMPLES/PYARPACK/README: I explained how to install and run pyarpack there.

The BLAS/LAPACK used are the ones eigen uses. ISO_C_BINDING (ICB) enables to call fortran from C/C++. From here arpackSolver.hpp uses eigen (ICBEXMM) to provide a ready to use C++ arpack solver. From there pyarpack (PYTHON3) is just a binding on top of arpackSolver.hpp which exposes C++ classes in python using boost-python.

fghoussen avatar Jun 18 '22 07:06 fghoussen

on macOS one might want

Never had a mac! But seems that compiler options FFLAGS="-ff2c -fno-second-underscore" are mandatory to build: https://github.com/opencollab/arpack-ng/blob/5eafea4328f1631eab28b1a20e757d1f0e21f8a6/.github/workflows/jobs.yml#L186

fghoussen avatar Jun 18 '22 08:06 fghoussen

on macOS one might want

Never had a mac! But seems that compiler options FFLAGS="-ff2c -fno-second-underscore" are mandatory to build:

https://github.com/opencollab/arpack-ng/blob/5eafea4328f1631eab28b1a20e757d1f0e21f8a6/.github/workflows/jobs.yml#L186

Maybe - note that https://github.com/opencollab/arpack-ng/blob/5eafea4328f1631eab28b1a20e757d1f0e21f8a6/.github/workflows/jobs.yml#L191 actually requests the use of Apple's blas (a.k.a. `Accelerate Framework)

One reason I ask is that most macOS pyarpack tests fail for me (with Apple's blas). So one should test with OpenBlas (provided by Homebrew) as something more sane.

dimpase avatar Jun 18 '22 08:06 dimpase

Try to build eigen (which is to be found by cmake) with the same blas/lapack (accelerate or openblas) that arpack founds/uses.

fghoussen avatar Jun 18 '22 08:06 fghoussen

Eigen does not use BLAS/LAPACK, so I'm lost here.

dimpase avatar Jun 18 '22 08:06 dimpase

On mac (never had one) without -DMPI (keep it simple):

  1. without -DPYTHON3, but with Apple's blas (Accelerate Framework) and FFLAGS="-ff2c -fno-second-underscore", does this work (test suite OK)? https://github.com/opencollab/arpack-ng/blob/5eafea4328f1631eab28b1a20e757d1f0e21f8a6/.github/workflows/jobs.yml#L191

  2. Now replacing only Apple's blas with openblas, does this work (test suite OK)?

  3. Now build boost-python from source for python3 and install it: https://github.com/opencollab/arpack-ng/blob/5eafea4328f1631eab28b1a20e757d1f0e21f8a6/.github/workflows/jobs.yml#L121 with python3 https://github.com/opencollab/arpack-ng/blob/5eafea4328f1631eab28b1a20e757d1f0e21f8a6/.github/workflows/jobs.yml#L124

  4. Now getting back to step 2, add -DPYTHON3 and check out in cmake logs that cmake found the boost-python compiled / installed in step 3, does this work (test suite OK)?

  5. Now if brew provides some kind of precompiled boost-python3 package, you may try to use it too (check cmake logs).

I wrote pyarpack a long time ago: I have a doubt now if Eigen indeed needs blas/lapack in this case (I'll checkout this out when I can). Eigen is needed/used for solving the Reverse Communication Interface pattern: https://github.com/opencollab/arpack-ng/blob/5eafea4328f1631eab28b1a20e757d1f0e21f8a6/EXAMPLES/MATRIX_MARKET/arpackSolver.hpp#L774 I was thinking that Eigen would needs blas/lapack in back-end for that. Maybe not?

fghoussen avatar Jun 18 '22 19:06 fghoussen

what is eigen you mentioned? Is it https://eigen.tuxfamily.org/ ?

dimpase avatar Jun 18 '22 19:06 dimpase

yes, it's a C++ template library meant for matrix-vector operations.

fghoussen avatar Jun 18 '22 19:06 fghoussen

@dimpase: if you can test ``pyarpack on macos and report about it, would be great!

fghoussen avatar Jun 18 '22 19:06 fghoussen

@dimpase: seems to work on mac #365. Did you brew install python3 and pip3 install numpy?

fghoussen avatar Jun 19 '22 14:06 fghoussen