Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Meson] Use the option -DLANCELOT_USE_MA57 is libhsl is found #203

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

amontoison
Copy link
Member

No description provided.

@amontoison amontoison requested a review from nimgould December 13, 2023 17:57
@amontoison
Copy link
Member Author

amontoison commented Dec 13, 2023

@nimgould
I have this error with I compile GALAHAD with this new flag and libHSL.

[1597/2484] Compiling Fortran object silst_single.p/src_sils_silst.F90.o
FAILED: silst_single.p/src_sils_silst.F90.o 
gfortran -Isilst_single.p -I. -I.. -Iinclude -I../include -I../src/dum/include -Isrc/ampl -I../src/ampl -I/home/alexis/Applications/libhsl/modules -Ilibgalahad_single.so.p -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -O0 -g -fopenmp -DLANCELOT_USE_MA57 -DGALAHAD_SINGLE -DSPRAL_SINGLE -Jsilst_single.p -o silst_single.p/src_sils_silst.F90.o -c ../src/sils/silst.F90
../src/sils/silst.F90:9:24:

    9 |    TYPE( SILS_control ) :: control
      |                        1
Error: Derived type ‘sils_control’ at (1) is being used before it is defined
../src/sils/silst.F90:10:22:

   10 |    TYPE( SILS_ainfo ) :: ainfo
      |                      1
Error: Derived type ‘sils_ainfo’ at (1) is being used before it is defined
../src/sils/silst.F90:11:22:

   11 |    TYPE( SILS_finfo ) :: finfo
      |                      1
Error: Derived type ‘sils_finfo’ at (1) is being used before it is defined
../src/sils/silst.F90:12:22:

   12 |    TYPE( SILS_sinfo ) :: sinfo
      |                      1
Error: Derived type ‘sils_sinfo’ at (1) is being used before it is defined
../src/sils/silst.F90:13:24:

   13 |    TYPE( SILS_factors ) :: factors
      |                        1
Error: Derived type ‘sils_factors’ at (1) is being used before it is defined
../src/sils/silst.F90:34:15:

   34 |    IF ( ainfo%FLAG < 0 ) THEN
      |               1
Error: Symbol ‘ainfo’ at (1) has no IMPLICIT type
../src/sils/silst.F90:35:73:

   35 |     WRITE(6,"( ' Failure of SILS_ANALYSE with AINFO%FLAG=',I0)" ) ainfo%FLAG
      |                                                                         1
Error: Symbol ‘ainfo’ at (1) has no IMPLICIT type
../src/sils/silst.F90:37:6:

   37 |    END IF
      |      1
Error: Expecting END PROGRAM statement at (1)
../src/sils/silst.F90:40:15:

   40 |    IF ( finfo%FLAG < 0 ) THEN
      |               1
Error: Symbol ‘finfo’ at (1) has no IMPLICIT type
../src/sils/silst.F90:41:75:

   41 |      WRITE(6,"(' Failure of SILS_FACTORIZE with FINFO%FLAG=', I0)") finfo%FLAG
      |                                                                           1
Error: Symbol ‘finfo’ at (1) has no IMPLICIT type
../src/sils/silst.F90:43:6:

   43 |    END IF
      |      1
Error: Expecting END PROGRAM statement at (1)
../src/sils/silst.F90:47:15:

   47 |    IF ( sinfo%FLAG == 0 ) WRITE(6,                                             &
      |               1
Error: Symbol ‘sinfo’ at (1) has no IMPLICIT type
../src/sils/silst.F90:51:14:

   51 |    IF( sinfo%FLAG == 0 ) WRITE(6,                                              &
      |              1
Error: Symbol ‘sinfo’ at (1) has no IMPLICIT type
../src/sils/silst.F90:33:53:

   33 |    CALL SILS_ANALYSE( matrix, factors, control, ainfo )
      |                                                     1
Error: Symbol ‘ainfo’ at (1) has no IMPLICIT type
../src/sils/silst.F90:31:41:

   31 |    CALL SILS_INITIALIZE( factors, control )
      |                                         1
Error: Symbol ‘control’ at (1) has no IMPLICIT type
../src/sils/silst.F90:31:32:

   31 |    CALL SILS_INITIALIZE( factors, control )
      |                                1
Error: Symbol ‘factors’ at (1) has no IMPLICIT type
../src/sils/silst.F90:39:55:

   39 |    CALL SILS_FACTORIZE( matrix, factors, control, finfo )
      |                                                       1
Error: Symbol ‘finfo’ at (1) has no IMPLICIT type
../src/sils/silst.F90:46:54:

   46 |    CALL SILS_SOLVE( matrix, factors, X, control, sinfo )
      |                                                      1
Error: Symbol ‘sinfo’ at (1) has no IMPLICIT type

@amontoison
Copy link
Member Author

amontoison commented Dec 13, 2023

@nimgould
You can reproduce the issue with

meson setup builddir --buildtype=debug \
                     -Dlibhsl_path=/home/alexis/Applications/libhsl/lib \
                     -Dlibhsl_modules=/home/alexis/Applications/libhsl/modules \
                     -Dexamples=true \
                     -Dtests=true

You just need to replace /home/alexis/Applications/libhsl by the path where you installed libHSL.

@nimgould
Copy link
Contributor

This is because you are using the -DLANCELOT_USE_MA57 flag when trying to test sils. This flag is used for other (lancelot) packages to switch linear solvers; lancelot was designed in the days before sls, and to modify it to use sls would take more effort than
I have time for at present. Maybe one day, when I am fully retired!

@nimgould
Copy link
Contributor

Probably a simpler alternative would be to move the
#ifdef LANCELOT_USE_MA57
#define GALAHAD_SILS_precision HSL_MA57_single
#else
#define GALAHAD_SILS_precision GALAHAD_SILS_single
#endif
out of galahad_modules.h and into the six lancelot routines that need the LANCELOT_USE_MA57 flag. I will try this later

@nimgould
Copy link
Contributor

2nd alternative didn't work as #define GALAHAD_SILS_precision has to be global. Thus we should not have the -DLANCELOT_USE_MA57 flag for any compiles except for lancelot packages (namely, lancelot.F90, lancelot_steering.F90, mdchl.F90 frntl.F90, precn.F90 and lancelot_types.F90, but it doesn't hurt to use it for all routines in the lancelot directory)

@amontoison
Copy link
Member Author

amontoison commented Dec 14, 2023

Nick, is it not possible to define a macro LANCELOT at the top of the following files: lancelot.F90, lancelot_steering.F90, mdchl.F90 frntl.F90, precn.F90 and lancelot_types.F90?

#define LANCELOT 1
#include "galahad_modules.h"

After that we could maybe update galahad_modules.h to check if the flags LANCELOT_USE_MA57 and LANCELOT are both defined.

@nimgould
Copy link
Contributor

That sounds like a good possibility. I will try

@nimgould
Copy link
Contributor

It seemed to have worked, I have pushed, please try it out

@amontoison
Copy link
Member Author

It works Nick 👍

@amontoison amontoison merged commit ff64b83 into ralna:master Dec 15, 2023
4 of 7 checks passed
@amontoison amontoison deleted the lancelot_hsl branch December 15, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants