-
Notifications
You must be signed in to change notification settings - Fork 34
Add building and container recipes #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # Set the minimum required version of CMake | ||
| cmake_minimum_required(VERSION 3.10) | ||
|
|
||
| # Set the project name | ||
| project(exercise) | ||
|
|
||
| # Set the C++ standard (adjust if needed) | ||
| set(CMAKE_CXX_STANDARD 14) | ||
|
|
||
|
|
||
| # Part 1 | ||
| # Boost libraries | ||
| find_package(Boost 1.71 REQUIRED COMPONENTS filesystem) | ||
|
|
||
| # Include Boost headers | ||
| include_directories(${Boost_INCLUDE_DIRS}) | ||
|
|
||
| # flatset | ||
| set(FLATSET_SOURCES flatset/flatset.cpp) | ||
|
|
||
| # Include directories for the flatset module | ||
| include_directories(flatset) | ||
|
|
||
| # Part 2 | ||
| # deal II | ||
| find_package(deal.II REQUIRED HINTS ${DEAL_II_DIR} | ||
| PATHS /usr/lib/cmake/deal.II) | ||
|
|
||
| # Add the source file for the Fem class | ||
| set(FEM_SOURCES fem/fem.cpp) | ||
|
|
||
| # Include directories for the fem module | ||
| include_directories(fem) | ||
|
|
||
|
|
||
| # Part 3 | ||
| # Filesystem | ||
| set(FILESYSTEM_SOURCES filesystem/filesystem.cpp) | ||
|
|
||
| # Include directories for the filesystem module | ||
| include_directories(filesystem) | ||
|
|
||
| # Add the source files to the executable | ||
| add_executable(main main.cpp ${FEM_SOURCES} ${FLATSET_SOURCES} ${FILESYSTEM_SOURCES}) | ||
|
|
||
| # Link Boost Filesystem | ||
| target_link_libraries(main Boost::filesystem) | ||
|
|
||
|
|
||
| # Link deal.II to the executable | ||
| deal_ii_setup_target(main) | ||
|
|
||
| # If you need specific libraries or include directories, add them here: | ||
| # target_include_directories(main PRIVATE /path/to/headers) | ||
| # target_link_libraries(main PRIVATE /path/to/library) | ||
|
|
||
| # Optionally set debugging options | ||
| if (CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
| message(STATUS "Building in Debug mode") | ||
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| FROM ubuntu:24.04 | ||
|
|
||
| # apt-get installs basics | ||
| RUN apt-get update | ||
| RUN apt-get install build-essential cmake unzip wget vim -y | ||
| # boost | ||
| RUN apt-get install libboost-all-dev -y | ||
| # deal II | ||
| RUN apt-get install libdeal.ii-dev -y | ||
|
|
||
|
|
||
| # no more used, now use mount | ||
| WORKDIR /cmake-exercise | ||
| COPY . /cmake-exercise | ||
|
|
||
| # change the encoding of shell to remove '\r' | ||
| RUN sed -i 's/\r$//' build_and_run.sh | ||
|
Comment on lines
+16
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strange to see this, especially both in the |
||
| CMD ["/bin/bash"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would combine these into one
RUNcommand.