From 65ec6d328593e578897a33aa30488e5e67333ced Mon Sep 17 00:00:00 2001 From: Dan Ibanez Date: Thu, 9 Nov 2017 15:36:07 -0700 Subject: [PATCH 1/2] Add first draft of CMake build system --- CMakeLists.txt | 13 +++++++++++++ DEMSI-LAMMPS | 2 +- src/CMakeLists.txt | 9 +++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 CMakeLists.txt create mode 100644 src/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000000..a9e2ea3dde94 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.1) + +project(DEMSI) + +set(CMAKE_CXX_FLAGS "-O3 -g --std=c++11") + +set(LAMMPS_PREFIX "" CACHE PATH "Path where LAMMPS is installed") + +find_path(LAMMPS_INCLUDE_DIR NAMES lammps.h PATHS "${LAMMPS_PREFIX}/include") +message("looking for lammps in ${LAMMPS_PREFIX}/lib") +find_library(LAMMPS_LIB NAMES lammps PATHS "${LAMMPS_PREFIX}/lib") + +add_subdirectory(src) diff --git a/DEMSI-LAMMPS b/DEMSI-LAMMPS index c80203cb0115..fc12d1d2cc2b 160000 --- a/DEMSI-LAMMPS +++ b/DEMSI-LAMMPS @@ -1 +1 @@ -Subproject commit c80203cb011542359190b13f069ed88574373e11 +Subproject commit fc12d1d2cc2be41325c88b3c50db51858fd89bee diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 000000000000..682df51daf64 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,9 @@ +add_executable(demsi + demsi.cpp + grid.cpp + lmp_instance.cpp + thermo.cpp + ) + +target_link_libraries(demsi PUBLIC "${LAMMPS_LIB}") +target_include_directories(demsi PUBLIC "${LAMMPS_INCLUDE_DIR}") From 9c1849de787c42d84dcf8bcd89bdfd0baa850fda Mon Sep 17 00:00:00 2001 From: Dan Ibanez Date: Thu, 9 Nov 2017 15:36:30 -0700 Subject: [PATCH 2/2] Include iostream in grid --- src/grid.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/grid.cpp b/src/grid.cpp index 88e4dd4bce82..82521f09c49f 100644 --- a/src/grid.cpp +++ b/src/grid.cpp @@ -6,8 +6,9 @@ #include "grid.h" #include "mpi.h" +#include #include -#include +#include #include