From 36fdd095e000d7da12ced645a797c0b0fdd5d016 Mon Sep 17 00:00:00 2001 From: Adel Ejjeh <aejjeh@hpvmfpga1.cs.illinois.edu> Date: Tue, 21 Jan 2020 13:33:34 -0600 Subject: [PATCH] Fixing visc-rt makefile and installer script --- hpvm/llvm_installer/llvm_installer.sh | 46 +++++++++++++-------------- hpvm/projects/visc-rt/makefile | 7 ++-- 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/hpvm/llvm_installer/llvm_installer.sh b/hpvm/llvm_installer/llvm_installer.sh index dc250e5e7e..8f9d2aebab 100755 --- a/hpvm/llvm_installer/llvm_installer.sh +++ b/hpvm/llvm_installer/llvm_installer.sh @@ -147,14 +147,12 @@ else fi HPVM_DIR=$CURRENT_DIR/$LLVM_SRC/tools/hpvm - -cp -ruv $CURRENT_DIR/CMakeLists.txt $HPVM_DIR -cp -ruv $CURRENT_DIR/CMakeLists.txt $HPVM_DIR -cp -ruv $CURRENT_DIR/include $HPVM_DIR/ -cp -ruv $CURRENT_DIR/include $HPVM_DIR/ -cp -ruv $CURRENT_DIR/lib $HPVM_DIR/ -cp -ruv $CURRENT_DIR/projects $HPVM_DIR/ -cp -ruv $CURRENT_DIR/test $HPVM_DIR/ +mkdir -p $HPVM_DIR +ln -s $CURRENT_DIR/CMakeLists.txt $HPVM_DIR +ln -s $CURRENT_DIR/include $HPVM_DIR/ +ln -s $CURRENT_DIR/lib $HPVM_DIR/ +ln -s $CURRENT_DIR/projects $HPVM_DIR/ +ln -s $CURRENT_DIR/test $HPVM_DIR/ ls $HPVM_DIR @@ -170,31 +168,31 @@ echo Patches applied. echo Now building... -if [ -d $BUILD_DIR ]; then - cd $BUILD_DIR - echo Found $BUILD_DIR. -else - mkdir -p $BUILD_DIR - mkdir -p $INSTALL_DIR - cd $BUILD_DIR - echo cmake ../$LLVM_SRC -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR - cmake ../$LLVM_SRC -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -fi +mkdir -p $BUILD_DIR +mkdir -p $INSTALL_DIR +cd $BUILD_DIR +echo cmake ../$LLVM_SRC -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR +cmake ../$LLVM_SRC -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLLVM_TARGETS_TO_BUILD="X86" -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR echo make -j$NUM_THREADS make -j$NUM_THREADS #make install +echo Building HPVM runtime +HPVM_RT_DIR=$HPVM_DIR/projects/visc-rt +cd $HPVM_RT_DIR +make + #cp -r $CURRENT_DIR/projects $HPVM_DIR/ #make -j$NUM_THREADS -if [ -x $INSTALL_DIR/bin/clang ]; then - true -else - echo LLVM not installed properly. - exit 0 -fi +#if [ -x $INSTALL_DIR/bin/clang ]; then +# true +#else +# echo LLVM not installed properly. +# exit 0 +#fi cd $CURRENT_DIR diff --git a/hpvm/projects/visc-rt/makefile b/hpvm/projects/visc-rt/makefile index e0f7e3b2c0..adcc632335 100644 --- a/hpvm/projects/visc-rt/makefile +++ b/hpvm/projects/visc-rt/makefile @@ -1,15 +1,14 @@ -#LLVM_SRC_ROOT = ../../../llvm +#LLVM_SRC_ROOT = LLVM_BUILD_ROOT = ${LLVM_SRC_ROOT}/../build/ -OPENCL_INC_PATH = /opt/intel/opencl-sdk/include CUDA_INC_PATH = /software/cuda-9.1/include/CL/ ifeq ($(NUM_CORES),) - NUM_CORES=8 + NUM_CORES=1 endif -CPP_FLAGS = -I $(LLVM_SRC_ROOT)/include -I $(LLVM_BUILD_ROOT)/include -I $(OPENCL_INC_PATH) -I $(CUDA_INC_PATH) -std=c++11 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS +CPP_FLAGS = -I$(LLVM_SRC_ROOT)/include -I$(LLVM_BUILD_ROOT)/include -I$(CUDA_INC_PATH) -std=c++11 -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS TARGET:=visc-rt LLVM_CC:=$(LLVM_BUILD_ROOT)/bin/clang -- GitLab