Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to evade precompile error using Julia when adding packages

I am trying to use three different packages with Julia programming (with Atom IDE, for what it's worth).

I'm very new to Julia so pardon any ignorance! Here's what I've got:

Pkg.add("JuMP")
Pkg.add("DataFrames")
Pkg.add("GLPKMathProgInterface")

These run successfully.

Then I have:

using DataFrames
using GLPKMathProgInterface
using JuMP

the "using DataFrames" line executes successfully, but after that I get a precompiling/installation error:

ERROR: LoadError: GLPK not properly installed. Please run Pkg.build("GLPK")
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] top-level scope at /Users/connordaly/.julia/packages/GLPK/thMVo/src/GLPK.jl:199
 [3] include at ./boot.jl:317 [inlined]
 [4] include_relative(::Module, ::String) at ./loading.jl:1038
 [5] include(::Module, ::String) at ./sysimg.jl:29
 [6] top-level scope at none:2
 [7] eval at ./boot.jl:319 [inlined]
 [8] eval(::Expr) at ./client.jl:399
 [9] top-level scope at ./none:3
in expression starting at /Users/connordaly/.julia/packages/GLPK/thMVo/src/GLPK.jl:196
ERROR: LoadError: LoadError: Failed to precompile GLPK [60bf3e95-4087-53dc-ae20-288a0d20c6a6] to /Users/connordaly/.julia/compiled/v0.7/GLPK/r6CoY.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] macro expansion at ./logging.jl:313 [inlined]
 [3] compilecache(::Base.PkgId, ::String) at ./loading.jl:1185
 [4] _require(::Base.PkgId) at ./logging.jl:311
 [5] require(::Base.PkgId) at ./loading.jl:852
 [6] macro expansion at ./logging.jl:311 [inlined]
 [7] require(::Module, ::Symbol) at ./loading.jl:834
 [8] include at ./boot.jl:317 [inlined]
 [9] include_relative(::Module, ::String) at ./loading.jl:1038
 [10] include at ./sysimg.jl:29 [inlined]
 [11] include(::String) at /Users/connordaly/.julia/packages/GLPKMathProgInterface/Ijibf/src/GLPKMathProgInterface.jl:2
 [12] top-level scope at none:0
 [13] include at ./boot.jl:317 [inlined]
 [14] include_relative(::Module, ::String) at ./loading.jl:1038
 [15] include(::Module, ::String) at ./sysimg.jl:29
 [16] top-level scope at none:2
 [17] eval at ./boot.jl:319 [inlined]
 [18] eval(::Expr) at ./client.jl:399
 [19] top-level scope at ./none:3
in expression starting at /Users/connordaly/.julia/packages/GLPKMathProgInterface/Ijibf/src/GLPKInterfaceBase.jl:6
in expression starting at /Users/connordaly/.julia/packages/GLPKMathProgInterface/Ijibf/src/GLPKMathProgInterface.jl:10
ERROR: Failed to precompile GLPKMathProgInterface [3c7084bd-78ad-589a-b5bb-dbd673274bea] to /Users/connordaly/.julia/compiled/v0.7/GLPKMathProgInterface/Y5bTM.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] macro expansion at ./logging.jl:313 [inlined]
 [3] compilecache(::Base.PkgId, ::String) at ./loading.jl:1185
 [4] macro expansion at ./logging.jl:311 [inlined]
 [5] _require(::Base.PkgId) at ./loading.jl:941
 [6] require(::Base.PkgId) at ./loading.jl:852
 [7] macro expansion at ./logging.jl:311 [inlined]
 [8] require(::Module, ::Symbol) at ./loading.jl:834

I have tried a bunch of things to get this package to work but no luck so far. Could anyone help me out? Thanks in advance!

like image 829
Connor Daly Avatar asked May 13 '26 18:05

Connor Daly


1 Answers

Being a new user to Julia, I assume you are trying this one version 1.0. This announcement is relevant https://discourse.julialang.org/t/psa-use-julia-0-7-if-you-are-upgrading/13321.

Julia 0.7 has the same functionality as 1.0, but still has deprecation warnings for compatibility, which have been removed in 1.0.

Give Julia 0.7 a try for the time being. You may also have add in a Pkg.build("GLPK") if you encounter that particular error again.

like image 121
dberge Avatar answered May 18 '26 20:05

dberge