Skip to content

Error building with LLVM 20 #33

@jakurzak

Description

@jakurzak

I'm trying to switch to LLVM 20 for building QDP-JIT.
I'm getting this error:

/apps/Chroma_/qdp-jit/lib/qdp_llvm.cc:2539:2: error: no type named 'LLVMTargetMachine' in namespace 'llvm'; did you mean 'LLVMTargetMachineRef'?
 2539 |         llvm::LLVMTargetMachine &LLVMTM = static_cast<llvm::LLVMTargetMachine &>(*TargetMachine);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
      |         LLVMTargetMachineRef
/apps/Chroma_/install/llvm-20/include/llvm-c/TargetMachine.h:35:41: note: 'LLVMTargetMachineRef' declared here
   35 | typedef struct LLVMOpaqueTargetMachine *LLVMTargetMachineRef;
      |                                         ^
/apps/Chroma_/qdp-jit/lib/qdp_llvm.cc:2539:48: error: no type named 'LLVMTargetMachine' in namespace 'llvm'; did you mean 'LLVMTargetMachineRef'?
 2539 |         llvm::LLVMTargetMachine &LLVMTM = static_cast<llvm::LLVMTargetMachine &>(*TargetMachine);
      |                                                       ^~~~~~~~~~~~~~~~~~~~~~~
      |                                                       LLVMTargetMachineRef
/apps/Chroma_/install/llvm-20/include/llvm-c/TargetMachine.h:35:41: note: 'LLVMTargetMachineRef' declared here
   35 | typedef struct LLVMOpaqueTargetMachine *LLVMTargetMachineRef;
      |                                         ^

My build script is:

git clone --recursive --branch devel https://github.com/JeffersonLab/qdp-jit.git
cd qdp-jit
mkdir build
cd build
cmake \
    -DCMAKE_BUILD_TYPE=RELEASE \
    -DCMAKE_C_COMPILER=${LLVM_INSTALL_ROOT}/bin/clang \
    -DCMAKE_CXX_COMPILER=${LLVM_INSTALL_ROOT}/bin/clang++ \
    -DLLVM_DIR=${LLVM_INSTALL_ROOT}/lib/cmake/llvm \
    -DLLD_DIR=${LLVM_INSTALL_ROOT}/lib/cmake/lld \
    -DGPU_TARGETS=${GPU_ARCH} \
    -DQDP_ENABLE_LLVM20=ON \
    -DBUILD_SHARED_LIBS=ON \
    -DQDP_ENABLE_BACKEND=ROCM \
    -DQDP_ENABLE_ROCM_STATS=ON \
    -DQDP_AC_ALIGNMENT_SIZE=128 \
    -DCMAKE_INSTALL_PREFIX=${QCD_INSTALL_ROOT}/qdpxx \
    -DQMP_DIR=${QCD_INSTALL_ROOT}/qmp/lib/cmake/QMP \
    -DCMAKE_PREFIX_PATH=${QCD_INSTALL_ROOT}/zstd/lib \
    -DCMAKE_C_FLAGS="-I${ROCM_PATH}/include/amd_comgr" \
    -DCMAKE_CXX_FLAGS="-I${ROCM_PATH}/include/amd_comgr" \
    ..
make -j 16
make install

It's not immediately obvious to me how to deal with this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions