Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Andree Heuer committed Dec 14, 2020
2 parents 2240d4c + 0bad97d commit b5403f7
Show file tree
Hide file tree
Showing 36 changed files with 1,239 additions and 77 deletions.
12 changes: 0 additions & 12 deletions .gitmodules

This file was deleted.

5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ else()
include_directories(${EIGEN3_INCLUDE_DIR})
endif()

include(cmake/downloadGoogletest.cmake)
include(cmake/downloadSpdlog.cmake)
include(cmake/downloadYamlCpp.cmake)


# putting all executables in cmake-build-*/bin
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin)

Expand Down
29 changes: 7 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ It analyzes maxima data generated by the open-source quantum Monte Carlo softwar

## Installation
### Installing required packages
To install inPsights, Git, CMake, the GNU Compiler Collection (gcc) and the Eigen3 library must be installed. This is most easily achieved by employing a packet manager.
To install inPsights, Git, CMake, the GNU Compiler Collection (gcc) must be installed.
This is most easily achieved by employing a packet manager.

#### MacOS
Make sure that the Xcode Command Line Tools are installed already with:
Expand All @@ -16,19 +17,16 @@ xcode-select --install


To install the required packages on MacOS, the [homebrew package manager](https://brew.sh) can be used.
It can be downloaded and installed from the command line as follows:
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
```
To download the packages with `homebrew` execute the following command in the terminal:
```bash
brew update
brew upgrade
brew install git cmake gcc@9 lapack eigen boost qt
```

Alternatively, the Qt5 online installer can be used, which is found on the [Qt webpage](https://www.qt.io/download).
During the installation, make sure to install Qt for the `x86_64` architecture and select `sources`, `Qt3D`, and additionally `QtCharts` (which will be required in future versions as well).
Alternatively, the [Qt5 online installer](https://www.qt.io/download-open-source) can be used.
During the installation, make sure to install Qt for the `x86_64` architecture
and select `sources`, `Qt3D`, and additionally `QtCharts` (which will be required in future versions as well).


#### Ubuntu
Expand Down Expand Up @@ -57,19 +55,6 @@ sudo apt-get -y install qtbase5-dev qt3d5-dev
```
This might cause problems during the build of the inPsights GUI.

#### Submodules in inPsights
After cloning the repository, make sure to initialize and update the submodules
```bash
git submodule update --init --recursive
```
to initialize all the submodules.

The next time you checkout a branch e.g. the submodules do not need to be initialized again afterwards. Thus
```bash
git submodule update --recursive
```
should be sufficient.

### Setting environment variables

#### Compilers
Expand Down Expand Up @@ -103,7 +88,7 @@ If Qt5 was download from the webpage and installed via the installer, the follow
export Qt5_DIR=/home/<username>/Qt/5.XX.X/gcc_64
```

If Qt5 was installed via `apt-get`, CMake should automatically find the library (not tested).
If Qt5 was installed via `apt-get`, CMake should find the library automatically.


## Building ProcessMaxima and inPsights
Expand All @@ -117,7 +102,7 @@ and configure CMake for an out-of-source release build:
```bash
cmake ..
```
CMake options can be specified to build the GUI or to use a precompiled version of the Eigen library
CMake options can be specified to build the GUI or to use a pre-compiled version of the Eigen library
```bash
cmake .. -DBUILD_GUI=ON -DBUILD_EIGEN=OFF
```
Expand Down
18 changes: 18 additions & 0 deletions cmake/downloadGoogletest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Download and unpack Googletest Library at configure time

message("Configuring googletest...")

configure_file(cmake/downloadGoogletest.in
googletest-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/googletest-download )

# Add Googletest library directly to our build. This adds
# the following targets: gtest, gmock

add_subdirectory(
${CMAKE_BINARY_DIR}/googletest-src
${CMAKE_BINARY_DIR}/googletest-build
)
15 changes: 15 additions & 0 deletions cmake/downloadGoogletest.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 2.8.2)

project(googletest-download NONE)

include(ExternalProject)
ExternalProject_Add(googletest
GIT_REPOSITORY "https://github.com/google/googletest.git"
GIT_TAG "release-1.10.0"
SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
18 changes: 18 additions & 0 deletions cmake/downloadSpdlog.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Download and unpack Spdlog Library at configure time

message("Configuring spdlog...")

configure_file(cmake/downloadSpdlog.in
spdlog-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/spdlog-download )
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/spdlog-download )

# Add Spdlog library directly to our build. This adds
# the following targets: spdlog

add_subdirectory(
${CMAKE_BINARY_DIR}/spdlog-src
${CMAKE_BINARY_DIR}/spdlog-build
)
15 changes: 15 additions & 0 deletions cmake/downloadSpdlog.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 2.8.2)

project(spdlog-download NONE)

include(ExternalProject)
ExternalProject_Add(spdlog
GIT_REPOSITORY "https://github.com/gabime/spdlog.git"
GIT_TAG "v1.8.2"
SOURCE_DIR "${CMAKE_BINARY_DIR}/spdlog-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/spdlog-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
21 changes: 21 additions & 0 deletions cmake/downloadYamlCpp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Download and unpack yaml-cpp Library at configure time

message("Configuring yaml-cpp...")

set(YAML_CPP_BUILD_TESTS OFF CACHE BOOL "Don't build the YAML tests.")
set(YAML_CPP_BUILD_CONTRIB OFF CACHE BOOL "Don't build YAML contributions.")

configure_file(cmake/downloadYamlCpp.in
yaml-cpp-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/yaml-cpp-download )
execute_process(COMMAND ${CMAKE_COMMAND} --build .
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/yaml-cpp-download )

# Add yaml-cpp library directly to our build. This adds
# the following targets: yaml-cpp

add_subdirectory(
${CMAKE_BINARY_DIR}/yaml-cpp-src
${CMAKE_BINARY_DIR}/yaml-cpp-build
)
15 changes: 15 additions & 0 deletions cmake/downloadYamlCpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 2.8.2)

project(yaml-cpp-download NONE)

include(ExternalProject)
ExternalProject_Add(yaml-cpp
GIT_REPOSITORY "https://github.com/jbeder/yaml-cpp.git"
GIT_TAG "yaml-cpp-0.6.3"
SOURCE_DIR "${CMAKE_BINARY_DIR}/yaml-cpp-src"
BINARY_DIR "${CMAKE_BINARY_DIR}/yaml-cpp-build"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
TEST_COMMAND ""
)
2 changes: 1 addition & 1 deletion src/BaseLib/tests/AYamlTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ TEST(AYamlTest, JsonCompatibility){
out << YAML::EndMap;

std::string outstring = out.c_str();
std::string expected ="{\"Molecule\": {\"Atoms\": {\"Types\": [\"He\", \"H\"],\n \"Positions\": [\n [0, 0, 0.37],\n [0, 0, -0.37],\n ]},\n\"Electrons\": {\"Types\": [\"a\", \"a\", \"b\"],\n \"Positions\": [\n [0, 0, 0.37],\n [0, 0, 0.37],\n [0, 0, -0.37],\n ]}}}";
std::string expected ="{\"Molecule\": {\"Atoms\": {\"Types\": [\"He\", \"H\"],\n \"Positions\": [\n [0, 0, 0.37],\n [0, 0, -0.37],\n ]}\n\"Electrons\": {\"Types\": [\"a\", \"a\", \"b\"],\n \"Positions\": [\n [0, 0, 0.37],\n [0, 0, 0.37],\n [0, 0, -0.37],\n ]}}}";
ASSERT_EQ(outstring,expected);
}
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
add_subdirectory(BaseLib)
add_subdirectory(Externals)
add_subdirectory(Methods)

if (${BUILD_GUI})
Expand Down
8 changes: 0 additions & 8 deletions src/Externals/CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion src/Externals/dualmc
Submodule dualmc deleted from 991a54
1 change: 0 additions & 1 deletion src/Externals/googletest
Submodule googletest deleted from 3af06f
1 change: 0 additions & 1 deletion src/Externals/spdlog
Submodule spdlog deleted from 616caa
1 change: 0 additions & 1 deletion src/Externals/yaml-cpp
Submodule yaml-cpp deleted from 98acc5
2 changes: 1 addition & 1 deletion src/GUI/source/InPsightsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void InPsightsWidget::showSplashScreen() {
splashScreen->setPixmap(pixmap);
splashScreen->show();

std::string message = "Version " + inPsights::version() + " (pre-release)\n "\
std::string message = "Version " + inPsights::version() + " (alpha)\n "\
"Copyright © 2016-2020 Michael A. Heuer.";
splashScreen->showMessage(message.c_str(), Qt::AlignBottom, Qt::gray);

Expand Down
2 changes: 2 additions & 0 deletions src/Methods/SurfaceGeneration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.11)

project(SurfaceGeneration CXX)

add_subdirectory(dualmc)

set ( PROJECT_FOLDER_NAME ${PROJECT_NAME} )
set ( PROJECT_PATH ${PROJECT_NAME})
set ( OUTPUT_NAME "${PROJECT_FOLDER_NAME}" )
Expand Down
23 changes: 23 additions & 0 deletions src/Methods/SurfaceGeneration/dualmc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.9)
project (dualmc CXX)

set ( PROJECT_FOLDER_NAME ${PROJECT_NAME})
set ( PROJECT_PATH ${PROJECT_NAME})
set ( OUTPUT_NAME "${PROJECT_FOLDER_NAME}" )
message ( "-- ++ CREATING PROJECT OR MAKEFILE ---> ${OUTPUT_NAME}" )

set(HEADER_FILES
include/DualMC.h
include/Tables.h
include/HelperFunctions.h
)

set(SOURCE_FILES
source/DualMC.cpp
)

add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES} ${HEADER_FILES})
target_include_directories(${PROJECT_NAME}
PUBLIC include
PRIVATE source
)
Loading

0 comments on commit b5403f7

Please sign in to comment.