Comments (5)
Thank you very much for the explanation. I just wanted to understand. It seems my reasoning was correct. I'm fine with using header-only libraries and understand the need because of the generic approach. The idea of precompiled diagram types is interesting, but I am happy with the current setup.
from graaf.
I may have found a solution.
Of course, for this ticket, a Dockerfile would also have to be created.
I am still learning how this works exactly.
But if no one else can be found, I would like to try my hand at this task.
Here is explaned how do Compile your app inside the Docker container:
https://hub.docker.com/_/gcc
Manuell Steps:
docker pull gcc
docker container create -it gcc
id: 6c795b4b94d4bbc0b624114224376d4f0a825b14ce791e7b104febb9c91a5e99
docker container start -i 6c795b4b94d4bbc0b624114224376d4f0a825b14ce791e7b104febb9c91a5e99
Container was started.
root@6c795b4b94d4:/# g++ --version
g++ (GCC) 13.2.0
root@6c795b4b94d4:/# cd home
- Clone the repository - clone your own fork if you want to contribute
git clone [email protected]:bobluppes/graaf.git
mkdir -p graaf/build && cd graaf/build
root@6c795b4b94d4:/home/graaf/build# apt-get upgrade
root@6c795b4b94d4:/home/graaf/build# apt-get install cmake
- Build the project
cmake ..
cmake --build .
Run the tests to ensure everything is working correctly
ctest
-- Performing Test HAVE_PTHREAD_AFFINITY -- success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/graaf/build
[ 96%] Linking CXX executable Graaf_perf
[ 96%] Built target Graaf_perf
[ 98%] Building CXX object _deps/google_benchmark-build/src/CMakeFiles/benchmark_main.dir/benchmark_main.cc.o
[100%] Linking CXX static library libbenchmark_main.a
[100%] Built target benchmark_main
root@6c795b4b94d4:/home/graaf/build# ctest
265/265 Test #265: UnweightedGraphTest.AddUnweightedEdge<std::pair<graaf::graph<int, graaf::my_unweighted_edge, (graaf::graph_type)1>, graaf::my_unweighted_edge >> ................................................ Passed 0.00 sec
100% tests passed, 0 tests failed out of 265
Total Test time (real) = 1.34 sec
from graaf.
Hi @MichaeINeumann, do I understand you have the build working now? Congrats 🥳
I see @misarb also has a PR(#74) open which adds a dockerfile. If you are up for trying it out their setup/providing feedback, maybe we can harmonize on the solution.
from graaf.
@bobluppes PR(#74) by @misarb works well.
It worked fine on the first try and started the build.
docker build -t graaf .
What I don't understand is that the build remains in the Docker image and no container is created. I then manually created a container from the image and found the build folder and was also able to run Graaf_test under build/test.
docker container create -it --name graaf graaf
docker container start -i graaf
I probably don't need a build to use the Graaf library. As described, only the header files need to be included. So the build process is only for testing the code?
https://bobluppes.github.io/graaf/docs/quickstart/installation
I thought I could use a pre-compiled library. So that you can also use it with older compilers. But I don't have any experience here and my questions certainly don't make sense.
Anyway, the Dockerfile works, even if I can't understand the exact background yet.
from graaf.
Thanks for testing the script @MichaeINeumann, then let's merge the PR and if needed we can iterate on it to improve.
Regarding your question on the build of Graaf, since it is intended to use as a header-only library, there is no option to build it statically and have another program link against it. After all, due to the generic programming approach (a vertex and edge can be any arbitrary user defined class), we would not know what to compile without a concrete usage (specifying the vertex and edge types). Therefore the library cannot be pre-compiled.
The build system therefore builds the various executables (test, performance, and examples) in which it included and compiles the header-only library each time.
We could however think about specifying some common graph types (graph<int, int>
) which we can pre-compile and use as a static library. What do you think about this?
from graaf.
Related Issues (20)
- Create common graph scenarios for unit tests
- [ALGO] Borůvka's algorithm HOT 14
- [ALGO] Kahn's Algorithm HOT 5
- [ALGO] Kosaraju's Algorithm HOT 5
- Improve documentation HOT 14
- [ALGO] Welsh-Powell Algorithm HOT 4
- Installation guide is inconsistent HOT 6
- [BUG] Graph coloring unstable for directed graphs HOT 2
- [DOCS] Document Welsh-Powell Algorithm HOT 2
- [BENCH] Benchmark Bron-Kerbosch Algorithm HOT 4
- [BENCH] Benchmark Greedy Graph Coloring Algorithm HOT 1
- [BENCH] Benchmark Welsh-Powell Algorithm HOT 4
- [BENCH] Benchmark DFS cycle detection HOT 4
- [BENCH] Benchmark BFS traversal HOT 4
- [DOCS] Broken image in readme HOT 2
- [FEAT] Adding Icons in the links section HOT 7
- [BENCH] DFS traversal HOT 5
- [BUG] Unexpected move construction occru when adding vertex or edge HOT 5
- [FEAT] 支持 C++ 17 吗? HOT 3
- How to perceive all the small cycles(https://www.pnas.org/doi/10.1073/pnas.0813040106)? Thanks! HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graaf.