Skip to content

Latest commit

 

History

History
173 lines (122 loc) · 6.37 KB

cpp_install.md

File metadata and controls

173 lines (122 loc) · 6.37 KB

C++ Installation

  1. Follow your system prerequisites (below)

  2. Clone the rFBP package from this repository, or download a stable release

git clone https://github.com/Nico-Curti/rFBP.git
cd rFBP
  1. rFBP could be built with CMake and Make or with the build scripts in the project. Example:

Unix OS:

./build.sh

Windows OS:

PS \>                 ./build.ps1

Installation

Ubuntu

  1. Define a work folder, which we will call WORKSPACE in this tutorial: this could be a "Code" folder in our home, a "c++" folder on our desktop, whatever you want. Create it if you don't already have, using your favourite method (mkdir in bash, or from the graphical interface of your distribution). We will now define an environment variable to tell the system where our folder is. Please note down the full path of this folder, which will look like /home/$(whoami)/code/
echo -e "\n export WORKSPACE=/full/path/to/my/folder \n" >> ~/.bashrc
source ~/.bashrc
  1. Open a Bash terminal and type the following commands to install all the prerequisites.
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-8 g++-8

wget --no-check-certificate https://cmake.org/files/v3.13/cmake-3.13.1-Linux-x86_64.tar.gz
tar -xzf cmake-3.13.1-Linux-x86_64.tar.gz
export PATH=$PWD/cmake-3.13.1-Linux-x86_64/bin:$PATH

sudo apt-get install -y make git dos2unix ninja-build
git config --global core.autocrlf input
git clone https://github.com/physycom/sysconfig
  1. Build the project with CMake (enable or disable OMP with the define -DOMP; enable or disable Cython building with the define -DPYWRAP; enable or disable the Scorer support using -DSCORER; enable or disable testing with the define -DBUILD_TEST):
cd $WORKSPACE
git clone https://github.com/Nico-Curti/rFBP
cd rFBP

mkdir -p build
cd build

cmake -DOMP=ON ..
make -j
cmake --build . --target install
cd ..

macOS

  1. If not already installed, install the XCode Command Line Tools, typing this command in a terminal:
xcode-select --install
  1. If not already installed, install Homebrew following the official guide.

  2. Open the terminal and type these commands

brew update
brew upgrade
brew install gcc@8
brew install cmake make git ninja
  1. Define a work folder, which we will call WORKSPACE in this tutorial: this could be a "Code" folder in our home, a "c++" folder on our desktop, whatever you want. Create it if you don't already have, using your favourite method (mkdir in bash, or from the graphical interface in Finder). We will now define an environment variable to tell the system where our folder is. Please note down the full path of this folder, which will look like /home/$(whoami)/code/

  2. Open a Terminal and type the following command (replace /full/path/to/my/folder with the previous path noted down)

echo -e "\n export WORKSPACE=/full/path/to/my/folder \n" >> ~/.bash_profile
source ~/.bash_profile
  1. Build the project with CMake (enable or disable OMP with the define -DOMP; enable or disable Cython building with the define -DPYWRAP; enable or disable the Scorer support using -DSCORER; enable or disable testing with the define -DBUILD_TEST):
cd $WORKSPACE
git clone https://github.com/Nico-Curti/rFBP
cd rFBP

mkdir -p build
cd build

cmake -DOMP=ON ..
make -j
cmake --build . --target install
cd ..

Windows (7+)

  1. Install Visual Studio 2017 from the official website

  2. Open your Powershell with Administrator privileges, type the following command and confirm it:

PS \>                 Set-ExecutionPolicy unrestricted
  1. If not already installed, please install chocolatey using the official guide

  2. If you are not sure about having them updated, or even installed, please install git, cmake and an updated Powershell. To do so, open your Powershell with Administrator privileges and type

PS \>                 cinst -y git cmake powershell
  1. Restart the PC if required by chocolatey after the latest step

  2. Install PGI 18.10 from the official website (the community edition is enough and is free; NOTE: install included MS-MPI, but avoid JRE and Cygwin)

  3. Activate license for PGI 18.10 Community Edition (rename the file %PROGRAMFILES%\PGI\license.dat-COMMUNITY-18.10 to %PROGRAMFILES%\PGI\license.dat) if necessary, otherwise enable a Professional License if available

  4. Define a work folder, which we will call WORKSPACE in this tutorial: this could be a "Code" folder in our home, a "cpp" folder on our desktop, whatever you want. Create it if you don't already have, using your favourite method (mkdir in Powershell, or from the graphical interface in explorer). We will now define an environment variable to tell the system where our folder is. Please note down its full path. Open a Powershell (as a standard user) and type

PS \>                 rundll32 sysdm.cpl,EditEnvironmentVariables
  1. In the upper part of the window that pops-up, we have to create a new environment variable, with name WORKSPACE and value the full path noted down before. If it not already in the PATH (this is possible only if you did it before), we also need to modify the "Path" variable adding the following string (on Windows 10 you need to add a new line to insert it, on Windows 7/8 it is necessary to append it using a ; as a separator between other records):
                      %PROGRAMFILES%\CMake\bin
  1. If vcpkg is not installed, please follow the next procedure, otherwise please jump to #12
PS \>                 cd $env:WORKSPACE
PS Code>              git clone https://github.com/Microsoft/vcpkg.git
PS Code>              cd vcpkg
PS Code\vcpkg>        .\bootstrap-vcpkg.bat
  1. Open a Powershell with Administrator privileges and type
PS \>                 cd $env:WORKSPACE
PS Code>              cd vcpkg
PS Code\vcpkg>        .\vcpkg integrate install
  1. Open a Powershell and build rFBP using the build.ps1 script
PS \>                 cd $env:WORKSPACE
PS Code>              git clone https://github.com/Nico-Curti/rFBP
PS Code>              cd rFBP
PS Code\rFBP>         .\build.ps1