Skip to content

Commit 0820f3f

Browse files
committed
Improve CUTEst.jl on Windows
Update `PATH` to ensure that we find the dependencies provided by MinGW.
1 parent c0a457c commit 0820f3f

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1919
[compat]
2020
CUTEst_jll = "2.6.0"
2121
Combinatorics = "1.0"
22-
DataStructures = "0.18, 0.19"
23-
JSON = "0.21"
22+
DataStructures = "0.19"
23+
JSON = "1.5"
2424
LazyArtifacts = "1.10"
2525
Libdl = "1.10"
2626
LinearAlgebra = "1.10"
2727
NLPModels = "0.21.5"
2828
NLPModelsTest = "0.10.2"
2929
Printf = "1.10"
30-
Quadmath = "0.5.10"
30+
Quadmath = "0.5.10, 1.0.1"
3131
REPL = "1.10"
3232
Random = "1.10"
3333
SIFDecode_jll = "3.0.0"

src/sifdecoder.jl

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,11 @@ function build_libsif(
204204
if isfile("$fname.f")
205205
@static if Sys.iswindows()
206206
mingw = Int == Int64 ? "mingw64" : "mingw32"
207-
gfortran = joinpath(artifact"mingw-w64", mingw, "bin", "gfortran.exe")
208-
run(`$gfortran -O3 -c -fPIC $fname.f`)
207+
bindir = joinpath(artifact"mingw-w64", mingw, "bin")
208+
gfortran = joinpath(bindir, "gfortran.exe")
209+
withenv("PATH" => string(bindir, ';', ENV["PATH"])) do
210+
run(`$gfortran -O3 -c -fPIC $fname.f`)
211+
end
209212
else
210213
run(`gfortran -O3 -c -fPIC $fname.f`)
211214
end
@@ -222,11 +225,16 @@ function build_libsif(
222225
elseif Sys.iswindows()
223226
@static if Sys.iswindows()
224227
mingw = Int == Int64 ? "mingw64" : "mingw32"
225-
gfortran = joinpath(artifact"mingw-w64", mingw, "bin", "gfortran.exe")
228+
bindir = joinpath(artifact"mingw-w64", mingw, "bin")
229+
gfortran = joinpath(bindir, "gfortran.exe")
226230
if standalone
227-
run(`$gfortran -shared -o $libsif_name $object_files`)
231+
withenv("PATH" => string(bindir, ';', ENV["PATH"])) do
232+
run(`$gfortran -shared -o $libsif_name $object_files`)
233+
end
228234
else
229-
run(`$gfortran -shared -o $libsif_name $object_files -Wl,--whole-archive $libcutest -Wl,--no-whole-archive`)
235+
withenv("PATH" => string(bindir, ';', ENV["PATH"])) do
236+
run(`$gfortran -shared -o $libsif_name $object_files -Wl,--whole-archive $libcutest -Wl,--no-whole-archive`)
237+
end
230238
end
231239
end
232240
else

0 commit comments

Comments
 (0)