From 48388406e395e98ee239eb13f3298a45a54aa40d Mon Sep 17 00:00:00 2001 From: Luis Carlos Limas Date: Sun, 1 Sep 2024 16:00:13 -0600 Subject: [PATCH 1/5] Clarify the docker commands for compilation This is the very first time I use docker, and I'm learning. Thas `pwd` told me nothing, I thought it was a password. But the correct value is the project path. I was able to compile after this fix: ```bat C:\full-path-to-my-biosim4-folder\biosim4\>docker run --rm -ti -v C:\full-path-to-my-biosim4-folder\biosim4:/app --name biosim biosim4 make test -d bin/Debug || mkdir -p bin/Debug test -d obj/Debug/src || mkdir -p obj/Debug/src c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/analysis.cpp -o obj/Debug/src/analysis.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/basicTypes.cpp -o obj/Debug/src/basicTypes.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/createBarrier.cpp -o obj/Debug/src/createBarrier.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/endOfGeneration.cpp -o obj/Debug/src/endOfGeneration.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/endOfSimStep.cpp -o obj/Debug/src/endOfSimStep.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/executeActions.cpp -o obj/Debug/src/executeActions.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/feedForward.cpp -o obj/Debug/src/feedForward.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/genome-compare.cpp -o obj/Debug/src/genome-compare.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/genome.cpp -o obj/Debug/src/genome.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/getSensor.cpp -o obj/Debug/src/getSensor.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/grid.cpp -o obj/Debug/src/grid.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/imageWriter.cpp -o obj/Debug/src/imageWriter.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/indiv.cpp -o obj/Debug/src/indiv.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/main.cpp -o obj/Debug/src/main.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/params.cpp -o obj/Debug/src/params.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/peeps.cpp -o obj/Debug/src/peeps.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/random.cpp -o obj/Debug/src/random.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/signals.cpp -o obj/Debug/src/signals.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/simulator.cpp -o obj/Debug/src/simulator.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/spawnNewGeneration.cpp -o obj/Debug/src/spawnNewGeneration.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/survival-criteria.cpp -o obj/Debug/src/survival-criteria.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/unitTestBasicTypes.cpp -o obj/Debug/src/unitTestBasicTypes.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/unitTestConnectNeuralNetWiringFromGenome.cpp -o obj/Debug/src/unitTestConnectNeuralNetWiringFromGenome.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -g -c src/unitTestGridVisitNeighborhood.cpp -o obj/Debug/src/unitTestGridVisitNeighborhood.o c++ -o bin/Debug/biosim4 obj/Debug/src/analysis.o obj/Debug/src/basicTypes.o obj/Debug/src/createBarrier.o obj/Debug/src/endOfGeneration.o obj/Debug/src/endOfSimStep.o obj/Debug/src/executeActions.o obj/Debug/src/feedForward.o obj/Debug/src/genome-compare.o obj/Debug/src/genome.o obj/Debug/src/getSensor.o obj/Debug/src/grid.o obj/Debug/src/imageWriter.o obj/Debug/src/indiv.o obj/Debug/src/main.o obj/Debug/src/params.o obj/Debug/src/peeps.o obj/Debug/src/random.o obj/Debug/src/signals.o obj/Debug/src/simulator.o obj/Debug/src/spawnNewGeneration.o obj/Debug/src/survival-criteria.o obj/Debug/src/unitTestBasicTypes.o obj/Debug/src/unitTestConnectNeuralNetWiringFromGenome.o obj/Debug/src/unitTestGridVisitNeighborhood.o -lopencv_core -lopencv_video -lopencv_videoio -lgomp -lpthread -fopenmp test -d bin/Release || mkdir -p bin/Release test -d obj/Release/src || mkdir -p obj/Release/src c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/analysis.cpp -o obj/Release/src/analysis.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/basicTypes.cpp -o obj/Release/src/basicTypes.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/createBarrier.cpp -o obj/Release/src/createBarrier.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/endOfGeneration.cpp -o obj/Release/src/endOfGeneration.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/endOfSimStep.cpp -o obj/Release/src/endOfSimStep.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/executeActions.cpp -o obj/Release/src/executeActions.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/feedForward.cpp -o obj/Release/src/feedForward.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/genome-compare.cpp -o obj/Release/src/genome-compare.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/genome.cpp -o obj/Release/src/genome.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/getSensor.cpp -o obj/Release/src/getSensor.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/grid.cpp -o obj/Release/src/grid.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/imageWriter.cpp -o obj/Release/src/imageWriter.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/indiv.cpp -o obj/Release/src/indiv.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/main.cpp -o obj/Release/src/main.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/params.cpp -o obj/Release/src/params.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/peeps.cpp -o obj/Release/src/peeps.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/random.cpp -o obj/Release/src/random.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/signals.cpp -o obj/Release/src/signals.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/simulator.cpp -o obj/Release/src/simulator.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/spawnNewGeneration.cpp -o obj/Release/src/spawnNewGeneration.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/survival-criteria.cpp -o obj/Release/src/survival-criteria.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/unitTestBasicTypes.cpp -o obj/Release/src/unitTestBasicTypes.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/unitTestConnectNeuralNetWiringFromGenome.cpp -o obj/Release/src/unitTestConnectNeuralNetWiringFromGenome.o c++ -Wall -pedantic -std=c++17 -fexceptions -fopenmp -I/usr/include/opencv4 -O3 -c src/unitTestGridVisitNeighborhood.cpp -o obj/Release/src/unitTestGridVisitNeighborhood.o c++ -o bin/Release/biosim4 obj/Release/src/analysis.o obj/Release/src/basicTypes.o obj/Release/src/createBarrier.o obj/Release/src/endOfGeneration.o obj/Release/src/endOfSimStep.o obj/Release/src/executeActions.o obj/Release/src/feedForward.o obj/Release/src/genome-compare.o obj/Release/src/genome.o obj/Release/src/getSensor.o obj/Release/src/grid.o obj/Release/src/imageWriter.o obj/Release/src/indiv.o obj/Release/src/main.o obj/Release/src/params.o obj/Release/src/peeps.o obj/Release/src/random.o obj/Release/src/signals.o obj/Release/src/simulator.o obj/Release/src/spawnNewGeneration.o obj/Release/src/survival-criteria.o obj/Release/src/unitTestBasicTypes.o obj/Release/src/unitTestConnectNeuralNetWiringFromGenome.o obj/Release/src/unitTestGridVisitNeighborhood.o -lopencv_core -lopencv_video -lopencv_videoio -lgomp -lpthread -fopenmp -O3 -s ``` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0378993..82576f2 100644 --- a/README.md +++ b/README.md @@ -241,7 +241,7 @@ docker build -t biosim4 . You can then compile the program with an ephemeral container: ```sh -docker run --rm -ti -v `pwd`:/app --name biosim biosim4 make +docker run --rm -ti -v `full-path-in-windows-to-your-biosim4-folder`:/app --name biosim biosim4 make ``` When you exit the container, the files compiled in your container files will persist in `./bin`. From bb0ec5ef49c3c181ef50dd2fbf396555db0d0e24 Mon Sep 17 00:00:00 2001 From: Luis Carlos Limas Date: Sun, 1 Sep 2024 23:35:24 -0600 Subject: [PATCH 2/5] Clarified how to run commands in docker I was trying to run OpenCV and CMake directly on windows, added clarification for docker users. --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 82576f2..d63998f 100644 --- a/README.md +++ b/README.md @@ -238,10 +238,10 @@ To build a Docker environment in which you can compile the program: docker build -t biosim4 . ``` -You can then compile the program with an ephemeral container: +You can then compile the program with an ephemeral container, remember that `pwd` stands for the fullpath of your `biosim4` project, something like `C:/full-path-in-windows/to-your/biosim4-folder/biosim4`: ```sh -docker run --rm -ti -v `full-path-in-windows-to-your-biosim4-folder`:/app --name biosim biosim4 make +docker run --rm -ti -v `pwd`:/app --name biosim biosim4 make ``` When you exit the container, the files compiled in your container files will persist in `./bin`. @@ -251,6 +251,11 @@ A `CMakeList.txt` file is provided to allow development, build, test, installati To build with cmake you need to install cmake. Once installed use the procedure below: +If using docker, start by opeing its terminal: +```sh +docker run --rm -ti -v `pwd`:/app --name biosim biosim4 bash +``` + ```sh mkdir build cd build From de47a856451d4eae5f975166ff4127ac140b0075 Mon Sep 17 00:00:00 2001 From: luiscla27 Date: Thu, 12 Sep 2024 21:31:35 -0600 Subject: [PATCH 3/5] Added cmake installation --- Dockerfile | 3 ++- README.md | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 10afad8..1ff6610 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,12 +8,13 @@ RUN apt-get update && apt-get install -yqq \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -RUN apt-get update && apt install -yqq python3-igraph +RUN apt-get update && apt-get install -yqq python3-igraph RUN apt-get update && apt-get install -yqq \ cimg-dev \ gnuplot \ libopencv-dev \ + cmake \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/README.md b/README.md index d63998f..80ec20b 100644 --- a/README.md +++ b/README.md @@ -249,13 +249,14 @@ When you exit the container, the files compiled in your container files will per A `CMakeList.txt` file is provided to allow development, build, test, installation and packaging with the CMake tool chain and all IDE's that support CMake. -To build with cmake you need to install cmake. Once installed use the procedure below: +To build with cmake you need to install cmake. -If using docker, start by opeing its terminal: +If you're using docker, `cmake` is already installed. So, you can directly open its terminal to use it: ```sh docker run --rm -ti -v `pwd`:/app --name biosim biosim4 bash ``` +Once cmake is installed use the procedure below: ```sh mkdir build cd build From d7b2a7cfe9ce0db01321734796c8726578aca927 Mon Sep 17 00:00:00 2001 From: "David R. Miller" Date: Thu, 10 Oct 2024 13:20:13 -0700 Subject: [PATCH 4/5] Update README.md Co-authored-by: Michael Pilosov <40366263+mathematicalmichael@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 80ec20b..b2b09d6 100644 --- a/README.md +++ b/README.md @@ -238,7 +238,7 @@ To build a Docker environment in which you can compile the program: docker build -t biosim4 . ``` -You can then compile the program with an ephemeral container, remember that `pwd` stands for the fullpath of your `biosim4` project, something like `C:/full-path-in-windows/to-your/biosim4-folder/biosim4`: +You can then compile the program with an ephemeral container. Note that `pwd` stands for the fullpath of your `biosim4` project, something like `C:/full-path-in-windows/to-your/biosim4-folder/biosim4` in Windows, or `/home/user/project-path/biosim4/` in Linux/MacOS: ```sh docker run --rm -ti -v `pwd`:/app --name biosim biosim4 make From 2a0db6f4471c0268253d6f046f8643d4b1572980 Mon Sep 17 00:00:00 2001 From: "David R. Miller" Date: Thu, 10 Oct 2024 13:20:28 -0700 Subject: [PATCH 5/5] Update README.md Co-authored-by: Michael Pilosov <40366263+mathematicalmichael@users.noreply.github.com> --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2b09d6..fe3733d 100644 --- a/README.md +++ b/README.md @@ -251,7 +251,7 @@ A `CMakeList.txt` file is provided to allow development, build, test, installati To build with cmake you need to install cmake. -If you're using docker, `cmake` is already installed. So, you can directly open its terminal to use it: +If you're using docker, `cmake` is already installed in the image. So, you can directly open its terminal to use it: ```sh docker run --rm -ti -v `pwd`:/app --name biosim biosim4 bash ```