Skip to content

Commit

Permalink
Pull in latest app4triqs changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentzell committed Apr 30, 2019
2 parents 43b0c9a + 3255e01 commit 92cd6f6
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 68 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ find_package(Cpp2Py 1.6 REQUIRED)

# Default Install directory to TRIQS_ROOT if not given or invalid.
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR (NOT IS_ABSOLUTE ${CMAKE_INSTALL_PREFIX}))
message(STATUS " No install prefix given (or invalid). Defaulting to TRIQS_ROOT")
message(STATUS "No install prefix given (or invalid). Defaulting to TRIQS_ROOT")
set(CMAKE_INSTALL_PREFIX ${TRIQS_ROOT} CACHE PATH "default install path" FORCE)
endif()
message(STATUS "-------- CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX} --------")
Expand Down
18 changes: 10 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -111,18 +111,20 @@ try {
// note: credentials used above don't work (need JENKINS-28335)
sh "git push origin master || { git pull --rebase origin master && git push origin master ; }"
}
/* Update docker repo submodule */
if (release) { dir("$workDir/docker") { try {
git(url: "ssh://[email protected]/TRIQS/docker.git", branch: env.BRANCH_NAME, credentialsId: "ssh", changelog: false)
sh "echo '160000 commit ${commit}\ttriqs_${projectName}' | git update-index --index-info"
sh """
/* Update packaging repo submodule */
if (release) { dir("$workDir/packaging") { try {
git(url: "ssh://[email protected]/TRIQS/packaging.git", branch: env.BRANCH_NAME, credentialsId: "ssh", changelog: false)
// note: credentials used above don't work (need JENKINS-28335)
sh """#!/bin/bash -ex
dir="${projectName}"
[[ -d triqs_\$dir ]] && dir=triqs_\$dir || [[ -d \$dir ]]
echo "160000 commit ${commit}\t\$dir" | git update-index --index-info
git commit --author='Flatiron Jenkins <[email protected]>' --allow-empty -m 'Autoupdate ${projectName}' -m '${env.BUILD_TAG}'
git push origin ${env.BRANCH_NAME} || { git pull --rebase origin ${env.BRANCH_NAME} && git push origin ${env.BRANCH_NAME} ; }
"""
// note: credentials used above don't work (need JENKINS-28335)
sh "git push origin ${env.BRANCH_NAME} || { git pull --rebase origin ${env.BRANCH_NAME} && git push origin ${env.BRANCH_NAME} ; }"
} catch (err) {
/* Ignore, non-critical -- might not exist on this branch */
echo "Failed to update docker repo"
echo "Failed to update packaging repo"
} } }
} }
} }
Expand Down
2 changes: 1 addition & 1 deletion c++/triqs_tprf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ add_library(triqs_tprf_c ${sources})
target_link_libraries(triqs_tprf_c PUBLIC triqs)

# Configure compilation
target_compile_options(triqs_tprf_c PUBLIC -std=c++17 -fPIC -fopenmp)
target_compile_options(triqs_tprf_c PUBLIC -fPIC -fopenmp -std=c++17)
target_link_libraries(triqs_tprf_c PUBLIC "-fopenmp") # We are using openmp
target_include_directories(triqs_tprf_c PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/c++>)
target_compile_definitions(triqs_tprf_c PUBLIC
Expand Down
71 changes: 35 additions & 36 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,52 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in ${CMAKE_CURRENT_BINARY_DIR
# ---------------------------------
# Top Sphinx target
# ---------------------------------
# Sources
file(GLOB_RECURSE sources *.rst)

set(sphinx_top ${CMAKE_CURRENT_BINARY_DIR}/html/contents.html)
add_custom_command(OUTPUT ${sphinx_top} DEPENDS ${sources}
COMMAND PYTHONPATH=${CMAKE_BINARY_DIR}/python:$ENV{PYTHONPATH} ${TRIQS_SPHINXBUILD_EXECUTABLE} -c . -j8 -b html ${CMAKE_CURRENT_BINARY_DIR} html)
add_custom_target(docs_sphinx ALL DEPENDS ${sphinx_top} ${CMAKE_CURRENT_BINARY_DIR})

# Application and modules must be compiled first
add_dependencies(docs_sphinx triqs_tprf_c lattice linalg chi_from_gg2 freq_conv hubbard_atom)
# Sphinx has internal caching, always run it
add_custom_target(docs_sphinx ALL)
add_custom_command(
TARGET docs_sphinx
COMMAND PYTHONPATH=${CMAKE_BINARY_DIR}/python:$ENV{PYTHONPATH} ${TRIQS_SPHINXBUILD_EXECUTABLE} -c . -j8 -b html ${CMAKE_CURRENT_SOURCE_DIR} html
)

# ------------------------------------------------------------------------------------------------
# Copy the directory substructure and link all files with relevant extensions
# cp_rs is a script in cpp2py/bin, it mimics cp -rs on Linux
# and filters the relevant extension
# ------------------------------------------------------------------------------------------------
set(EXT_FOR_DOC "rst png txt css_t conf css js gif jpg py html bib h5 md ipynb")
execute_process(COMMAND cp_rs ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${EXT_FOR_DOC})
# Autodoc usage requires the python modules to be built first
get_property(CPP2PY_MODULES_LIST GLOBAL PROPERTY CPP2PY_MODULES_LIST)
add_dependencies(docs_sphinx ${CPP2PY_MODULES_LIST})

# -----------------------------------------------------------------------------
# Make an optional target that allows us to regenerate the C++ doc with c++2rst
# Create an optional target that allows us to regenerate the C++ doc with c++2rst
# -----------------------------------------------------------------------------
add_custom_target(docs_cpp2rst)

get_property(TRIQS_INCLUDE_DIRS TARGET triqs PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
get_property(TPRF_INCLUDE_DIRS TARGET triqs_tprf_c PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
set(CPP2RST_INCLUDE_DIRS ${TRIQS_INCLUDE_DIRS} ${TPRF_INCLUDE_DIRS})

foreach(I ${CPP2RST_INCLUDE_DIRS})
set (CPP2RST_INCLUDE_COMMAND ${CPP2RST_INCLUDE_COMMAND} --includes ${I})
foreach(t triqs_tprf_c triqs)
get_property(INCLUDE_DIRS TARGET ${t} PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
get_property(SYSTEM_INCLUDE_DIRS TARGET ${t} PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES)
if(SYTEM_INCLUDE_DIRS)
list(REMOVE_ITEM INCLUDE_DIRS ${SYSTEM_INCLUDE_DIRS})
endif()
foreach(DIR ${INCLUDE_DIRS})
set(CPP2RST_INCLUDE_FLAGS ${CPP2RST_INCLUDE_FLAGS} -I${DIR})
endforeach()
foreach(DIR ${SYSTEM_INCLUDE_DIRS})
set(CPP2RST_INCLUDE_FLAGS ${CPP2RST_INCLUDE_FLAGS} -isystem=${DIR})
endforeach()
get_property(COMPILE_OPTIONS TARGET ${t} PROPERTY INTERFACE_COMPILE_OPTIONS)
set(CPP2RST_CXXFLAGS ${CPP2RST_CXXFLAGS} ${COMPILE_OPTIONS})
endforeach()

add_custom_target(docs_cpp2rst)
macro(generate_docs header_file)
add_custom_command(
TARGET docs_cpp2rst
COMMAND c++2rst
${header_file}
-N triqs_tprf
-N triqs_tprf::hubbard_atom
--output_directory ${CMAKE_CURRENT_SOURCE_DIR}/cpp2rst_generated
${CPP2RST_INCLUDE_COMMAND}
--cxxflags="-std=c++17"
-I ${CMAKE_SOURCE_DIR}/c++
-I ${TRIQS_ROOT}/include
2>&1 >> cpp2rst.log
COMMAND rm -rf ${CMAKE_CURRENT_SOURCE_DIR}/cpp2rst_generated
COMMAND
c++2rst
${header_file}
-N triqs_tprf
-N triqs_tprf::hubbard_atom
--output_directory ${CMAKE_CURRENT_SOURCE_DIR}/cpp2rst_generated
--cxxflags="${CPP2RST_CXXFLAGS}"
${CPP2RST_INCLUDE_FLAGS}
)
endmacro(generate_docs)

generate_docs(${CMAKE_CURRENT_SOURCE_DIR}/reference/doc_root.hpp)

# ---------------------------------
Expand Down
4 changes: 2 additions & 2 deletions doc/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Version 0.1
-----------
Version 2.1.0
-------------

Some Changes
~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion doc/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ extensions = ['sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx.ext.autosummary',
'plot_directive',
'numpydoc',
'plot_directive',
'autorun',
'nbsphinx',
'sphinx.ext.githubpages',
Expand Down
14 changes: 7 additions & 7 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Prerequisites
-------------

#. The :ref:`TRIQS <triqslibs:welcome>` library, see :ref:`TRIQS installation instruction <triqslibs:installation>`.
In the following, we assume that Triqs is installed in the ``path_to_triqs`` directory.
In the following, we assume that TRIQS is installed in the directory ``path_to_triqs``.

Installation steps
------------------
Expand Down Expand Up @@ -39,23 +39,23 @@ Installation steps
Version compatibility
---------------------

Be careful that the version of TPRF must be compatible with your TRIQS library version, see :ref:`TRIQS website <triqslibs:versions>`.
In particular you should make sure that the Major and Minor Version number are the same.
If you want to use a particular version, go into the directory with the sources
and look at all available versions::
Keep in mind that the version of ``tprf`` must be compatible with your TRIQS library version,
see :ref:`TRIQS website <triqslibs:versions>`.
In particular the Major and Minor Version numbers have to be the same.
To use a particular version, go into the directory with the sources, and look at all available versions::

$ cd tprf.src && git tag

Checkout the version that you want::

$ git checkout 2.1.0

Then follow the steps 2 to 4 described above to compile the code.
and follow steps 2 to 4 above to compile the code.

Custom CMake options
--------------------

The functionality of ``tprf`` can be tweaked using extra compile-time options passed to CMake::
The compilation of ``tprf`` can be configured using CMake-options::

cmake ../tprf.src -DOPTION1=value1 -DOPTION2=value2 ... ../tprf.src

Expand Down
2 changes: 1 addition & 1 deletion doc/issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Reporting issues
================

Please report all problems and bugs directly at the github issue page
`<https://github.com/HugoStrand/tprf/issues>`_. In order to make it easier for us
`<https://github.com/TRIQS/tprf/issues>`_. In order to make it easier for us
to solve the issue please follow these guidelines:

#. In all cases specify which version of the application you are using. You can
Expand Down
4 changes: 2 additions & 2 deletions python/triqs_tprf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ target_link_libraries(chi_from_gg2 triqs_tprf_c)
add_cpp2py_module(freq_conv)
target_link_libraries(freq_conv triqs_tprf_c)

# Build the C++ extension module
add_cpp2py_module(hubbard_atom)
target_link_libraries(hubbard_atom triqs_tprf_c)

Expand All @@ -20,7 +19,8 @@ configure_file(version.py.in version.py)

# All Python files. Copy them in the build dir to have a complete package for the tests.
file(GLOB_RECURSE python_sources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py)
list(FILTER python_sources EXCLUDE REGEX "_desc.py")
file(GLOB_RECURSE wrap_generators RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *_desc.py)
list(REMOVE_ITEM python_sources "${wrap_generators}")
foreach(file ${python_sources})
configure_file(${file} ${file} COPYONLY)
endforeach()
Expand Down
2 changes: 1 addition & 1 deletion python/triqs_tprf/version.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
################################################################################

version = "@TPRF_VERSION@"
triqs_version = "@TRIQS_VERSION@"
triqs_hash = "@TRIQS_GIT_HASH@"
triqs_tprf_hash = "@TPRF_GIT_HASH@"

Expand All @@ -33,4 +32,5 @@ def show_version():
def show_git_hash():
print "\nYou are using triqs_tprf git hash %s based on triqs git hash %s\n"%(triqs_tprf_hash, triqs_hash)

triqs_version = "@TRIQS_VERSION@"
info = (version, triqs_tprf_hash[:7], triqs_version, triqs_hash[:7])
8 changes: 4 additions & 4 deletions share/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ if(NOT CMAKE_INSTALL_PREFIX STREQUAL TRIQS_ROOT)
)

message(STATUS "***************************************************************")
message(STATUS "* Custom install Location. Use: ")
message(STATUS "* Custom install Location. Use: ")
message(STATUS "* ")
message(STATUS "* source ${CMAKE_INSTALL_PREFIX}/share/triqs_tprfvars.sh ")
message(STATUS "* ")
message(STATUS "* to set up the environment variables ")
message(STATUS "* source ${CMAKE_INSTALL_PREFIX}/share/triqs_tprfvars.sh ")
message(STATUS "* ")
message(STATUS "* to set up the environment variables ")
message(STATUS "***************************************************************")

endif()
4 changes: 2 additions & 2 deletions share/cmake/triqs_tprf-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ set(TPRF_GIT_HASH @TPRF_GIT_HASH@)
set(TPRF_ROOT @CMAKE_INSTALL_PREFIX@)

# Include the exported targets of this project
include(@CMAKE_INSTALL_PREFIX@/lib/cmake/triqs/triqs_tprf-targets.cmake)
include(@CMAKE_INSTALL_PREFIX@/lib/cmake/triqs_tprf/triqs_tprf-targets.cmake)

MESSAGE(STATUS "Found TPRFConfig.cmake with version ${TPRF_VERSION}, hash = ${TPRF_GIT_HASH}")
message(STATUS "Found triqs_tprf-config.cmake with version ${TPRF_VERSION}, hash = ${TPRF_GIT_HASH}")

# Was the Project built with Documentation?
set(TPRF_WITH_DOCUMENTATION @Build_Documentation@)
Expand Down
4 changes: 2 additions & 2 deletions share/triqs_tprfvars.sh.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Source this in your environment.

export TRIQS_ROOT=@CMAKE_INSTALL_PREFIX@
export TPRF_ROOT=@CMAKE_INSTALL_PREFIX@

export CPLUS_INCLUDE_PATH=@CMAKE_INSTALL_PREFIX@/include:$CPLUS_INCLUDE_PATH
export PATH=@CMAKE_INSTALL_PREFIX@/bin:$PATH
export LIBRARY_PATH=@CMAKE_INSTALL_PREFIX@/lib:$LIBRARY_PATH
export LD_LIBRARY_PATH=@CMAKE_INSTALL_PREFIX@/lib:$LD_LIBRARY_PATH
export PYTHONPATH=@CMAKE_INSTALL_PREFIX@/@CPP2PY_PYTHON_LIB_DEST_ROOT@:$PYTHONPATH
export CMAKE_PREFIX_PATH=@CMAKE_INSTALL_PREFIX@/lib/cmake/triqs:$CMAKE_PREFIX_PATH
export CMAKE_PREFIX_PATH=@CMAKE_INSTALL_PREFIX@/lib/cmake/triqs_tprf:$CMAKE_PREFIX_PATH

0 comments on commit 92cd6f6

Please sign in to comment.