diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml new file mode 100644 index 0000000..f219db0 --- /dev/null +++ b/.github/workflows/build_test.yml @@ -0,0 +1,18 @@ +name: C++ Build +'on': + push: + branches: + - master + pull_request: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Build C++ project + run: | + docker build -t ci_cd_image . + docker run ci_cd_image diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2882f8e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,57 @@ +# Use Ubuntu as base image +FROM ubuntu:latest + +# Set non-interactive mode +ENV DEBIAN_FRONTEND=noninteractive + +# Update Ubuntu packages and install necessary dependencies +RUN apt-get update && apt-get install -y \ + git \ + cmake \ + libeigen3-dev \ + nlohmann-json3-dev \ + libspdlog-dev \ + build-essential \ + zlib1g-dev\ + && rm -rf /var/lib/apt/lists/* + +# Install Libzip +RUN git clone https://github.com/nih-at/libzip.git \ + && cd libzip \ + && mkdir build \ + && cd build \ + && cmake .. \ + && make \ + && make install + +# Install Google Test v1.12.1 +RUN git clone -b release-1.12.1 https://github.com/google/googletest.git \ + && cd googletest \ + && mkdir build \ + && cd build \ + && cmake .. \ + && make \ + && make install + +# Install mio +RUN git clone -b master https://github.com/vimpunk/mio.git \ + && cd mio \ + && mkdir build \ + && cd build \ + && cmake .. \ + && make \ + && make install + +#setting the working directory +WORKDIR /app + +#Copy the project to the container +COPY . . + +#Run and build the project +RUN mkdir build && \ + cd build && \ + cmake .. && \ + make + + diff --git a/README.md b/README.md index 5809b04..2b77254 100644 --- a/README.md +++ b/README.md @@ -3,16 +3,31 @@ The C++ implementations to the memory-mapped tractography file format. ## Installation + ### Dependencies + - c++11 compiler / cmake -- libzip -- nlohmann::json -- Eigen3 -- spdlog +- libzip (version 1.10.1 downloaded from https://libzip.org/download/) +- nlohmann::json(version 3.11.3 cloned from https://github.com/nlohmann/json) +- Eigen3(version 3.4.0 from https://eigen.tuxfamily.org/index.php?title=Main_Page ) +- spdlog(spd) [version: 1.13.0 cloned from https://github.com/gabime/spdlog) - GTest (optional) +- mio (cloned from fhttps://github.com/vimpunk/mio/tree/master) ### Installing + `cmake . && make` ## How to use -COMING SOON + +* Install all dependencies (after either cloning github repo or downloading) using these commands + * `mkdir build` + * `cd build` + * `cmake ..` + * `make` + * `make install` +* clone into this repo using `git clone https://github.com/tee-ar-ex/trx-cpp.git` +* To run trx_cpp: + * `cmake -B build` + * `cd build` + * `make` diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 847dc83..0b252e5 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -16,6 +16,7 @@ find_package (Eigen3 CONFIG REQUIRED) find_package(nlohmann_json CONFIG REQUIRED) find_package(spdlog CONFIG REQUIRED) find_package(GTest CONFIG REQUIRED) +find_package(mio REQUIRED) enable_testing()