编译安装调试 scaLapack
/home/hipper/ex_scalapack/
mkdir ./lapack
mkdir -p ./lapack/local/lib
mkdir ./openmpi
mkdir ./scalapack
1,编译安装 Lapack
下载代码:
cd lapack
wget https://github.com/Reference-LAPACK/lapack/archive/refs/tags/v3.12.0.tar.gz
tar zxf v3.12.0.tar.gz
编译lapack:
cd lapack-3.12.0/
cp make.inc.example make.inc
make -j
ls ./
安装 lapack:
cd ..
cp lapack-3.12.0/lib*.a ./local/lib/
设置scalapack编译时需要的环境变量:
libLapackPath=/home/hipper/ex_scalapack/lapack/local/lib/liblapack.a
libRefBlasPath=/home/hipper/ex_scalapack/lapack/local/lib/librefblas.a
2, 编译安装 openmpi
下载代码:
cd openmpi/
wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.6.tar.gz
配置编译:
./configure --prefix=/home/hipper/ex_scalapack/openmpi/local --with-cuda 2>&1 | tee config.out
make -j
make install
./configure --help
可以查看配置选项,
比如编译 libopenmpi_cxx.so:
bash
./configure \
--prefix=/home/hipper/ex_openmpi/local \
--enable-mpi-cxx \
--enable-mpi-fortran \
--with-cuda 2>&1 | tee config.out
设置环境变量:
bash
export PATH=$PATH:/home/hipper/ex_scalapack/openmpi/local/bin
export LD_LIBRARY_PATH=/home/hipper/ex_scalapack/openmpi/local/lib:$LD_LIBRARY_PATH
ls ../local/bin
3,编译安装 sacLapack
下载代码:
bash
cd scalapack/
git clone https://github.com/Reference-ScaLAPACK/scalapack.git
或者:
wget https://github.com/Reference-ScaLAPACK/scalapack/archive/refs/tags/v2.2.0.tar.gz
tar zxf v2.2.0.tar.gz
配置编译
bash
mkdir build/
cd build/
cmake -DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_CXX_COMPILER=mpicxx \
-DCMAKE_C_COMPILER=mpicc \
-DCMAKE_Fortran_COMPILER=mpifort \
-DLAPACK_LIBRARIES=$libLapackPath \
-DBLAS_LIBRARIES=$libRefBlasPath \
../scalapack
make -j
ls ./lib/
4. 单机简单测试
ls ./TESTING/
./xdqr
参考:
https://support.huawei.com/enterprise/zh/doc/EDOC1100283144/17286012
https://docs.nvidia.com/nvpl/_static/scalapack/getting-started.html
https://github.com/amd/aocl-scalapack