libprima / prima

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. PRIMA means Reference Implementation for Powell's methods with Modernization and Amelioration, P for Powell.
http://libprima.net
BSD 3-Clause "New" or "Revised" License
304 stars 40 forks source link

CMake test fails with strict diagnostic options for Intel compilers #193

Open zaikunzhang opened 5 months ago

zaikunzhang commented 5 months ago

Hi @nbelakovski ,

I tried adding strict diagnostic options for Intel compilers to cmake.yml:

https://github.com/libprima/prima/compare/5366ab6..ea93390

After that, a few warnings are emitted, which are treated as errors, and the CMake test then fails:

https://github.com/libprima/prima/actions/runs/8790876683

Would you have time to have a look?

I would like to reiterate the following.

  1. Warnings are future bugs. PRIMA does not tolerate warnings, unless they are emitted due to compiler bugs or we are one thousand percent sure that they are irrelevant.

  2. In our development and test, compilers and linters should be invoked with the most strict diagnostic/debugging options, e.g., -Wall -Wextra -Wpedantic -Werror or something similar. This also applies to other code such as C++ and Python.

Thank you very much.

Zaikun

zaikunzhang commented 5 months ago

Hi Alexis @amontoison,

Could you have a look at this? Thank you.

Best regards, Zaikun

amontoison commented 5 months ago

Hi @zaikunzhang! The issue is that you have some headers of C functions in prima.c. They should in a *.h file. I suppose that they are not in prima.h because you don't want to export them but we can create another header file.

More details: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54817

zaikunzhang commented 5 months ago

Thank you @amontoison . Could you propose the changes by a PR?

There are also other warnings/ errors of different nature.

Many thanks.