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

CUTEstModel - Path with blank spaces #252

Closed
leonardosecchin opened this issue Mar 19, 2021 · 6 comments
Closed

CUTEstModel - Path with blank spaces #252

leonardosecchin opened this issue Mar 19, 2021 · 6 comments

Comments

@leonardosecchin
Copy link

Hi,
I am using Julia 1.5.3.
The routine "CUTEstModel" apparently does not handle paths containing blank spaces when reading a SIF file.
Sincerely,
Leonardo.

@abelsiqueira
Copy link
Member

Hi @leonardosecchin, thanks for the issue. I have a few clarification questions:

You're trying CUTEstModel("PATH TO FILE")?
Can you post an example and the output?
Is it a separate .SIF file that you have, or one of the shipped ones?

@leonardosecchin
Copy link
Author

leonardosecchin commented Mar 19, 2021

Hi,
I executed "nlp = CUTEstModel(sifdir[i]);", where "sifdir[i]" is a string provided by "readdir" command.
Here is the output. I printed the complete path to the sif file (it exists!) from Julia.
I notice that no "basename" command is executed...

This is the complete path to SIF file: /home/leonardo/Dropbox/UFES/Otimizacao 2/julia/sif/AKIVA.SIF

basename: operando extra “.SIF”
Tente "basename --help" para mais informações.
ERROR: ArgumentError: NULL library handle
Stacktrace:
[1] #dlsym#1 at /home/leonardo/julia/usr/share/julia/stdlib/v1.5/Libdl/src/Libdl.jl:54 [inlined]
[2] dlsym(::Ptr{Nothing}, ::Symbol) at /home/leonardo/julia/usr/share/julia/stdlib/v1.5/Libdl/src/Libdl.jl:54
[3] (::CUTEst.var"#24#25"{Bool,Bool,Tuple{},String,String,Array{Int32,1}})() at /home/leonardo/.julia/packages/CUTEst/wFmxq/src/CUTEst.jl:215
[4] cd(::CUTEst.var"#24#25"{Bool,Bool,Tuple{},String,String,Array{Int32,1}}, ::String) at ./file.jl:104
[5] CUTEstModel(::String; decode::Bool, verbose::Bool, efirst::Bool, lfirst::Bool, lvfirst::Bool) at /home/leonardo/.julia/packages/CUTEst/wFmxq/src/CUTEst.jl:205
[6] CUTEstModel at /home/leonardo/.julia/packages/CUTEst/wFmxq/src/CUTEst.jl:193 [inlined]
[7] testesSIF(; sifpath::String) at /home/leonardo/Dropbox/UFES/Otimizacao 2/julia/testesSIF.jl:55
[8] testesSIF() at /home/leonardo/Dropbox/UFES/Otimizacao 2/julia/testesSIF.jl:27
[9] top-level scope at REPL[4]:1

@abelsiqueira
Copy link
Member

Makes sense, I'll have to take a look to see whether it's inside CUTEst.jl or just CUTEst.
In the meantime, can you use the SIF problems downloaded automatically by CUTEst.jl?
nlp = CUTEstModel("AKIVA") for instance, should work.

@leonardosecchin
Copy link
Author

If the environment variable MASTSIF has no blank spaces, CUTEstModel works.
Otherwise, an error "xxxx.SIF not found" occurs.
I believe that this does not depend on whether we use the path of the problems automatically download by CUTEst.jl (where there are probably no blank spaces) or a particular path.

@abelsiqueira
Copy link
Member

Hello again. I've tried to run CUTEst directly and it fails too, so it's not an issue with the Julia wrapper, but with the sifdecoder code.

Example:

sifdecoder "Some dir/AKIVA.SIF" 
basename: extra operand ‘.SIF’
Try 'basename --help' for more information.

 ERROR: file .SIF is not known in directories
 .
dir or $MASTSIF

I went into the sifdecoder script and changed

-251   PROBNAME=`basename $PROBLEM .SIF`
+251   PROBNAME=`basename "$PROBLEM" .SIF`
-252   PROBDIR=`dirname $PROBLEM`
+252   PROBDIR=`dirname "$PROBLEM"`

-400   $LN -s $PROBDIR/${PROBNAME}.SIF ./$TEMPNAME.SIF
+400   $LN -s "$PROBDIR/${PROBNAME}.SIF" ./$TEMPNAME.SIF

and apparently, it works. I just don't know a good way to test it. @dpo, do you?

@amontoison
Copy link
Member

Fixed with the release v0.13.3.
The decoder is now a binary and not anymore a shell script.
We have a new dependency for it (SIFDecode_jll.jl).

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

No branches or pull requests

3 participants