diff --git a/bin/gal b/bin/gal index 1cae8ba0ac..b23440893c 100755 --- a/bin/gal +++ b/bin/gal @@ -868,6 +868,15 @@ elif [[ $2 == 'colt' ]]; then [[ $UPDATE == '1' ]] && $GALOBJ/buildspec colt update [[ ! -L RUNCOLT.SPC ]] && ln -s ~/.galahad/specs/RUNCOLT.SPC RUNCOLT.SPC +# epf + +elif [[ $2 == 'epf' ]]; then + RUNMAIN=$GALOBJ/runepf_sif_$PRECIS.o +# PROBLIB="-lgalahad_problem" + [[ ! -e ~/.galahad/specs/RUNEPF.SPC ]] && $GALOBJ/buildspec epf + [[ $UPDATE == '1' ]] && $GALOBJ/buildspec epf update + [[ ! -L RUNEPF.SPC ]] && ln -s ~/.galahad/specs/RUNEPF.SPC RUNEPF.SPC + # funnel elif [[ $2 == 'funnel' ]]; then diff --git a/doc/README.matlab b/doc/README.matlab index 8819c93207..41dc454915 100644 --- a/doc/README.matlab +++ b/doc/README.matlab @@ -4,13 +4,93 @@ Matlab interfaces are now available to a growing number of GALAHAD packages --------- For LINUX --------- + ............................ + MATLAB for R2022a and later + ............................ + +For MATLAB R2011a and above, GALAHAD must be installed using the +gfortran compiler. BUT ... you will need to use (and have installed) +gcc/gfortran-10, not the more modern version (11 and above) that may +comes as default with today's Linux. For Ubuntu Linux, see + + https://help.ubuntu.com/community/MATLAB + +for details on how to download packaged versions of the relevant +outdated compilers. For other Linux distributions, you might have +to build gcc-10 from source code. Grumble to the Mathworks! + +Once you have a working gcc/gfortran-10 - making sure that they are +both on your shell search path - either select the "install with Matlab" +option when installing, or if a gfortran version has already been installed, +issue the commands + + cd $GALAHAD/src/matlab + make -s -f $GALAHAD/makefiles/pc64.lnx.gfo + +(substitute pc.lnx.gfo for the appropriate string on non-Linux or 32-bit + machines, e.g pc.lnx.gfo). + +N.B. the MATLAB environment variable must point to your system matlab directory. + +Once the Matlab versions have been installed, make sure that +$GALAHAD/src/matlab is on your Matlab path. + +Issue the commands + + help galahad + +within Matlab to find the current status of available interfaces. + +Note that at present there is no single-precision version. + + ........................ + MATLAB for R2020b-2021b + ........................ + +As for MATLAB for R2022a, but you will need gfortran/gcc-8 not 10. +Edit $GALAHAD/makefiles/pc64.lnx.gfo to check that all mentions of gfortran/gcc +have the trailing -8. This should have been taken care of automatically +during the installation process. + + ......................... + MATLAB for R2018a-R2020a + ......................... + +As for MATLAB for R2022a, but you will need gfortran/gcc-6 not 10. +Edit $GALAHAD/makefiles/pc64.lnx.gfo to check that all mentions of gfortran/gcc +have the trailing -6. This should have been taken care of automatically +during the installation process. + + ........................ + MATLAB for R2016b-R2017b + ......................... + +As for MATLAB for R2022a, but you will need gfortran/gcc-4.9 not 10 +Edit $GALAHAD/makefiles/pc64.lnx.gfo to check that all mentions of gfortran/gcc +have the trailing -4.9. This should have been taken care of automatically +during the installation process. + + ........................ + MATLAB for R2013b-R2016a + ......................... + +As for MATLAB for R2022a, but you will need gfortran/gcc-4.7 not 10. +Edit $GALAHAD/makefiles/pc64.lnx.gfo to check that all mentions of gfortran/gcc +have the trailing -4.7. This should have been taken care of automatically + + ........................ + MATLAB for R2011a-R2013a + ......................... +As for MATLAB for R2022a, but you will need gfortran/gcc-4.4 not 10. +Edit $GALAHAD/makefiles/pc64.lnx.gfo to check that all mentions of gfortran/gcc +have the trailing -4.4. .................... MATLAB before R2011a .................... To use the Matlab interfaces, GALAHAD must be installed using the -g95 compiler - other compilers may become available in the future +g95 compiler - other compilers have become available since then. if Matlab's mex facility becomes more fortran-90 friendly. Either select the "install with Matlab" option when installing, or if a g95 version has already been installed, issue the commands @@ -40,15 +120,6 @@ $GALAHAD/makefiles/pc64.lnx.g95, and to the FFLAGS variable in your Matlab mexopts.sh file (in the relevant release subdirectory of the .matlab directory in your home directory). - ........................ - MATLAB for R2011a-R2013a - ......................... - -For MATLAB R2011a and above, GALAHAD must be installed using the -gfortran compiler. BUT ... you will need to use (and have installed) -gcc/gfortran-4.4, not the more modern version (4.5 and above) that comes -as default with today's Linux. For Ubuntu Linux, see - https://help.ubuntu.com/community/MATLAB for details on how to download packaged versions of the relevant @@ -77,43 +148,6 @@ $GALAHAD/src/matlab is on your Matlab path. to find the current status of available interfaces. - ........................ - MATLAB for R2013b-R2016a - ......................... - -As for MATLAB for R2011a-R2013a, but you will need gfortran/gcc-4.7 not 4.4. -Edit $GALAHAD/makefiles/pc64.lnx.gfo to check that all mentions of gfortran/gcc -have the trailing -4.7. - - ........................ - MATLAB for R2016b-R2017b - ......................... - -As for MATLAB for R2011a-R2013a, but you will need gfortran/gcc-4.9 not 4.4. -Edit $GALAHAD/makefiles/pc64.lnx.gfo to check that all mentions of gfortran/gcc -have the trailing -4.9. This should have been taken care of automatically -during the installation process. - - ......................... - MATLAB for R2018a-R2020a - ......................... - -As for MATLAB for R2011a-R2013a, but you will need gfortran/gcc-6 not 4.4. -Edit $GALAHAD/makefiles/pc64.lnx.gfo to check that all mentions of gfortran/gcc -have the trailing -6. This should have been taken care of automatically -during the installation process. - - ............................ - MATLAB for R2020b and above - ............................ - -As for MATLAB for R2011a-R2013a, but you will need gfortran/gcc-8 not 4.4. -Edit $GALAHAD/makefiles/pc64.lnx.gfo to check that all mentions of gfortran/gcc -have the trailing -8. This should have been taken care of automatically -during the installation process. - -Note that at present there is no single-precision version. - ........................... Replacement BLAS and LAPACK ........................... @@ -137,7 +171,7 @@ than the dynamic -l* syntax. For MAC OS X ------------ -Here, the supported compiler is GNU gfortran. So +Here, the supported compiler used to be GNU gfortran. So cd $GALAHAD/src/matlab make -s -f $GALAHAD/makefiles/pc.lnx.gfo @@ -164,16 +198,18 @@ interface. The dreaded "MATLAB Error: Cannot load any more object with static TLS" bug --------------------------------------------------------------------------- -For a number of years, the Mathworks have been aware of a serious mex bug. -MATLAB dynamically loads some libraries with static TLS (thread local storage, +For a number of years, the Mathworks were aware of a serious mex bug. +MATLAB dynamically loaded some libraries with static TLS (thread local storage, e.g. see gcc compiler flag -ftls-model). Loading too many such libs eventually -leaaves no space left. The Mathworks solution is a farcical work-around +leaaves no space left. The Mathworks solution was a farcical work-around that involves inserting the line "ones(10)*ones(10);" in startup.m, that aims to load "important" libraries first. Of late, this "solution" seems -increasigly less likley to work, but Mathworks appears not to care about -its significant mex user base by failing to provide a proper fix. +increasigly less likley to work, but Mathworks appeared not to care about +its significant mex user base by failing to provide a proper fix. Fortunately +sanity has broken out, and you are only likely to see this with older +versions of Matlab. -The most successful temporary "cure" we have found is to compile the +The most successful temporary "cure" we found was to compile the Matlab programs as usual, to issue the command ldd $GALAHAD/src/matlab/galahad_wcp.mexa64 @@ -221,6 +257,8 @@ for the discussion and tip Nick Gould (nick.gould@stfc.ac.uk) Dominique Orban (dominique.orban@polymtl.ca) Philippe Toint (philippe.toint@fundp.ac.be) +Jari Fowkes (jaroslav.fowkes@stfc.ac.uk) +Alexis Montoison (alexis.montoison@polymtl.ca) For GALAHAD productions -This version: 12th November 2020 +This version: 24th May 2024 diff --git a/doc/src/makedocs b/doc/src/makedocs index 4ef79ae8a2..2a8d03f60d 100755 --- a/doc/src/makedocs +++ b/doc/src/makedocs @@ -1,6 +1,6 @@ #!/bin/csh -foreach pack ( arc bgo blls bllsb bqp bqpb bsc check clls cro ccqp cqp dgo dps dqp eqp fdc fdh filtrane fisqp glrt gls gltr hash icfs ir lancelot lancelot_simple lpa lpb lsp lsqp l2rt lsrt lstr llsr llst lms miqr mop nls nlpt presolve psls qpa qpb qpc qpp qpt rand roots rpd rqs sbls scale scu sha sils sls slls smt sort symbols trb trs tru ugo uls wcp ) +#foreach pack ( arc bgo blls bllsb bqp bqpb bsc check clls cro ccqp cqp dgo dps dqp eqp fdc fdh filtrane fisqp glrt gls gltr hash icfs ir lancelot lancelot_simple lpa lpb lsp lsqp l2rt lsrt lstr llsr llst lms miqr mop nls nlpt presolve psls qpa qpb qpc qpp qpt rand roots rpd rqs sbls scale scu sha sils sls slls smt sort symbols trb trs tru ugo uls wcp ) #foreach pack ( filtrane ) #foreach pack ( sils ) #foreach pack ( sort ) @@ -36,7 +36,7 @@ foreach pack ( arc bgo blls bllsb bqp bqpb bsc check clls cro ccqp cqp dgo dps d #foreach pack ( ir ) #foreach pack ( qpp ) #foreach pack ( lsp ) -#foreach pack ( sha ) +foreach pack ( sha ) #foreach pack ( clls ) #foreach pack ( lsqp ) #foreach pack ( qpa ) @@ -104,4 +104,5 @@ foreach pack ( arc bgo blls bllsb bqp bqpb bsc check clls cro ccqp cqp dgo dps d # lpr ../$pack.ps ps2pdf "-sPAPERSIZE=a4" ../$pack.ps ../$pack.pdf rm ../$pack.ps + cp ../$pack.pdf ../../../galahad_docs/pdf/Fortran/ end diff --git a/include/galahad_modules.h b/include/galahad_modules.h index 31c9e63cde..bc6515ab6e 100644 --- a/include/galahad_modules.h +++ b/include/galahad_modules.h @@ -97,6 +97,7 @@ #define GALAHAD_LSQP_precision GALAHAD_LSQP_single_64 #define GALAHAD_LSRT_precision GALAHAD_LSRT_single_64 #define GALAHAD_LSTR_precision GALAHAD_LSTR_single_64 +#define GALAHAD_MAP_precision GALAHAD_MAP_single_64 #define GALAHAD_MIQR_precision GALAHAD_MIQR_single_64 #define GALAHAD_MOP_precision GALAHAD_MOP_single_64 #define GALAHAD_NLLSRT_precision GALAHAD_NLLSRT_single_64 @@ -470,6 +471,7 @@ #define GALAHAD_LSQP_precision GALAHAD_LSQP_single #define GALAHAD_LSRT_precision GALAHAD_LSRT_single #define GALAHAD_LSTR_precision GALAHAD_LSTR_single +#define GALAHAD_MAP_precision GALAHAD_MAP_single #define GALAHAD_MIQR_precision GALAHAD_MIQR_single #define GALAHAD_MOP_precision GALAHAD_MOP_single #define GALAHAD_NLLSRT_precision GALAHAD_NLLSRT_single @@ -847,6 +849,7 @@ #define GALAHAD_LSQP_precision GALAHAD_LSQP_double_64 #define GALAHAD_LSRT_precision GALAHAD_LSRT_double_64 #define GALAHAD_LSTR_precision GALAHAD_LSTR_double_64 +#define GALAHAD_MAP_precision GALAHAD_MAP_double_64 #define GALAHAD_MIQR_precision GALAHAD_MIQR_double_64 #define GALAHAD_MOP_precision GALAHAD_MOP_double_64 #define GALAHAD_NLLSRT_precision GALAHAD_NLLSRT_double_64 @@ -1220,6 +1223,7 @@ #define GALAHAD_LSQP_precision GALAHAD_LSQP_double #define GALAHAD_LSRT_precision GALAHAD_LSRT_double #define GALAHAD_LSTR_precision GALAHAD_LSTR_double +#define GALAHAD_MAP_precision GALAHAD_MAP_double #define GALAHAD_MIQR_precision GALAHAD_MIQR_double #define GALAHAD_MOP_precision GALAHAD_MOP_double #define GALAHAD_NLLSRT_precision GALAHAD_NLLSRT_double diff --git a/include/hsl_mc68.h b/include/hsl_mc68.h index 2a0eeea91d..963013d011 100644 --- a/include/hsl_mc68.h +++ b/include/hsl_mc68.h @@ -83,7 +83,7 @@ struct mc68_info { ipc_ duplicate; /* holds number of duplicate entries */ ipc_ n_compressions; /* holds number of compressions in order */ ipc_ n_zero_eigs; /* holds the number of zero eigs from ma47 */ - long l_workspace; /* holds length of workspace iw used in order */ + int64_t l_workspace; /* holds length of workspace iw used in order */ ipc_ zb01_info; /* holds flag from zb01_expand1 call */ ipc_ n_dense_rows; /* holds number of dense rows from amdd */ }; diff --git a/include/hsl_subset.h b/include/hsl_subset.h index 1548164e9d..fd1beae084 100644 --- a/include/hsl_subset.h +++ b/include/hsl_subset.h @@ -1,7 +1,9 @@ #ifdef INTEGER_64 #define hsl_metis galahad_metis_64 +#define HSL_METIS galahad_metis_64 #else #define hsl_metis galahad_metis +#define HSL_METIS galahad_metis #endif #ifdef INTEGER_64 diff --git a/src/external/hsl/makemaster b/src/external/hsl/makemaster index 431b0f547a..33379af435 100644 --- a/src/external/hsl/makemaster +++ b/src/external/hsl/makemaster @@ -617,22 +617,35 @@ hsl_zd11_double_64: kinds $(LHD64)(hsl_zd11d_64.o) # metis +#metis_silent: metis_$(PRECIS) +#metis: metis_$(PRECIS) +# @printf ' %-21s\n' "GALAHAD: metis ($(PRECIS) $(SUCC)" +#metis_single: metis_32 +#metis_double: metis_32 +#metis_single_64: metis_64 +#metis_double_64: metis_64 + +#metis_32: +# ( cd ./metis ; $(MAKE) -f \ +# $(GALAHAD)/makefiles/$(VERSION) build \ +# PRECIS=$(PRECIS) PWD=$(PWD)/metis ) +#metis_64: +# ( cd ./metis ; $(MAKE) -f \ +# $(GALAHAD)/makefiles/$(VERSION) build_64 \ +# PRECIS=$(PRECIS) PWD=$(PWD)/metis ) + +metis: metis_silent + @printf ' %-21s\n' "HSL METIS routines ($(PRECIS) $(SUCC)" metis_silent: metis_$(PRECIS) -metis: metis_$(PRECIS) - @printf ' %-21s\n' "GALAHAD: metis ($(PRECIS) $(SUCC)" -metis_single: metis_32 -metis_double: metis_32 -metis_single_64: metis_64 -metis_double_64: metis_64 - -metis_32: - ( cd ./metis ; $(MAKE) -f \ - $(GALAHAD)/makefiles/$(VERSION) build \ - PRECIS=$(PRECIS) PWD=$(PWD)/metis ) -metis_64: - ( cd ./metis ; $(MAKE) -f \ - $(GALAHAD)/makefiles/$(VERSION) build_64 \ - PRECIS=$(PRECIS) PWD=$(PWD)/metis ) +metis_single: kinds $(LHS)(hsl_metis.o) $(LHS)(hsl_metis5_adapter.o) +metis_double: kinds $(LHD)(hsl_metis.o) $(LHD)(hsl_metis5_adapter.o) +metis_single_64: kinds $(LHS64)(hsl_metis_64.o) \ + $(LHS64)(hsl_metis5_adapter_64.o) +metis_double_64: kinds $(LHD64)(hsl_metis_64.o) \ + $(LHD64)(hsl_metis5_adapter_64.o) +metis_nodend: + ( cd ./metis ; \ + $(MAKE) -f $(HSLSUBSET)/makefiles/$(VERSION) all PWD=$(PWD)/metis ) # hsl_metis diff --git a/src/llsr/llsr.F90 b/src/llsr/llsr.F90 index 12d1190036..4ba4ea5303 100644 --- a/src/llsr/llsr.F90 +++ b/src/llsr/llsr.F90 @@ -3388,7 +3388,8 @@ SUBROUTINE LLSR_import_scaling( data, status, S_type, S_ne, S_row, & ! copy control to data - WRITE( data%llsr_control%out, "( '' )", ADVANCE = 'no') !prevents ifort bug + IF ( data%llsr_control%out > 0 ) WRITE( data%llsr_control%out, & + "( '' )", ADVANCE = 'no') !prevents ifort bug error = data%llsr_control%error space_critical = data%llsr_control%space_critical deallocate_error_fatal = data%llsr_control%space_critical diff --git a/src/makedefs/intermediaries b/src/makedefs/intermediaries index 11982a908b..582ebf0e29 100644 --- a/src/makedefs/intermediaries +++ b/src/makedefs/intermediaries @@ -336,6 +336,11 @@ make_lstr: $(MAKE) -f $(GALAHAD)/makefiles/$(VERSION) lstr.o \ PRECIS=$(PRECIS) PWD=$(GALAHAD)/src/lstr ) +make_map: + ( cd $(GALAHAD)/src/map ; \ + $(MAKE) -f $(GALAHAD)/makefiles/$(VERSION) map.o \ + PRECIS=$(PRECIS) PWD=$(GALAHAD)/src/map ) + make_miqr: ( cd $(GALAHAD)/src/miqr ; \ $(MAKE) -f $(GALAHAD)/makefiles/$(VERSION) miqr.o \ @@ -992,6 +997,11 @@ make_all_lstr: $(MAKE) -f $(GALAHAD)/makefiles/$(VERSION) lstr_silent \ PRECIS=$(PRECIS) PWD=$(GALAHAD)/src/lstr ) +make_all_map: + ( cd $(GALAHAD)/src/map ; \ + $(MAKE) -f $(GALAHAD)/makefiles/$(VERSION) map_silent \ + PRECIS=$(PRECIS) PWD=$(GALAHAD)/src/map ) + make_all_miqr: ( cd $(GALAHAD)/src/miqr ; \ $(MAKE) -f $(GALAHAD)/makefiles/$(VERSION) miqr_silent \ @@ -1597,6 +1607,11 @@ make_ciface_lstr: $(MAKE) -f $(GALAHAD)/makefiles/$(VERSION) lstr_ciface.o \ PRECIS=$(PRECIS) PWD=$(GALAHAD)/src/lstr ) +make_ciface_map: + ( cd $(GALAHAD)/src/map ; \ + $(MAKE) -f $(GALAHAD)/makefiles/$(VERSION) map_ciface.o \ + PRECIS=$(PRECIS) PWD=$(GALAHAD)/src/map ) + make_ciface_miqr: ( cd $(GALAHAD)/src/miqr ; \ $(MAKE) -f $(GALAHAD)/makefiles/$(VERSION) miqr_ciface.o \ @@ -2254,6 +2269,11 @@ make_pyiface_lstr: $(MAKE) -f $(GALAHAD)/makefiles/$(VERSION) lstr_pyiface.o \ PRECIS=$(PRECIS) PWD=$(GALAHAD)/src/lstr ) +make_pyiface_map: + ( cd $(GALAHAD)/src/map ; \ + $(MAKE) -f $(GALAHAD)/makefiles/$(VERSION) map_pyiface.o \ + PRECIS=$(PRECIS) PWD=$(GALAHAD)/src/map ) + make_pyiface_miqr: ( cd $(GALAHAD)/src/miqr ; \ $(MAKE) -f $(GALAHAD)/makefiles/$(VERSION) miqr_pyiface.o \ diff --git a/src/makedefs/packages b/src/makedefs/packages index 15d06297af..15b5a9a3fc 100644 --- a/src/makedefs/packages +++ b/src/makedefs/packages @@ -77,8 +77,8 @@ # subset is available, set HSLSUBSET to its directory; if not, set # HSLSUBSET to $(GALAHAD)/src/external/hsl which contains dummy versions -HSLSUBSET = $(GALAHAD)/src/external/hsl -#HSLSUBSET = $(GALAHAD)/../hsl_subset/src +#HSLSUBSET = $(GALAHAD)/src/external/hsl +HSLSUBSET = $(GALAHAD)/../hsl_subset/src # HSLSUBSET is the source directory for the HSL Archive SUBSET packages. # If the actual HSL SUBSET files have been downloaded, these will diff --git a/src/nls/nls.F90 b/src/nls/nls.F90 index 78b1948504..6170a5d227 100644 --- a/src/nls/nls.F90 +++ b/src/nls/nls.F90 @@ -187,7 +187,7 @@ MODULE GALAHAD_NLS_precision ! removal of the file alive_file from unit alive_unit terminates execution INTEGER ( KIND = ip_ ) :: alive_unit = 40 - CHARACTER ( LEN = 30 ) :: alive_file = 'ALIVE.d' + CHARACTER ( LEN = 30 ) :: alive_file = 'ALIVE.d ' ! is the Jacobian matrix of first derivatives available (>= 2), is access ! only via matrix-vector products (=1) or is it not available (<=0) ? diff --git a/src/sls/sls.F90 b/src/sls/sls.F90 index fdd4ee484d..66622db1b1 100644 --- a/src/sls/sls.F90 +++ b/src/sls/sls.F90 @@ -980,6 +980,7 @@ SUBROUTINE SLS_initialize( solver, data, control, inform, check ) INTEGER ( KIND = ip_ ), PARAMETER :: n_dummy = 2 INTEGER ( KIND = ip_ ), DIMENSION( n_dummy + 1 ) :: PTR = (/ 1, 2, 3 /) INTEGER ( KIND = ip_ ), DIMENSION( n_dummy ) :: ROW = (/ 2, 1 /) + INTEGER ( KIND = ip_ ), DIMENSION( n_dummy ) :: ROWL = (/ 1, 2 /) INTEGER ( KIND = ip_ ), DIMENSION( 8 ) :: ICNTL_metis INTEGER ( KIND = ip_ ), DIMENSION( n_dummy ) :: PERM, INVP TYPE ( mc68_control ) :: control_mc68 @@ -996,7 +997,7 @@ SUBROUTINE SLS_initialize( solver, data, control, inform, check ) ! check to see if HSL ordering packages are available control_mc68%lp = - 1 - CALL MC68_order( 1_ip_, n_dummy, PTR, ROW, PERM, control_mc68, info_mc68 ) + CALL MC68_order( 1_ip_, n_dummy, PTR, ROWL, PERM, control_mc68, info_mc68 ) hsl_available = info_mc68%flag >= 0 ! check to see if the MeTiS ordering packages is available diff --git a/src/tools/makemaster b/src/tools/makemaster index db72b44b8b..5963e61f60 100644 --- a/src/tools/makemaster +++ b/src/tools/makemaster @@ -46,9 +46,9 @@ include $(GALAHAD)/src/makedefs/instructions # non-standard package compilation -$(package).o: $(LG)($(package).o) +$(package).o: $(LG)($(package)_$(PRECIS).o) -$(LG)($(package).o): ../$(package)/$(package).F90 +$(LG)($(package)_$(PRECIS).o): ../$(package)/$(package).F90 @printf ' %-9s %-15s\t\t' "Compiling" "$(package)" $(CP) ../$(package)/$(package).F90 $(OBJ)/$(package).F90 cd $(OBJ); $(FORTRAN) -o $(package)_$(PRECIS).o \