Skip to content

Build Instructions

NanmiaoWu edited this page Mar 25, 2020 · 33 revisions

Dependencies

Linux

Ubuntu (Tested on 16.04)

Dependencies

Before installing other dependencies please make sure the following packages are installed:

sudo apt-get install wget python3 python3-dev python3-pip libblas-dev liblapack-dev
pip3 install pytest

HPX

You can find more details in HPX Build Recipes.

Note: Avoid using jemalloc If you are installing Phylanx with its Python frontend.

git clone --depth 1 https://github.com/STEllAR-GROUP/hpx.git
cd hpx
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE={Release,Debug} \
      -DCMAKE_INSTALL_PREFIX=/hpx/install/path \
      -DHPX_WITH_MALLOC=tcmalloc \
      -DTCMALLOC_ROOT=/path/to/gperftools \
      [-DHPX_WITH_DEPRECATION_WARNINGS=Off -DHPX_WITH_EXAMPLES=Off] ..
make
make install

Blaze

git clone --depth=1 https://bitbucket.org/blaze-lib/blaze.git
cd blaze
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE={Release,Debug} -DCMAKE_INSTALL_PREFIX=/blaze/install/path -DBLAZE_SMP_THREADS=HPX -DHPX_DIR=/path/to/hpx ..
make install

Blaze_tensor

git clone --depth=1 https://github.com/STEllAR-GROUP/blaze_tensor.git
cd blaze_tensor
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE={Release,Debug} -DCMAKE_INSTALL_PREFIX=/blaze_tensor/install/path -DBLAZE_DIR=/path/to/blaze -DBLAZE_SMP_THREADS=HPX -DHPX_DIR=/path/to/hpx ..
make
make install

pybind11

git clone --depth=1 https://github.com/pybind/pybind11.git
cd pybind11
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE={Release,Debug} -DCMAKE_INSTALL_PREFIX=/pybind11/install_path/ ..
make install

Phylanx

git clone --depth=1 https://github.com/STEllAR-GROUP/phylanx.git
cd phylanx
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE={Release,Debug} -DCMAKE_INSTALL_PREFIX=/phylanx/install/path/ -DHPX_DIR=/hpx/install/path/lib/cmake/HPX/ -Dblaze_DIR=/blaze/install/path/share/blaze/cmake/ -Dpybind11_DIR=/pybind11/install/path/share/cmake/pybind11/ ..
make
make install

CircleCi

You can find more details in CircleCi config.

Windows

  1. Install Vcpkg
  2. Install the prerequisites via Vcpkg

e.g.

vcpkg install boost:x64-windows
vcpkg install hwloc:x64-windows
vcpkg install pybind11:x64-windows
vcpkg install clapack:x64-windows
vcpkg install blaze:x64-windows --head

Note: If you want to use a different BLAS library instead of OpenBLAS consult CMake documentation https://github.com/Kitware/CMake/blob/master/Modules/FindBLAS.cmake and elsewhere

  1. Build HPX according to instructions from HPX documentation

  2. Install BlazeTensor

Open a PowerShell window at the location you want to install BlazeTensor, e.g. C:/Repos/, and enter

git clone https://github.com/STEllAR-GROUP/blaze_tensor.git

Create two files in the location you will install BlazeTensor called "blaze_tensor.bat" and "blaze_tensor.cmake". The .bat file will contain the following

cd blaze_tensor 
rd /s /q cmake-build-debug 
git pull 
cmake -C ../blaze_tensor.cmake -H. -Bcmake-build-debug -G"Visual Studio 16 2019" -A"x64" 
cmake  --build cmake-build-debug 

Note: Ensure that the line starting with "cmake -C" is modified to match your version of Windows and Visual Studio. Also, you may choose to omit the line beginning with "rd" as this removes any previous build of BlazeTensor if it exists.

Then the .cmake file will contain

set(CMAKE_BUILD_TYPE Debug CACHE STRING "")
set(CMAKE_TOOLCHAIN_FILE "C:/Repos/vcpkg/scripts/buildsystems/vcpkg.cmake" CACHE FILEPATH "") 
set(HPX_DIR "C:/Repos/hpx/cmake-build-debug/lib/cmake/HPX" CACHE PATH "")

Note: You may need to change the file path of the toolchain file to the location of vcpkg.cmake and change the HPX_DIR to the file path of HPXConfig.cmake

Now run the "blaze_tensor.bat" file by double-clicking it.

  1. Build Phylanx
    • Set CMAKE_TOOLCHAIN_FILE to the location of the Vcpkg CMake script
      • e.g. If Vcpkg was set up in C:/local/vcpkg then the script file may be located in C:/local/vcpkg/scripts/buildsystems/vcpkg.cmake
    • Set HPX_DIR to the location of your HPX build
      • e.g. If you built HPX in C:/local/hpx-debug the path would be C:/local/hpx-debug/lib/cmake/HPX
    • Provide the same CMAKE_BUILD_TYPE you used for building HPX