Skip to content

Commit 2d14cd9

Browse files
Add building and container recipes
1 parent 42a78b7 commit 2d14cd9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+19993
-26
lines changed

CMakeLists.txt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
cmake_minimum_required(VERSION 3.16)
2+
project(cmake_exercise)
3+
4+
set(CMAKE_CXX_STANDARD 17)
5+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
6+
7+
# --- Find Dependencies ---
8+
find_package(Boost REQUIRED COMPONENTS filesystem)
9+
find_package(deal.II REQUIRED)
10+
find_package(yaml-cpp REQUIRED)
11+
find_package(MPI REQUIRED)
12+
find_package(OpenMP REQUIRED)
13+
14+
# --- Define the Executable ---
15+
add_executable(main
16+
main.cpp
17+
flatset/flatset.cpp
18+
filesystem/filesystem.cpp
19+
fem/fem.cpp
20+
yamlParser/yamlParser.cpp
21+
)
22+
23+
# --- Link Libraries ---
24+
# 1. Setup deal.II (Handles Trilinos, PETSc, TBB, etc.)
25+
deal_ii_setup_target(main)
26+
27+
# 2. Link other libraries (Using plain style to match deal.II)
28+
target_link_libraries(main
29+
Boost::filesystem
30+
yaml-cpp
31+
MPI::MPI_CXX
32+
OpenMP::OpenMP_CXX
33+
)
34+
35+
# --- Include Directories ---
36+
target_include_directories(main PRIVATE
37+
${CMAKE_CURRENT_SOURCE_DIR}
38+
/usr/include/trilinos
39+
/usr/include/petsc
40+
)

Dockerfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
FROM ubuntu:24.04
2+
3+
# Prevent interactive prompts during installation
4+
ENV DEBIAN_FRONTEND=noninteractive
5+
6+
# Install all dependencies including the tricky ones (Trilinos, PETSc, TBB, MPI, Kokkos)
7+
RUN apt-get update && apt-get install -y \
8+
build-essential \
9+
cmake \
10+
git \
11+
wget \
12+
unzip \
13+
vim \
14+
libboost-all-dev \
15+
libdeal.ii-dev \
16+
mpi-default-dev \
17+
libkokkos-dev \
18+
libtrilinos-epetra-dev \
19+
libtrilinos-epetraext-dev \
20+
libtrilinos-teuchos-dev \
21+
libtrilinos-aztecoo-dev \
22+
libtrilinos-amesos-dev \
23+
libtrilinos-ifpack-dev \
24+
libtrilinos-ml-dev \
25+
libpetsc-real-dev \
26+
libtbb-dev \
27+
&& rm -rf /var/lib/apt/lists/*
28+
29+
# Manual install of yaml-cpp 0.6.3
30+
WORKDIR /tmp
31+
RUN wget https://github.com/jbeder/yaml-cpp/archive/refs/tags/yaml-cpp-0.6.3.zip
32+
RUN unzip yaml-cpp-0.6.3.zip
33+
RUN cd yaml-cpp-yaml-cpp-0.6.3 && \
34+
mkdir build && cd build && \
35+
cmake .. -DYAML_BUILD_SHARED_LIBS=ON && \
36+
make -j4 && \
37+
make install
38+
39+
# Set environment variables
40+
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
41+
WORKDIR /cmake-exercise

0 commit comments

Comments
 (0)