LFortran 编译 PRIMA

  • LFortran Compiles PRIMA: LFortran can now compile and execute libprima/PRIMA, marking the eighth production-grade third-party code. PRIMA is a Fortran package for solving general nonlinear optimization problems without derivatives.

    • Compilation Steps: Set up the environment with conda create -n lfortran lfortran=0.46.0 make cmake and git clone https://github.com/Pranavchiku/prima.git. Then, set environment variables for macos or linux and run git clean -dfx, FC="lfortran --cpp" cmake -S. -B build -DCMAKE_INSTALL_PREFIX=$(pwd)/install && cmake --build build --target install to build and compile. For optimizations, use FC="lfortran --cpp --fast".
    • Benchmarks: Compared LFortran with GFortran without optimizations on a MacBook Air M2. Compiling cobyla took 5.284s with LFortran and 6.881s with GFortran. In examples, LFortran was sometimes slower and sometimes faster than GFortran.
  • Development Overview: Compiling PRIMA was challenging with issues like improper handling of procedure variables, passing arrays with non-unit strides, and precision loss with the power operator. Multiple pull requests addressed these issues.
  • Next Steps: LFortran has compiled eight third-party codes and aims to reach beta quality by compiling 10 more. The priority is to transition from alpha to beta, focusing on features used in these codes. They will continue to announce successful compilations and target other codes like Fortran Package Manager (fpm), LAPACK, etc.
  • Join Us: Welcome new contributors on Zulip.
  • Acknowledgements: Thank Sovereign Tech Fund (STF), NumFOCUS, QuantStack, Google Summer of Code, John D. Cook, LANL, GSI Technology, GitHub, OpenCollective and NumFOCUS sponsors, and all contributors.
  • Discussions: Fortran Discourse: https://fortran-lang.discourse.group/t/lfortran-compiles-prima/9296, Twitter/X: https://x.com/lfortranorg/status/1896958812365713906
阅读 7
0 条评论