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

[CUTEst.jl] Support Windows #350

Merged
merged 5 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
with:
compiler: 'gcc'
version: '11'
if: matrix.os == 'macos-latest' || matrix.os == 'macos-13'
if: matrix.os != 'ubuntu-latest'
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
Expand Down
6 changes: 6 additions & 0 deletions gen/wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ function main()
code = replace(code, "Ptr{ip_}" => "Ptr{Cint}")
code = replace(code, "Ptr{ipc_}" => "Ptr{Cint}")

# errors in cutest.h
code = replace(code, "cutest_cint_csgrp_" => "cutest_csgrp_")
code = replace(code, "cutest_cint_csjp_" => "cutest_csjp_")
code = replace(code, "cutest_cint_csgrshp_" => "cutest_csgrshp_")
code = replace(code, "cutest_cint_cchprodsp_" => "cutest_cchprodsp_")

blocks = split(code, "end\n")
nblocks = length(blocks)
code = ""
Expand Down
14 changes: 8 additions & 6 deletions src/CUTEst.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,14 @@
isdir(cutest_problems_path) || mkpath(cutest_problems_path)

function __init__()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function __init__()
function __init__()

Could you just add a comment around to say why we don't do anything for Windows here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because we don't have bash on Windows. I will add a comment in a different PR.

if success(`bash -c "type gfortran"`)
@static Sys.isapple() ? (global libgfortran = []) :
(global libgfortran = [strip(read(`gfortran --print-file libgfortran.so`, String))])
else
@error "gfortran is not installed. Please install it and try again."
return
if !Sys.iswindows()
if success(`bash -c "type gfortran"`)
@static Sys.isapple() ? (global libgfortran = []) :
(global libgfortran = [strip(read(`gfortran --print-file libgfortran.so`, String))])
else
@error "gfortran is not installed. Please install it and try again."
return

Check warning on line 37 in src/CUTEst.jl

View check run for this annotation

Codecov / codecov/patch

src/CUTEst.jl#L36-L37

Added lines #L36 - L37 were not covered by tests
end
end

# set default MASTSIF location if the user hasn't set it already
Expand Down
Loading
Loading