From 84d6f4fd6d82ab9efe4997b8c6824b63e8cca4ea Mon Sep 17 00:00:00 2001 From: Jeremy Lloyd Conlin Date: Mon, 14 Dec 2020 09:52:05 -0700 Subject: [PATCH] Bugfix release v1.2.1 (#126) * Create ContinuousIntegration.yml (#124) * Adding GCC pragma back in to make GCC compile in release mode. * Fixes to issues #106 and #116. * ContinuousIntegration make is now verbose (sorry). * Fixing up some command-line flags. * Removing signature command-line option. This addresses issue #125. * Put command line option in wrong place. * Adding catch-adapter to target_link_libraries of select tests. * Adding catch-adapter to njoy21 library * Changing to g++-8 (#135) * Update installation hyperlink in readme (#134) * Updating ReleaseNotes. Co-authored-by: Nick Touran --- .github/workflows/ContinuousIntegration.yml | 42 +++++++++++++++++++ .gitignore | 2 +- CMakeLists.txt | 6 +-- README.md | 3 +- ReleaseNotes.md | 3 ++ cmake/develop_dependencies.cmake | 6 +++ src/njoy21.hpp | 5 ++- src/njoy21/CommandLine.hpp | 1 - src/njoy21/CommandLine/src/ctor.hpp | 6 --- src/njoy21/CommandLine/test/CMakeLists.txt | 2 +- .../CommandLine/test/CommandLine.test.cpp | 1 - .../Driver/Factory/src/setupManager.hpp | 4 -- src/njoy21/Driver/test/CMakeLists.txt | 2 +- src/njoy21/Signature.hpp.in | 6 --- src/njoy21/io/Manager/test/CMakeLists.txt | 3 +- .../legacy/Sequence/test/CMakeLists.txt | 3 +- 16 files changed, 66 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/ContinuousIntegration.yml delete mode 100644 src/njoy21/Signature.hpp.in diff --git a/.github/workflows/ContinuousIntegration.yml b/.github/workflows/ContinuousIntegration.yml new file mode 100644 index 00000000..6a8257b5 --- /dev/null +++ b/.github/workflows/ContinuousIntegration.yml @@ -0,0 +1,42 @@ +# GitHub workflow to enable continuous integration +name: Continuous Integration + +# This workflow is triggered on pushes and pull requests to the repository. +on: + push: + branches: '**' + pull_request: + branches: 'master' + +jobs: + build: + runs-on: ${{matrix.os}} + strategy: + matrix: + os: [ ubuntu-18.04, macos-10.15 ] + cxx: [ g++-8, clang++ ] + vFortran: [ gfortran-8 ] + build_type: [ Debug, Release ] + + steps: + - name: which CXX + run: | + which ${{matrix.cxx}} + ${{matrix.cxx}} --version + - name: which gfortran + run: | + which ${{matrix.vFortran}} + ${{matrix.vFortran}} --version + - uses: actions/checkout@v2 + - name: mkdir bin + run: mkdir bin + - name: cmake + run: cmake -D CMAKE_Fortran_COMPILER=`which ${{matrix.vFortran}}` -D CMAKE_CXX_COMPILER=`which ${{matrix.cxx}}` -D CMAKE_BUILD_TYPE=${{matrix.build_type}} .. + working-directory: ./bin + - name: make + run: make -j2 VERBOSE=1 + working-directory: ./bin + - name: ctest + run: ctest -j2 -R njoy21* + working-directory: ./bin + diff --git a/.gitignore b/.gitignore index 060d1acd..9abcb000 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ subprojects -bin +bin* build __pycache__ *.pyc diff --git a/CMakeLists.txt b/CMakeLists.txt index 2cab2ae9..c5493749 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ option( strict_compile # Compile flags set( common_flags "-Wall" "-Wextra" "-Wpedantic" ) -set( strict_flags "-Werror" ) +set( strict_flags "-Werror" "-Wno-unknown-warning-option" ) set( release_flags "-O3" ) set( debug_flags "-O0" "-g" ) @@ -52,9 +52,6 @@ endif() # Project targets ######################################################################## -configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/src/njoy21/Signature.hpp.in" - "${CMAKE_CURRENT_BINARY_DIR}/src/njoy21/Signature.hpp" @ONLY ) - add_library( njoy21_library INTERFACE ) target_include_directories( njoy21_library @@ -68,6 +65,7 @@ target_link_libraries( njoy21_library INTERFACE njoy_c_bindings INTERFACE tclap-adapter INTERFACE utility + INTERFACE catch-adapter ) ####################################################################### diff --git a/README.md b/README.md index 774c9da1..ec4c8176 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,8 @@ NJOY21 is primarily written in modern C++. It consists of many subprojects that Please refer to the [Release Notes](ReleaseNotes.md) to see what has changed from one version to the next. ## Installation -Instructions for building and installing NJOY21---as well as any of the subprojects---are found on our [website](https://docs.github.io/install.html). +Instructions for building and installing NJOY21---as well as any of the subprojects---are +found on our [website](https://docs.njoy21.io/install.html). ## Version To see the version number for NJOY21, simply execute (after building): diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 19773410..26bbe464 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,6 +1,9 @@ # Release Notes—NJOY21 Given here are some release notes for NJOY21. Each release is made through a formal [Pull Request](https://github.com/njoy/NJOY21/pulls) made on GitHub. There are links in this document that point to each of those Pull Requests, where you can see in great details the changes that were made. Often the Pull Requests are made in response to an [issue](https://github.com/njoy/NJOY21/issues). In such cases, links to those issues are also given. +## [NJOY21 1.2.1](https://github.com/njoy/NJOY21/pull/126) +This update removes the `--signature` command-line option as that was a feature of the previous build system. This also updates the GitHub Actions such that they now test all of the NJOY21 stuff, but not the integration tests. + ## [NJOY21 1.2.0](https://github.com/njoy/NJOY21/pull/122) This update makes significant changes to the build system. Instead of using a [homegrown](https://github.com/njoy/metaconfigure) method for handling dependencies, we now use the [`FetchContent`](https://cmake.org/cmake/help/v3.16/module/FetchContent.html) capabilities in CMake. We now require CMake 3.16 to configure and build NJOY21. diff --git a/cmake/develop_dependencies.cmake b/cmake/develop_dependencies.cmake index 84a18968..6b57356f 100644 --- a/cmake/develop_dependencies.cmake +++ b/cmake/develop_dependencies.cmake @@ -35,6 +35,12 @@ FetchContent_Declare( tclap-adapter GIT_SHALLOW TRUE ) +FetchContent_Declare( catch-adapter + GIT_REPOSITORY https://github.com/njoy/catch-adapter + GIT_TAG origin/master + GIT_SHALLOW TRUE + ) + FetchContent_Declare( utility GIT_REPOSITORY https://github.com/njoy/utility GIT_TAG origin/master diff --git a/src/njoy21.hpp b/src/njoy21.hpp index 780dc29e..73aff0ed 100644 --- a/src/njoy21.hpp +++ b/src/njoy21.hpp @@ -18,7 +18,11 @@ #include "Log.hpp" #include "utility.hpp" + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #include "lipservice.hpp" +#pragma GCC diagnostic pop #include "njoy_c.h" @@ -37,7 +41,6 @@ struct CommandLine; #include "njoy21/interface.hpp" #include "njoy21/legacy.hpp" #include "njoy21/Version.hpp" -#include "njoy21/Signature.hpp" } } diff --git a/src/njoy21/CommandLine.hpp b/src/njoy21/CommandLine.hpp index 8d923e37..7d90b734 100644 --- a/src/njoy21/CommandLine.hpp +++ b/src/njoy21/CommandLine.hpp @@ -16,7 +16,6 @@ struct njoy::njoy21::CommandLine { std::optional< std::string > errorPath; bool legacySwitch; bool verifyOnly; - bool signature; /* methods */ #include "njoy21/CommandLine/src/ctor.hpp" diff --git a/src/njoy21/CommandLine/src/ctor.hpp b/src/njoy21/CommandLine/src/ctor.hpp index cef6d35e..14ca793d 100644 --- a/src/njoy21/CommandLine/src/ctor.hpp +++ b/src/njoy21/CommandLine/src/ctor.hpp @@ -18,11 +18,6 @@ CommandLine( int argc, char* argv[] ){ "path to file where NJOY21 error ought to be directed. (defaults to standard error)", false, std::optional< std::string >(), " error path", cmd ); - TCLAP::SwitchArg - signature( "", "signature", - "Write signature to standard output", - cmd ); - TCLAP::SwitchArg legacySwitch( "L", "legacy", "Call to Fortran routines even if C++ routines are available", cmd ); @@ -43,6 +38,5 @@ CommandLine( int argc, char* argv[] ){ this->errorPath = errorPath.getValue(); this->legacySwitch = legacySwitch.getValue(); this->verifyOnly = verifyOnly.getValue(); - this->signature = signature.getValue(); } diff --git a/src/njoy21/CommandLine/test/CMakeLists.txt b/src/njoy21/CommandLine/test/CMakeLists.txt index d4fea951..bd3cc455 100644 --- a/src/njoy21/CommandLine/test/CMakeLists.txt +++ b/src/njoy21/CommandLine/test/CMakeLists.txt @@ -10,5 +10,5 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${njoy21_appended_flags} ) -target_link_libraries( njoy21.CommandLine.test PUBLIC njoy21_library ) +target_link_libraries( njoy21.CommandLine.test PUBLIC njoy21_library catch-adapter ) add_test( NAME njoy21.CommandLine COMMAND njoy21.CommandLine.test ) diff --git a/src/njoy21/CommandLine/test/CommandLine.test.cpp b/src/njoy21/CommandLine/test/CommandLine.test.cpp index cfe6a8d2..0fbb83d4 100644 --- a/src/njoy21/CommandLine/test/CommandLine.test.cpp +++ b/src/njoy21/CommandLine/test/CommandLine.test.cpp @@ -20,7 +20,6 @@ SCENARIO( "Parsing a command-line interface for options and flags" ){ REQUIRE( not CL.outputPath ); REQUIRE( not CL.legacySwitch ); REQUIRE( not CL.verifyOnly ); - REQUIRE( not CL.signature ); } GIVEN( "An instance of the Commandline with an input path" ){ std::vector< std::string > arguments = { "njoy21", "--input", "/my/path" }; diff --git a/src/njoy21/Driver/Factory/src/setupManager.hpp b/src/njoy21/Driver/Factory/src/setupManager.hpp index e67c2144..205c1d14 100644 --- a/src/njoy21/Driver/Factory/src/setupManager.hpp +++ b/src/njoy21/Driver/Factory/src/setupManager.hpp @@ -1,9 +1,5 @@ static io::Manager setupManager( CommandLine& commandLine ){ io::Manager::Builder builder; - if( commandLine.signature ){ - std::cout << Signature::signature() << std::endl; - std::exit( 0 ); - } if ( commandLine.inputPath ){ builder.input( *(commandLine.inputPath) ); diff --git a/src/njoy21/Driver/test/CMakeLists.txt b/src/njoy21/Driver/test/CMakeLists.txt index 86bc2c43..5662475b 100644 --- a/src/njoy21/Driver/test/CMakeLists.txt +++ b/src/njoy21/Driver/test/CMakeLists.txt @@ -10,7 +10,7 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${njoy21_appended_flags} ) -target_link_libraries( njoy21.Driver.test PUBLIC njoy21_library ) +target_link_libraries( njoy21.Driver.test PUBLIC njoy21_library catch-adapter ) file( GLOB resources "resources/*" ) foreach( resource ${resources}) file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) diff --git a/src/njoy21/Signature.hpp.in b/src/njoy21/Signature.hpp.in deleted file mode 100644 index 98dc0e9c..00000000 --- a/src/njoy21/Signature.hpp.in +++ /dev/null @@ -1,6 +0,0 @@ -class Signature{ -public: - static const std::string signature(){ - return R"signature( @SIGNATURE@ )signature"; - } -}; diff --git a/src/njoy21/io/Manager/test/CMakeLists.txt b/src/njoy21/io/Manager/test/CMakeLists.txt index 97fd33e2..cf380677 100644 --- a/src/njoy21/io/Manager/test/CMakeLists.txt +++ b/src/njoy21/io/Manager/test/CMakeLists.txt @@ -10,7 +10,8 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${njoy21_appended_flags} ) -target_link_libraries( njoy21.io.Manager.test PUBLIC njoy21_library ) +target_link_libraries( njoy21.io.Manager.test PUBLIC njoy21_library + catch-adapter ) file( GLOB resources "resources/*" ) foreach( resource ${resources}) file( COPY "${resource}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}" ) diff --git a/src/njoy21/legacy/Sequence/test/CMakeLists.txt b/src/njoy21/legacy/Sequence/test/CMakeLists.txt index 29f7387d..98167840 100644 --- a/src/njoy21/legacy/Sequence/test/CMakeLists.txt +++ b/src/njoy21/legacy/Sequence/test/CMakeLists.txt @@ -10,5 +10,6 @@ $<$:${${PREFIX}_link_time_optimization_flags}> $<$:${${PREFIX}_nonportable_optimization_flags}>> ${CXX_appended_flags} ${njoy21_appended_flags} ) -target_link_libraries( njoy21.legacy.Sequence.test PUBLIC njoy21_library ) +target_link_libraries( njoy21.legacy.Sequence.test PUBLIC njoy21_library + catch-adapter ) add_test( NAME njoy21.legacy.Sequence COMMAND njoy21.legacy.Sequence.test )