Added -DCMAKE_PREFIX_PATH=\$AOMP/lib/cmake to build_comgr.sh cmake options.
If a user had reference to /opt/rocm in \$PATH, the cmake default path search order would resolve find_path(AMDDeviceLibs) in /opt/rocm/lib/cmake, causing a build failure for AOMP.
@@ -78,7 +78,7 @@ if [ "$1" != "nocmake" ] && [ "$1" != "install" ] ; then
$SUDO rm -rf $BUILD_AOMP/build/comgr
export LLVM_DIR=$AOMP_INSTALL_DIR
export Clang_DIR=$AOMP_INSTALL_DIR
- MYCMAKEOPTS="-DCMAKE_INSTALL_PREFIX=$INSTALL_COMGR -DCMAKE_BUILD_TYPE=$BUILDTYPE $AOMP_ORIGIN_RPATH -DLLVM_BUILD_MAIN_SRC_DIR=$AOMP_REPOS/$AOMP_PROJECT_REPO_NAME/llvm -DLLVM_DIR=$AOMP_INSTALL_DIR -DClang_DIR=$AOMP_INSTALL_DIR -DAMD_COMGR_BUILD_NO_ROCM=ON"
+ MYCMAKEOPTS="-DCMAKE_INSTALL_PREFIX=$INSTALL_COMGR -DCMAKE_BUILD_TYPE=$BUILDTYPE $AOMP_ORIGIN_RPATH -DLLVM_BUILD_MAIN_SRC_DIR=$AOMP_REPOS/$AOMP_PROJECT_REPO_NAME/llvm -DLLVM_DIR=$AOMP_INSTALL_DIR -DClang_DIR=$AOMP_INSTALL_DIR -DAMD_COMGR_BUILD_NO_ROCM=ON -DCMAKE_PREFIX_PATH=$AOMP/lib/cmake"
mkdir -p $BUILD_AOMP/build/comgr
cd $BUILD_AOMP/build/comgr
echo " -----Running comgr cmake ---- "
