coin-or-tools / BuildTools

Macros and patches for GNU autotools
https://coin-or-tools.github.io/BuildTools/
Other
3 stars 7 forks source link

HSL ThirdParty build system in IpOpt out of date #69

Closed svigerske closed 5 years ago

svigerske commented 5 years ago

Issue created by migration from Trac.

Original creator: jhogg

Original creation time: 2009-01-08 12:04:13

Assignee: @andrea5w

Version: 0.5

STFC now distribute codes and their dependencies in separate files. For example let us consider MA57, observing that no naming scheme is given when downloading the file (it just appears as text in the browser).

We have wlog two files: ma57d.f ma57d.deps.f

The current build system expects a single file ma57ad.f. This models how things used to be done - since these scripts were written it seems that renaming and management practice changes have occurred.

Obviously in this case [and for all F77 codes] we can trivially work around this by concatenating and renaming the result ma57ad.f.

I am currently in the process of adding an interface to HSL_MA77 which is a Fortran 90 code. As a result we have three files: hsl_ma77d.f90 hsl_ma77d.deps.f90 hsl_ma77d.deps.f

We have dependencies in both fixed and free source formats, so concatenating these files will produce compile errors. Further we need to add a dependency to ensure that the f90 deps are compiled before the f90 code so the module files are readable.

We should also endeavor to ensure the f77 and f90 compilers used are compatible - I've seen some nasty messes with automake choosing g77 (GNU) and f95 (NAG) compilers which don't produce stuff one can easily link together due to underscoring practices. I neat solution might be to default to using the F95 ($FC) compiler to compile F77 code in place of the ($F77) compiler.

I don't have the necessary knowledge of automake and the IpOpt build system to easily make these changes myself however.

Jonathan Hogg

svigerske commented 5 years ago

Comment by @svigerske created at 2011-01-04 11:16:56

Hi,

Replying to [ticket:69 jhogg]:

STFC now distribute codes and their dependencies in separate files. For example let us consider MA57, observing that no naming scheme is given when downloading the file (it just appears as text in the browser).

We have wlog two files: ma57d.f ma57d.deps.f

The current build system expects a single file ma57ad.f. This models how things used to be done - since these scripts were written it seems that renaming and management practice changes have occurred.

Obviously in this case [and for all F77 codes] we can trivially work around this by concatenating and renaming the result ma57ad.f.

Yes. You think one still needs to change the buildsystem then?

I just downloaded MA57 and got a tar archive, which contained among others the files ma57d.f and ddeps.f. I then concatenate these files into ma57ad.f and tried a build.

The build failed on multiple symbols because ddeps.f containes MC21AD and MC21BD, which are already in my ma21ad.f, which seem to be used for MA28.

So I remove the duplicate routines from my ma57ad.f and try again. Now ThirdParty/HSL builds fine but Ipopt does not link because I did not provide FD15.

So I download also FD15, add the fd15d.f to the end of ma57ad.f, try again, and things seem to work fine.

I believe the buildsystem could be adapted to the current way how HSL provides the routines, but it then may not work anymore for users who did not download the HSL anew. Maybe it would be better to update only the Ipopt documentation for the current system?

I am currently in the process of adding an interface to HSL_MA77 which is a Fortran 90 code. As a result we have three files: hsl_ma77d.f90 hsl_ma77d.deps.f90 hsl_ma77d.deps.f

We have dependencies in both fixed and free source formats, so concatenating these files will produce compile errors. Further we need to add a dependency to ensure that the f90 deps are compiled before the f90 code so the module files are readable.

From a look on the buildsystem, it seems that this has all be done.

We should also endeavor to ensure the f77 and f90 compilers used are compatible - I've seen some nasty messes with automake choosing g77 (GNU) and f95 (NAG) compilers which don't produce stuff one can easily link together due to underscoring practices. I neat solution might be to default to using the F95 ($FC) compiler to compile F77 code in place of the ($F77) compiler.

I don't have the necessary knowledge of automake and the Ipopt build system to easily make these changes myself however.

There is, as far as I know, no option in the buildsystem to specify a F95 compiler ($FC). F90 code just gets compiled by $F77, hoping that it's a compiler that also supports F95. It gives an error message if this is not the case, so the user can specify explicitely which fortran compiler to use.

We also recently changed the order in which compilers are searched for on !Linux/Gnu systems. I.e., it now looks first for gfortran, then to fort77.

Stefan

svigerske commented 5 years ago

Comment by jdh created at 2012-01-10 10:18:40

There is now a autotools based build distributed from HSL specifically for producing the libcoinhsl library. See http://www.hsl.rl.ac.uk/ipopt.

I believe the plan is to use this going forwards for new HSL solver support (HSL_MA77, HSL_MA86, HSL_MA97). Older codes will continue to be supported using the ThirdParty/HSL/ system.

With the next release of Ipopt (current version has bugs in HSL_MA86 driver - fixed in trunk) documentation should be updated to reflect this arrangement?

svigerske commented 5 years ago

Comment by @svigerske created at 2012-02-12 18:52:19

Also the COIN-OR Buildtools ThirdParty/HSL/trunk has been updated to use the new HSL archive system. A new stable/1.4 branch has been created now, too.

In my opinion, the changes to the HSL link require a new Ipopt stable version, since a user likely has to download HSL anew. Ipopt's documentation is not updated yet.

The fixes for the Ipopt/MA86 interface have been merged into Ipopt's stable/3.10 and have been released with Ipopt 3.10.2.

svigerske commented 5 years ago

Comment by @svigerske created at 2012-02-12 18:52:19

Resolution: fixed