coin-or-tools / ThirdParty-Mumps

COIN-OR autotools harness to build Mumps
Eclipse Public License 1.0
18 stars 13 forks source link

SucessFull Compiling ARM64 Android Termux; Bugs in patch file get.Mumps #9

Closed defencedog closed 1 year ago

defencedog commented 1 year ago

I assume there is a problem with patches because similar lines sometimes are comment in .F file whereas left intact in other places especially true for USE OMP_LIB

Using openblas, clang, gfortran-11 (for TUR Termux repo) & self-compiled metis5

clang version 15.0.4
Target: aarch64-unknown-linux-android24
Thread model: posix
InstalledDir: /data/data/com.termux/files/usr/bin
Found candidate GCC installation: /data/data/com.termux/files/usr/lib/gcc/aarch64-linux-android/11.1.0
Found candidate GCC installation: /data/data/com.termux/files/usr/lib/gcc/aarch64-linux-android/11.3.0
Selected GCC installation: /data/data/com.termux/files/usr/lib/gcc/aarch64-linux-android/11.3.0
Candidate multilib: .;@m64
Selected multilib: .;@m64

gfortran-11 -v
Reading specs from /data/data/com.termux/files/usr/lib/gcc/aarch64-linux-android/11.3.0/specs
COLLECT_GCC=gfortran-11
COLLECT_LTO_WRAPPER=/data/data/com.termux/files/usr/libexec/gcc/aarch64-linux-android/11.3.0/lto-wrapper
Target: aarch64-linux-android
Configured with: /home/builder/.termux-build/gcc-11/src/configure --disable-dependency-tracking --prefix=/data/data/com.termux/files/usr --libdir=/data/data/com.termux/files/usr/lib --sbindir=/data/data/com.termux/files/usr/bin --disable-rpath --disable-rpath-hack --enable-initfini-array --enable-default-pie --enable-languages=c,c++,fortran --enable-lto --enable-host-shared --enable-host-libquadmath --enable-libatomic --enable-libatomic-ifuncs=no --enable-libbacktrace --enable-libquadmath --enable-libgomp --enable-gold --enable-version-specific-runtime-libs --enable-eh-frame-hdr-for-static --disable-shared --disable-libmpx --disable-libssp --disable-libstdcxx --disable-multilib --disable-tls --with-libatomic --with-system-zlib --with-gmp=/data/data/com.termux/files/usr --with-mpfr=/data/data/com.termux/files/usr --with-mpc=/data/data/com.termux/files/usr --with-isl=/data/data/com.termux/files/usr --with-gxx-include-dir=/data/data/com.termux/files/usr/include/c++/v1 --program-suffix=-11 --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419 --with-stage1-ldflags=-specs=/home/builder/.termux-build/gcc-11/tmp/specs --host=aarch64-linux-android --target=aarch64-linux-android --disable-nls --enable-static --libexecdir=/data/data/com.termux/files/usr/libexec
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.3.0 (GCC)

Metis check

checking for library Metis with combined link and compile check... yes
checking whether Metis library is linkable with Fortran compiler... yes
checking Metis version... 5

Comment out following lines {filename/location} {line(s)} {contents or as above}

MUMPS/src/dsol_omp_m.F 300 [USE OMP_LIB]
MUMPS/src/ssol_omp_m.F 300
MUMPS/src/dfac_par_m.F 42
MUMPS/src/dfac_b.F 33 52
MUMPS/src/sfac_b.F 33 528
MUMPS/src/sfac_par_m.F 42
MUMPS/src/dsol_lr.F 16  [USE DMUMPS_LR_CORE]
MUMPS/src/ssol_lr.F 16 [USE SMUMPS_LR_CORE]

Configure & build command CC=clang FC=gfortran-11 LIBS=/data/data/com.termux/files/usr/lib/gcc/aarch64-linux-android/11.3.0/libgomp.a ./configure ADD_FCFLAGS=-fallow-argument-mismatch --prefix=$PREFIX/local --with-lapack="-L/data/data/com.termux/files/usr/include/openblas/ -lopenblas" --with-metis-lflags=$PREFIX/local/lib/[libmetis.so](http://libmetis.so/) --with-precision=all --with-intsize=64 --build=aarch64-linux-android

svigerske commented 1 year ago

The patch in ThirdParty-Mumps doesn't do anything with the OMP_LIB macro, so the problem seems to be rather in the Mumps code itself.

If you do not comment out the lines you suggest, you will get compilation errors on your platform?

defencedog commented 1 year ago

Yes build isn't successful if i don't do above steps

svigerske commented 1 year ago

I don't have a setup to try to reproduce compilation failures on ARM64, so I am very hesitant to add another patch to workaround issues with Mumps. You might want to bring up your problem with the MUMPS developers instead: http://mumps-solver.org/