From 932cffa95cf6b7777c29fb753c86cfa07d49263d Mon Sep 17 00:00:00 2001 From: marisa Date: Sun, 29 Oct 2023 20:50:54 -0300 Subject: [PATCH] Initial CMake project structure --- .gitignore | 1 + CMakeLists.txt | 12 +++++++ flake.lock | 61 ++++++++++++++++++++++++++++++++++++ flake.nix | 21 +++++++++++++ src/main.cpp | 17 ++++++++++ src/md/CMakeLists.txt | 6 ++++ src/md/MolecularDynamics.cpp | 10 ++++++ 7 files changed, 128 insertions(+) create mode 100644 .gitignore create mode 100644 CMakeLists.txt create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 src/main.cpp create mode 100644 src/md/CMakeLists.txt create mode 100644 src/md/MolecularDynamics.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..567609b --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..cd83aed --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,12 @@ +# Copyright (c) 2023 jun + +cmake_minimum_required(VERSION 3.10) +project(molecular_dynamics) + +set(CMAKE_CXX_STANDARD 20) + +add_subdirectory(src/md) + +add_executable(my_project src/main.cpp) + +target_link_libraries(my_project PRIVATE md) \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..33e17d1 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1689068808, + "narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1690031011, + "narHash": "sha256-kzK0P4Smt7CL53YCdZCBbt9uBFFhE0iNvCki20etAf4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "12303c652b881435065a98729eb7278313041e49", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..44079d7 --- /dev/null +++ b/flake.nix @@ -0,0 +1,21 @@ +# Copyright (c) 2023 jun + +{ + description = "MolecularDynamics2"; + + inputs = { + flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + devShells.default = pkgs.mkShell { + packages = with pkgs; [ gcc cmake clang gnuplot llvmPackages.openmp bc ]; + }; + }); +} \ No newline at end of file diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..3a9e7dd --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,17 @@ +/** + * @file main.cpp + * @author jun + * @brief Main entry of the program + * @version 0.1 + * @date 2023-07-23 + * + * Copyright (c) 2023 jun + * + */ + +#include + +int main() { + std::cout << "kk eae men" << std::endl; + return 0; +} \ No newline at end of file diff --git a/src/md/CMakeLists.txt b/src/md/CMakeLists.txt new file mode 100644 index 0000000..aaba9fc --- /dev/null +++ b/src/md/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2023 jun + +project(md) + +add_library(md + MolecularDynamics.cpp) \ No newline at end of file diff --git a/src/md/MolecularDynamics.cpp b/src/md/MolecularDynamics.cpp new file mode 100644 index 0000000..1883aca --- /dev/null +++ b/src/md/MolecularDynamics.cpp @@ -0,0 +1,10 @@ +/** + * @file MolecularDynamics.cpp + * @author jun + * @brief + * @version 0.1 + * @date 2023-07-23 + * + * Copyright (c) 2023 jun + * + */ \ No newline at end of file