sunhaiyong1978 / Yongbao

一个基于交叉编译的Linux发行版。
24 stars 1 forks source link

cross_tools SPIRV-LLVM-Translator cmake error #17

Open Lingzilla opened 11 months ago

Lingzilla commented 11 months ago

under loongarch64/scripts/step/cross-tools/SPIRV-LLVM-Translator:

source env/cross-tools/config
source env/distro.info
source env/function.sh
source env/cross-tools/custom
export STEP_BUILDNAME=cross-tools
export STEP_PACKAGENAME=SPIRV-LLVM-Translator
export PACKAGE_VERSION=17.0.0
export RESOURCEDIR=${NEW_TARGET_SYSDIR}/files/cross-tools/SPIRV-LLVM-Translator/17.0.0/
rm -rf ${BUILD_DIRECTORY}/SPIRV-LLVM-Translator-17.0.0
tar xvf ${DOWNLOADDIR}/SPIRV-LLVM-Translator-17.0.0.tar.gz -C ${BUILD_DIRECTORY} 
pushd ${BUILD_DIRECTORY}/SPIRV-LLVM-Translator-17.0.0

    tar xvf ${RESOURCEDIR}/files/SPIRV-Headers-sdk-1.3.250.1.tar.gz
        mkdir -p build
        pushd build
                cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release  -DCMAKE_INSTALL_PREFIX:PATH=${CROSSTOOLS_DIR} \
              -DCMAKE_INSTALL_RPATH="${CROSSTOOLS_DIR}/lib${LIB_SUFF};\\\${ORIGIN}/../lib${LIB_SUFF}" \
                      -DBUILD_SHARED_LIBS=OFF -DCCACHE_ALLOWED=OFF -DBASE_LLVM_VERSION="$(get_package_version cross-tools_llvm-project)" \
              -DLLVM_DIR:PATH=${CROSSTOOLS_DIR}/lib${LIB_SUFF}/cmake/llvm \
              -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${PWD}/../SPIRV-Headers-sdk-1.3.250.1 -Wno-dev ..
                eval ${MAKE_AND_INSTALL}
        popd
popd 
rm -rf ${BUILD_DIRECTORY}/SPIRV-LLVM-Translator-17.0.0

when I compile this, I got the SPIRV-Headers-vulkan-sdk-1.3.268.0.tar.gz instead of SPIRV-Headers-sdk-1.3.250.1.tar.gz, after I replaced the path of these headers, it looks like below:

source env/cross-tools/config
source env/distro.info
source env/function.sh
source env/cross-tools/custom
export STEP_BUILDNAME=cross-tools
export STEP_PACKAGENAME=SPIRV-LLVM-Translator
export PACKAGE_VERSION=17.0.0
export RESOURCEDIR=${NEW_TARGET_SYSDIR}/files/cross-tools/SPIRV-LLVM-Translator/17.0.0/
rm -rf ${BUILD_DIRECTORY}/SPIRV-LLVM-Translator-17.0.0
tar xvf ${DOWNLOADDIR}/SPIRV-LLVM-Translator-17.0.0.tar.gz -C ${BUILD_DIRECTORY}
pushd ${BUILD_DIRECTORY}/SPIRV-LLVM-Translator-17.0.0

        tar xvf ${RESOURCEDIR}/files/SPIRV-Headers-vulkan-sdk-1.3.268.0.tar.gz
        mkdir -p build
        pushd build
                cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release  -DCMAKE_INSTALL_PREFIX:PATH=${CROSSTOOLS_DIR} \
                      -DCMAKE_INSTALL_RPATH="${CROSSTOOLS_DIR}/lib${LIB_SUFF};\\\${ORIGIN}/../lib${LIB_SUFF}" \
                      -DBUILD_SHARED_LIBS=OFF -DCCACHE_ALLOWED=OFF -DBASE_LLVM_VERSION="$(get_package_version cross-tools_llvm-project)" \
                      -DLLVM_DIR:PATH=${CROSSTOOLS_DIR}/lib${LIB_SUFF}/cmake/llvm \
                      -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${PWD}/../SPIRV-Headers-vulkan-sdk-1.3.268.0 -Wno-dev ..
                eval ${MAKE_AND_INSTALL}
        popd
popd
rm -rf ${BUILD_DIRECTORY}/SPIRV-LLVM-Translator-17.0.0

And it will configure correctly.

sunhaiyong1978 commented 10 months ago

制作的时候用-o 制定llvm_git参数编译一下看看。 ./build.sh -o llvm_git