Skip to content

Commit

Permalink
Dynamically select cpu_target
Browse files Browse the repository at this point in the history
  • Loading branch information
fivegrant committed Dec 4, 2023
1 parent 18d8efe commit 8c1ed62
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions install.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ Pkg.instantiate()

import PackageCompiler

target = if !(length(ARGS) == 0) lowercase(ARGS[1]) else "local" end
target = !(length(ARGS) == 0) ? lowercase(ARGS[1]) : "local"
cpu_target = target == "local" ? "native" : "generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"

sysimage_dir = "/"
env_dir = if target == "local"
Expand Down Expand Up @@ -42,7 +43,9 @@ package_names = [
if match(pkg_pattern, line) !== nothing
]

PackageCompiler.create_sysimage(package_names; precompile_execution_file="precompile.jl", sysimage_path=sysimage_dir*"ASKEM-Sysimage.so")
@info "Compiling for cpu_target=$cpu_target"

PackageCompiler.create_sysimage(package_names; precompile_execution_file="precompile.jl", sysimage_path=sysimage_dir*"ASKEM-Sysimage.so", cpu_target=cpu_target)
if target == "local"
@info """
To use the basic (slower) mode, simply run:
Expand Down

0 comments on commit 8c1ed62

Please sign in to comment.