Skip to content

Merge pull request #16 from topazus/fix-find-scalapack #221

Merge pull request #16 from topazus/fix-find-scalapack

Merge pull request #16 from topazus/fix-find-scalapack #221

Workflow file for this run

name: Run Github CI tests.
on: [push, pull_request]
jobs:
test:
name: Build and test
runs-on: ubuntu-latest
strategy:
matrix:
compiler:
- gcc
test: [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install dependencies
run: |
export BLUE="\033[34;1m"
mkdir -p installDir
printf "${BLUE} YL; Installing gcc-9 via apt\n"
sudo apt-get update
sudo apt-get install build-essential software-properties-common -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt-get update
sudo apt-get install gcc-9 g++-9 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
export CXX="g++-9"
export CC="gcc-9"
printf "${BLUE} YL; Done installing gcc-9 via apt\n"
printf "${BLUE} YL; Installing gfortran via apt\n"
sudo apt-get install gfortran-9 -y
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-9 60
printf "${BLUE} YL; Done installing gfortran via apt\n"
printf "${BLUE} YL; Installing openmpi\n"
sudo apt-get install openmpi-bin libopenmpi-dev
printf "${BLUE} YL; Done installing openmpi\n"
printf "${BLUE} YL; Installing dos2unixfrom apt\n"
sudo apt-get install dos2unix
printf "${BLUE} YL; Done installing dos2unixfrom apt\n"
printf "${BLUE} YL; Installing BLASfrom apt\n"
sudo apt-get install libblas-dev
export BLAS_LIB=/usr/lib/x86_64-linux-gnu/libblas.so
printf "${BLUE} YL; Done installing BLASfrom apt\n"
printf "${BLUE} YL; Installing LAPACKfrom apt\n"
sudo apt-get install liblapack-dev
export LAPACK_LIB=/usr/lib/x86_64-linux-gnu/liblapack.so
printf "${BLUE} YL; Done installing LAPACKfrom apt\n"
printf "${BLUE} YL; Installing ScaLAPACK from source\n"
cd $GITHUB_WORKSPACE/installDir
wget http://www.netlib.org/scalapack/scalapack-2.1.0.tgz
tar -xf scalapack-2.1.0.tgz
cd scalapack-2.1.0
rm -rf build
mkdir -p build
cd build
cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_Fortran_COMPILER=mpif90 \
-DCMAKE_INSTALL_PREFIX=./install \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_Fortran_FLAGS="-fopenmp" \
-DBLAS_LIBRARIES="$BLAS_LIB" \
-DLAPACK_LIBRARIES="$LAPACK_LIB"
make
make install
export SCALAPACK_LIB="$GITHUB_WORKSPACE/installDir/scalapack-2.1.0/build/install/lib/libscalapack.so"
printf "${BLUE} YL; Done installing ScaLAPACK from source\n"
printf "${BLUE} YL; Installing arpack from source\n"
cd $GITHUB_WORKSPACE/installDir
git clone https://github.com/opencollab/arpack-ng.git
cd arpack-ng
rm -rf build
mkdir -p build
cd build
cmake .. \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_CXX_COMPILER=mpic++ \
-DCMAKE_Fortran_COMPILER=mpif90 \
-DCMAKE_INSTALL_PREFIX=. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_Fortran_FLAGS="-fopenmp" \
-DTPL_BLAS_LIBRARIES="$BLAS_LIB" \
-DTPL_LAPACK_LIBRARIES="$LAPACK_LIB" \
-DMPI=ON \
-DEXAMPLES=ON \
-DCOVERALLS=ON
make
export ARPACK_LIB="$GITHUB_WORKSPACE/installDir/arpack-ng/build/lib/libarpack.so;$GITHUB_WORKSPACE/installDir/arpack-ng/build/lib/libparpack.so"
printf "${BLUE} YL; Done installing arpack from source\n"
- name: Install package
run: |
export BLUE="\033[34;1m"
export BLAS_LIB=/usr/lib/x86_64-linux-gnu/libblas.so
export LAPACK_LIB=/usr/lib/x86_64-linux-gnu/liblapack.so
export SCALAPACK_LIB="$GITHUB_WORKSPACE/installDir/scalapack-2.1.0/build/install/lib/libscalapack.so"
export ARPACK_LIB="$GITHUB_WORKSPACE/installDir/arpack-ng/build/lib/libarpack.so;$GITHUB_WORKSPACE/installDir/arpack-ng/build/lib/libparpack.so"
printf "${BLUE} YL; Installing ButterflyPACK from source\n"
cd $GITHUB_WORKSPACE
rm -rf build
mkdir -p build
cd build
export CRAYPE_LINK_TYPE=dynamic
rm -rf CMakeCache.txt
rm -rf DartConfiguration.tcl
rm -rf CTestTestfile.cmake
rm -rf cmake_install.cmake
rm -rf CMakeFiles
cmake .. \
-DCMAKE_CXX_FLAGS="-fopenmp" \
-Denable_blaslib=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_CXX_COMPILER=mpic++ \
-DCMAKE_Fortran_COMPILER=mpif90 \
-DCMAKE_INSTALL_PREFIX=. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
-DCMAKE_Fortran_FLAGS="-fopenmp" \
-DTPL_BLAS_LIBRARIES="$BLAS_LIB" \
-DTPL_LAPACK_LIBRARIES="$LAPACK_LIB" \
-DTPL_SCALAPACK_LIBRARIES="$SCALAPACK_LIB" \
-DTPL_ARPACK_LIBRARIES="$ARPACK_LIB"
make
make install
printf "${BLUE} YL; Done installing ButterflyPACK from source\n"
- name: Test
run: |
cd $GITHUB_WORKSPACE
export TEST_NUMBER=${{ matrix.test }}
sh ./.ci_tests.sh