Update pkg setup
This commit is contained in:
@@ -1,16 +1,13 @@
|
||||
# Setup hook for ascend-toolkit
|
||||
# This is sourced when ascend-toolkit is in buildInputs of another derivation
|
||||
# Setup hook for ascend-toolkit (sourced when package is in buildInputs)
|
||||
addAscendEnv() {
|
||||
local toolkit="${1:?ascend-toolkit path required}"
|
||||
|
||||
# Core environment variables
|
||||
export ASCEND_TOOLKIT_HOME="${toolkit}"
|
||||
export ASCEND_HOME_PATH="${toolkit}"
|
||||
export ASCEND_OPP_PATH="${toolkit}/opp"
|
||||
export ASCEND_AICPU_PATH="${toolkit}"
|
||||
export TOOLCHAIN_HOME="${toolkit}/toolkit"
|
||||
|
||||
# PATH
|
||||
addToSearchPath PATH "${toolkit}/bin"
|
||||
addToSearchPath PATH "${toolkit}/tools/ccec_compiler/bin"
|
||||
addToSearchPath PATH "${toolkit}/tools/profiler/bin"
|
||||
@@ -18,7 +15,6 @@ addAscendEnv() {
|
||||
addToSearchPath PATH "${toolkit}/tools/show_kernel_debug_data"
|
||||
addToSearchPath PATH "${toolkit}/tools/msobjdump"
|
||||
|
||||
# LD_LIBRARY_PATH
|
||||
addToSearchPath LD_LIBRARY_PATH "${toolkit}/lib64"
|
||||
addToSearchPath LD_LIBRARY_PATH "${toolkit}/lib64/plugin/opskernel"
|
||||
addToSearchPath LD_LIBRARY_PATH "${toolkit}/lib64/plugin/nnengine"
|
||||
@@ -27,15 +23,11 @@ addAscendEnv() {
|
||||
addToSearchPath LD_LIBRARY_PATH "${toolkit}/tools/aml/lib64/plugin"
|
||||
addToSearchPath LD_LIBRARY_PATH "${toolkit}/devlib"
|
||||
|
||||
# PYTHONPATH
|
||||
addToSearchPath PYTHONPATH "${toolkit}/python/site-packages"
|
||||
addToSearchPath PYTHONPATH "${toolkit}/opp/built-in/op_impl/ai_core/tbe"
|
||||
|
||||
# CMAKE_PREFIX_PATH
|
||||
addToSearchPath CMAKE_PREFIX_PATH "${toolkit}/lib64/cmake"
|
||||
addToSearchPath CMAKE_PREFIX_PATH "${toolkit}/toolkit/tools/tikicpulib/lib/cmake"
|
||||
}
|
||||
|
||||
if [ -n "${ascend-toolkit:-}" ]; then
|
||||
addAscendEnv "${ascend-toolkit}"
|
||||
fi
|
||||
addAscendEnv "@ASCEND_TOOLKIT@"
|
||||
|
||||
16
nix/bisheng-wrapper-setup-hook.sh
Normal file
16
nix/bisheng-wrapper-setup-hook.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
# Setup hook for bisheng-wrapper (source when package is in buildInputs).
|
||||
# Use alone when ASCEND_TOOLKIT_HOME already points at a CANN install (Nix or not).
|
||||
addToSearchPath PATH "@WRAPPER_OUT@/bin"
|
||||
|
||||
if [ -n "${ASCEND_TOOLKIT_HOME:-}" ]; then
|
||||
_ascend_arch_linux="$(uname -m)-linux"
|
||||
export BISHENG_REAL="${ASCEND_TOOLKIT_HOME}/${_ascend_arch_linux}/ccec_compiler/bin/bisheng"
|
||||
fi
|
||||
|
||||
export CMAKE_C_COMPILER="@WRAPPER_OUT@/bin/bisheng"
|
||||
export CMAKE_CXX_COMPILER="@WRAPPER_OUT@/bin/bisheng"
|
||||
|
||||
if [ -f "@WRAPPER_OUT@/nix-support/bisheng-nix-cflags" ]; then
|
||||
export NIX_CFLAGS_COMPILE_bisheng="$(cat "@WRAPPER_OUT@/nix-support/bisheng-nix-cflags")"
|
||||
export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE_bisheng"
|
||||
fi
|
||||
Reference in New Issue
Block a user