Skip to content

Commit 31f5ced

Browse files
authored
update compile scripts to fix conda build env not correctly configure… (#2587)
* update compile scripts to fix conda build env not correctly configured issue * update VER_IPEX in compile bundle
1 parent df5a54a commit 31f5ced

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

examples/cpu/inference/python/llm/tools/env_setup.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,13 @@ if [ $((${MODE} & 0x02)) -ne 0 ]; then
133133
echo " Found GCC version $(gcc -dumpfullversion)"
134134
echo " Installing gcc and g++ 12.3 with conda"
135135
echo ""
136+
conda install -y sysroot_linux-64
136137
conda install -y gcc==12.3 gxx==12.3 cxx-compiler -c conda-forge
137-
conda update -y sysroot_linux-64
138-
export CC=${CONDA_PREFIX}/bin/gcc
139-
export CXX=${CONDA_PREFIX}/bin/g++
140-
export PATH=${CONDA_PREFIX}/bin:${PATH}
141-
export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}
138+
if [ -z ${CONDA_BUILD_SYSROOT} ]; then
139+
source ${CONDA_PREFIX}/etc/conda/activate.d/activate-gcc_linux-64.sh
140+
source ${CONDA_PREFIX}/etc/conda/activate.d/activate-gxx_linux-64.sh
141+
source ${CONDA_PREFIX}/etc/conda/activate.d/activate-binutils_linux-64.sh
142+
fi
142143
fi
143144

144145
set +e

scripts/compile_bundle.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
set -eo pipefail
33

4-
VER_IPEX=main
4+
VER_IPEX=v2.2.0+cpu
55

66
# Mode: Select which components to install. PyTorch and Intel® Extension for PyTorch* are always installed.
77
# High bit: 8 7 6 5 4 3 2 1 :Low bit
@@ -149,9 +149,11 @@ ABI=$(python -c "import torch; print(int(torch._C._GLIBCXX_USE_CXX11_ABI))")
149149
if [ ${GCC_CONDA} -eq 1 ]; then
150150
conda install -y sysroot_linux-64
151151
conda install -y gcc==12.3 gxx==12.3 cxx-compiler -c conda-forge
152-
export CC=${CONDA_PREFIX}/bin/gcc
153-
export CXX=${CONDA_PREFIX}/bin/g++
154-
export LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}
152+
if [ -z ${CONDA_BUILD_SYSROOT} ]; then
153+
source ${CONDA_PREFIX}/etc/conda/activate.d/activate-gcc_linux-64.sh
154+
source ${CONDA_PREFIX}/etc/conda/activate.d/activate-gxx_linux-64.sh
155+
source ${CONDA_PREFIX}/etc/conda/activate.d/activate-binutils_linux-64.sh
156+
fi
155157
fi
156158
set +e
157159
command -v make > /dev/null

0 commit comments

Comments
 (0)