-
Notifications
You must be signed in to change notification settings - Fork 66
[ML] Add PyTorch setup instructions for Linux #1688
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ML] Add PyTorch setup instructions for Linux #1688
Conversation
build-setup/linux.md
Outdated
mkdir /usr/local/cmake | ||
./cmake-3.19.3-Linux-x86_64.sh --skip-license --prefix=/usr/local/cmake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkdir /usr/local/cmake | |
./cmake-3.19.3-Linux-x86_64.sh --skip-license --prefix=/usr/local/cmake | |
sudo mkdir /usr/local/cmake | |
sudo ./cmake-3.19.3-Linux-x86_64.sh --skip-license --prefix=/usr/local/cmake |
The Dockerfile runs as root, whereas the average user with a Linux laptop won't be, so best to include the sudo
in these instructions.
build-setup/linux.md
Outdated
In your `.bashrc` file add CMake to `PATH`: | ||
|
||
``` | ||
PATH=$PATH:/usr/local/cmake/bin | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could include this bit on line 20 so the person working through the instructions can do that all in one go.
build-setup/linux.md
Outdated
tar -xzf Python-3.7.9.tgz | ||
cd Python-3.7.9/ | ||
./configure --enable-optimizations | ||
make altinstall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this install to a directory that requires root access? If so it needs sudo
, but for all the other packages we build from source we do the bulk of the build as non-root and just the install as root, i.e. this sequence occurs multiple times in this file:
make
sudo make install
Maybe there's an equivalent for Python like:
make
sudo make altinstall
Or if not then probably the whole build needs to be under sudo
.
build-setup/linux.md
Outdated
mkdir /usr/local/gcc93/include/pytorch | ||
cp -r torch/include/* /usr/local/gcc93/include/pytorch/ | ||
cp torch/lib/libtorch_cpu.so /usr/local/gcc93/lib | ||
cp torch/lib/libc10.so /usr/local/gcc93/lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mkdir /usr/local/gcc93/include/pytorch | |
cp -r torch/include/* /usr/local/gcc93/include/pytorch/ | |
cp torch/lib/libtorch_cpu.so /usr/local/gcc93/lib | |
cp torch/lib/libc10.so /usr/local/gcc93/lib | |
sudo mkdir /usr/local/gcc93/include/pytorch | |
sudo cp -r torch/include/* /usr/local/gcc93/include/pytorch/ | |
sudo cp torch/lib/libtorch_cpu.so /usr/local/gcc93/lib | |
sudo cp torch/lib/libc10.so /usr/local/gcc93/lib |
cd Python-3.7.9/ | ||
./configure --enable-optimizations | ||
make | ||
sudo make altinstall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading the makefile the altinstall
target does not overwrite any current installations by updating softlinks etc. We will use altinstall
rather than install
and be explicit by invoking python with the full path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Instructions for installing the dependencies and building PyTorch on Linux
Follows the same commands used to build the docker image in #1678