Skip to content

Build from source

Shinya Morino edited this page Nov 3, 2018 · 17 revisions

OS

Sqaod is developed on Ubuntu 16.04, and the build instruction on this page is for Ubuntu 16.04.
But sqaod does not use distribution-specific features, thus, it should run on other common Linux distributions.

1. Install cuda-toolkit (If you need to run CUDA-based solvers.)

Please visit CUDA downloads, and download 'deb(network)' or 'deb(local)' package. The following is an example to install CUDA toolkit with the deb(network) package.
This instruction is for CUDA 9.1, and CUDA version 9.0 or later is required.

sudo dpkg -i cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
# installing CUDA.
sudo apt--get install cuda
# or install cuda-toolkit only if you want to build sqoad on a PC without NVIDIA GPU(s).
sudo apt--get install cuda-toolkit

2. Install dependencies

apt-get install automake autoconf libtool

3. Clone sqaod repository and external repositories.

Cloning sqaod repository and run the clone_3rdparty.sh script to clone eigen and cub.

git clone https://shinmorino.github.com/sqaod.git
cd sqaod
./clone_3rdparty.sh

Note: Please checkout 1.0 branch of sqaod repository if you build sqaod 1.0. Master branch is for 1.1 development.

4. Configure and build.

Run the instruction below.

# at the top level directory of sqaod.
./autogen.sh  # generating build files with GNU autotools.
./configure --enable-cuda
make
make install

Following options are available for configure script.

#  --enable-cuda<=cuda-prefix> : (default) false.<BR>
#    The default value of cuda-prefix is '/usr/local/cuda'.
#    If you want explicitly specify CUDA version, specify full path of CUDA toolkit dir.
#    Below is an example to specify CUDA 9.2.

./configure --enable-cuda=/usr/local/cuda-9.2

If you want to specify SIMD options, use SIMD_OPT env var. The default is 'sse2', and 'avx2' is the recommended option for Haswell and later.

export SIMD_OPT=avx2
./configure --enable-cuda ...

4. Build python package and c-extensions

C-extensions and python packages are built for the python version currently used.
The following instruction is for python 2.7.

To build, run the following commands.

apt-get install python-dev
pip install numpy setuptools
# at the top-level directory of sqaod.
./build_py.sh

The binary distribution is created in sqaod/sqaodpy/dist.
To install, use pip.

pip install sqaodpy/dist/sqaod-0.1.dev0-cp27-cp27mu-manylinux1_x86_64.whl

Clone this wiki locally