Skip to content

Commit

Permalink
Merge branch 'learning-process:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
khasanyanovk authored Oct 25, 2024
2 parents 31ea14e + 862e6d0 commit c6aa62c
Show file tree
Hide file tree
Showing 47 changed files with 4,305 additions and 5 deletions.
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,16 @@ The following parallel programming technologies are considered in practice:

Unsupported operating system!

* **Linux (`gcc` and `clang`)**:
* **Ubuntu / Debian (`gcc` and `clang`)**:
```
sudo apt install -y cppcheck
```

* **NixOS / Nix (with flakes enabled)**:
```
nix develop .
```

* **MacOS (apple clang)**:
```
brew install cppcheck
Expand All @@ -44,10 +50,16 @@ Code style is checked using [clang-format](https://clang.llvm.org/docs/ClangForm

[Installers link.](https://www.microsoft.com/en-us/download/details.aspx?id=105289) You have to install `msmpisdk.msi` and `msmpisetup.exe`.

* **Linux (`gcc` and `clang`)**:
* **Ubuntu / Debian (`gcc` and `clang`)**:
```
sudo apt install -y mpich openmpi-bin libopenmpi-dev
```

* **NixOS / Nix (with flakes enabled)**:
```
nix develop .
```

* **MacOS (apple clang)**:
```
brew install open-mpi
Expand All @@ -57,10 +69,16 @@ Code style is checked using [clang-format](https://clang.llvm.org/docs/ClangForm

`OpenMP` is included into `gcc` and `msvc`, but some components should be installed additionally:

* **Linux (`gcc` and `clang`)**:
* **Ubuntu / Debian (`gcc` and `clang`)**:
```
sudo apt install -y libomp-dev
```

* **NixOS / Nix (with flakes enabled)**:
```
nix develop .
```

* **MacOS (`llvm`)**:
```
brew install llvm
Expand Down
1 change: 1 addition & 0 deletions cmake/boost.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ExternalProject_Add(ppc_boost
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -G${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DBOOST_INCLUDE_LIBRARIES=mpi -DBOOST_ENABLE_MPI=ON
-D MPI_INCLUDE_PATH=${MPI_INCLUDE_PATH} -D MPI_LIBRARIES=${MPI_LIBRARIES} -D MPI_COMPILE_FLAGS=${MPI_COMPILE_FLAGS} -D MPI_LINK_FLAGS=${MPI_LINK_FLAGS}
-DCMAKE_INSTALL_LIBDIR=lib
BUILD_COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/ppc_boost/build" --config ${CMAKE_BUILD_TYPE}
INSTALL_COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_CURRENT_BINARY_DIR}/ppc_boost/build" --prefix "${CMAKE_CURRENT_BINARY_DIR}/ppc_boost/install"
TEST_COMMAND "")
4 changes: 2 additions & 2 deletions cmake/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ MACRO(CPPCHECK_TEST ProjectId ALL_SOURCE_FILES)
endif ()
endforeach ()
if (NOT APPLE)
find_program(CPPCHECK_EXEC /usr/bin/cppcheck)
find_program(CPPCHECK_EXEC cppcheck)
add_custom_target(
"${ProjectId}_cppcheck" ALL
COMMAND ${CPPCHECK_EXEC}
Expand All @@ -74,5 +74,5 @@ MACRO(CPPCHECK_TEST ProjectId ALL_SOURCE_FILES)
${ALL_SOURCE_FILES}
)
ENDIF ()
endif( UNIX )
endif( UNIX AND USE_CPPCHECK)
ENDMACRO()
1 change: 1 addition & 0 deletions cmake/gtest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ ExternalProject_Add(ppc_googletest
CONFIGURE_COMMAND "${CMAKE_COMMAND}" -S "${CMAKE_SOURCE_DIR}/3rdparty/googletest/" -B "${CMAKE_CURRENT_BINARY_DIR}/ppc_googletest/build/"
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -G${CMAKE_GENERATOR} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-Dgtest_force_shared_crt=ON
-DCMAKE_INSTALL_LIBDIR=lib
BUILD_COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/ppc_googletest/build" --config ${CMAKE_BUILD_TYPE}
INSTALL_COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_CURRENT_BINARY_DIR}/ppc_googletest/build" --prefix "${CMAKE_CURRENT_BINARY_DIR}/ppc_googletest/install")
1 change: 1 addition & 0 deletions cmake/onetbb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ else(MSVC)
INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/install"
CONFIGURE_COMMAND "${CMAKE_COMMAND}" -S "${CMAKE_SOURCE_DIR}/3rdparty/onetbb/" -B "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/build/"
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -G${CMAKE_GENERATOR} -DTBB_TEST=OFF -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_LIBDIR=lib
BUILD_COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/build" --config ${CMAKE_BUILD_TYPE}
INSTALL_COMMAND "${CMAKE_COMMAND}" --install "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/build" --prefix "${CMAKE_CURRENT_BINARY_DIR}/ppc_onetbb/install")
endif(MSVC)
96 changes: 96 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
treefmt-nix.url = "github:numtide/treefmt-nix";
};
outputs = {
self,
nixpkgs,
flake-utils,
treefmt-nix,
}:
flake-utils.lib.eachDefaultSystem (system: let
pkgs = import nixpkgs {
inherit system;
};
py3 = pkgs.python3.withPackages (ps: [ps.xlsxwriter]);
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
gcc
ninja
cmake
openmpi
py3
cppcheck
];
};
formatter =
(treefmt-nix.lib.evalModule pkgs {
projectRootFile = "flake.nix";
programs.alejandra.enable = true;
})
.config
.build
.wrapper;
});
}
Loading

0 comments on commit c6aa62c

Please sign in to comment.