mpimd-csc / flexiblas

FlexiBLAS - A BLAS and LAPACK wrapper library with runtime exchangeable backends. This is only a mirror of https://gitlab.mpi-magdeburg.mpg.de/software/flexiblas-release
https://www.mpi-magdeburg.mpg.de/projects/flexiblas
GNU Lesser General Public License v3.0
36 stars 7 forks source link

Cross-compilation issues #11

Closed ViralBShah closed 6 months ago

ViralBShah commented 3 years ago

In Julia, we cross-compile the libraries for 13 platforms. The first step towards using flexiblas in Julia is to get it to build with our BinaryBuilder cross compilation system. Tests that need to be run at runtime generally do not work out. In this case, it looks like disabling openmp will be good enough. Any ideas how to do so?

[15:41:59] -- Try OpenMP C flag = [-fopenmp]
[15:41:59] -- Performing Test OpenMP_FLAG_DETECTED
[15:41:59] -- Performing Test OpenMP_FLAG_DETECTED - Success
[15:41:59] -- Try OpenMP Fortran flag = [-fopenmp]
[15:41:59] -- Performing Test OpenMP_FLAG_DETECTED
[15:41:59] -- Performing Test OpenMP_FLAG_DETECTED - Success
[15:41:59] -- Found OpenMP: -fopenmp  
[15:41:59] CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately:
[15:41:59]    OMP_RUN_STATE_C (advanced)
[15:41:59]    OMP_RUN_STATE_C__TRYRUN_OUTPUT (advanced)
[15:41:59] For details see /workspace/srcdir/flexiblas/build/TryRunResults.cmake
[15:41:59] -- Failed to determine OpenMP Version of the C Compiler
[15:41:59] CMake Error: TRY_RUN() invoked in cross-compiling mode, please set the following cache variables appropriately:
[15:41:59]    OMP_RUN_STATE_Fortran (advanced)
[15:41:59]    OMP_RUN_STATE_Fortran__TRYRUN_OUTPUT (advanced)
[15:41:59] For details see /workspace/srcdir/flexiblas/build/TryRunResults.cmake
[15:41:59] -- Failed to determine OpenMP Version of the Fortran Compiler

Here's the build recipe and the results on all platforms: https://github.com/JuliaPackaging/Yggdrasil/pull/2248

grisuthedragon commented 3 years ago

Thats not the only test where config-time code ist evaluated. -.- I can think of something like a configuration file, where one could set all related values. But I have to do a bit research about cmake and the cross compiling thing.

ViralBShah commented 3 years ago

For now, I think if I can somehow tell it to disable OpenMP, it would be great since I can then figure out how far the builds get.

grisuthedragon commented 3 years ago

I started working on this. I checked out your sources and changed

GitSource("https://github.com/mpimd-csc/flexiblas.git",                                                                                                                                          
              "fae1b3c4d546ddae73b369570ff6fecd8127fcbf"), 

into

DirectorySource("/home/devuser/work/software/flexiblas") 

to use my local development version. Then I end up with the following error:

~/software/julia-1.5.3/bin/julia F/FlexiBLAS/build_tarballs.jl 
[ Info: Building for i686-linux-gnu, x86_64-linux-gnu, aarch64-linux-gnu, armv7l-linux-gnueabihf, powerpc64le-linux-gnu, i686-linux-musl, x86_64-linux-musl, aarch64-linux-musl, armv7l-linux-musleabihf, x86_64-apple-darwin14, x86_64-unknown-freebsd11.1, i686-w64-mingw32, x86_64-w64-mingw32
[ Info: Directory "/home/devuser/work/software/flexiblas" found
   Updating registry at `~/.julia/registries/General`
/bin/bash: line 34: cd: too many arguments
Previous command exited with 1
ERROR: LoadError: Build for flexiblas on aarch64-linux-gnu did not complete successfully

Stacktrace:
 [1] error(::String) at ./error.jl:33
...

Alternatively, I need support for recursive cloning in the GitSource, since my development version works with submodules.

@ViralBShah Any ideas how to get this build process working?