From d8edcd65803d05530aae642e5d5bdc3a7170a640 Mon Sep 17 00:00:00 2001 From: jwdeitch Date: Sun, 14 Oct 2018 20:10:26 -0400 Subject: [PATCH] WS lib + Boost + Cmake cleanup --- CMakeLists.txt | 11 +++++++++-- Dockerfile | 8 +++++--- {Algorithm => src/Algorithm}/Algorithm.hpp | 0 {Algorithm => src/Algorithm}/MonteCarlo.cpp | 0 {Algorithm => src/Algorithm}/MonteCarlo.hpp | 0 {Lattice => src/Lattice}/Lattice.hpp | 0 {Model => src/Model}/Heisenberg.cpp | 0 {Model => src/Model}/Heisenberg.hpp | 0 {Model => src/Model}/Model.hpp | 0 src/WebSocket.cpp | 9 +++++++++ src/WebSocket.hpp | 11 +++++++++++ main.cpp => src/main.cpp | 5 +++++ 12 files changed, 39 insertions(+), 5 deletions(-) rename {Algorithm => src/Algorithm}/Algorithm.hpp (100%) rename {Algorithm => src/Algorithm}/MonteCarlo.cpp (100%) rename {Algorithm => src/Algorithm}/MonteCarlo.hpp (100%) rename {Lattice => src/Lattice}/Lattice.hpp (100%) rename {Model => src/Model}/Heisenberg.cpp (100%) rename {Model => src/Model}/Heisenberg.hpp (100%) rename {Model => src/Model}/Model.hpp (100%) create mode 100644 src/WebSocket.cpp create mode 100644 src/WebSocket.hpp rename main.cpp => src/main.cpp (91%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e828fb..931117f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,17 @@ cmake_minimum_required(VERSION 3.10) project(MCSM) -set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD 14) + +find_package(Boost 1.67.0 REQUIRED COMPONENTS system) +if(Boost_FOUND) + include_directories(${Boost_INCLUDE_DIRS}) +endif() find_library(MCSM libarmadillo) -add_executable(MCSM main.cpp Model/Model.hpp Model/Heisenberg.cpp Algorithm/MonteCarlo.cpp Lattice/Lattice.hpp Model/Heisenberg.hpp Algorithm/MonteCarlo.hpp Algorithm/Algorithm.hpp) +file(GLOB_RECURSE SOURCES "src/*.cpp" "src/*.hpp") + +add_executable(MCSM ${SOURCES}) target_link_libraries(MCSM armadillo) \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 8224163..acc97e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ FROM ubuntu:18.10 -RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y g++ git cmake nlohmann-json-dev libarmadillo-dev +RUN apt update && DEBIAN_FRONTEND=noninteractive apt install -y g++ git cmake nlohmann-json-dev libarmadillo-dev libssl-dev libboost1.67-all-dev nano + +RUN mkdir /deps && cd /deps && git clone https://gitlab.com/eidheim/Simple-WebSocket-Server.git && cd Simple-WebSocket-Server && cmake . && make install COPY . /usr/local WORKDIR /usr/local/ -RUN cmake . && make -CMD ./MCSM ## docker build -t mcsm . && docker run mcsm \ No newline at end of file + +CMD sleep infinity ### cmake . && make && ./MCSM ## docker build -t mcsm . && docker run mcsm \ No newline at end of file diff --git a/Algorithm/Algorithm.hpp b/src/Algorithm/Algorithm.hpp similarity index 100% rename from Algorithm/Algorithm.hpp rename to src/Algorithm/Algorithm.hpp diff --git a/Algorithm/MonteCarlo.cpp b/src/Algorithm/MonteCarlo.cpp similarity index 100% rename from Algorithm/MonteCarlo.cpp rename to src/Algorithm/MonteCarlo.cpp diff --git a/Algorithm/MonteCarlo.hpp b/src/Algorithm/MonteCarlo.hpp similarity index 100% rename from Algorithm/MonteCarlo.hpp rename to src/Algorithm/MonteCarlo.hpp diff --git a/Lattice/Lattice.hpp b/src/Lattice/Lattice.hpp similarity index 100% rename from Lattice/Lattice.hpp rename to src/Lattice/Lattice.hpp diff --git a/Model/Heisenberg.cpp b/src/Model/Heisenberg.cpp similarity index 100% rename from Model/Heisenberg.cpp rename to src/Model/Heisenberg.cpp diff --git a/Model/Heisenberg.hpp b/src/Model/Heisenberg.hpp similarity index 100% rename from Model/Heisenberg.hpp rename to src/Model/Heisenberg.hpp diff --git a/Model/Model.hpp b/src/Model/Model.hpp similarity index 100% rename from Model/Model.hpp rename to src/Model/Model.hpp diff --git a/src/WebSocket.cpp b/src/WebSocket.cpp new file mode 100644 index 0000000..74a647e --- /dev/null +++ b/src/WebSocket.cpp @@ -0,0 +1,9 @@ +#include "WebSocket.hpp" + +void WebSocket::RunServer() { + +} + +void SendFrame() { + +} \ No newline at end of file diff --git a/src/WebSocket.hpp b/src/WebSocket.hpp new file mode 100644 index 0000000..0806f1f --- /dev/null +++ b/src/WebSocket.hpp @@ -0,0 +1,11 @@ +#pragma once + + +#include + +using WsServer = SimpleWeb::SocketServer; + +class WebSocket { + void RunServer(); + void SendFrame(); +}; \ No newline at end of file diff --git a/main.cpp b/src/main.cpp similarity index 91% rename from main.cpp rename to src/main.cpp index 5f81d96..5a087b1 100644 --- a/main.cpp +++ b/src/main.cpp @@ -1,11 +1,16 @@ #include +#include #include #include "Model/Heisenberg.hpp" #include "Algorithm/MonteCarlo.hpp" +#include "WebSocket.hpp" + using namespace arma; int main() { + auto ws = std::make_unique(); + std::cout << "Phys-sym v. 0.0" << std::endl; std::cout << "Simulation software" << std::endl << std::endl;