jacobwilliams / PowellOpt

Optimization algorithms by M.J.D. Powell
Other
35 stars 7 forks source link

Build fails on Sonoma (x86_64, arm64): `Error: Symbol 'n' at (1) has no IMPLICIT type` #8

Closed barracuda156 closed 9 months ago

barracuda156 commented 9 months ago
 + gfortran -c ././src/cobyla.f90   -O3 -funroll-loops -Wimplicit-interface -fPIC -fmax-errors=1 -fcoarray=single -fimplicit-none -Werror=implicit-interface -ffree-form -J build/gfortran_2654F75F5833692A -Ibuild/gfortran_2654F75F5833692A -o build/gfortran_2654F75F5833692A/PowellOpt/src_cobyla.f90.o
././src/cobyla.f90:138:24:

  138 |     subroutine cobylb (n, m, mpp, x, rhobeg, rhoend, iprint, maxfun, con, sim, simi, &
      |                        1
Error: Symbol 'n' at (1) has no IMPLICIT type
compilation terminated due to -fmax-errors=1.
[ 25%]                     cobyla.f90  done.

././src/cobyla.f90:138:24:

  138 |     subroutine cobylb (n, m, mpp, x, rhobeg, rhoend, iprint, maxfun, con, sim, simi, &
      |                        1
Error: Symbol 'n' at (1) has no IMPLICIT type
compilation terminated due to -fmax-errors=1.
<ERROR> Compilation failed for object " src_cobyla.f90.o "
<ERROR> stopping due to failed compilation
STOP 1

https://build.macports.org/builders/ports-14_x86_64-builder/builds/11972/steps/install-port/logs/stdio

jacobwilliams commented 9 months ago

Just pushed a fix. This is because FPM got stricter with the default settings, and this is very old code.

barracuda156 commented 9 months ago

Thank you! Will update it in Macports now.

zaikunzhang commented 9 months ago

Not intending to tread on the toes of @jacobwilliams, who deserves many credits for maintaining the F95 wrappers of the late Professor Powell's code, I would like to bring PRIMA to the attention of @barracuda156 and anyone who uses Powell's methods in practice.

PRIMA is a package for solving general nonlinear optimization problems without using derivatives. It provides the reference implementation for Powell's derivative-free optimization methods, i.e., COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA. It fixes bugs in the original Fortran 77 code, which is not maintained anymore, and it improves the performance significantly.

See https://github.com/libprima/prima .

Thank @jacobwilliams !

barracuda156 commented 9 months ago

@zaikunzhang Thank you for the reference! I can test PRIMA build in a few days once I am back to my normal testing hardware, and provided it builds both for PowerPC and aarch64, I will add the port for it to Macports (I assume x86 works as a given, but the rest should be verified).

barracuda156 commented 9 months ago

@zaikunzhang Build works fine, regular tests pass, stress tests freeze however: https://github.com/libprima/prima/issues/121

zaikunzhang commented 9 months ago

@zaikunzhang Build works fine, regular tests pass, stress tests freeze however: https://github.com/libprima/prima/issues/121

Thanks. That's not freeze. The stress test is intended to take forever (a long time), and we what to make sure that nothing will crash before it finishes or is interrupted. That is exactly what we want to do with the stress test.

The stress test should not be invoked on a local machine (it is turned off by default), unless you want to observe a "freeze". We do it only on GitHub actions, which will terminate the test after six hours.

Thank you.