jfowkes / pycutest

Python interface to CUTEst
https://jfowkes.github.io/pycutest/
GNU General Public License v3.0
27 stars 10 forks source link

error when Installing on Linux #52

Closed KenZhenLin closed 1 year ago

KenZhenLin commented 1 year ago

Hi,

I was following the documentation "Installing CUTEst on Linux", and I ran the command

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/jfowkes/pycutest/master/.install_cutest.sh)"

And I got the error below:

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/jfowkes/pycutest/master/.install_cutest.sh)"

Build schedule:
 - SIFDecode from
    /home/cutest/sifdecode/
 - CUTEst from
 -  /home/cutest/cutest/

 Version for architecture pc64.lnx.gfo will be installed

 Installing SIFDecode ...

Installing the double precision version
 compiling in /home/cutest/sifdecode//src with the comand
 /usr/bin/make -s -f /home/cutest/sifdecode//makefiles/pc64.lnx.gfo all
 Compiling sifdecode                /bin/sh: gfortran-12: command not found
 => Disabling optimization /bin/sh: line 2: gfortran-12: command not found
make[1]: *** [/home/cutest/sifdecode//objects/pc64.lnx.gfo/double/libsifdecode.a(sifdecode.o)] Error 127
make: *** [all_double] Error 2

Could you please give some advice? Thanks a lot!

By the way, gfortran -v gives me gcc version 6.2.0 (GCC).

jfowkes commented 1 year ago

Hi @KenZhenLin, many thanks for reporting. This is a bug upstream in archdefs, could you please edit /home/cutest/archdefs/compiler.pc64.lnx.gfo and change the line:

FORTRAN='gfortran-12'

to read

FORTRAN='gfortran'

and re-run the install script (you may need to delete any temporary files that have been created). I will report this upstream and it will hopefully be fixed soon.

jfowkes commented 1 year ago

@KenZhenLin this has now been fixed upstream, please update your archdefs to the latest.

KenZhenLin commented 1 year ago

@KenZhenLin this has now been fixed upstream, please update your archdefs to the latest.

Thanks a lot for the quick response! I would like to remove everything and try it again. Would it be sufficient to remove the directory cutest?

jfowkes commented 1 year ago

@KenZhenLin yes if you remove the top level /home/cutest directory that should work.

KenZhenLin commented 1 year ago

@KenZhenLin yes if you remove the top level /home/cutest directory that should work.

Thanks! I tried it again, and that line does not have issues anymore! Now I got an error when trying the test

cd $SIFDECODE/src ; make -f $SIFDECODE/makefiles/$MYARCH test

The message is long, but in the end it shows:

echo ""

echo " Decode unconstrained SIF file"
 Decode unconstrained SIF file
cd /home/cutest/sifdecode//sif/ ; sifdecoder ALLINITU
/bin/sh: sifdecoder: command not found
make[1]: *** [test_unconstrained_double] Error 127
make[1]: Leaving directory `/home/cutest/sifdecode/src/decode'
make: *** [test_double] Error 2
jfowkes commented 1 year ago

Great, I wouldn't worry about those tests, as long as CUTEst and SIFDecoder were successfully installed you should now be able to install PyCUTEst.

KenZhenLin commented 1 year ago

Great, I wouldn't worry about those tests, as long as CUTEst and SIFDecoder were successfully installed you should now be able to install PyCUTEst.

Thanks! The process went well, I just need to do a few tests to make sure everything works correctly. I will give you an update when it's done!

May I ask some quick questions?

Can I assume all the problems from pycutest.import_problem are the original CUTEst problems without any modifications (such as removing constant terms)?

Also I don't see a description on if a problem is minimization or maximization, are they all assumed to be minimization?

Finally, I see there is a closed question on getting the optimal objective value and the corresponding x. Looks like some files, for example ARGLINA.SIF, do not have the optimal value. Is there now a better way to get the optimal objective value, and the x that attains the optimal, if possible?

Thank you!

lindonroberts commented 1 year ago

Hi @KenZhenLin, in response to your questions:

Thanks!

KenZhenLin commented 1 year ago

Hi @KenZhenLin, in response to your questions:

  • The problems are imported exactly as per the original CUTEst problems, except fixed variables (i.e. where the upper and lower bounds are equal) are dropped. This can be changed by setting the optional argument drop_fixed_variables=False
  • Yes, all problems are minimization
  • Sorry, we still don't have a way to get the optimal objective value/solution x in PyCUTEst

Thanks!

I see! Thank you for the clear answer!

jfowkes commented 1 year ago

Closing as this bug has been fixed upstream in ARCHDefs.