summaryrefslogtreecommitdiff
path: root/compile_from_source.md
diff options
context:
space:
mode:
authorTim Dettmers <dettmers@g3030.hyak.local>2021-10-21 17:22:43 -0700
committerTim Dettmers <dettmers@g3030.hyak.local>2021-10-21 17:22:43 -0700
commit0fb378b4eed1fffc61b71439a5d5b11ad8335dd0 (patch)
treeb6991395aa0d889ca738bf25210c7187ce98ec4d /compile_from_source.md
parentd2f16726905f53952fc744147802076f6a1d8711 (diff)
Added compilation from source instructions; easier compilation.
Diffstat (limited to 'compile_from_source.md')
-rw-r--r--compile_from_source.md20
1 files changed, 20 insertions, 0 deletions
diff --git a/compile_from_source.md b/compile_from_source.md
new file mode 100644
index 0000000..c6a8b18
--- /dev/null
+++ b/compile_from_source.md
@@ -0,0 +1,20 @@
+# Compiling from source
+
+Basic steps.
+1. `make cudaXXX` where `cudaXXX` is among `cuda92, cuda10x, cuda110, cuda11x`
+2. `CUDA_VERSION=XXX python setup.py install`
+
+To run these steps you will need to have the nvcc compiler installed that comes with a CUDA installation. If you use anaconda (recommended) then you can figure out which version of CUDA you are using with PyTorch via the command `conda list | grep cudatoolkit`. Then you can install the nvcc compiler by downloading and installing the same CUDA version from the [CUDA toolkit archive](https://developer.nvidia.com/cuda-toolkit-archive).
+
+For your convenience, there is a install script int he root directory that installs CUDA 11.1 locally and configures it automatically. After installing you should add the `bin` sub-directory to the `$PATH` variable to make the compiler visible to your system. To do this you can add this to your `.bashrc` by executing these commands:
+```bash
+echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64/" >> ~/.bashrc
+echo "export PATH=$PATH:/usr/local/cuda/bin/" >> ~/.bashrc
+source ~/.bashrc
+```
+
+By default, the Makefile will look at your `CUDA_HOME` environmental variable to find your CUDA version for compiling the library. If this path is not set it is inferred from the path of your `nvcc` compiler.
+
+Either `nvcc` needs to be in path for the `CUDA_HOME` variable needs to be set to the CUDA directory root (e.g. `/usr/local/cuda`) in order for compilation to succeed
+
+If you have problems compiling the library with these instructions from source, please open an issue.