- Install a compatible version of
gcc:
$ export GCC_VERSION="8"
$ sudo apt-get update
$ sudo apt-get -y install gcc-${GCC_VERSION} g++-${GCC_VERSION}- Set the recently installed version of
gccas default:
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_VERSION} 20
$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-${GCC_VERSION} 20
$ sudo update-alternatives --config gcc
$ sudo update-alternatives --config g++- Install a compatible version of
boostlibrary:
Using the package manager (1.65 on Ubuntu 18.04)
$ sudo apt-get -y install libboost-all-devor build from scratch
$ export BOOST="boost_1_70_0"
$ export BOOST_VERSION="1.70.0"
$ wget https://dl.bintray.com/boostorg/release/${BOOST_VERSION}/source/${BOOST}.tar.gz -O /tmp/${BOOST}.tar.gz
$ tar -xf /tmp/${BOOST}.tar.gz
$ cd ./${BOOST}/
$ ./bootstrap.sh --prefix=/usr/local
$ ./b2 -j8
$ sudo ./b2 install- The default settings are:
-DTARGET_PLATFORM=arm
-DSELECTED_DEBUG=vverb
-DSIMULATOR=KnottyKraken
-DCMAKE_C_COMPILER=/usr/bin/gcc
-DCMAKE_CXX_COMPILER=/usr/bin/g++
-DBOOST_INCLUDEDIR=/usr/local/include
-DBOOST_LIBRARYDIR=/usr/local/lib- Add options by
-D${OPTION_NAME}=${OPTION}aftercmake.
$ cmake -DSIMULATOR=KnottyKraken . && make -j- Use
make cleanto only remove*.aand*.sofiles. - Use
make clean_cmaketo remove all of the files and folders that cmake produces.
The preferred version of Ubuntu is 18.04. When you contribute to this project, please clang-format the code at first. Please follow these instructions:
$ sudo apt-get install clang-format-6.0Use the .clang-format file from repository and locate it in the folder where you want to format the code.
Within the folder, use this command to format .cpp/.hpp/.c/.h files:
$ find . -type f -and \( -name "*.hpp" -or -name "*.cpp" -or -name "*.h" -or -name "*.c" \) | xargs clang-format -i -style=fileUse the clang_format_test.sh file to check whether the formatting is successful or not. If it is successful, there will be green works showing All source code in commit are properly formatted. Otherwise, there will be red warning showing Found formatting errors! and which file where the problem is in.