1
1
# Invoke with
2
- # `julia --project=deps deps/build_local.jl [path-to-enzyme ]`
2
+ # `julia --project=deps deps/build_local.jl [dbg/opt ]`
3
3
4
4
# the pre-built ReactantExtra_jll might not be loadable on this platform
5
5
Reactant_jll = Base. UUID (" 0192cb87-2b54-54ad-80e0-3be72ad8a3c0" )
@@ -24,7 +24,6 @@ run(Cmd(`$(Base.julia_cmd().exec[1]) --project=. -e "using Pkg; Pkg.instantiate(
24
24
# --define=using_rocm=true --define=using_rocm_hipcc=true
25
25
# --action_env TF_ROCM_AMDGPU_TARGETS="gfx900,gfx906,gfx908,gfx90a,gfx1030"
26
26
27
-
28
27
# --repo_env TF_NEED_CUDA=1
29
28
# --repo_env TF_NVCC_CLANG=1
30
29
# --repo_env TF_NCCL_USE_STUB=1
@@ -38,16 +37,35 @@ run(Cmd(`$(Base.julia_cmd().exec[1]) --project=. -e "using Pkg; Pkg.instantiate(
38
37
# --crosstool_top="@local_config_cuda//crosstool:toolchain"
39
38
40
39
arg = try
41
- run (Cmd (` nvidia-smi` ))
42
- " --config=cuda"
40
+ run (Cmd (` nvidia-smi` ))
41
+ " --config=cuda"
43
42
catch
44
- " "
43
+ " "
44
+ end
45
+
46
+ build_kind = if length (ARGS ) == 1
47
+ kind = ARGS [1 ]
48
+ if kind ∉ (" dbg" , " opt" )
49
+ error (" Invalid build kind $(kind) . Valid options are 'dbg' and 'opt'" )
50
+ end
51
+ kind
52
+ else
53
+ " dbg"
45
54
end
46
55
47
- run (Cmd (` bazel build $(arg) -c dbg --action_env=JULIA=$(Base. julia_cmd (). exec[1 ])
48
- --repo_env HERMETIC_PYTHON_VERSION="3.10"
49
- --check_visibility=false --verbose_failures :libReactantExtra.so :Builtin.inc.jl :Arith.inc.jl :Affine.inc.jl :Func.inc.jl :Enzyme.inc.jl :StableHLO.inc.jl :CHLO.inc.jl :VHLO.inc.jl` , dir= source_dir,
50
- ))
56
+ @info " Building JLL with -c $(build_kind) "
57
+
58
+ if isempty (arg)
59
+ run (Cmd (` bazel build -c $(build_kind) --action_env=JULIA=$(Base. julia_cmd (). exec[1 ])
60
+ --repo_env HERMETIC_PYTHON_VERSION="3.10"
61
+ --check_visibility=false --verbose_failures :libReactantExtra.so :Builtin.inc.jl :Arith.inc.jl :Affine.inc.jl :Func.inc.jl :Enzyme.inc.jl :StableHLO.inc.jl :CHLO.inc.jl :VHLO.inc.jl` , dir= source_dir,
62
+ ))
63
+ else
64
+ run (Cmd (` bazel build $(arg) -c $(build_kind) --action_env=JULIA=$(Base. julia_cmd (). exec[1 ])
65
+ --repo_env HERMETIC_PYTHON_VERSION="3.10"
66
+ --check_visibility=false --verbose_failures :libReactantExtra.so :Builtin.inc.jl :Arith.inc.jl :Affine.inc.jl :Func.inc.jl :Enzyme.inc.jl :StableHLO.inc.jl :CHLO.inc.jl :VHLO.inc.jl` , dir= source_dir,
67
+ ))
68
+ end
51
69
# env=Dict("HOME"=>ENV["HOME"], "PATH"=>joinpath(source_dir, "..")*":"*ENV["PATH"])))
52
70
53
71
run (Cmd (` rm -f libReactantExtra.dylib` , dir= joinpath (source_dir, " bazel-bin" )))
0 commit comments