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 committed May 11, 2020
1 parent 2bc2e18 commit e427430
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/CUTEst.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Libdl.dlsym
# Only one problem can be interfaced at any given time.
global cutest_instances = 0

export CUTEstModel, sifdecoder, fetch_sif_problems
export CUTEstModel, sifdecoder, fetch_sif_problems, export_cutest_env

mutable struct CUTEstModel <: AbstractNLPModel
meta :: NLPModelMeta
Expand Down Expand Up @@ -112,6 +112,22 @@ include("core_interface.jl")
include("julia_interface.jl")
include("classification.jl")

"""
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: add to your ~/.bashrc\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")
nothing
end

"""
fetch_sif_problems()
Expand Down

0 comments on commit e427430

Please sign in to comment.