TensorLight is a light-weight tensor operation library for C and CUDA.
The following steps have been tested for Ubuntu 16.04 but should work with other distros as well. Required packages can be installed using the following command:
sudo apt-get install build-essential perl git pkg-config check
If you want to build with CUDA support, you also have to install CUDA 8.0
or later according to their website CUDA Toolkit 8.0.
Remember to put nvcc
(usually in /usr/local/cuda/bin
) in environment variable PATH
.
-
Clone this repository to your local directory.
cd <my_working_directory> git clone https://github.com/zhaozhixu/TensorLight.git cd TensorLight
-
Build and install
First, configure your installation using:
chmod +x configure ./configure
There are options to custom your building and installation process. You can append them after
./configure
. For example, use./configure --with-cuda=yes
if you want to build with CUDA support. Detailed
./configure
options can be printed using./configure -h
.After that, use
make
to compile the library and run the tests. Thenmake install
to copy the library files and headers into the installation directory, orsudo make install
if you don't have the permissions with that directory.make sudo make install
-
Other
make
optionsUse
make info
to see othermake
options. Especially, you can usemake clean
to clean up the build directory and all object files, andmake uninstall
to remove library files and headers from the installation directory.
Include tl_tensor.h
in your project to use TensorLight functions.
Documentation is coming soon. But it should be familiar if you have experience
with numpy
in Python.
You can use the following command to get the compilation and linking flags when building your project.
pkg-config --cflags --libs tensorlight