From 53a59ea1a781305c3e9223b0b463c147bbe83bc2 Mon Sep 17 00:00:00 2001 From: Lily Olson Date: Mon, 24 Jun 2024 10:21:40 -0400 Subject: [PATCH] reopt_jl changes for Windows install --- omf/solvers/reopt_jl/__init__.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/omf/solvers/reopt_jl/__init__.py b/omf/solvers/reopt_jl/__init__.py index 86d81340c..3ef4d2a19 100644 --- a/omf/solvers/reopt_jl/__init__.py +++ b/omf/solvers/reopt_jl/__init__.py @@ -61,20 +61,19 @@ def install_reopt_jl(system : list = platform.system(), build_sysimage=True): commands += [ f'touch "{instantiated_path}"' ] elif system == "Windows": commands = [ - f'cd "{thisDir}" & del julia-1.9.4-win64.zip', - f'cd "{thisDir}" & curl -o julia-1.9.4-win64.zip https://julialang-s3.julialang.org/bin/winnt/x64/1.9/julia-1.9.4-win64.zip', - f'cd "{thisDir}" & tar -x -f "julia-1.9.4-win64.zip' ] + f'cd {thisDir} & del julia-1.9.4-win64.zip', + f'cd {thisDir} & curl -o julia-1.9.4-win64.zip https://julialang-s3.julialang.org/bin/winnt/x64/1.9/julia-1.9.4-win64.zip', + f'cd {thisDir} & tar -x -f julia-1.9.4-win64.zip' ] commands += install_pyjulia if build_sysimage: commands += [ - f'''cd "{thisDir}\\julia-1.9.4\\bin" & julia --project="{project_path}" -e ' + f'''cd {thisDir}\\julia-1.9.4\\bin & julia --project="{project_path}" -e ' import Pkg; Pkg.instantiate(); import REoptSolver; using PackageCompiler; PackageCompiler.create_sysimage(["REoptSolver"]; sysimage_path="{sysimage_path}", precompile_execution_file="{precompile_path}", cpu_target="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)") - ' ''' - f'copy nul "{instantiated_path}"' - ] + ' '''] + commands += [ f'copy nul {instantiated_path}' ] else: raise ValueError(f'No installation script available yet for {system}')