Skip to content

Commit

Permalink
print CUTEst environment variables
Browse files Browse the repository at this point in the history
closes #225
  • Loading branch information
dpo authored and tmigot committed Aug 8, 2022
1 parent 7ea04f4 commit 6d1919a
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/CUTEst.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import Libdl.dlsym
# Only one problem can be interfaced at any given time.
global cutest_instances = 0

export CUTEstModel, sifdecoder, set_mastsif
export CUTEstModel, sifdecoder, set_mastsif, export_cutest_env

mutable struct CUTEstModel <: AbstractNLPModel{Float64, Vector{Float64}}
meta::NLPModelMeta{Float64, Vector{Float64}}
Expand Down Expand Up @@ -126,7 +126,29 @@ include("julia_interface.jl")
include("classification.jl")

"""
<<<<<<< HEAD
set_mastsif()
=======
export_cutest_env()
Print environment variables to add to the user's `~/.bashrc`
in order to use CUTEst as installed by CUTEst.jl from outside
Julia.
"""
function export_cutest_env(io::IO=stdout)
print(io, "# CUTEst settings: copy and paste the following into your ~/.bashrc\n#\n")
for var ("ARCHDEFS", "SIFDECODE", "CUTEST", "MYARCH", "MASTSIF")
print(io, "export $var=$(ENV["$var"])\n")
end
print(io, "export PATH=\${SIFDECODE}/bin:\${CUTEST}/bin:\${PATH}\n")
print(io, "run_sifdecoder() { bash -c \"export $(CUTEst_jll.LIBPATH_env)=$(CUTEst_jll.LIBPATH); source \$SIFDECODE/bin/sifdecoder \$@\"; }\n")
print(io, "#\n# to decode a problem, use run_sifdecoder followed by any options accepted by the decoder")
nothing
end

"""
fetch_sif_problems()
>>>>>>> print CUTEst environment variables
Set the MASTSIF environment variable to point to the main SIF collection.
"""
Expand Down

0 comments on commit 6d1919a

Please sign in to comment.