Basically, I have an MIP completely defined, everything is working, until I attempt to solve via GLPK, when it gives me the following error: UndefVarError: floatmax not defined I tried defining floatmax as anything, but to no avail. I'm completely stuck. Here's an image of my code and the problem: 1
-
Hi Tamir! Please, could you edit the code and error message into your post as text form? Then the content is searchable, and can't disappear later. – phipsgabler Dec 08 '18 at 09:56
2 Answers
It looks like you have an old version of Compat
installed. Try running Pkg.update()
. floatmax
is defined on Julia 0.6 beginning with Compat 1.1.0. I fixed the version requirements here: https://github.com/JuliaOpt/GLPKMathProgInterface.jl/pull/55.

- 943
- 5
- 10
The problem is that you are working under Julia 0.6 and floatmax
is internally used by the GLPKMathProgInterface.jl package.
Possible solutions are:
- Swithch to Julia 1.0 (recommended)
- Install an older version of GLPKMathProgInterface.jl before it was ported to Julia 1.0; release v0.4.2 should be ok
Manually add the following definition in the source file GLPKMathProgInterface.jl before include section:
floatmax(::Type{Float64}) = prevfloat(Float64(Inf))
(I have not run it as I do not have Julia 0.6 any more, but it should work; the risk is that even if you fix this some more fixes like this might be needed - so option 3 is not really recommended, but it might work so I am giving it)

- 66,844
- 3
- 80
- 107