ralna / GALAHAD

A library of modern Fortran modules for nonlinear optimization
https://www.galahad.rl.ac.uk
Other
115 stars 15 forks source link

Errors when generating shared libraries #22

Closed amontoison closed 1 year ago

amontoison commented 1 year ago
 creating double precision shared libraries with the comand
 /usr/bin/make -s -f /home/alexis/Bureau/git/GALAHAD/makefiles/pc64.lnx.gfo create_shared
 creating shared GALAHAD libraries in
  /home/alexis/Bureau/git/GALAHAD/objects/pc64.lnx.gfo/double/shared
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 28: [[: not found
 static library libgalahad_py.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_hsl.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_spral.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_mkl_pardiso.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_pardiso.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_wsmp.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_pastix.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_mumps.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_umfpack.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_metis.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_lapack.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_blas.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_cutest_dummy.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_hsl_c.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_c.a does not exist, shared creation skipped

SUCCESS: GALAHAD successfully installed <-- Ahem... Ahem...

SUCCESS: All builds succeeded! <-- Ahem... Ahem... Ahem...

We also have a typo with comand.

nimgould commented 1 year ago

I am not sure I know what the [[: not found means. Do the lib$name.a static libraries exist in /home/alexis/Bureau/git/GALAHAD/objects/pc64.lnx.gfo/double ?

nimgould commented 1 year ago

[comand -> command changes made, thanks)

amontoison commented 1 year ago

Yes, I have all static libraries in /home/alexis/Bureau/git/GALAHAD/objects/pc64.lnx.gfo/double folder. :thinking:

nimgould commented 1 year ago

Could you temporarily edit

$GALAHAD/bin/create_shared

to put in a -vx debug flag on the first line, and then, from

$GALAHAD/src

try

/usr/bin/make -f /home/alexis/Bureau/git/GALAHAD/makefiles/pc64.lnx.gfo create_shared .

I want to see what create_shared thinks its variable flags are. Thanks!

amontoison commented 1 year ago
alexis@HP-Spectre:~/Bureau/git/GALAHAD/src$ /usr/bin/make -f /home/alexis/Bureau/git/GALAHAD/makefiles/pc64.lnx.gfo create_shared .
cd /home/alexis/Bureau/git/GALAHAD/objects/pc64.lnx.gfo/double; CC=gcc FORTRAN=gfortran OPTIMIZATION=-O \
                   SHARED=-shared DLEXT=so LOADALL=--whole-archive \
                   LOADNONE=--no-whole-archive \
                   sh /home/alexis/Bureau/git/GALAHAD/bin/create_shared
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 2: -vx: not found
 creating shared GALAHAD libraries in
  /home/alexis/Bureau/git/GALAHAD/objects/pc64.lnx.gfo/double/shared
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 29: [[: not found
 static library libgalahad_py.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_hsl.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_spral.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_mkl_pardiso.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_pardiso.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_wsmp.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_pastix.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_mumps.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_umfpack.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_metis.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_lapack.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_blas.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_cutest_dummy.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_hsl_c.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 46: [[: not found
 static library libgalahad_c.a does not exist, shared creation skipped
make: rien à faire pour « . ».
nimgould commented 1 year ago

Sorry, I meant that the first line of the script should be

!/bin/bash -vx

which will say what is being executed, and what the shell variables expand to

amontoison commented 1 year ago
cd /home/alexis/Bureau/git/GALAHAD/objects/pc64.lnx.gfo/double; CC=gcc FORTRAN=gfortran OPTIMIZATION=-O \
                   SHARED=-shared DLEXT=so LOADALL=--whole-archive \
                   LOADNONE=--no-whole-archive \
                   sh /home/alexis/Bureau/git/GALAHAD/bin/create_shared

...
 creating shared GALAHAD libraries in
  /home/alexis/Bureau/git/GALAHAD/objects/pc64.lnx.gfo/double/shared
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 28: [[: not found
 static library libgalahad_py.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_hsl.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_spral.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_mkl_pardiso.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_pardiso.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_wsmp.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_pastix.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_mumps.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_umfpack.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_metis.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_lapack.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_blas.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_cutest_dummy.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_hsl_c.a does not exist, shared creation skipped
/home/alexis/Bureau/git/GALAHAD/bin/create_shared: 45: [[: not found
 static library libgalahad_c.a does not exist, shared creation skipped
make: rien à faire pour « . ».
amontoison commented 1 year ago

@nimgould It works with create_one_shared for information.

amontoison commented 1 year ago

I solved the issue by using [ ... ] instead of [[ ... ]] but I don't understand why.

nimgould commented 1 year ago

Me neither, but maybe a C programmer can explain. [[ ]] works under bash here.

https://stackoverflow.com/questions/3427872/whats-the-difference-between-and-in-bash

gives some clues, and suggests that [[ ]] does not need the "" around the "lib$name,a", indeed perhaps [[ ]] actually think that the quotes are part of the name. So, [ ] is probably better, I have checked here that [ ] works, and I have updated the distro accordingly