diff --git a/hpvm/llvm_installer/llvm_installer.sh b/hpvm/llvm_installer/llvm_installer.sh index 726a63219066e8027464407989168eb9b8615f97..dc250e5e7e68bd6aaf83b9ac643eb3e96861f0fb 100755 --- a/hpvm/llvm_installer/llvm_installer.sh +++ b/hpvm/llvm_installer/llvm_installer.sh @@ -28,6 +28,8 @@ CLANG_TOOLS_SRC="clang-tools-extra-$VERSION.src" if [ -d $LLVM_SRC ]; then echo Found $LLVM_SRC! +elif [ -d llvm ]; then + echo Found llvm, not downloading $LLVM_SRC! else echo $WGET $URL/$VERSION/$LLVM_SRC$SUFFIX $WGET $URL/$VERSION/$LLVM_SRC$SUFFIX @@ -37,6 +39,8 @@ fi if [ -d $LLVM_SRC ]; then echo Everything looks sane. mv $LLVM_SRC llvm +elif [ -d llvm ]; then + echo Everything looks sane. else echo Install had problems. Quitting. exit @@ -135,29 +139,37 @@ if [ $LLD_SRC != "" ]; then fi fi - -mkdir $CURRENT_DIR/$LLVM_SRC/tools/hpvm +echo Adding HPVM sources to tree +if [ -d $CURRENT_DIR/$LLVM_SRC/tools/hpvm ]; then + mkdir $CURRENT_DIR/$LLVM_SRC/tools/hpvm +else + echo $CURRENT_DIR/$LLVM_SRC/tools/hpvm exists. +fi HPVM_DIR=$CURRENT_DIR/$LLVM_SRC/tools/hpvm -cp $CURRENT_DIR/CMakeLists.txt $HPVM_DIR -cp -r $CURRENT_DIR/include $HPVM_DIR/ -cp -r $CURRENT_DIR/lib $HPVM_DIR/ -cp -r $CURRENT_DIR/projects $HPVM_DIR/ -#rm -r $HPVM_DIR/projects/llvm-cbe -cp -r $CURRENT_DIR/test $HPVM_DIR/ +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/ ls $HPVM_DIR export LLVM_SRC_ROOT=$CURRENT_DIR/$LLVM_SRC echo ${LLVM_SRC_ROOT} +echo Applying HPVM patches cd $CURRENT_DIR/llvm_patches /bin/bash ./construct_patch.sh /bin/bash ./apply_patch.sh echo Patches applied. +echo Now building... + if [ -d $BUILD_DIR ]; then cd $BUILD_DIR echo Found $BUILD_DIR. @@ -165,9 +177,11 @@ else mkdir -p $BUILD_DIR mkdir -p $INSTALL_DIR cd $BUILD_DIR - cmake ../$LLVM_SRC -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DLLVM_TARGETS_TO_BUILD="X86;NVPTX" -DCMAKE_INSTALL_PREFIX=$INSTALL_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 +echo make -j$NUM_THREADS make -j$NUM_THREADS #make install