mirror of
https://gitee.com/mindspore/akg.git
synced 2025-12-06 11:59:12 +08:00
adapt gcc11 for cpu codegen and default pack whl package
This commit is contained in:
6
build.sh
Normal file → Executable file
6
build.sh
Normal file → Executable file
@@ -23,6 +23,7 @@ usage()
|
||||
echo "bash build.sh [-e cpu|gpu|ascend] [-j[n]] [-t on|off] [-o] [-u]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " -d Debug mode"
|
||||
echo " -e Hardware environment: cpu, gpu or ascend"
|
||||
echo " -j[n] Set the threads when building (Default: -j8)"
|
||||
echo " -t Unit test: on or off (Default: off)"
|
||||
@@ -41,7 +42,7 @@ mk_new_dir()
|
||||
mkdir -pv "${create_dir}"
|
||||
}
|
||||
|
||||
write_checksum()
|
||||
write_checksum_tar()
|
||||
{
|
||||
cd "$OUTPUT_PATH" || exit
|
||||
PACKAGE_LIST=$(ls lib*.tar.gz) || exit
|
||||
@@ -175,7 +176,8 @@ cp libakg.so ${OUTPUT_PATH}
|
||||
cd ${OUTPUT_PATH}
|
||||
tar czvf libakg.tar.gz libakg.so
|
||||
rm -rf libakg.so
|
||||
write_checksum
|
||||
write_checksum_tar
|
||||
source ${AKG_DIR}/scripts/package.sh
|
||||
|
||||
cd -
|
||||
echo "---------------- AKG: build end ----------------"
|
||||
|
||||
@@ -23,6 +23,16 @@ if [ ! -d ${OUTPUT_PATH} ]; then
|
||||
mkdir -pv "${OUTPUT_PATH}"
|
||||
fi
|
||||
|
||||
write_version() {
|
||||
if [ ! -e ${BASEPATH}/version.txt ]; then
|
||||
version=`git branch | sed -n '/\* /s///p'`
|
||||
if [ -z ${version} ]; then
|
||||
version='master'
|
||||
fi
|
||||
echo ${version#r} > ${BASEPATH}/version.txt
|
||||
fi
|
||||
}
|
||||
|
||||
write_checksum() {
|
||||
cd "${OUTPUT_PATH}"
|
||||
PACKAGE_LIST=$(ls akg-*.whl)
|
||||
@@ -32,6 +42,7 @@ write_checksum() {
|
||||
done
|
||||
}
|
||||
|
||||
write_version
|
||||
cd ${BASEPATH}
|
||||
${PYTHON} setup.py sdist bdist_wheel
|
||||
|
||||
@@ -46,8 +57,10 @@ do
|
||||
PY_TAGS="cp37-cp37m"
|
||||
elif [[ $PY_VERSION == *3.8* ]]; then
|
||||
PY_TAGS="cp38-cp38"
|
||||
elif [[ $PY_VERSION == *3.9* ]]; then
|
||||
PY_TAGS="cp39-cp39"
|
||||
else
|
||||
echo "Error: Could not find Python 3.8 or Python 3.7"
|
||||
echo "Error: Could not find Python between 3.7 and 3.9"
|
||||
exit 1
|
||||
fi
|
||||
new_file_name="${prefix}-${PY_TAGS}-linux_${CUR_ARCH}.whl"
|
||||
|
||||
14
setup.py
14
setup.py
@@ -15,7 +15,15 @@
|
||||
import os
|
||||
from setuptools import setup
|
||||
|
||||
VERSION = '1.6.0'
|
||||
pwd = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
||||
def _read_file(filename):
|
||||
with open(os.path.join(pwd, filename), encoding='UTF-8') as f:
|
||||
return f.read()
|
||||
|
||||
|
||||
version = _read_file('version.txt').replace("\n", "")
|
||||
|
||||
package_data = {
|
||||
'akg': [
|
||||
@@ -33,7 +41,7 @@ package_data = {
|
||||
|
||||
def collect_dirs(cur_dir, dirs):
|
||||
"""Collect all sub dirs in current dir."""
|
||||
for root, all_dirs, files in os.walk(cur_dir, followlinks=True):
|
||||
for root, all_dirs, _ in os.walk(cur_dir, followlinks=True):
|
||||
for d in all_dirs:
|
||||
if '.' in d:
|
||||
continue
|
||||
@@ -67,7 +75,7 @@ def find_files(where=None):
|
||||
|
||||
setup(
|
||||
name='akg',
|
||||
version=VERSION,
|
||||
version=version,
|
||||
author='The MindSpore Authors',
|
||||
author_email='contact@mindspore.cn',
|
||||
url='https://www.mindspore.cn/',
|
||||
|
||||
@@ -36,7 +36,7 @@ if(NOT USE_LLVM STREQUAL "OFF")
|
||||
set_source_files_properties(${COMPILER_LLVM_SRCS}
|
||||
PROPERTIES COMPILE_DEFINITIONS "DMLC_ENABLE_RTTI=0")
|
||||
set_source_files_properties(${COMPILER_LLVM_SRCS}
|
||||
PROPERTIES COMPILE_FLAGS "-fno-rtti -Wno-init-list-lifetime")
|
||||
PROPERTIES COMPILE_FLAGS "-fno-rtti -Wno-init-list-lifetime -Wno-mismatched-new-delete -Wno-deprecated-declarations")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user