Skip to content

Commit

Permalink
[CI] Test pyarpack on macos. (#365)
Browse files Browse the repository at this point in the history
* [CI] Test pyarpack on macos.
* Fix pyarpack compilation warning: seems like default is python3 now.
* Improve pyarpack doc.
* pyarpack: run with latest boost-python version and require Boost >= 1.78.
  • Loading branch information
fghoussen authored Jun 25, 2022
1 parent d3cec6d commit 872df83
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 9 deletions.
55 changes: 48 additions & 7 deletions .github/workflows/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
cd build
cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON ..
make all
make test
CTEST_OUTPUT_ON_FAILURE=1 make test
make package_source
ubuntu_latest_cmake_install:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -118,15 +118,20 @@ jobs:
- name: Build boost-python for python3 (not provided by apt-cache)
run : |
sudo apt-get -y install wget
wget https://sourceforge.net/projects/boost/files/boost/1.77.0/boost_1_77_0.tar.gz
tar -xf boost_1_77_0.tar.gz
cd boost_1_77_0
wget https://sourceforge.net/projects/boost/files/boost/1.79.0/boost_1_79_0.tar.gz
tar -xf boost_1_79_0.tar.gz
cd boost_1_79_0
./bootstrap.sh --with-libraries=python --with-python=/usr/bin/python3 --with-toolset=gcc
sudo ./b2 toolset=gcc install
sudo apt-get install locate
sudo updatedb
- name: Run job
run: mkdir build; cd build; cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON -DICBEXMM=ON -DPYTHON3=ON .. && make all test
run: |
mkdir build
cd build
cmake -DEXAMPLES=ON -DMPI=ON -DICB=ON -DICBEXMM=ON -DPYTHON3=ON ..
make all
CTEST_OUTPUT_ON_FAILURE=1 make test
ubuntu_latest_autotools_ilp64:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -190,7 +195,43 @@ jobs:
export CXXFLAGS="-Qunused-arguments"
LIBS="-framework Accelerate" cmake -DBLA_VENDOR=Generic -DEXAMPLES=ON -DICB=ON -DMPI=ON ..
make all
make test
CTEST_OUTPUT_ON_FAILURE=1 make test
macos_latest_cmake_python:
runs-on: macos-latest
steps:
- name: Clone and check out repository code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}} # Branch where changes are implemented.
repository: ${{github.event.pull_request.head.repo.full_name}} # Repo where changes are implemented.
- name: Check commit
run: |
git log -1
- name: Update OS
run: |
brew uninstall --ignore-dependencies gcc
brew update
softwareupdate --install --all
- name: Install brew dependencies
run: |
brew list --formula -1 | while read line; do brew unlink $line; done
brew install gcc cmake boost-python3 eigen python3
brew list --formula -1 | while read line; do brew link --overwrite $line; done
pip3 install numpy
- name: Run job
run: |
mkdir -p build
cd build
export FC=gfortran
export FFLAGS="-ff2c -fno-second-underscore"
export CC=clang
export CFLAGS="-Qunused-arguments"
export CXX=clang++
export CXXFLAGS="-Qunused-arguments"
LIBS="-framework Accelerate" cmake -DBLA_VENDOR=Generic -DEXAMPLES=ON -DICB=ON -DPYTHON3=ON ..
make all
CTEST_OUTPUT_ON_FAILURE=1 make test
macos_latest_autotools:
runs-on: macos-latest
steps:
Expand Down Expand Up @@ -252,4 +293,4 @@ jobs:
mkdir -p build && cd build
cmake -GNinja -DICB=ON .. # -DEXAMPLES=ON KO
cmake --build . -v
ctest
ctest --output-on-failure
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ arpack-ng - 3.9.0
* [BUG FIX] Compile C programs with ICB.
* arpackmm: command line bug fix.
* arpackmm: restart bug fix.
* pyarpack: fix compilation warning, test on macos and latest boost-python (1.79).

[ Haoyang Liu ]
* CMake: minimum required version changed to 3.0
Expand Down
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ if (PYTHON3)

find_package(PythonInterp 3 REQUIRED)
find_package(PythonLibs 3 REQUIRED)
find_package(Boost COMPONENTS python${BOOST_PYTHON_LIBSUFFIX} numpy${BOOST_PYTHON_LIBSUFFIX} REQUIRED)
find_package(Boost 1.78 COMPONENTS python${BOOST_PYTHON_LIBSUFFIX} numpy${BOOST_PYTHON_LIBSUFFIX} REQUIRED)

set(ICBEXMM "ON")
endif ()
Expand Down Expand Up @@ -647,7 +647,6 @@ if(ICB)

if (PYTHON3)
python_add_module(pyarpack ${arpackutil_STAT_SRCS} ${arpacksrc_STAT_SRCS} ${arpacksrc_ICB} ${PROJECT_SOURCE_DIR}/EXAMPLES/PYARPACK/pyarpack.cpp)
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)
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})
Expand Down
3 changes: 3 additions & 0 deletions EXAMPLES/PYARPACK/README
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Python3: ~/arpack-ng/build> cmake -DCMAKE_INSTALL_PREFIX=/tmp/local -DPYTHON3=ON
~/arpack-ng/build> make install
Note: Boost must have been compiled for Python3.
Note: installation will install libpyarpack.so in the install directory.
Note: python3 minimal packages must be installed (apt-get install python3-minimal python3-pip).
numpy must be installed (apt-get install python3-numpy) as the A/B matrices used by arpack
solver must be numpy arrays.

Usage:
------
Expand Down

0 comments on commit 872df83

Please sign in to comment.