t-sakashita / rokko

Integrated Interface for libraries of eigenvalue decomposition
Boost Software License 1.0
10 stars 2 forks source link

ctest fails #582

Open wistaria opened 3 years ago

wistaria commented 3 years ago

https://github.com/t-sakashita/rokko/actions/runs/666932530 92% tests passed, 20 tests failed out of 241

t-sakashita commented 3 years ago

test/blasのビルドにおいて、gemm.hppでエラーが起きている。 https://github.com/t-sakashita/rokko/runs/2813815307

/home/runner/work/rokko/rokko/rokko/blas/gemm.hpp:38:163: error: cannot convert ‘std::complex<double>*’ to ‘const double*’ for argument ‘7’ to ‘void cblas_zgemm(CBLAS_ORDER, CBLAS_TRANSPOSE, CBLAS_TRANSPOSE, blasint, blasint, blasint, const double*, const double*, blasint, const double*, blasint, const double*, double*, blasint)’
   cblas_ ## NAMES (order, trans_a, trans_b, m, n, k, &alpha, lapack::complex_cast(a), lda_a, lapack::complex_cast(b), lda_b, &beta, lapack::complex_cast(c), lda_c); \
                                                                                                                                                                   ^
/home/runner/work/rokko/rokko/rokko/blas/gemm.hpp:42:1: note: in expansion of macro ‘BLAS_GEMM_IMPL’
 BLAS_GEMM_IMPL(zgemm, std::complex<double>);
 ^~~~~~~~~~~~~~
t-sakashita commented 3 years ago

上記のエラーは、clang@Macでは起きない。 g++@Macでのコンパイルでは起きましたか? @wistaria

t-sakashita commented 3 years ago

エラー内容は、7番目の引数alphaを、std::complex<double>*からconst double*へ変換できない、ということ。

まず、rokko::lapack::complex_castを用いればよいか?

const_castを用いれば良いか? https://en.cppreference.com/w/cpp/language/const_cast

t-sakashita commented 3 years ago

5f06aecf3add106ee21f8f6e23f6407b23cae0ed

t-sakashita commented 3 years ago

https://github.com/t-sakashita/rokko/runs/2816584241

t-sakashita commented 3 years ago

githubのCIの環境を、Macで再現して、作業を楽にする。 エラーが出た箇所は、cblasを逐次で用いている。 cblasをg++でビルドしたもので、実行してみる。

wistaria commented 3 years ago

Macでの再現環境の作り方

  1. VirtualBox と Vagrant のインストール: https://github.com/cmsi/MateriAppsLive/wiki/DebianLiveSetup#virtualbox-vagrant-packerのインストール-macos
  2. 適当なディレクトリに移動し、以下の内容の Vagrantfile を作成
    Vagrant.configure("2") do |config|
    config.vm.box = "ubuntu/bionic64"
    config.vm.hostname = "bionic18"
    config.vm.synced_folder ENV["HOME"], "/home/vagrant/host"
    config.vm.provider "virtualbox" do |vb|
    vb.memory = "4096"
    end
    config.vm.provision "shell", inline: <<-SHELL
    cp -fp /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
    echo 'Asia/Tokyo' > /etc/timezone
    SHELL
    end
  3. vagrant up を実行。仮想マシンが起動する
  4. vagrant ssh で仮想マシンにログインし、https://github.com/t-sakashita/rokko/blob/develop/.github/workflows/build.yml の内容を実行
wistaria commented 3 years ago

エラーは再現できた

t-sakashita commented 3 years ago

できれば、修正もお願いします。

wistaria commented 3 years ago

@t-sakashita コンパイルは通りました d4664e0abf624f8aa932248a7dc3bd32c984b785 https://github.com/t-sakashita/rokko/actions/runs/954290281

t-sakashita commented 3 years ago

仮想環境でのbuild.ymlの実行は、どのコマンドで行うのでしょうか?

wistaria commented 3 years ago

とりあえず build.yml の中の

sudo apt-get update && sudo apt-get -y install build-essential cmake gfortran mpi-default-dev libboost-all-dev libopenblas-dev liblapack-dev liblapacke-dev libscalapack-mpi-dev trilinos-all-dev
mkdir -p build && cd build && source rokko/rokkoenv.sh && cmake -DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc -DCMAKE_Fortran_COMPILER=mpif90 -DMPIEXEC_PREFLAGS="--oversubscribe" ..
make
ctest

を copy & paste して実行しました