fixed scripts
This commit is contained in:
parent
9f4538a308
commit
38fbc1ea40
|
@ -9,9 +9,9 @@ export LD_LIBRARY_PATH=$LIBTORCH/lib:$LD_LIBRARY_PATH
|
|||
|
||||
# Precompiled libtorch
|
||||
sudo rm -rf $LIBTORCH
|
||||
mkdir -p $LIBTORCH
|
||||
sudo mkdir -p $LIBTORCH
|
||||
wget -O /tmp/libtorch-cxx11-abi-shared-with-deps-1.5.1+cpu.zip https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-1.5.1%2Bcpu.zip
|
||||
unzip /tmp/libtorch-cxx11-abi-shared-with-deps-1.5.1+cpu.zip -d $LIBTORCH
|
||||
sudo unzip /tmp/libtorch-cxx11-abi-shared-with-deps-1.5.1+cpu.zip -d $LIBTORCH
|
||||
|
||||
# Update .bashrc
|
||||
FILE='$HOME/.bashrc'
|
||||
|
@ -19,13 +19,13 @@ LN_LIBTORCH = 'export LIBTORCH="$GOPATH/pkg/mod/github.com/sugarme/gotch@$GOTCH_
|
|||
LN_LIBRARY_PATH = 'export LIBRARY_PATH=$LIBTORCH/lib'
|
||||
LN_CPATH = 'export CPATH=$CPATH:$LIBTORCH/lib:$LIBTORCH/include:$LIBTORCH/include/torch/csrc:$LIBTORCH/include/torch/csrc/api/include'
|
||||
LN_LD_LIBRARY_PATH = 'export LD_LIBRARY_PATH=$LIBTORCH/lib:$LD_LIBRARY_PATH'
|
||||
grep -qF -- "$LN_LIBTORCH" "$FILE" || echo "$LN_LIBTORCH" >> "$FILE"
|
||||
grep -qF -- "$LN_LIBRARY_PATH" "$FILE" || echo "$LN_LIBRARY_PATH" >> "$FILE"
|
||||
grep -qF -- "$LN_CPATH" "$FILE" || echo "$LN_CPATH" >> "$FILE"
|
||||
grep -qF -- "$LN_LD_LIBRARY_PATH" "$FILE" || echo "$LN_LD_LIBRARY_PATH" >> "$FILE"
|
||||
sudo grep -qF -- "$LN_LIBTORCH" "$FILE" || sudo echo "$LN_LIBTORCH" >> "$FILE"
|
||||
sudo grep -qF -- "$LN_LIBRARY_PATH" "$FILE" || sudo echo "$LN_LIBRARY_PATH" >> "$FILE"
|
||||
sudo grep -qF -- "$LN_CPATH" "$FILE" || sudo echo "$LN_CPATH" >> "$FILE"
|
||||
sudo grep -qF -- "$LN_LD_LIBRARY_PATH" "$FILE" || sudo echo "$LN_LD_LIBRARY_PATH" >> "$FILE"
|
||||
|
||||
# Update CPU config
|
||||
sudo rm $LIBTORCH/lib.go
|
||||
cp $LIBTORCH/lib.go.cpu $LIBTORCH/lib.go
|
||||
mv $LIBTORCH/dummy_cuda_dependency.cpp $LIBTORCH/dummy_cuda_dependency.cpp.gpu
|
||||
mv $LIBTORCH/fake_cuda_dependency.cpp.cpu $LIBTORCH/fake_cuda_dependency.cpp
|
||||
sudo cp $LIBTORCH/lib.go.cpu $LIBTORCH/lib.go
|
||||
sudo mv $LIBTORCH/dummy_cuda_dependency.cpp $LIBTORCH/dummy_cuda_dependency.cpp.gpu
|
||||
sudo mv $LIBTORCH/fake_cuda_dependency.cpp.cpu $LIBTORCH/fake_cuda_dependency.cpp
|
||||
|
|
|
@ -7,9 +7,9 @@ export CPATH=$CPATH:$LIBTORCH/lib:$LIBTORCH/include:$LIBTORCH/include/torch/csrc
|
|||
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBTORCH/lib:/usr/lib64-nvidia:/usr/local/cuda-10.1/lib64
|
||||
|
||||
sudo rm -rf $LIBTORCH
|
||||
mkdir -p $LIBTORCH
|
||||
sudo mkdir -p $LIBTORCH
|
||||
wget -O /tmp/libtorch-cxx11-abi-shared-with-deps-1.5.1%2Bcu101.zip https://download.pytorch.org/libtorch/cu101/libtorch-cxx11-abi-shared-with-deps-1.5.1%2Bcu101.zip
|
||||
unzip /tmp/libtorch-cxx11-abi-shared-with-deps-1.5.1%2Bcu101.zip -d $LIBTORCH
|
||||
sudo unzip /tmp/libtorch-cxx11-abi-shared-with-deps-1.5.1%2Bcu101.zip -d $LIBTORCH
|
||||
|
||||
# update .bashrc
|
||||
FILE='$HOME/.bashrc'
|
||||
|
@ -17,7 +17,7 @@ LN_LIBTORCH = 'export LIBTORCH="$GOPATH/pkg/mod/github.com/sugarme/gotch@$GOTCH_
|
|||
LN_LIBRARY_PATH = 'export LIBRARY_PATH=$LIBTORCH/lib'
|
||||
LN_CPATH = 'export CPATH=$CPATH:$LIBTORCH/lib:$LIBTORCH/include:$LIBTORCH/include/torch/csrc/api/include'
|
||||
LN_LD_LIBRARY_PATH = 'export LD_LIBRARY_PATH=$LIBTORCH/lib:/usr/lib64-nvidia:/usr/local/cuda-10.1/lib64'
|
||||
grep -qF -- "$LN_LIBTORCH" "$FILE" || echo "$LN_LIBTORCH" >> "$FILE"
|
||||
grep -qF -- "$LN_LIBRARY_PATH" "$FILE" || echo "$LN_LIBRARY_PATH" >> "$FILE"
|
||||
grep -qF -- "$LN_CPATH" "$FILE" || echo "$LN_CPATH" >> "$FILE"
|
||||
grep -qF -- "$LN_LD_LIBRARY_PATH" "$FILE" || echo "$LN_LD_LIBRARY_PATH" >> "$FILE"
|
||||
sudo grep -qF -- "$LN_LIBTORCH" "$FILE" || sudo echo "$LN_LIBTORCH" >> "$FILE"
|
||||
sudo grep -qF -- "$LN_LIBRARY_PATH" "$FILE" || sudo echo "$LN_LIBRARY_PATH" >> "$FILE"
|
||||
sudo grep -qF -- "$LN_CPATH" "$FILE" || sudo echo "$LN_CPATH" >> "$FILE"
|
||||
sudo grep -qF -- "$LN_LD_LIBRARY_PATH" "$FILE" || sudo echo "$LN_LD_LIBRARY_PATH" >> "$FILE"
|
||||
|
|
Loading…
Reference in New Issue
Block a user