Skip to content

Commit

Permalink
Clarify the docker commands for compilation (#106)
Browse files Browse the repository at this point in the history
* 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
```

* Clarified how to run commands in docker

I was trying to run OpenCV and CMake directly on windows, added clarification for docker users.

* Added cmake installation

* Update README.md

Co-authored-by: Michael Pilosov <[email protected]>

* Update README.md

Co-authored-by: Michael Pilosov <[email protected]>

---------

Co-authored-by: David R. Miller <[email protected]>
Co-authored-by: Michael Pilosov <[email protected]>
  • Loading branch information
3 people authored Oct 10, 2024
1 parent 1e59fe2 commit 4f0e057
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*

Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,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:
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
Expand All @@ -250,8 +250,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 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
```

Once cmake is installed use the procedure below:
```sh
mkdir build
cd build
Expand Down

0 comments on commit 4f0e057

Please sign in to comment.