From 9c683815ac4e6c87a720f77ceb1c453948b00a06 Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Thu, 24 Mar 2022 15:04:59 -0500 Subject: [PATCH 1/5] moved faddeeva from vendored to external --- {vendor/faddeeva => include/openmc/external}/Faddeeva.hh | 0 {vendor/faddeeva => src/external}/Faddeeva.cc | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename {vendor/faddeeva => include/openmc/external}/Faddeeva.hh (100%) rename {vendor/faddeeva => src/external}/Faddeeva.cc (99%) diff --git a/vendor/faddeeva/Faddeeva.hh b/include/openmc/external/Faddeeva.hh similarity index 100% rename from vendor/faddeeva/Faddeeva.hh rename to include/openmc/external/Faddeeva.hh diff --git a/vendor/faddeeva/Faddeeva.cc b/src/external/Faddeeva.cc similarity index 99% rename from vendor/faddeeva/Faddeeva.cc rename to src/external/Faddeeva.cc index 80e42228c1..6a7051e249 100644 --- a/vendor/faddeeva/Faddeeva.cc +++ b/src/external/Faddeeva.cc @@ -157,7 +157,7 @@ #ifdef __cplusplus -# include "Faddeeva.hh" +# include "openmc/external/Faddeeva.hh" # include # include From 39a4daa20b8a86f5d3a3ab426e7a2fea186232c9 Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Thu, 24 Mar 2022 15:07:12 -0500 Subject: [PATCH 2/5] don't compile faddeeva separately --- CMakeLists.txt | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ba8a79efa5..aa44990435 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -258,18 +258,6 @@ if("${isSystemDir}" STREQUAL "-1") set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}") endif() -#=============================================================================== -# faddeeva library -#=============================================================================== - -add_library(faddeeva STATIC vendor/faddeeva/Faddeeva.cc) -target_include_directories(faddeeva - PUBLIC - $ - $ -) -target_compile_options(faddeeva PRIVATE ${cxxflags}) - #=============================================================================== # libopenmc #=============================================================================== @@ -372,7 +360,8 @@ list(APPEND libopenmc_SOURCES # Add bundled external dependencies list(APPEND libopenmc_SOURCES - src/external/quartic_solver.cpp) + src/external/quartic_solver.cpp + src/external/Faddeeva.cc) # For Visual Studio compilers if(MSVC) @@ -426,7 +415,7 @@ endif() # target_link_libraries treats any arguments starting with - but not -l as # linker flags. Thus, we can pass both linker flags and libraries together. target_link_libraries(libopenmc ${ldflags} ${HDF5_LIBRARIES} ${HDF5_HL_LIBRARIES} - faddeeva xtensor gsl::gsl-lite-v1 fmt::fmt) + xtensor gsl::gsl-lite-v1 fmt::fmt) if(TARGET pugixml::pugixml) target_link_libraries(libopenmc pugixml::pugixml) @@ -460,7 +449,7 @@ target_link_libraries(openmc libopenmc) # Ensure C++14 standard is used. Starting with CMake 3.8, another way this could # be done is using the cxx_std_14 compiler feature. set_target_properties( - openmc libopenmc faddeeva + openmc libopenmc PROPERTIES CXX_STANDARD 14 CXX_EXTENSIONS OFF) #=============================================================================== @@ -481,7 +470,7 @@ configure_file(cmake/OpenMCConfig.cmake.in "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIR configure_file(cmake/OpenMCConfigVersion.cmake.in "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OpenMCConfigVersion.cmake" @ONLY) set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/OpenMC) -install(TARGETS openmc libopenmc faddeeva +install(TARGETS openmc libopenmc EXPORT openmc-targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -501,7 +490,3 @@ install(FILES man/man1/openmc.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) install(FILES LICENSE DESTINATION "${CMAKE_INSTALL_DOCDIR}" RENAME copyright) install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(FILES "${CMAKE_BINARY_DIR}/include/openmc/version.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/openmc) - -# Copy headers for vendored dependencies (note that all except faddeeva are handled -# separately since they are managed by CMake) -install(DIRECTORY vendor/faddeeva DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) From 7050b825efbde31fa37bab49437b0351b8165271 Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Thu, 24 Mar 2022 15:08:32 -0500 Subject: [PATCH 3/5] updated fadeeva header location --- src/math_functions.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/math_functions.cpp b/src/math_functions.cpp index 32228bcdd5..ba1c6c3db1 100644 --- a/src/math_functions.cpp +++ b/src/math_functions.cpp @@ -1,6 +1,6 @@ #include "openmc/math_functions.h" -#include "Faddeeva.hh" +#include "openmc/external/Faddeeva.hh" #include "openmc/constants.h" #include "openmc/random_lcg.h" From 1e6b953b4822e23572d9e92d33121b314ac890f6 Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Fri, 25 Mar 2022 11:49:56 -0500 Subject: [PATCH 4/5] recursive include cc and hh files --- MANIFEST.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST.in b/MANIFEST.in index c2789a152e..d596283251 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -23,9 +23,11 @@ recursive-include examples *.cpp recursive-include examples *.py recursive-include examples *.xml recursive-include include *.h +recursive-include include *.hh recursive-include man *.1 recursive-include openmc *.pyx recursive-include openmc *.c +recursive-include src *.cc recursive-include src *.cpp recursive-include src *.rnc recursive-include src *.rng From f0683a616c5e66db3eceb6f0bb8e4e52de3297d5 Mon Sep 17 00:00:00 2001 From: Kalin Kiesling Date: Fri, 25 Mar 2022 11:50:20 -0500 Subject: [PATCH 5/5] exclude external files from coverage --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e65e630b15..050c8e287b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,7 +120,7 @@ jobs: - name: after_success shell: bash run: | - cpp-coveralls -i src -i include --exclude-pattern "/usr/*" --dump cpp_cov.json + cpp-coveralls -i src -i include -e src/external --exclude-pattern "/usr/*" --dump cpp_cov.json coveralls --merge=cpp_cov.json --service=github finish: