Skip to content

Commit

Permalink
Adjust app4triqs Skeleton for nrgljubljana_interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentzell committed Nov 5, 2019
1 parent 0a61ab8 commit 7d83798
Show file tree
Hide file tree
Showing 45 changed files with 251 additions and 242 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
@@ -1,2 +1,2 @@
Checks: '-*,modernize-*,cppcoreguidelines-*,-modernize-use-trailing-return-type'
HeaderFilterRegex: 'app4triqs'
HeaderFilterRegex: 'nrgljubljana_interface'
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.md
Expand Up @@ -32,7 +32,7 @@ Please provide the application version that you used.

You can get this information from copy and pasting the output of
```bash
python -c "from app4triqs.version import *; show_version(); show_git_hash();"
python -c "from nrgljubljana_interface.version import *; show_version(); show_git_hash();"
```
from the command line. Also, please include the OS you are running and its version.

Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -22,7 +22,7 @@ script:
- cmake .. -DBuild_Tests=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR
- make -j2 install
- source $INSTALL_DIR/share/triqsvars.sh
# ===== Set up app4triqs and test
# ===== Set up nrgljubljana_interface and test
- cd $TRAVIS_BUILD_DIR
- mkdir build && cd build
- cmake .. -DASAN=ON -DUBSAN=ON
Expand Down
22 changes: 11 additions & 11 deletions CMakeLists.txt
@@ -1,20 +1,20 @@
# ##############################################################################
#
# app4triqs - An example application using triqs and cpp2py
# nrgljubljana_interface - An example application using triqs and cpp2py
#
# Copyright (C) ...
#
# app4triqs is free software: you can redistribute it and/or modify it under the
# nrgljubljana_interface is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# app4triqs is distributed in the hope that it will be useful, but WITHOUT ANY
# nrgljubljana_interface is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# app4triqs (in the file COPYING.txt in this directory). If not, see
# nrgljubljana_interface (in the file COPYING.txt in this directory). If not, see
# <http://www.gnu.org/licenses/>.
#
# ##############################################################################
Expand All @@ -26,7 +26,7 @@ endif()

# ############
# Define Project
project(APP4TRIQS VERSION 2.2.0 LANGUAGES C CXX)
project(NRGLJUBLJANA_INTERFACE VERSION 2.2.0 LANGUAGES C CXX)

# ############
# Load TRIQS and CPP2PY
Expand Down Expand Up @@ -73,7 +73,7 @@ add_compile_options(

# Create an Interface target for compiler warnings
add_library(project_warnings INTERFACE)
install(TARGETS project_warnings EXPORT app4triqs-targets)
install(TARGETS project_warnings EXPORT nrgljubljana_interface-targets)
target_compile_options(project_warnings
INTERFACE
-Wall
Expand All @@ -88,8 +88,8 @@ target_compile_options(project_warnings
# #############
# Build Project

# Build and install the app4triqs library
add_subdirectory(c++/app4triqs)
# Build and install the nrgljubljana_interface library
add_subdirectory(c++/nrgljubljana_interface)

# Tests
option(Build_Tests "Build tests" ON)
Expand All @@ -100,7 +100,7 @@ endif()

if(TRIQS_WITH_PYTHON_SUPPORT)
# Python interface
add_subdirectory(python/app4triqs)
add_subdirectory(python/nrgljubljana_interface)

# Build the documentation
option(Build_Documentation "Build documentation" OFF)
Expand All @@ -127,10 +127,10 @@ if(BUILD_DEBIAN_PACKAGE)
if(NOT CMAKE_INSTALL_PREFIX STREQUAL "/usr")
message(FATAL_ERROR "CMAKE_INSTALL_PREFIX must be /usr for packaging")
endif()
set(CPACK_PACKAGE_NAME app4triqs)
set(CPACK_PACKAGE_NAME nrgljubljana_interface)
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_PACKAGE_CONTACT "https://github.com/TRIQS/app4triqs")
set(CPACK_PACKAGE_CONTACT "https://github.com/TRIQS/nrgljubljana_interface")
execute_process(COMMAND dpkg --print-architecture OUTPUT_VARIABLE CMAKE_DEBIAN_PACKAGE_ARCHITECTURE OUTPUT_STRIP_TRAILING_WHITESPACE)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "triqs (>= 2.2)")
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
Expand Down
1 change: 0 additions & 1 deletion ChangeLog.md

This file was deleted.

10 changes: 10 additions & 0 deletions ChangeLog.md
@@ -0,0 +1,10 @@
Version 2.2.0
-------------

App4triqs Version 2.2.0 provides a project
skeleton for TRIQS applications based on
the TRIQS Library Version 2.2.0.
It is intended for applications with both
Python and C++ components.

This is the initial release for this project.
2 changes: 1 addition & 1 deletion Jenkinsfile
@@ -1,4 +1,4 @@
def projectName = "app4triqs" /* set to app/repo name */
def projectName = "nrgljubljana_interface" /* set to app/repo name */

/* which platform to build documentation on */
def documentationPlatform = "ubuntu-clang"
Expand Down
8 changes: 4 additions & 4 deletions LICENSE.txt
@@ -1,18 +1,18 @@
app4triqs - An example application using triqs and cpp2py
nrgljubljana_interface - An example application using triqs and cpp2py

Copyright (C) 2017-2018, N. Wentzell, O. Parcollet
Copyright (C) 2018-2019, The Simons Foundation
authors: N. Wentzell, D. Simons, H. Strand, O. Parcollet

app4triqs is free software: you can redistribute it and/or modify it under the
nrgljubljana_interface is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.

app4triqs is distributed in the hope that it will be useful, but WITHOUT ANY
nrgljubljana_interface is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
app4triqs (in the file COPYING.txt in this directory). If not, see
nrgljubljana_interface (in the file COPYING.txt in this directory). If not, see
<http://www.gnu.org/licenses/>.
28 changes: 14 additions & 14 deletions README.md
@@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.org/TRIQS/app4triqs.svg?branch=unstable)](https://travis-ci.org/TRIQS/app4triqs)
[![Build Status](https://travis-ci.org/TRIQS/nrgljubljana_interface.svg?branch=unstable)](https://travis-ci.org/TRIQS/nrgljubljana_interface)

# app4triqs - A skeleton for a TRIQS application
# nrgljubljana_interface - A skeleton for a TRIQS application

Initial Setup
-------------
Expand All @@ -12,11 +12,11 @@ To adapt this skeleton for a new TRIQS application, the following steps are nece
* Run the following commands in order after replacing **appname** accordingly

```bash
git clone https://github.com/triqs/app4triqs --branch unstable appname
git clone https://github.com/triqs/nrgljubljana_interface --branch unstable appname
cd appname
./share/squash_history.sh
./share/replace_and_rename.py appname
git add -A && git commit -m "Adjust app4triqs skeleton for appname"
git add -A && git commit -m "Adjust nrgljubljana_interface skeleton for appname"
```

You can now add your github repository and push to it
Expand All @@ -30,13 +30,13 @@ git push origin unstable
If you prefer to use the [SSH interface](https://help.github.com/en/articles/connecting-to-github-with-ssh)
to the remote repository, replace the http link with e.g. `git@github.com:username/appname`.

### Merging app4triqs skeleton updates ###
### Merging nrgljubljana_interface skeleton updates ###

You can merge future changes to the app4triqs skeleton into your project with the following commands
You can merge future changes to the nrgljubljana_interface skeleton into your project with the following commands

```bash
git remote update
git merge app4triqs_remote/unstable -m "Merge latest app4triqs skeleton changes"
git merge nrgljubljana_interface_remote/unstable -m "Merge latest nrgljubljana_interface skeleton changes"
```

If you should encounter any conflicts resolve them and `git commit`.
Expand All @@ -51,24 +51,24 @@ Getting Started
---------------

After setting up your application as described above you should customize the following files and directories
according to your needs (replace app4triqs in the following by the name of your application)
according to your needs (replace nrgljubljana_interface in the following by the name of your application)

* Adjust or remove the `README.md` and `doc/ChangeLog.md` file
* In the `c++/app4triqs` subdirectory adjust the example files `app4triqs.hpp` and `app4triqs.cpp` or add your own source files.
* In the `c++/nrgljubljana_interface` subdirectory adjust the example files `nrgljubljana_interface.hpp` and `nrgljubljana_interface.cpp` or add your own source files.
* In the `test/c++` subdirectory adjust the example test `basic.cpp` or add your own tests.
* In the `python/app4triqs` subdirectory add your Python source files.
Be sure to remove the `app4triqs_module_desc.py` file unless you want to generate a Python module from your C++ source code.
* In the `python/nrgljubljana_interface` subdirectory add your Python source files.
Be sure to remove the `nrgljubljana_interface_module_desc.py` file unless you want to generate a Python module from your C++ source code.
* In the `test/python` subdirectory adjust the example test `Basic.py` or add your own tests.
* Adjust any documentation examples given as `*.rst` files in the doc directory.
* Adjust the sphinx configuration in `doc/conf.py.in` as necessary.
* The build and install process is identical to the one outline [here](https://triqs.github.io/app4triqs/unstable/install.html).
* The build and install process is identical to the one outline [here](https://triqs.github.io/nrgljubljana_interface/unstable/install.html).

### Optional ###
----------------

* If you want to wrap C++ classes and/or functions provided in the `c++/app4triqs/app4triqs.hpp` rerun the `c++2py` tool with
* If you want to wrap C++ classes and/or functions provided in the `c++/nrgljubljana_interface/nrgljubljana_interface.hpp` rerun the `c++2py` tool with
```bash
c++2py -r app4triqs_module_desc.py
c++2py -r nrgljubljana_interface_module_desc.py
```
* Add your email address to the bottom section of `Jenkinsfile` for Jenkins CI notification emails
```
Expand Down
@@ -1,22 +1,22 @@
file(GLOB_RECURSE sources *.cpp)
add_library(app4triqs_c ${sources})
add_library(nrgljubljana_interface_c ${sources})

# Link against triqs and enable warnings
target_link_libraries(app4triqs_c PUBLIC triqs PRIVATE project_warnings)
target_link_libraries(nrgljubljana_interface_c PUBLIC triqs PRIVATE project_warnings)

# Configure compilation
target_compile_options(app4triqs_c PUBLIC -fPIC)
target_include_directories(app4triqs_c PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/c++>)
target_compile_definitions(app4triqs_c PUBLIC
APP4TRIQS_GIT_HASH=${PROJECT_GIT_HASH}
target_compile_options(nrgljubljana_interface_c PUBLIC -fPIC)
target_include_directories(nrgljubljana_interface_c PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/c++>)
target_compile_definitions(nrgljubljana_interface_c PUBLIC
NRGLJUBLJANA_INTERFACE_GIT_HASH=${PROJECT_GIT_HASH}
TRIQS_GIT_HASH=${TRIQS_GIT_HASH}
$<$<CONFIG:Debug>:APP4TRIQS_DEBUG>
$<$<CONFIG:Debug>:NRGLJUBLJANA_INTERFACE_DEBUG>
$<$<CONFIG:Debug>:TRIQS_DEBUG>
$<$<CONFIG:Debug>:TRIQS_ARRAYS_ENFORCE_BOUNDCHECK>
)

# Install library and headers
install(TARGETS app4triqs_c EXPORT app4triqs-targets DESTINATION lib)
install(TARGETS nrgljubljana_interface_c EXPORT nrgljubljana_interface-targets DESTINATION lib)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h")


Expand All @@ -32,7 +32,7 @@ if(ANALYZE_SOURCES)
# Run clang-tidy if found
if(CLANG_TIDY_EXECUTABLE)
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXECUTABLE}")
set_target_properties(app4triqs_c PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXECUTABLE}")
set_target_properties(nrgljubljana_interface_c PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_EXECUTABLE}")
else()
message(STATUS "clang-tidy not found in $PATH. Please consider installing clang-tidy for additional checks!")
endif()
Expand All @@ -41,7 +41,7 @@ if(ANALYZE_SOURCES)
if(CPPCHECK_EXECUTABLE)
message(STATUS "cppcheck found: ${CPPCHECK_EXECUTABLE}")
add_custom_command(
TARGET app4triqs_c
TARGET nrgljubljana_interface_c
COMMAND ${CPPCHECK_EXECUTABLE}
--enable=warning,style,performance,portability
--std=c++17
Expand All @@ -64,11 +64,11 @@ option(UBSAN OFF "Compile library and executables with LLVM Undefined Behavior S

if(ASAN)
find_package(sanitizer REQUIRED "asan")
target_link_libraries(app4triqs_c PUBLIC asan)
install(TARGETS asan EXPORT app4triqs-targets)
target_link_libraries(nrgljubljana_interface_c PUBLIC asan)
install(TARGETS asan EXPORT nrgljubljana_interface-targets)
endif()
if(UBSAN)
find_package(sanitizer REQUIRED "ubsan")
target_link_libraries(app4triqs_c PUBLIC ubsan)
install(TARGETS ubsan EXPORT app4triqs-targets)
target_link_libraries(nrgljubljana_interface_c PUBLIC ubsan)
install(TARGETS ubsan EXPORT nrgljubljana_interface-targets)
endif()
@@ -1,28 +1,28 @@
/*******************************************************************************
*
* app4triqs: A TRIQS based impurity solver
* nrgljubljana_interface: A TRIQS based impurity solver
*
* Copyright (c) 2019 The Simons foundation
* authors: Nils Wentzell
*
* app4triqs is free software: you can redistribute it and/or modify it under the
* nrgljubljana_interface is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* app4triqs is distributed in the hope that it will be useful, but WITHOUT ANY
* nrgljubljana_interface is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* app4triqs. If not, see <http://www.gnu.org/licenses/>.
* nrgljubljana_interface. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include "./types.hpp"

namespace app4triqs {
namespace nrgljubljana_interface {

/// The collection of all output containers in solver_core
struct container_set {
Expand Down Expand Up @@ -53,4 +53,4 @@ namespace app4triqs {
}
};

} // namespace app4triqs
} // namespace nrgljubljana_interface
@@ -1,27 +1,27 @@
/*******************************************************************************
*
* app4triqs: A TRIQS based impurity solver
* nrgljubljana_interface: A TRIQS based impurity solver
*
* Copyright (c) 2019 The Simons foundation
* authors: Nils Wentzell
*
* app4triqs is free software: you can redistribute it and/or modify it under the
* nrgljubljana_interface is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* app4triqs is distributed in the hope that it will be useful, but WITHOUT ANY
* nrgljubljana_interface is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* app4triqs. If not, see <http://www.gnu.org/licenses/>.
* nrgljubljana_interface. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#include "./params.hpp"

namespace app4triqs {
namespace nrgljubljana_interface {

void h5_write(triqs::h5::group h5group, std::string subgroup_name, constr_params_t const &cp) {
auto grp = h5group.create_group(subgroup_name);
Expand Down Expand Up @@ -55,4 +55,4 @@ namespace app4triqs {
h5_read(grp, "post_process", sp.post_process);
}

} // namespace app4triqs
} // namespace nrgljubljana_interface
@@ -1,28 +1,28 @@
/*******************************************************************************
*
* app4triqs: A TRIQS based impurity solver
* nrgljubljana_interface: A TRIQS based impurity solver
*
* Copyright (c) 2019 The Simons foundation
* authors: Nils Wentzell
*
* app4triqs is free software: you can redistribute it and/or modify it under the
* nrgljubljana_interface is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* app4triqs is distributed in the hope that it will be useful, but WITHOUT ANY
* nrgljubljana_interface is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* app4triqs. If not, see <http://www.gnu.org/licenses/>.
* nrgljubljana_interface. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#pragma once
#include "./types.hpp"

namespace app4triqs {
namespace nrgljubljana_interface {

/// The parameters for the solver construction
struct constr_params_t {
Expand Down Expand Up @@ -88,4 +88,4 @@ namespace app4triqs {
: constr_params_t(constr_params_), solve_params_t(solve_params_) {}
};

} // namespace app4triqs
} // namespace nrgljubljana_interface

0 comments on commit 7d83798

Please sign in to comment.