Open16

BinaryBuilder.jlでHPhiをbuildしたい

ultimatileultimatile
cd HPhi-3.5.1
cmake -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release -S . -Bbuild -DCONFIG=gcc -DENABLE_MPI=OFF
cmake --build build -j16
cmake --build build --target install
ultimatileultimatile
  • find_package(MPI COMPONENTS Fortran REQUIRED)にした方が良い?

https://discourse.cmake.org/t/cmake-and-mpi-fortran-cmake-doesnt-see-it/4869

ultimatileultimatile
-- Check for working Fortran compiler: /workspace/destdir/bin/mpif90 - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestFortranCompiler.cmake:54 (message):
  The Fortran compiler

    "/workspace/destdir/bin/mpif90"

  is not able to compile a simple test program.

  It fails with the following output:

crossbuild特有の問題っぽい?↓

https://zenn.dev/hidenori3/articles/8ba759cb7d58a6

ultimatileultimatile

x86_64-linux-musl+OpenBLAS_jll+OpenMPI_jll作業log

cmake -S./HPhi-3.5.2/ -Bbuild -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release -DBLAS_LIBRARIES=$libdir/libopenblas64_.so -DLAPACK_LIBRARIES=$libdir/libopenblas64_.so -DCMAKE_Fortran_COMPILER=mpif90
ultimatileultimatile

enable_language(C Fortran)enable_language(Fortran)にした方が良いっぽい

ultimatileultimatile

platform一覧

   [ ] Platform("i686", "linux"; libc = "glibc")
   [ ] Platform("x86_64", "linux"; libc = "glibc")
   [ ] Platform("aarch64", "linux"; libc = "glibc")
   [ ] Platform("armv6l", "linux"; call_abi = "eabihf", libc = "glibc")
   [ ] Platform("armv7l", "linux"; call_abi = "eabihf", libc = "glibc")
   [ ] Platform("powerpc64le", "linux"; libc = "glibc")
   [ ] Platform("i686", "linux"; libc = "musl")
   [ ] Platform("x86_64", "linux"; libc = "musl")
   [ ] Platform("aarch64", "linux"; libc = "musl")
   [ ] Platform("armv6l", "linux"; call_abi = "eabihf", libc = "musl")
   [ ] Platform("armv7l", "linux"; call_abi = "eabihf", libc = "musl")
   [ ] Platform("x86_64", "macos"; )
   [ ] Platform("aarch64", "macos"; )
   [ ] Platform("x86_64", "freebsd"; )
   [ ] Platform("i686", "windows"; )
   [ ] Platform("x86_64", "windows"; )
ultimatileultimatile

64bitかつx86_64aarch64だけ残す

   [ ] Platform("x86_64", "linux"; libc = "glibc")
   [ ] Platform("aarch64", "linux"; libc = "glibc")
   [ ] Platform("x86_64", "linux"; libc = "musl")
   [ ] Platform("aarch64", "linux"; libc = "musl")
   [ ] Platform("x86_64", "macos"; )
   [ ] Platform("aarch64", "macos"; )
   [ ] Platform("x86_64", "freebsd"; )
   [ ] Platform("x86_64", "windows"; )
  • muslはいけるのか?
  • windowsはいけるのか?
  • freebsdはいけるのか?
ultimatileultimatile

いけるのかよくわかないのを外す

   [ ] Platform("x86_64", "linux"; libc = "glibc")
   [ ] Platform("aarch64", "linux"; libc = "glibc")
   [ ] Platform("x86_64", "macos"; )
   [ ] Platform("aarch64", "macos"; )
ultimatileultimatile

Platform("x86_64", "linux"; libc = "glibc")

sed -i -e "s/C Fortran/Fortran/" HPhi-3.5.2/CMakeLists.txt
cmake -S./HPhi-3.5.2/ -Bbuild -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release -DBLAS_LIBRARIES=$libdir/libopenblas64_.so -DLAPACK_LIBRARIES=$libdir/libopenblas64_.so -DCMAKE_Fortran_COMPILER=mpifort
cmake --build build --parallel ${nproc}

失敗

Fatal Error: Cannot open module file ‘mpi.mod’ for reading at (1): No such file or directory

link path ($libdir=/workspace/destdir/lib)をわからせる必要がある