mirror of
https://github.com/ANL-CEEESA/MIPLearn.jl.git
synced 2025-12-06 08:28:52 -06:00
Improve sysimage.jl
This commit is contained in:
13
Makefile
13
Makefile
@@ -1,17 +1,16 @@
|
|||||||
# UnitCommitment.jl: Optimization Package for Security-Constrained Unit Commitment
|
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
|
||||||
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
|
# Copyright (C) 2020-2021, UChicago Argonne, LLC. All rights reserved.
|
||||||
# Released under the modified BSD license. See COPYING.md for more details.
|
# Released under the modified BSD license. See COPYING.md for more details.
|
||||||
|
|
||||||
JULIA := julia --color=yes --project=@.
|
JULIA := julia --color=yes --project=@.
|
||||||
VERSION := 0.2
|
VERSION := 0.2
|
||||||
|
|
||||||
build/sysimage.so: src/utils/sysimage.jl Project.toml Manifest.toml
|
build/sysimage.so: src/utils/sysimage.jl Project.toml
|
||||||
mkdir -p build
|
julia --project=. -e "using Pkg; Pkg.instantiate()"
|
||||||
$(JULIA) --trace-compile=build/precompile.jl test/runtests.jl
|
$(JULIA) src/utils/sysimage.jl test/runtests.jl
|
||||||
$(JULIA) src/utils/sysimage.jl
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf build/*
|
rm -rfv build/*
|
||||||
|
|
||||||
test: build/sysimage.so
|
test: build/sysimage.so
|
||||||
$(JULIA) --sysimage build/sysimage.so test/runtests.jl
|
$(JULIA) --sysimage build/sysimage.so test/runtests.jl
|
||||||
|
|||||||
@@ -1,44 +1,33 @@
|
|||||||
# MIPLearn: Extensible Framework for Learning-Enhanced Mixed-Integer Optimization
|
# UnitCommitment.jl: Optimization Package for Security-Constrained Unit Commitment
|
||||||
# Copyright (C) 2020-2021, UChicago Argonne, LLC. All rights reserved.
|
# Copyright (C) 2020, UChicago Argonne, LLC. All rights reserved.
|
||||||
# Released under the modified BSD license. See COPYING.md for more details.
|
# Released under the modified BSD license. See COPYING.md for more details.
|
||||||
|
|
||||||
using PackageCompiler
|
using PackageCompiler
|
||||||
|
using TOML
|
||||||
using Cbc
|
|
||||||
using Clp
|
|
||||||
using Conda
|
|
||||||
using CSV
|
|
||||||
using DataFrames
|
|
||||||
using Distributed
|
|
||||||
using JLD2
|
|
||||||
using JSON
|
|
||||||
using JuMP
|
|
||||||
using Logging
|
using Logging
|
||||||
using MathOptInterface
|
|
||||||
using Printf
|
|
||||||
using PyCall
|
|
||||||
using TimerOutputs
|
|
||||||
|
|
||||||
pkg = [
|
Logging.disable_logging(Logging.Info)
|
||||||
:Cbc
|
mkpath("build")
|
||||||
:Clp
|
|
||||||
:Conda
|
|
||||||
:CSV
|
|
||||||
:DataFrames
|
|
||||||
:Distributed
|
|
||||||
:JLD2
|
|
||||||
:JSON
|
|
||||||
:JuMP
|
|
||||||
:Logging
|
|
||||||
:MathOptInterface
|
|
||||||
:Printf
|
|
||||||
:PyCall
|
|
||||||
:TimerOutputs
|
|
||||||
]
|
|
||||||
|
|
||||||
@info "Building system image..."
|
println("Generating precompilation statements...")
|
||||||
|
run(`julia --project=. --trace-compile=build/precompile.jl $(ARGS)`)
|
||||||
|
|
||||||
|
println("Finding dependencies...")
|
||||||
|
project = TOML.parsefile("Project.toml")
|
||||||
|
manifest = TOML.parsefile("Manifest.toml")
|
||||||
|
deps = Symbol[]
|
||||||
|
for dep in keys(project["deps"])
|
||||||
|
if "path" in keys(manifest[dep][1])
|
||||||
|
println(" - $(dep) [skip]")
|
||||||
|
else
|
||||||
|
println(" - $(dep)")
|
||||||
|
push!(deps, Symbol(dep))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
println("Building system image...")
|
||||||
create_sysimage(
|
create_sysimage(
|
||||||
pkg,
|
deps,
|
||||||
precompile_statements_file = "build/precompile.jl",
|
precompile_statements_file = "build/precompile.jl",
|
||||||
sysimage_path = "build/sysimage.so",
|
sysimage_path = "build/sysimage.so",
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user