firemodels / fds

Fire Dynamics Simulator
https://pages.nist.gov/fds-smv/
Other
650 stars 618 forks source link

Compilation failure for GitHub Actions for MacOS #12851

Closed mcgratta closed 5 months ago

mcgratta commented 5 months ago

I just committed code changes to the fds central repository and I received an error from GitHub actions when it tried to compile the osx_gnu_openmpi version. From the link error below, it appears as if the linker is trying to link code compiled on an ARM64 computer with x86 code, like the Intel MKL libraries.

mpifort -m64 -O0 -std=f2018 -ggdb -Wall -Wcharacter-truncation -Wno-target-lifetime -fcheck=all -fbacktrace -ffpe-trap=invalid,zero,overflow -frecursive -ffpe-summary=none -fall-intrinsics -cpp -DGITHASH_PP=\"-master\" -DGITDATE_PP=\""Thu Apr 25 16:15:21 2024 -0400\"" -DBUILDDATE_PP=\""Apr 25, 2024  20:15:57\"" -DWITH_MKL -I/opt/intel/oneapi/mkl/2023.2.0/include   -fopenmp -o fds_ompi_gnu_osx_db prec.o cons.o chem.o prop.o devc.o type.o data.o mesh.o func.o gsmv.o smvv.o rcal.o turb.o soot.o pois.o geom.o ccib.o radi.o part.o vege.o ctrl.o hvac.o mass.o wall.o fire.o velo.o pres.o init.o dump.o read.o divg.o main.o /opt/intel/oneapi/mkl/2023.2.0/lib/libmkl_intel_lp64.a /opt/intel/oneapi/mkl/2023.2.0/lib/libmkl_sequential.a /opt/intel/oneapi/mkl/2023.2.0/lib/libmkl_core.a /opt/intel/oneapi/mkl/2023.2.0/lib/libmkl_blacs_custom_lp64.a -lpthread -lm -ldl -ld_classic 
ld: warning: ignoring file /opt/intel/oneapi/mkl/2023.2.0/lib/libmkl_intel_lp64.a, building for macOS-arm64 but attempting to link with file built for unknown-x86_[64](https://github.com/firemodels/fds/actions/runs/8838812053/job/24270795538#step:8:65)
ld: warning: ignoring file /opt/intel/oneapi/mkl/2023.2.0/lib/libmkl_sequential.a, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /opt/intel/oneapi/mkl/2023.2.0/lib/libmkl_core.a, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
ld: warning: ignoring file /opt/intel/oneapi/mkl/2023.2.0/lib/libmkl_blacs_custom_lp64.a, building for macOS-arm64 but attempting to link with file built for unknown-x86_64
Undefined symbols for architecture arm64:
  "_cluster_sparse_solver_d_", referenced from:
      ___globmat_solver_MOD_finish_glmat_solver in pres.o
      ___globmat_solver_MOD_get_h_matrix_ludcmp in pres.o
      ___globmat_solver_MOD_glmat_solver in pres.o
  "_pardiso_d_", referenced from:
      ___locmat_solver_MOD_finish_ulmat_solver in pres.o
      ___locmat_solver_MOD_ulmat_h_matrix_ludcmp in pres.o
      ___locmat_solver_MOD_ulmat_solve_zone in pres.o
ld: symbol(s) not found for architecture arm64
collect2: error: ld returned 1 exit status
make: *** [ompi_gnu_osx_db] Error 1
Error: Process completed with exit code 2.
marcosvanella commented 5 months ago

FYI I took out OneAPI from the OSX actions file. macos-latest is now an M1 runner. First MKL was crashing with ARM native gcc and openmpi from brew as Kevin shows. Taking the library linking made the intel osx target update and crash when trying to compile openmpi with ifort. I just left the gnu osx target compiling with gcc-openmpi and no mkl.

rmcdermo commented 5 months ago

Sounds reasonable. Thanks @marcosvanella

marcfehling commented 4 months ago

Sorry for joining the party so late.

As @marcosvanella stated already, the macos-latest configuration now runs on M1 ARM machines. See also: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories

As far as I know, Intel MKL only runs on x64 architecture, so we are out of luck with ARM machines. https://www.intel.com/content/www/us/en/developer/articles/system-requirements/oneapi-math-kernel-library-system-requirements.html

Similarly, the Intel Fortran compilers do not generate ARM code as far as I know.

We can fall back to a legacy configuration in github-actions that still uses x64 processors by specifying macos-13. Or no longer care about it (as you already implemented).

rmcdermo commented 4 months ago

Thanks @marcfehling . We care, just lots on the to-do list before we can get an open-source LU solver implemented :)