Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added CMakeLists.txt
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no content in the CMakeLists.txt, which was the main focus of the exercise.

Empty file.
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ubuntu:24.04
WORKDIR /usr/local/app

COPY main.cpp ./
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

main.cpp also depends on flatset/flatset.hpp, which is not copied into the container. The image fails to build with:

 => ERROR [5/5] RUN g++ main.cpp -o main                                                                                                                                            0.2s 
------                                                                                                                                                                                   
 > [5/5] RUN g++ main.cpp -o main:                                                                                                                                                       
0.147 main.cpp:2:10: fatal error: flatset/flatset.hpp: No such file or directory                                                                                                         
0.147     2 | #include "flatset/flatset.hpp"                                                                                                                                             
0.147       |          ^~~~~~~~~~~~~~~~~~~~~                                                                                                                                             
0.147 compilation terminated.


RUN apt-get update && apt-get install -y gcc g++
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dependencies (Boost, deal.II) are not installed.

RUN g++ main.cpp -o main
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not using cmake and make, but directly the compiler.

52 changes: 26 additions & 26 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
//#include "fem/fem.hpp"
//#include "flatset/flatset.hpp"
//#include "filesystem/filesystem.hpp"
//#include "yamlParser/yamlParser.hpp"
// #include "fem/fem.hpp"
#include "flatset/flatset.hpp"
// #include "filesystem/filesystem.hpp"
// #include "yamlParser/yamlParser.hpp"
#include <iostream>

int main(int argc, char *argv[])
{
std::cout << "Let's fight with CMake, Docker, and some dependencies!" << std::endl << std::endl;
std::cout << "Let's fight with CMake, Docker, and some dependencies!" << std::endl
<< std::endl;

//std::cout << "Solve Poisson problem with FEM using deal.II" << std::endl;
//Fem fem;
//fem.run();
//std::cout << std::endl;
// std::cout << "Solve Poisson problem with FEM using deal.II" << std::endl;
// Fem fem;
// fem.run();
// std::cout << std::endl;

//std::cout << "Modify a flat set using boost container" << std::endl;
//modifyAndPrintSets();
//std::cout << std::endl;
std::cout << "Modify a flat set using boost container" << std::endl;
modifyAndPrintSets();
std::cout << std::endl;

//std::cout << "Inspect the current directory using boost filesystem" << std::endl;
//inspectDirectory();
//std::cout << std::endl;
// std::cout << "Inspect the current directory using boost filesystem" << std::endl;
// inspectDirectory();
// std::cout << std::endl;


//if ( argc == 2 )
// if ( argc == 2 )
//{
// const std::string yamlFile( argv[1] );
// std::cout << "Parse some yaml file with yaml-cpp" << std::endl;
// std::cout << " " << yamlFile << std::endl;
// parseConfig( yamlFile );
//}
//else
// const std::string yamlFile( argv[1] );
// std::cout << "Parse some yaml file with yaml-cpp" << std::endl;
// std::cout << " " << yamlFile << std::endl;
// parseConfig( yamlFile );
// }
// else
//{
// std::cout << "To parse a yaml file please specify file on command line" << std::endl;
// std::cout << " ./main YAMLFILE" << std::endl;
//}
// std::cout << "To parse a yaml file please specify file on command line" << std::endl;
// std::cout << " ./main YAMLFILE" << std::endl;
// }

return 0;
}