@@ -205,8 +205,26 @@ else
205205 log_warn " Skipping monarch torch import hack (monarch may not be installed yet)"
206206fi
207207
208- # Step 4: Install forge package
209- log_info " Step 4: Installing forge package..."
208+ # Step 4: Check for existing build directory and warn user
209+ log_info " Step 4: Checking for existing build directory..."
210+ if [ -d " build" ]; then
211+ log_warn " Detected existing build/ directory at: $( pwd) /build"
212+ log_warn " This directory may contain artifacts from a previous pip installation"
213+ log_warn " that could interfere with the current installation."
214+ log_warn " If you encounter issues, manually remove it with: rm -rf build"
215+ echo " "
216+ read -p " $( echo -e ${YELLOW} Do you want to continue anyway? [y/N]:${NC} ) " -n 1 -r
217+ echo " "
218+ if [[ ! $REPLY =~ ^[Yy]$ ]]; then
219+ log_info " Installation cancelled by user"
220+ log_info " You can manually remove the build/ directory with: rm -rf build"
221+ exit 0
222+ fi
223+ log_warn " Continuing with existing build/ directory. Things might go wrong!"
224+ fi
225+
226+ # Step 5: Install forge package
227+ log_info " Step 5: Installing forge package..."
210228pip install --no-deps --force-reinstall .
211229if [ $? -ne 0 ]; then
212230 log_error " Failed to install forge package"
@@ -248,7 +266,7 @@ log_info "Unsetting CUDA_HOME and overwriting the LD_LIBRARY_PATH"
248266unset CUDA_HOME
249267export LD_LIBRARY_PATH=${CONDA_PREFIX} /lib
250268
251- # Step 5 : Ask user to test
269+ # Step 6 : Ask user to test
252270echo " "
253271log_info " Installation completed successfully!"
254272echo " "
0 commit comments