Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup dev environment on WSL(ubuntu 16.04) #74

Open
fyt000 opened this issue Aug 25, 2019 · 0 comments
Open

Setup dev environment on WSL(ubuntu 16.04) #74

fyt000 opened this issue Aug 25, 2019 · 0 comments

Comments

@fyt000
Copy link
Collaborator

fyt000 commented Aug 25, 2019

install build essential, gcc toolchain and switch to use gcc/g++-9 as default

$ sudo apt install build-essential
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt update
$ sudo apt install gcc-9 g++-9
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 90 --slave /usr/bin/g++ g++ /usr/bin/g++-9 --slave /usr/bin/gcov gcov /usr/bin/gcov-9

download & install boost:

$ wget https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.bz2
$ tar --bzip2 -xf boost_1_71_0.tar.bz2
$ cd boost_1_71_0/
$ sudo ./b2 -j 8 install
$ cd -

OpenSSL

$ sudo apt install libssl-dev

CMake, reload shell after installation

$ wget https://github.com/Kitware/CMake/releases/download/v3.15.2/cmake-3.15.2.tar.gz
$ tar -xvzf cmake-3.15.2.tar.gz
$ cd cmake-3.15.2/
$ ./bootstrap
$ make -j 8
$ sudo make install
$ cd -

Ninja

sudo apt install ninja-build

nlohmann_json

$ git clone https://github.com/nlohmann/json.git
$ cd json
$ cmake -DJSON_BuildTests=OFF .
$ sudo make install
$ cd -

PostgreSQL

$ sudo apt install postgresql postgresql-contrib postgresql-client libpq-dev postgresql-server-dev-all

In WSL, PostgreSQL must be manually started each time

$ sudo service postgresql start

Create niba database

$ sudo -u postgres psql
postgres=# create database niba; 
postgres=# create database niba_static;
postgres=# \q

Load schemas/niba_player.sql into niba, and actual data dump(eg. schemas/niba_static.sql) into niba_static

$ sudo -u postgres psql -d niba -f niba_player.sql
$ sudo -u postgres psql -d niba_static -f niba_static.sql

Allow access to PostgreSQL on unix sockets

  1. modify /etc/postgresql/10/main/pg_hba.conf change peer to trust for unix socket and user postgres (eg. the first uncommented line in the file)
  2. sudo service postgresql restart

Build, if it doesn't run most likely database access permission is not setup properly

$ ./rebuild.sh -n
$ build/niba-server

Test

$ cd test
$ ./test_latency.py

Optionally install

$ sudo apt install clang-format-8
@fyt000 fyt000 changed the title Setup dev environment on WSL(ubuntu) Setup dev environment on WSL(ubuntu 16.04) Aug 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant