From 872df83b9e4f493f4bf68457a96edbcafafd5e4c Mon Sep 17 00:00:00 2001 From: Franck HOUSSEN Date: Sat, 25 Jun 2022 19:16:31 +0200 Subject: [PATCH] [CI] Test pyarpack on macos. (#365) * [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. --- .github/workflows/jobs.yml | 55 +++++++++++++++++++++++++++++++++----- CHANGES | 1 + CMakeLists.txt | 3 +-- EXAMPLES/PYARPACK/README | 3 +++ 4 files changed, 53 insertions(+), 9 deletions(-) diff --git a/.github/workflows/jobs.yml b/.github/workflows/jobs.yml index dba54f305..0a7a2b020 100644 --- a/.github/workflows/jobs.yml +++ b/.github/workflows/jobs.yml @@ -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 @@ -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: @@ -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: @@ -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 diff --git a/CHANGES b/CHANGES index 4bc982f00..e513861da 100644 --- a/CHANGES +++ b/CHANGES @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 76bcda226..a11e77c11 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 () @@ -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}) diff --git a/EXAMPLES/PYARPACK/README b/EXAMPLES/PYARPACK/README index 5e68c0185..1a1a9eecf 100644 --- a/EXAMPLES/PYARPACK/README +++ b/EXAMPLES/PYARPACK/README @@ -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: ------