#!/bin/bash
echo $(grep -E "^VERSION_ID=" /etc/os-release | cut -d'"' -f2)
if [[ "${task_name}" == *ubuntu24* ]]; then
sudo update-alternatives --set gcc /usr/bin/gcc-14
export PATH=/opt/buildtools/python-3.10.2/bin:$PATH
else
if [[ -f "/opt/rh/devtoolset-7/enable" ]]; then
echo "source devtoolset"
source /opt/rh/devtoolset-7/enable
fi
rm -rf /home/jenkins/opensource/lib_cache
ln -s /home/jenkins/opensource/ubuntu20/lib_cache /home/jenkins/opensource/lib_cache
fi
if [[ "${task_name}" =~ Compile_Ascend_X86_ubuntu24 ]]; then
sed -i "1i set(CMAKE_EXPORT_COMPILE_COMMANDS ON)" "CMakeLists.txt"
echo "api-check=compile" >> "${ATOMGIT_OUTPUT}"
else
echo "api-check=continue" >> "${ATOMGIT_OUTPUT}"
fi
if [[ "${target_branch}" == "master" ]] || [[ "${target_branch}" == "develop" ]]; then
sudo update-alternatives --set lcov /opt/lcov-2.3.2/bin/lcov
lcov --version
fi
gcc --version
source /home/jenkins/Ascend/cann/bin/setenv.bash
set +e
pip3 install -r super_kernel/requirements-dev.txt
echo "exec cmd: [bash build.sh --pkg --cann_3rd_lib_path="/home/jenkins/opensource"]"
bash build.sh --pkg --cann_3rd_lib_path="/home/jenkins/opensource"
ret=$?
exit $ret