t-sakashita / rokko

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

EigenExaでのRank mismatch #601

Closed t-sakashita closed 1 year ago

t-sakashita commented 1 year ago

https://github.com/t-sakashita/rokko/actions/runs/4988423978/jobs/8931136856

[ 10%] Building Fortran object src/CMakeFiles/EigenExa.dir/lapack_eigen.F.o
/home/runner/work/rokko/rokko/build/rokko/build/eigenexa-2.7/src/lapack_eigen.F:56:11:

   31 |      &     temp, lwork, i, liwork, info)
      |           2
......
   56 |      &     work, lwork, iwork, liwork, info)
      |           1
Error: Rank mismatch between actual argument at (1) and actual argument at (2) (scalar and rank-1)
t-sakashita commented 1 year ago

Fortranコンパイラに-fallow-argument-mismatchを渡す必要がありそう。

t-sakashita commented 1 year ago

仮想環境で検証する。 https://github.com/t-sakashita/rokko/wiki/TestByVirtualBox_Vagrant

wistaria commented 1 year ago
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
  if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0.0)
    add_definitions("-fallow-argument-mismatch")
  endif()
endif()
t-sakashita commented 1 year ago

Actionsに使われているubuntu-latestのバージョンは、22.04.2であった。 対応する名前は、ubuntu/jammy64。 CMakeが出力したgfortranのバージョン:

-- The Fortran compiler identification is GNU 11.3.0
t-sakashita commented 1 year ago
/home/vagrant/rokko/build/rokko/build/EigenExa-2.4b/src/eigen_libs.F:1914:42:

 1914 |       data const_pai2 /z'3ff921FB54442D18'/
      |                                          1
Error: BOZ literal constant near (1) cannot be assigned to a REAL variable [see ‘-fno-allow-invalid-boz’]
/home/vagrant/rokko/build/rokko/build/EigenExa-2.4b/src/eigen_libs.F:1887:42:

 1887 |       data const_2pai /z'401921FB54442D18'/
      |                                          1
Error: BOZ literal constant near (1) cannot be assigned to a REAL variable [see ‘-fno-allow-invalid-boz’]
/home/vagrant/rokko/build/rokko/build/EigenExa-2.4b/src/eigen_libs.F:1860:41:

 1860 |       data const_pai /z'400921FB54442D18'/
      |                                         1
Error: BOZ literal constant near (1) cannot be assigned to a REAL variable [see ‘-fno-allow-invalid-boz’]
/home/vagrant/rokko/build/rokko/build/EigenExa-2.4b/src/eigen_libs.F:1833:35:

 1833 |       data eps /z'3CB0000000000000'/
      |                                   1
Error: BOZ literal constant near (1) cannot be assigned to a REAL variable [see ‘-fno-allow-invalid-boz’]

コンパイルオプション-fno-allow-invalid-bozが必要

t-sakashita commented 1 year ago
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
  if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0.0)
    add_definitions("-fallow-argument-mismatch -fallow-invalid-boz")
  endif()
endif()
t-sakashita commented 1 year ago

上記では、ソースファイルmiscC.cに対しても、-fallow-argument-mismatch -fallow-invalid-bozがセットされてしまい、エラーとなる。

Fortranコンパイラのみにオプションをセットする方法

https://stackoverflow.com/questions/25534932/cmake-fortran-compiler-dependent-flags

とりあえず、CMAKE_Fortran_FLAGSに追加する方針をとる。

t-sakashita commented 1 year ago

523610255dd5e049947b8a7dcffd6f04cc29745e

t-sakashita commented 1 year ago

パッケージのダウンロードで失敗した。 https://github.com/t-sakashita/rokko/actions/runs/5000228305/jobs/8958059200

なぜでしょうか? @wistaria

t-sakashita commented 1 year ago

↑何度かRe-runすると、パッケージのダウンロードができるようになりました。 たまたま、azureのネットワークの調子が悪かっただけなのだと思います。

t-sakashita commented 1 year ago

eigenexaのインストールに関するActionsは、成功した。