# What else than PATH solver for linear or mixed complementarity problem (LCP/MCP)?

**URL:** <https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110>\
**Category:** Optimization (Mathematical)\
**Tags:** complementarity\
**Created:** [December 4, 2023, 12:26pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110 "2023-12-04T12:26:19Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Post date:** [December 4, 2023, 12:26pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/1 "2023-12-04T12:26:19Z")

</div>

What else than [PATHSolver.jl](https://github.com/chkwon/PATHSolver.jl) is available in Julia for linear or mixed complementarity problem (LCP/MCP)? Within JuMP or outside it.

The thing is that [The PATH Solver](https://pages.cs.wisc.edu/~ferris/path.html) binaries are still [not available for Apple M processors](https://github.com/chkwon/PATHSolver.jl/issues/61) and I am becoming less optimistic that they will be any time soon…

[Knitro, reportedly, can handle complementarity constraints](https://www.artelys.com/app/docs/knitro/2_userGuide/complementarity.html), but I still have not got the license. Anything else out there?

Sure I can always use the Rosetta version of Julia. It is just that if it is because of a single missing package, I feel reluctant. Furthermore, I am quite good at messing things up while having several versions of this and that on my machine, that is why I like to keep just one Julia.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [December 4, 2023, 5:26pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/2 "2023-12-04T17:26:15Z")

</div>

PATH supports M1. (The issue you linked is closed because i fixed it.)

Do you have a reproducible example of it not working?

---

<div class="post-metadata">

**Author:** ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Post date:** [December 4, 2023, 6:34pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/3 "2023-12-04T18:34:47Z")

</div>

Oops, I feel stupid then. Well, I kept visiting their ([The PATH Solver](https://pages.cs.wisc.edu/~ferris/path.html)) webpage and since those zip archives such as `path_5.0.05_macOS.zip` kept acquiring no silicon versions of the libraries, I concluded that they are still not available.

The only thing that helps me recover from the embarrassment is knowing that finally I can start exploring complementarity constraints in Julia 🙂

Anyway, this is what I get after just installing `PATHSolverj.jl` (just the first few lines):

```Julia
julia> using JuMP

julia> using PATHSolver

julia> model = Model(PATHSolver.Optimizer)
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Error showing value of type Model:
ERROR: could not load library "/Users/hurak/.julia/datadeps/libpath50/libpath50.silicon.dylib"
dlopen(/Users/hurak/.julia/datadeps/libpath50/libpath50.silicon.dylib, 0x0001): tried: '/Users/hurak/.julia/datadeps/libpath50/libpath50.silicon.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/hurak/.julia/datadeps/libpath50/libpath50.silicon.dylib' (no such file), '/Users/hurak/.julia/datadeps/libpath50/libpath50.silicon.dylib' (no such file)
Stacktrace:
  [1] c_api_Path_Version
    @ ~/.julia/packages/PATHSolver/QQzLy/src/C_API.jl:581 [inlined]

```

Indeed, my `.Julia/datadeps/libpath50` directory is empty, while the README says

> By default, `PATHSolver.jl` will download a copy of the underlying PATH solver.

Shall I file an issue here?

To fix this myself, I have returned to their website and indeed, the link to [julia directory](https://pages.cs.wisc.edu/~ferris/path/julia/) that I previously overlooked does contain silicon libraries (`libpath50.silicon.dylib` and `liblusol.silicon.dylib`). I downloaded them, set the `PATH_JL_LOCATION` to my new `libpath50.silicon.dylib` and things seem working now. Thanks.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [December 4, 2023, 7:16pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/4 "2023-12-04T19:16:47Z")

</div>

I haven’t seen this issue before. It sounds like it might just have been a network issue. No need to open an issue…it’ll just be me replying.

Could you try restarting Julia?

Were there any errors in precompilation?

Can you reach `http://pages.cs.wisc.edu/~ferris/path/julia/libpath50.silicon.dylib` from your machine? (I guess so, because you downloaded them manually.)

---

<div class="post-metadata">

**Author:** ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Post date:** [December 4, 2023, 8:33pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/5 "2023-12-04T20:33:27Z")

</div>

I tried all possible combinations of restarting Julia, uninstalling `PATHSolver.jl` and installing it again. Still the `~/.julia/datadeps/libpath50` directory is empty. No error messages in precompilation.

I also erased the `~/.julia/datadeps/libpath50` directory, it was empty after all (and uninstall/restart/install). It did not help. Maybe surprisingly the sister directory `liblusol` did contain something – `liblusol.dylib`, which I guess was for the Intel version.

And yes, of course I can reach the two silicon.dylib libraries on MF’s website.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [December 4, 2023, 11:49pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/6 "2023-12-04T23:49:07Z")

</div>

Very weird. I just tried this and it works locally. What version of PATHSolver.jl do you have installed?

What is `versioninfo()`?

---

<div class="post-metadata">

**Author:** ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Post date:** [December 5, 2023, 9:16am UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/7 "2023-12-05T09:16:52Z")

</div>

`PATHSolver v1.7.1`

```Julia
julia> versioninfo()
Julia Version 1.9.4
Commit 8e5136fa297 (2023-11-14 08:46 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M2
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, apple-m1)
  Threads: 1 on 4 virtual cores

```

---

<div class="post-metadata">

**Author:** ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Post date:** [December 5, 2023, 5:44pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/8 "2023-12-05T17:44:49Z")

</div>

I can also inform you that a colleague of mine with MacBook with M1 or M2 has just installed `PATHSolver.jl` package and confirmed to me that his `~/.Julia/datadeps` remains empty.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [December 5, 2023, 5:47pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/9 "2023-12-05T17:47:42Z")

</div>

Is this at your work? Is it a firewall issue? Does it work on your home network?

What is the output of

```julia
import DataDeps
DataDeps.register(
    DataDeps.DataDep(
        "libpath50",
        "The libpath50 binary from http://pages.cs.wisc.edu/~ferris",
        "http://pages.cs.wisc.edu/~ferris/path/julia/libpath50.silicon.dylib",
        "4e667615180565062013ab50a3968bbeddf3e510a9cdbfc27aa685152742b637",
    ),
)
DataDeps.datadep"libpath50"

```

---

<div class="post-metadata">

**Author:** ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Post date:** [December 5, 2023, 6:09pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/10 "2023-12-05T18:09:29Z")

</div>

I am actually sitting at home. It should not be a firewall issue. That colleague of mine tried the same from the university campus.

This is what I get with your code:

```Julia
julia> import DataDeps

julia> DataDeps.register(
           DataDeps.DataDep(
               "libpath50",
               "The libpath50 binary from http://pages.cs.wisc.edu/~ferris",
               "http://pages.cs.wisc.edu/~ferris/path/julia/libpath50.silicon.dylib",
               "4e667615180565062013ab50a3968bbeddf3e510a9cdbfc27aa685152742b637",
           ),
       )
DataDeps.DataDep("libpath50", "http://pages.cs.wisc.edu/~ferris/path/julia/libpath50.silicon.dylib", "4e667615180565062013ab50a3968bbeddf3e510a9cdbfc27aa685152742b637", DataDeps.fetch_default, identity, "The libpath50 binary from http://pages.cs.wisc.edu/~ferris")

julia> DataDeps.datadep"libpath50"
This program has requested access to the data dependency libpath50.
which is not currently installed. It can be installed automatically, and you will not see this message again.

The libpath50 binary from http://pages.cs.wisc.edu/~ferris

Do you want to download the dataset from http://pages.cs.wisc.edu/~ferris/path/julia/libpath50.silicon.dylib to "/Users/hurak/.julia/datadeps/libpath50"?
[y/n]

y
┌ Info: Downloading
│ source = "http://pages.cs.wisc.edu/~ferris/path/julia/libpath50.silicon.dylib"
│ dest = "/Users/hurak/.julia/datadeps/libpath50/libpath50.silicon.dylib"
│ progress = 1.0
│ time_taken = "0.02 s"
│ time_remaining = "0.0 s"
│ average_speed = "15.381 KiB/s"
│ downloaded = "252 bytes"
│ remaining = "0 bytes"
└ total = "252 bytes"
┌ Info: Downloading
│ source = "http://pages.cs.wisc.edu/~ferris/path/julia/libpath50.silicon.dylib"
│ dest = "/Users/hurak/.julia/datadeps/libpath50/libpath50.silicon.dylib"
│ progress = 1.0
│ time_taken = "1.65 s"
│ time_remaining = "0.0 s"
│ average_speed = "335.487 KiB/s"
│ downloaded = "553.219 KiB"
│ remaining = "0 bytes"
└ total = "553.219 KiB"
"/Users/hurak/.julia/datadeps/libpath50"

```

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [December 5, 2023, 7:16pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/11 "2023-12-05T19:16:19Z")

</div>

And does it work now? Is it inn the `datadeps` directory?

This is exactly the code that gets run, so I don’t understand why it would work in the REPL but not when you install:

> <https://github.com/chkwon/PATHSolver.jl/blob/72d8307f1bc1a050fd033719ddd8027af6579f4a/src/PATHSolver.jl#L15-L83>

---

<div class="post-metadata">

**Author:** ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Post date:** [December 5, 2023, 7:29pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/12 "2023-12-05T19:29:10Z")

</div>

Yep, it is there now:  
`➜ ~ ls .julia/datadeps/libpath50 libpath50.silicon.dylib`

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [December 5, 2023, 8:09pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/13 "2023-12-05T20:09:11Z")

</div>

I have no idea what the problem is, and no idea how to debug this. From our side, everything seems to be working.

What happens if you delete the `libpath50` directory, and then do:

```julia
] add PATHSolver#odow-patch-1
# Restart Julia
import PATHSolver
PATHSolver._install_datadeps()

```

---

<div class="post-metadata">

**Author:** ![zdenek\_hurak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zdenek_hurak/32/53118_2.png) [@zdenek\_hurak](https://discourse.julialang.org/u/zdenek_hurak)\
**Post date:** [December 5, 2023, 8:42pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/14 "2023-12-05T20:42:54Z")

</div>

It works. It downloads the correct libraries to the correct directory.

I can understand that debugging such issues is a pain, but let me emphasise that I am perfectly fine with the current state.

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [December 5, 2023, 11:09pm UTC](https://discourse.julialang.org/t/what-else-than-path-solver-for-linear-or-mixed-complementarity-problem-lcp-mcp/107110/15 "2023-12-05T23:09:38Z")

</div>

I can only think that something happened when you switched from the Rosetta to native builds and BinDeps didn’t download the correct thing. No idea.

Happy that you’re able to use PATH now though. Let me know if anything else comes up.
