From dd33a61cc6d0094d45a52ec37d9dc696e1b9158d Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Wed, 24 Jun 2020 08:57:44 -0400 Subject: [PATCH 01/17] [cmake] When searching dependency sources, check both current dir and CMAKE_SOURCE_DIR/deps --- deps/CMakeLists.txt | 3 ++- deps/external_dependency.cmake | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 25c49960..9ac49757 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -17,7 +17,8 @@ include(external_dependency.cmake) # to locate the package in the system. # Skip this step if Build_Deps option is set. # 2. Try to find a directory containing the sources -# at ${PROJECT_SOURCE_DIR}/deps/name. If found +# at ${CMAKE_CURRENT_SOURCE_DIR}/name and +# ${CMAKE_SOURCE_DIR}/deps/name. If found # build it as a cmake sub-project. # 3. If GIT_REPO is provided, git clone the sources, # and build them as a cmake sub-project. diff --git a/deps/external_dependency.cmake b/deps/external_dependency.cmake index e7cc44ea..7ba1b7ad 100644 --- a/deps/external_dependency.cmake +++ b/deps/external_dependency.cmake @@ -51,6 +51,9 @@ function(external_dependency) if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}) message(STATUS "Found sources for dependency ${ARGV0} at ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}") add_subdirectory(${ARGV0} ${subdir_opts}) + elseif(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/deps/${ARGV0}) + message(STATUS "Found sources for dependency ${ARGV0} at ${CMAKE_SOURCE_DIR}/deps/${ARGV0}") + add_subdirectory(${ARGV0} ${subdir_opts}) elseif(ARG_GIT_REPO) set(bin_dir ${CMAKE_CURRENT_BINARY_DIR}/${ARGV0}) set(src_dir ${bin_dir}_src) From 6aff3f1a39f121690785d086c9a7ae33b2f625de Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Wed, 24 Jun 2020 10:06:11 -0400 Subject: [PATCH 02/17] [cmake] Default to -DBuild_Deps=IfNotFound, adjust install instructions --- deps/CMakeLists.txt | 2 +- doc/install.rst | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 9ac49757..dad295fd 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -35,7 +35,7 @@ include(external_dependency.cmake) # In particular the dependency will not be installed. if(NOT DEFINED Build_Deps) - set(Build_Deps "Never" CACHE STRING "Do we build dependencies from source? [Never/Always/IfNotFound]") + set(Build_Deps "IfNotFound" CACHE STRING "Do we build dependencies from source? [Never/Always/IfNotFound]") else() set(Build_Deps_Opts "Never" "Always" "IfNotFound") if(NOT ${Build_Deps} IN_LIST Build_Deps_Opts) diff --git a/doc/install.rst b/doc/install.rst index 203ab7cd..d8668c58 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -19,13 +19,6 @@ Installation steps $ git clone https://github.com/TRIQS/app4triqs app4triqs.src -#. Make sure that all additional dependencies are installed on your system and available in your environment. - Alternatively build the dependencies from source instead with:: - - $ (cd deps && ./download.sh) - - In this case they will be installed together with your application. - #. Create and move to a new directory where you will compile the code:: $ mkdir app4triqs.build && cd app4triqs.build From 15e4c6d6352c314b8ed011db482122003601bc2a Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Wed, 24 Jun 2020 10:13:02 -0400 Subject: [PATCH 03/17] [cmake] Provide information on INSTALL_PREFIX in config.cmake files --- share/cmake/app4triqs-config.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/cmake/app4triqs-config.cmake.in b/share/cmake/app4triqs-config.cmake.in index e9101328..452a7d75 100644 --- a/share/cmake/app4triqs-config.cmake.in +++ b/share/cmake/app4triqs-config.cmake.in @@ -21,7 +21,7 @@ set(@PROJECT_NAME@_ROOT @CMAKE_INSTALL_PREFIX@ CACHE STRING "@PROJECT_NAME@ root # Include the exported targets of this project include(@CMAKE_INSTALL_PREFIX@/lib/cmake/@PROJECT_NAME@/@PROJECT_NAME@-targets.cmake) -message(STATUS "Found @PROJECT_NAME@-config.cmake with version @PROJECT_VERSION@, hash = @PROJECT_GIT_HASH@") +message(STATUS "Found @PROJECT_NAME@-config.cmake with version @PROJECT_VERSION@, hash = @PROJECT_GIT_HASH@, root = @CMAKE_INSTALL_PREFIX@") # Was the Project built with Documentation? set(@PROJECT_NAME@_WITH_DOCUMENTATION @Build_Documentation@ CACHE BOOL "Was @PROJECT_NAME@ build with documentation?") From c04128fa0d2b4d9022e322b3bdba768641069639 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Wed, 8 Jul 2020 11:25:57 -0400 Subject: [PATCH 04/17] [cmake] Protect against flags -I/usr/include in extract_flags.cmake --- share/cmake/extract_flags.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/share/cmake/extract_flags.cmake b/share/cmake/extract_flags.cmake index dfcf67b0..6bce43c2 100644 --- a/share/cmake/extract_flags.cmake +++ b/share/cmake/extract_flags.cmake @@ -76,10 +76,14 @@ macro(extract_flags) list(REMOVE_ITEM sys_inc_dirs ${inc_dirs}) endif() foreach(dir ${inc_dirs}) - set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -I${dir}") + if(NOT dir STREQUAL "/usr/include") + set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -I${dir}") + endif() endforeach() foreach(dir ${sys_inc_dirs}) - set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -isystem${dir}") + if(NOT dir STREQUAL "/usr/include") + set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -isystem${dir}") + endif() endforeach() get_property_recursive(libs TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES) From e2f4e9988e66b52463305b84d5878b692393c67e Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Tue, 14 Jul 2020 18:29:12 -0400 Subject: [PATCH 05/17] [cmake] Extend extract_flags.cmake to treat compiler-specific generator expressions properly --- share/cmake/extract_flags.cmake | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/share/cmake/extract_flags.cmake b/share/cmake/extract_flags.cmake index 6bce43c2..b6d11483 100644 --- a/share/cmake/extract_flags.cmake +++ b/share/cmake/extract_flags.cmake @@ -93,7 +93,8 @@ macro(extract_flags) endif() endforeach() - # We have to replace generator expressions explicitly + # ==== We have to replace generator expressions explicitly ==== + if(ARG_BUILD_INTERFACE) string(REGEX REPLACE "\\$" "\\1" ${target}_LDFLAGS "${${target}_LDFLAGS}") string(REGEX REPLACE "\\$" "\\1" ${target}_CXXFLAGS "${${target}_CXXFLAGS}") @@ -101,6 +102,19 @@ macro(extract_flags) string(REGEX REPLACE "\\$" "\\1" ${target}_LDFLAGS "${${target}_LDFLAGS}") string(REGEX REPLACE "\\$" "\\1" ${target}_CXXFLAGS "${${target}_CXXFLAGS}") endif() + + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + string(REGEX REPLACE "\\$<\\$:([^ ]*)>" "\\1" ${target}_LDFLAGS "${${target}_LDFLAGS}") + string(REGEX REPLACE "\\$<\\$:([^ ]*)>" "\\1" ${target}_CXXFLAGS "${${target}_CXXFLAGS}") + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + string(REGEX REPLACE "\\$<\\$:([^ ]*)>" "\\1" ${target}_LDFLAGS "${${target}_LDFLAGS}") + string(REGEX REPLACE "\\$<\\$:([^ ]*)>" "\\1" ${target}_CXXFLAGS "${${target}_CXXFLAGS}") + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + string(REGEX REPLACE "\\$<\\$:([^ ]*)>" "\\1" ${target}_LDFLAGS "${${target}_LDFLAGS}") + string(REGEX REPLACE "\\$<\\$:([^ ]*)>" "\\1" ${target}_CXXFLAGS "${${target}_CXXFLAGS}") + endif() + + # Remove all remaining generator expressions string(REGEX REPLACE " [^ ]*\\$<[^ ]*:[^>]*>" "" ${target}_LDFLAGS "${${target}_LDFLAGS}") string(REGEX REPLACE " [^ ]*\\$<[^ ]*:[^>]*>" "" ${target}_CXXFLAGS "${${target}_CXXFLAGS}") endmacro() From 5a9fc1118b0ad371bc351cca7f597432780f95c6 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Tue, 14 Jul 2020 18:29:39 -0400 Subject: [PATCH 06/17] [cmake] In extract_flags.cmake, protect extraction of -L/usr/lib and fix filtering -I/usr/include --- share/cmake/extract_flags.cmake | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/share/cmake/extract_flags.cmake b/share/cmake/extract_flags.cmake index b6d11483..e00ee628 100644 --- a/share/cmake/extract_flags.cmake +++ b/share/cmake/extract_flags.cmake @@ -76,14 +76,10 @@ macro(extract_flags) list(REMOVE_ITEM sys_inc_dirs ${inc_dirs}) endif() foreach(dir ${inc_dirs}) - if(NOT dir STREQUAL "/usr/include") - set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -I${dir}") - endif() + set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -I${dir}") endforeach() foreach(dir ${sys_inc_dirs}) - if(NOT dir STREQUAL "/usr/include") - set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -isystem${dir}") - endif() + set(${target}_CXXFLAGS "${${target}_CXXFLAGS} -isystem${dir}") endforeach() get_property_recursive(libs TARGET ${target} PROPERTY INTERFACE_LINK_LIBRARIES) @@ -117,4 +113,10 @@ macro(extract_flags) # Remove all remaining generator expressions string(REGEX REPLACE " [^ ]*\\$<[^ ]*:[^>]*>" "" ${target}_LDFLAGS "${${target}_LDFLAGS}") string(REGEX REPLACE " [^ ]*\\$<[^ ]*:[^>]*>" "" ${target}_CXXFLAGS "${${target}_CXXFLAGS}") + + # Filter out system directories from LDFLAGS and CXXFLAGS + string(REGEX REPLACE " -L/usr/lib " " " ${target}_LDFLAGS "${${target}_LDFLAGS}") + string(REGEX REPLACE " -I/usr/include " " " ${target}_CXXFLAGS "${${target}_CXXFLAGS}") + string(REGEX REPLACE " -isystem/usr/include " " " ${target}_CXXFLAGS "${${target}_CXXFLAGS}") + endmacro() From 9c23827e01589f2925e234868da8a98b339d6b9d Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Mon, 27 Jul 2020 15:25:32 -0400 Subject: [PATCH 07/17] [doc] Add missing theme images --- doc/themes/agogo/static/bgfooter.png | Bin 0 -> 434 bytes doc/themes/agogo/static/bgtop.png | Bin 0 -> 430 bytes doc/themes/triqs/static/bodybg.png | Bin 0 -> 602 bytes doc/themes/triqs/static/footerbg.png | Bin 0 -> 313 bytes doc/themes/triqs/static/headerbg.png | Bin 0 -> 344 bytes doc/themes/triqs/static/listitem.png | Bin 0 -> 207 bytes doc/themes/triqs/static/relbg.png | Bin 0 -> 332 bytes 7 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 doc/themes/agogo/static/bgfooter.png create mode 100644 doc/themes/agogo/static/bgtop.png create mode 100644 doc/themes/triqs/static/bodybg.png create mode 100644 doc/themes/triqs/static/footerbg.png create mode 100644 doc/themes/triqs/static/headerbg.png create mode 100644 doc/themes/triqs/static/listitem.png create mode 100644 doc/themes/triqs/static/relbg.png diff --git a/doc/themes/agogo/static/bgfooter.png b/doc/themes/agogo/static/bgfooter.png new file mode 100644 index 0000000000000000000000000000000000000000..9ce5bdd902943fdf8b0c0ca6a545297e1e2cc665 GIT binary patch literal 434 zcmV;j0ZsmiP)Px#24YJ`L;%wO*8tD73qoQ5000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXD> z2Q(2CT#42I000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}0003ENklR?sq9~H`=l5UI-{JW_f9!)=Hwush3JC}Y z1gFM&r>$lJNPt^*1k!w;l|obx>lr$2IOaI$n=(gBBaj^I0=y%@K5N&GIU&-%OE_~V zX=m=_j7d`hvubQRuF+xT63vIfWnC3%kKN*T3l7ob3nEC2R->wU1Y)4)(7_t^thiqb zj$CO7xBn9gg`*!MY$}SI|_*)!a*&V0w7h>cUb&$Grh37iJ=C%Yn c>}w1E0Z4f>1OEiDlmGw#07*qoM6N<$g4BwtIsgCw literal 0 HcmV?d00001 diff --git a/doc/themes/agogo/static/bgtop.png b/doc/themes/agogo/static/bgtop.png new file mode 100644 index 0000000000000000000000000000000000000000..a0d4709bac8f79943a817195c086461c8c4d5419 GIT binary patch literal 430 zcmV;f0a5;mP)Px#24YJ`L;zI)R{&FzA;Z4_000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXD> z2Q3AZhV-)l000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}0003ANklMo8vqN`cM=KwSQV|n zk}naE+VzlN;kK@Ej${PSkI$-R6-Yfp`zA;^O$`)7`gRi{-0i?owGIbX{p>Nc##93U z;sA|ayOYkG%F9M0iEMUM*s3NDYSS=KN2ht8Rv|7nv77i{NTO47R)}V_+2H~mL-nTR z_8j}*%6Qm8?#7NU2kM$#gcP&kO?iw|n}ynz+r-~FA9nKcZnfixWvZ&d28Cc_6&_Pe zMpbjI>9r+<=}NIDz4mCd3U++H?rrHcYxH&eeB|)>mnv*N#44ILM2zL6yU!VVWSrgp Y0Yu&#qm)=by8r+H07*qoM6N<$f@HC)j{pDw literal 0 HcmV?d00001 diff --git a/doc/themes/triqs/static/bodybg.png b/doc/themes/triqs/static/bodybg.png new file mode 100644 index 0000000000000000000000000000000000000000..506b6f908b346569a405118042adcb5db9fb59d3 GIT binary patch literal 602 zcmV-g0;TC1q*fe@n4#zaZ?&yk{Pg#&{Xy2CBNQ>%&e-+xAnMpv*ngq{Yp02t8n}`i8jjEKY*^cXXY{O zlvqRJrK(`I&QecRHo;4L?3|K%;w7(12#~EORd`4xJxNt{*kqnilB5|iZ0uZgjEK%b z)w#xbjxj=-QrK73Rh1C!4>V|(6f0;o2uL%Q41W4Pp2U|b-=$hM*L7d-=F90}_z(Ex oiKLl%?=@rxd|N}U-+$K7UroZ0lrV;)AOHXW07*qoM6N<$f)b?!!T zStD}VgsY}*S8{)cY|s5E@lW=1_Qve`>w9F9_U3-h-^Tn*!*t`hZ6H=!O@QAMW#`%r zQCFfiu$_5aXm50deYNXb(KUjbU-QI1fB!%6&(p&{7=;g?6nRsmascQ@22WQ%mvv4F FO#mA*ghBuS literal 0 HcmV?d00001 diff --git a/doc/themes/triqs/static/headerbg.png b/doc/themes/triqs/static/headerbg.png new file mode 100644 index 0000000000000000000000000000000000000000..6d3e1d5e651326bf0315d05da96aedfe55b257e9 GIT binary patch literal 344 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1SFYWcSQjy&H|6fVxatW5N34Jm|X!BWH0gb zb!ETH$S0;{@^ZgSFHq>ar;B5V#p$<`9rF$=2)N#FFBB1xU)}!l@6!$qvzdB6oSg4g z1%;<3&V0zZSF*O`-;aJU@DxD`=Le`hnB0DjDSsgXeG@Jbi4RlYsDn#}C*1 z?qBrQJ%5Jg**LTF;RO>exn4YA8($uBaf;poL1O_1zPS9gqH)^nGivj%)c)Oiq9Fh1 zna@rfUel{~-Thm~ykWB6^IJ9huGz&Ke%{pOdGVFR`|Vb5FYol5ef2b(T~h7&l5JL- zYLEM5)^&Z|c6R?wz8RW+zH2t;{xi8P$o(g2=Jc;K7urSWX6Z&Sr_Gx_ZJ{2Jy(OV{ o2CwkH%oFT4{vZBvy8R>T@984ky))J?1qK0wr>mdKI;Vst0L~YZ=>Px# literal 0 HcmV?d00001 diff --git a/doc/themes/triqs/static/listitem.png b/doc/themes/triqs/static/listitem.png new file mode 100644 index 0000000000000000000000000000000000000000..e45715f914df0b9ce5650cd81f826565d794bc6f GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^oIuRO!3HEZ#7tid5-9M9ECz~A24Tjhjus6-LG}_) zUsv|KjDqY+yxD&zFaw41JY5_^BrYc>NGv&UGh(5%v^3ic2_Tqf;9+ScrKuZn^uU2H zQyfn*9&-yU`CQ%jRM<_jbEVs=+4%-On`#az=vrO%C^ha<()jUzeq*EHImaYp10cwd vh@M+!5EQwitFh7Z?ulO_J-(9;uViOPP?5c=x_{|>pv?@Pu6{1-oD!M<&SgTz literal 0 HcmV?d00001 diff --git a/doc/themes/triqs/static/relbg.png b/doc/themes/triqs/static/relbg.png new file mode 100644 index 0000000000000000000000000000000000000000..47225851b87028b3b18e4ca7e0162984a3643595 GIT binary patch literal 332 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1SFYWcSQjy&H|6fVxatW5N34Jm|X!BWH0gb zb!ETH$S>#XorPwP2Z@rO!1+&>XXC$7MK3nOVpPe b)G_S-&Gh)gjM8kNw;4QL{an^LB{Ts5zWs(2 literal 0 HcmV?d00001 From 56483b2d7d2bf3c95a90ddc0d70a8cdb549ae203 Mon Sep 17 00:00:00 2001 From: Dylan Simon Date: Mon, 3 Aug 2020 11:23:34 -0400 Subject: [PATCH 08/17] [jenkins] send email on test failure too --- Jenkinsfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 3d7ff1e5..bab8d5a6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -102,6 +102,7 @@ for (int i = 0; i < osxPlatforms.size(); i++) { } /****************** wrap-up */ +def error = null try { parallel platforms if (keepInstall) { node("docker") { @@ -150,13 +151,13 @@ try { } } } } } catch (err) { + error = err +} finally { /* send email on build failure (declarative pipeline's post section would work better) */ - if (env.BRANCH_NAME != "jenkins") emailext( + if ((error != null || currentBuild.currentResult != 'SUCCESS') && env.BRANCH_NAME != "jenkins") emailext( subject: "\$PROJECT_NAME - Build # \$BUILD_NUMBER - FAILED", body: """\$PROJECT_NAME - Build # \$BUILD_NUMBER - FAILED -$err - Check console output at \$BUILD_URL to view full results. Building \$BRANCH_NAME for \$CAUSE @@ -168,11 +169,11 @@ Changes: End of build log: \${BUILD_LOG,maxLines=60} """, - to: 'nwentzell@flatironinstitute.org', + to: 'nwentzell@flatironinstitute.org, dsimon@flatironinstitute.org', recipientProviders: [ [$class: 'DevelopersRecipientProvider'], ], replyTo: '$DEFAULT_REPLYTO' ) - throw err + if (error != null) throw error } From ff8124ea24cc75146f048d1f81bb489426e12d1a Mon Sep 17 00:00:00 2001 From: Dylan Simon Date: Mon, 3 Aug 2020 11:25:11 -0400 Subject: [PATCH 09/17] [jenkins] inject test failure to test email --- test/python/Basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/python/Basic.py b/test/python/Basic.py index 9ff46e2d..4c90ad13 100644 --- a/test/python/Basic.py +++ b/test/python/Basic.py @@ -14,7 +14,7 @@ class test_toto(unittest.TestCase): b=Toto(2) c=a+b - self.assertEqual(c, b) + self.assertEqual(c, a) def test_h5(self): From 1eabf195704742d07b619a5808ad4abbded5cc51 Mon Sep 17 00:00:00 2001 From: Dylan Simon Date: Mon, 3 Aug 2020 11:32:27 -0400 Subject: [PATCH 10/17] Revert "[jenkins] inject test failure to test email" This reverts commit ff8124ea24cc75146f048d1f81bb489426e12d1a. --- test/python/Basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/python/Basic.py b/test/python/Basic.py index 4c90ad13..9ff46e2d 100644 --- a/test/python/Basic.py +++ b/test/python/Basic.py @@ -14,7 +14,7 @@ class test_toto(unittest.TestCase): b=Toto(2) c=a+b - self.assertEqual(c, a) + self.assertEqual(c, b) def test_h5(self): From 43720b8f8f608748289b0bae118014138d0b5a57 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Mon, 3 Aug 2020 15:34:31 -0400 Subject: [PATCH 11/17] [cmake] Use find_package over find_dependency in config.cmake.in to improve cmake version compatibility --- share/cmake/app4triqs-config.cmake.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/share/cmake/app4triqs-config.cmake.in b/share/cmake/app4triqs-config.cmake.in index 452a7d75..ef926eff 100644 --- a/share/cmake/app4triqs-config.cmake.in +++ b/share/cmake/app4triqs-config.cmake.in @@ -15,8 +15,7 @@ set(@PROJECT_NAME@_GIT_HASH @PROJECT_GIT_HASH@ CACHE STRING "@PROJECT_NAME@ git set(@PROJECT_NAME@_ROOT @CMAKE_INSTALL_PREFIX@ CACHE STRING "@PROJECT_NAME@ root directory") ## Find the target dependencies -#include(CMakeFindDependencyMacro) -#find_dependency(... HINTS @CMAKE_INSTALL_PREFIX@) +#find_package(... REQUIRED HINTS @CMAKE_INSTALL_PREFIX@) # Include the exported targets of this project include(@CMAKE_INSTALL_PREFIX@/lib/cmake/@PROJECT_NAME@/@PROJECT_NAME@-targets.cmake) From eb68c32562daa0a4b496af1c84be9a806ff90815 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Mon, 3 Aug 2020 15:38:56 -0400 Subject: [PATCH 12/17] Update changelog for app4triqs 3.0.0 release --- doc/ChangeLog.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index c71910b2..99deae8e 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -1,7 +1,17 @@ -Version 2.2.0 -------------- +Version 3.0.0 +============= -App4triqs Version 2.2.0 provides a project +app4triqs version 3.0.0 is a compatibility +release for TRIQS version 3.0.0 that +* introduces compatibility with Python 3 (Python 2 no longer supported) +* adds a cmake-based dependency management +* fixes several application issues + + +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 From 7047ac8373f74b81798f72da2852a17ba9c37d9e Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Thu, 6 Aug 2020 13:36:09 -0400 Subject: [PATCH 13/17] Add template for conda packaging --- packaging/conda/build.sh | 22 ++++++++++ packaging/conda/conda_build_config.yaml | 3 ++ packaging/conda/meta.yaml | 57 +++++++++++++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 packaging/conda/build.sh create mode 100644 packaging/conda/conda_build_config.yaml create mode 100644 packaging/conda/meta.yaml diff --git a/packaging/conda/build.sh b/packaging/conda/build.sh new file mode 100644 index 00000000..e3d1f540 --- /dev/null +++ b/packaging/conda/build.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +mkdir build +cd build + +# Openmpi Specific environment setup - Cf. https://github.com/conda-forge/libnetcdf-feedstock/pull/80 +export OMPI_MCA_btl=self,tcp +export OMPI_MCA_plm=isolated +export OMPI_MCA_rmaps_base_oversubscribe=yes +export OMPI_MCA_btl_vader_single_copy_mechanism=none +mpiexec="mpiexec --allow-run-as-root" + +source $PREFIX/share/triqsvars.sh + +cmake \ + -DCMAKE_INSTALL_PREFIX=$PREFIX \ + -DCMAKE_BUILD_TYPE=Release \ + .. + +make -j${CPU_COUNT} VERBOSE=1 +CTEST_OUTPUT_ON_FAILURE=1 ctest +make install diff --git a/packaging/conda/conda_build_config.yaml b/packaging/conda/conda_build_config.yaml new file mode 100644 index 00000000..289631fa --- /dev/null +++ b/packaging/conda/conda_build_config.yaml @@ -0,0 +1,3 @@ +mpi: + - mpich + - openmpi diff --git a/packaging/conda/meta.yaml b/packaging/conda/meta.yaml new file mode 100644 index 00000000..2fd369ef --- /dev/null +++ b/packaging/conda/meta.yaml @@ -0,0 +1,57 @@ +{% set version = "3.0.0" %} + +package: + name: app4triqs + version: {{ version }} + +source: + url: https://github.com/TRIQS/app4triqs/releases/download/{{ version }}/app4triqs-{{ version }}.tar.gz + sha256: PUT HERE THE SHA256 OF YOUR RELEASE TARBALL + +build: + number: 0 + skip: True # [win or py<30] + +requirements: + build: + - cmake + - make + - {{ compiler('c') }} + - {{ compiler('cxx') }} + host: + - triqs {{ '.'.join(version.split('.')[:2]) }} + - boost-cpp + - hdf5 + - {{ mpi }} + - libblas + - liblapack + - python + run: + - {{ pin_compatible("triqs", max_pin="x.x") }} + - boost-cpp + - hdf5 + - {{ mpi }} + - libblas + - liblapack + - python + +test: + commands: + - export OMPI_MCA_btl=self,tcp + - export OMPI_MCA_plm=isolated + - export OMPI_MCA_rmaps_base_oversubscribe=yes + - export OMPI_MCA_btl_vader_single_copy_mechanism=none + - export mpiexec="mpiexec --allow-run-as-root" + - python -c "import app4triqs" + +about: + home: https://triqs.github.io/app4triqs + license: GPL-3.0-or-later + license_family: GPL + license_file: LICENSE.txt + summary: 'An application based on the TRIQS library' + +extra: + recipe-maintainers: + - wentzell + - pgunn From abdc51ca9410253180786feeedd633dca71e2d30 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Thu, 6 Aug 2020 13:39:09 -0400 Subject: [PATCH 14/17] Add template easybuild script --- ...app4triqs-3.0.0-foss-2019a-Python-3.7.2.eb | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 packaging/TRIQS-app4triqs-3.0.0-foss-2019a-Python-3.7.2.eb diff --git a/packaging/TRIQS-app4triqs-3.0.0-foss-2019a-Python-3.7.2.eb b/packaging/TRIQS-app4triqs-3.0.0-foss-2019a-Python-3.7.2.eb new file mode 100644 index 00000000..e467ccb9 --- /dev/null +++ b/packaging/TRIQS-app4triqs-3.0.0-foss-2019a-Python-3.7.2.eb @@ -0,0 +1,65 @@ +easyblock = 'CMakeMake' + +name = 'TRIQS-app4triqs' +version = '3.0.0' +versionsuffix = '-Python-%(pyver)s' + +homepage = 'https://triqs.github.io/app4triqs/' +description = """ + TRIQS (Toolbox for Research on Interacting Quantum Systems) is a + scientific project providing a set of C++ and Python libraries to + develop new tools for the study of interacting quantum systems. + + PROVIDE HERE A DESCRIPTION OF YOUR APPLICATION +""" + +docurls = ['https://triqs.github.io/app4triqs/%(version_major_minor)s.x/'] +software_license = 'LicenseGPLv3' + +toolchain = {'name': 'foss', 'version': '2019a'} +toolchainopts = {'pic': True, 'usempi': True} + +source_urls = ['https://github.com/TRIQS/app4triqs/releases/download/%(version)s/'] +sources = ['app4triqs-%(version)s.tar.gz'] +checksums = ['PUT HERE THE SHA256 OF THE RELEASE TARBALL'] + +dependencies = [ + ('Python', '3.7.2'), + ('SciPy-bundle', '2019.03'), + ('Boost', '1.70.0'), + ('Clang', '8.0.0'), + ('GMP', '6.1.2'), + ('HDF5', '1.10.5'), + ('Mako', '1.0.8'), + ('h5py', '2.9.0'), + ('TRIQS', '3.0.0', versionsuffix), + ('NFFT', '3.5.1') +] + +builddependencies = [ + ('CMake', '3.13.3') +] + +separate_build_dir = True + +runtest = 'test' + +sanity_check_paths = { + 'files': ['lib/libapp4triqs_c.a'], + 'dirs': ['include', 'include/app4triqs', 'lib', + 'lib/python%(pyshortver)s/site-packages', 'share'], +} + +sanity_check_commands = ["python -c 'import app4triqs'"] + +modextrapaths = { + 'CPLUS_INCLUDE_PATH': 'include', + 'PYTHONPATH': 'lib/python%(pyshortver)s/site-packages', + 'CMAKE_PREFIX_PATH': 'lib/cmake/app4triqs', +} +modextravars = { + 'APP4TRIQS_ROOT': '%(installdir)s', + 'APP4TRIQS_VERSION': '%(version)s', +} + +moduleclass = 'phys' From 182550a831aaf387219ab06a4062030a121031af Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Fri, 7 Aug 2020 10:53:16 -0400 Subject: [PATCH 15/17] [cmake] Make sure imported targets are always global, some copyright header adjustments --- deps/external_dependency.cmake | 49 +++++++++++++++++---------- share/cmake/app4triqs-config.cmake.in | 8 ++++- share/cmake/extract_flags.cmake | 30 +++++++--------- 3 files changed, 50 insertions(+), 37 deletions(-) diff --git a/deps/external_dependency.cmake b/deps/external_dependency.cmake index 7ba1b7ad..19dd26dc 100644 --- a/deps/external_dependency.cmake +++ b/deps/external_dependency.cmake @@ -1,25 +1,38 @@ -################################################################################### +# Copyright (c) 2020 Simons Foundation # -# APP4TRIQS: a Toolbox for Research in Interacting Quantum Systems +# This program 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. # -# Copyright (C) 2020 Simons Foundation -# authors: N. Wentzell +# This program 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. # -# APP4TRIQS 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 -# 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 . -# -################################################################################### +# You may obtain a copy of the License at +# https://www.gnu.org/licenses/gpl-3.0.txt + +# Consider ROOT env variables in find_package +if(POLICY CMP0074) + cmake_policy(SET CMP0074 NEW) +endif() + +# Make sure that imported targets are always global +get_property(IMPORTED_ALWAYS_GLOBAL GLOBAL PROPERTY IMPORTED_ALWAYS_GLOBAL) +if(NOT IMPORTED_ALWAYS_GLOBAL) + function(add_library) + set(_args ${ARGN}) + if ("${_args}" MATCHES ";IMPORTED") + list(APPEND _args GLOBAL) + endif() + _add_library(${_args}) + endfunction() + set_property(GLOBAL PROPERTY IMPORTED_ALWAYS_GLOBAL TRUE) +endif() + +# Define External Dependency Function function(external_dependency) cmake_parse_arguments(ARG "EXCLUDE_FROM_ALL;BUILD_ALWAYS" "VERSION;GIT_REPO;GIT_TAG" "" ${ARGN}) diff --git a/share/cmake/app4triqs-config.cmake.in b/share/cmake/app4triqs-config.cmake.in index ef926eff..940e75f6 100644 --- a/share/cmake/app4triqs-config.cmake.in +++ b/share/cmake/app4triqs-config.cmake.in @@ -15,7 +15,13 @@ set(@PROJECT_NAME@_GIT_HASH @PROJECT_GIT_HASH@ CACHE STRING "@PROJECT_NAME@ git set(@PROJECT_NAME@_ROOT @CMAKE_INSTALL_PREFIX@ CACHE STRING "@PROJECT_NAME@ root directory") ## Find the target dependencies -#find_package(... REQUIRED HINTS @CMAKE_INSTALL_PREFIX@) +#function(find_dep) +# get_property(${ARGV0}_FOUND GLOBAL PROPERTY ${ARGV0}_FOUND) +# if(NOT ${ARGV0}_FOUND) +# find_package(${ARGN} REQUIRED HINTS @CMAKE_INSTALL_PREFIX@) +# endif() +#endfunction() +#find_dep(depname 1.0) # Include the exported targets of this project include(@CMAKE_INSTALL_PREFIX@/lib/cmake/@PROJECT_NAME@/@PROJECT_NAME@-targets.cmake) diff --git a/share/cmake/extract_flags.cmake b/share/cmake/extract_flags.cmake index e00ee628..ed5b6c1f 100644 --- a/share/cmake/extract_flags.cmake +++ b/share/cmake/extract_flags.cmake @@ -1,24 +1,18 @@ -################################################################################### +# Copyright (c) 2019-2020 Simons Foundation # -# TRIQS: a Toolbox for Research in Interacting Quantum Systems +# This program 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. # -# Copyright (C) 2019-2020 Simons Foundation -# author: N. Wentzell +# This program 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. # -# TRIQS 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. -# -# TRIQS 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 -# TRIQS. If not, see . -# -################################################################################### +# You may obtain a copy of the License at +# https://www.gnu.org/licenses/gpl-3.0.txt + # Recursively fetch all targets that the interface of a target depends upon macro(get_all_interface_targets name target) From 23568264b576b763aa465a9ad8dcdce0a851976c Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Thu, 6 Aug 2020 15:07:35 -0400 Subject: [PATCH 16/17] Replace travis.yml by github workflow --- .github/workflows/build.yml | 89 +++++++++++++++++++++++++++++++++++++ .travis.yml | 34 -------------- 2 files changed, 89 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..8f1ad4a5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,89 @@ +name: build + +on: + push: + branches: [ unstable ] + pull_request: + branches: [ unstable ] + +jobs: + build: + + strategy: + matrix: + include: + - {os: ubuntu-20.04, cc: gcc-10, cxx: g++-10} + - {os: ubuntu-20.04, cc: clang-10, cxx: clang++-10} + - {os: macos-10.15, cc: gcc-10, cxx: g++-10} + - {os: macos-10.15, cc: /usr/local/opt/llvm/bin/clang, cxx: /usr/local/opt/llvm/bin/clang++} + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v2 + + - name: Install ubuntu dependencies + if: matrix.os == 'ubuntu-20.04' + run: > + sudo apt-get install + clang-10 + g++-10 + gfortran + hdf5-tools + libblas-dev + libboost-dev + libclang-10-dev + libc++-10-dev + libc++abi-10-dev + libfftw3-dev + libgfortran4 + libgmp-dev + libhdf5-dev + liblapack-dev + libopenmpi-dev + openmpi-bin + openmpi-common + openmpi-doc + python3-clang-10 + python3-dev + python3-mako + python3-matplotlib + python3-mpi4py + python3-numpy + python3-pip + python3-scipy + python3-sphinx + python3-nbsphinx + + - name: Install homebrew dependencies + if: matrix.os == 'macos-10.15' + run: | + brew install gcc@10 llvm@10 boost fftw hdf5 open-mpi openblas numpy scipy mpi4py + pip3 install mako + pip3 install -r requirements.txt + + - name: Build & Install TRIQS + env: + CC: ${{ matrix.cc }} + CXX: ${{ matrix.cxx }} + run: | + git clone https://github.com/TRIQS/triqs --branch unstable + mkdir triqs/build && cd triqs/build + cmake .. -DBuild_Tests=OFF -DCMAKE_INSTALL_PREFIX=$HOME/install + make -j1 install VERBOSE=1 + cd ../ + + - name: Build app4triqs + env: + CC: ${{ matrix.cc }} + CXX: ${{ matrix.cxx }} + run: | + source $HOME/install/share/triqsvars.sh + mkdir build && cmake -B build + cmake --build build -j2 + + - name: Test app4triqs + run: | + source $HOME/install/share/triqsvars.sh + cd build + ctest -j2 --output-on-failure diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7e3b6f87..00000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ - -language: cpp -sudo: required -dist: bionic - -compiler: - - gcc - - clang - -before_install: - - sudo apt-get update - - sudo apt-get install -y --allow-unauthenticated libblas-dev libboost-all-dev libfftw3-dev libgfortran3 libhdf5-serial-dev libgmp-dev liblapack-dev libopenmpi-dev libclang-dev python-clang-6.0 python-dev python-h5py python-mako python-matplotlib python-mpi4py python-numpy python-scipy python-sphinx libjs-mathjax libnfft3-dev - -install: true - -script: - - export INSTALL_DIR=$HOME/root_install # We install outside the repository - # ===== Set up TRIQS - - cd $TRAVIS_BUILD_DIR - - git clone https://github.com/TRIQS/triqs --branch unstable - - mkdir triqs/build && cd triqs/build - - cmake .. -DBuild_Tests=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR - - make -j2 install - - source $INSTALL_DIR/share/triqsvars.sh - # ===== Set up app4triqs and test - - cd $TRAVIS_BUILD_DIR - - mkdir build && cd build - - cmake .. -DASAN=ON -DUBSAN=ON - - export UBSAN_SYMBOLIZER_PATH=$(which llvm-symbolizer) - - export ASAN_SYMBOLIZER_PATH=$(which llvm-symbolizer) - - export UBSAN_OPTIONS=symbolize=1:print_stacktrace=1 - - export ASAN_OPTIONS=symbolize=1:detect_leaks=0 - - export CTEST_OUTPUT_ON_FAILURE=1 - - make -j2 && make test From e31cbd0f766749ef7ed6bbd3963376ccf80bb9c2 Mon Sep 17 00:00:00 2001 From: Nils Wentzell Date: Sat, 8 Aug 2020 15:24:13 -0400 Subject: [PATCH 17/17] [doc] Update status badge for GH Actions --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 67c9f481..52e2c0b4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/TRIQS/app4triqs.svg?branch=unstable)](https://travis-ci.org/TRIQS/app4triqs) +[![build](https://github.com/TRIQS/app4triqs/workflows/build/badge.svg)](https://github.com/TRIQS/app4triqs/actions?query=workflow%3Abuild) # app4triqs - A skeleton for a TRIQS application