Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cross_tools SPIRV-LLVM-Translator cmake error #17

Open
Lingzilla opened this issue Dec 31, 2023 · 1 comment
Open

cross_tools SPIRV-LLVM-Translator cmake error #17

Lingzilla opened this issue Dec 31, 2023 · 1 comment

Comments

@Lingzilla
Copy link

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants