diff --git a/.clang-format b/.clang-format
index e9ab196..997b526 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,23 +1,7 @@
-# This file is part of preseq
-#
-# Copyright (C) 2024: Andrew D. Smith
-#
-# Authors: Andrew D. Smith
-#
-# This 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.
-#
-# This software 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.
-
BasedOnStyle: LLVM
ColumnLimit: 80
IndentWidth: 2
-AlwaysBreakAfterReturnType: TopLevel
+AlwaysBreakAfterReturnType: All
ContinuationIndentWidth: 2
ConstructorInitializerIndentWidth: 2
BraceWrapping:
@@ -26,3 +10,4 @@ BraceWrapping:
BreakBeforeBraces: Custom
BreakConstructorInitializers: AfterColon
SpacesBeforeTrailingComments: 2
+ReflowComments: false
diff --git a/.clang-format-ignore b/.clang-format-ignore
new file mode 100644
index 0000000..de5042e
--- /dev/null
+++ b/.clang-format-ignore
@@ -0,0 +1,2 @@
+src/CLI11/CLI11.hpp
+src/nlohmann/json.hpp
diff --git a/.clang-tidy b/.clang-tidy
new file mode 100644
index 0000000..fd5b64e
--- /dev/null
+++ b/.clang-tidy
@@ -0,0 +1,31 @@
+Checks: 'cert-*,cppcoreguidelines-*,performance-*,clang-diagnostic-*,clang-analyzer-*,-clang-diagnostic-unqualified-std-cast-call,-clang-diagnostic-unknown-warning-option,-clang-analyzer-unix.BlockInCriticalSection,-cppcoreguidelines-pro-type-vararg'
+WarningsAsErrors: '*'
+HeaderFileExtensions:
+ - ''
+ - h
+ - hh
+ - hpp
+ - hxx
+ImplementationFileExtensions:
+ - c
+ - cc
+ - cpp
+ - cxx
+HeaderFilterRegex: ''
+ExcludeHeaderFilterRegex: 'OptionParser.hpp'
+FormatStyle: none
+CheckOptions:
+ cert-dcl16-c.NewSuffixes: 'L;LL;LU;LLU'
+ cert-err33-c.AllowCastToVoid: 'true'
+ cert-err33-c.CheckedFunctions: '::aligned_alloc;::asctime_s;::at_quick_exit;::atexit;::bsearch;::bsearch_s;::btowc;::c16rtomb;::c32rtomb;::calloc;::clock;::cnd_broadcast;::cnd_init;::cnd_signal;::cnd_timedwait;::cnd_wait;::ctime_s;::fclose;::fflush;::fgetc;::fgetpos;::fgets;::fgetwc;::fopen;::fopen_s;::fprintf;::fprintf_s;::fputc;::fputs;::fputwc;::fputws;::fread;::freopen;::freopen_s;::fscanf;::fscanf_s;::fseek;::fsetpos;::ftell;::fwprintf;::fwprintf_s;::fwrite;::fwscanf;::fwscanf_s;::getc;::getchar;::getenv;::getenv_s;::gets_s;::getwc;::getwchar;::gmtime;::gmtime_s;::localtime;::localtime_s;::malloc;::mbrtoc16;::mbrtoc32;::mbsrtowcs;::mbsrtowcs_s;::mbstowcs;::mbstowcs_s;::memchr;::mktime;::mtx_init;::mtx_lock;::mtx_timedlock;::mtx_trylock;::mtx_unlock;::printf_s;::putc;::putwc;::raise;::realloc;::remove;::rename;::scanf;::scanf_s;::setlocale;::setvbuf;::signal;::snprintf;::snprintf_s;::sprintf;::sprintf_s;::sscanf;::sscanf_s;::strchr;::strerror_s;::strftime;::strpbrk;::strrchr;::strstr;::strtod;::strtof;::strtoimax;::strtok;::strtok_s;::strtol;::strtold;::strtoll;::strtoul;::strtoull;::strtoumax;::strxfrm;::swprintf;::swprintf_s;::swscanf;::swscanf_s;::thrd_create;::thrd_detach;::thrd_join;::thrd_sleep;::time;::timespec_get;::tmpfile;::tmpfile_s;::tmpnam;::tmpnam_s;::tss_create;::tss_get;::tss_set;::ungetc;::ungetwc;::vfprintf;::vfprintf_s;::vfscanf;::vfscanf_s;::vfwprintf;::vfwprintf_s;::vfwscanf;::vfwscanf_s;::vprintf_s;::vscanf;::vscanf_s;::vsnprintf;::vsnprintf_s;::vsprintf;::vsprintf_s;::vsscanf;::vsscanf_s;::vswprintf;::vswprintf_s;::vswscanf;::vswscanf_s;::vwprintf_s;::vwscanf;::vwscanf_s;::wcrtomb;::wcschr;::wcsftime;::wcspbrk;::wcsrchr;::wcsrtombs;::wcsrtombs_s;::wcsstr;::wcstod;::wcstof;::wcstoimax;::wcstok;::wcstok_s;::wcstol;::wcstold;::wcstoll;::wcstombs;::wcstombs_s;::wcstoul;::wcstoull;::wcstoumax;::wcsxfrm;::wctob;::wctrans;::wctype;::wmemchr;::wprintf_s;::wscanf;::wscanf_s;'
+ cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField: 'false'
+ cert-str34-c.DiagnoseSignedUnsignedCharComparisons: 'false'
+ cppcoreguidelines-non-private-member-variables-in-classes.IgnorePublicMemberVariables: 'true'
+ google-readability-braces-around-statements.ShortStatementLines: '1'
+ google-readability-function-size.StatementThreshold: '800'
+ google-readability-namespace-comments.ShortNamespaceLines: '10'
+ google-readability-namespace-comments.SpacesBeforeComments: '2'
+ llvm-else-after-return.WarnOnConditionVariables: 'false'
+ llvm-else-after-return.WarnOnUnfixable: 'false'
+ llvm-qualified-auto.AddConstToQualified: 'false'
+SystemHeaders: 'false'
diff --git a/.cppcheck_suppress b/.cppcheck_suppress
index 45e2b9e..aae5583 100644
--- a/.cppcheck_suppress
+++ b/.cppcheck_suppress
@@ -1,6 +1,6 @@
# This file is part of preseq
#
-# Copyright (C) 2024: Andrew D. Smith
+# Copyright (C) 2024-2025 Andrew D. Smith
#
# Authors: Andrew D. Smith
#
@@ -17,7 +17,18 @@
missingIncludeSystem
constVariablePointer
checkersReport
-unusedFunction:src/bam_record_utils.hpp
-unusedFunction:src/bam_record_utils.cpp
-*:src/smithlab_cpp*
-unusedStructMember:src/*.hpp
+unknownMacro
+unmatchedSuppression
+# Ignore unused function because it's too hard to get right
+unusedFunction
+# Ignore unused struct member because this won't go unnoticed anyway
+unusedStructMember
+# Ignore missing includes because if they are real things won't build
+missingInclude
+# Exclude external files
+*:*CLI11.hpp
+*:*json.hpp
+# Problem caused by external files
+toomanyconfigs
+# More problems caused by external files -- with too many ifdefs
+normalCheckLevelMaxBranches
diff --git a/.gitmodules b/.gitmodules
index 0b7b9ae..128a3ce 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,9 +1,6 @@
[submodule "preseqR"]
path = preseqR
url = ../preseqR.git
-[submodule "src/smithlab_cpp"]
- path = src/smithlab_cpp
- url = ../smithlab_cpp.git
[submodule "src/bamxx"]
path = src/bamxx
url = ../bamxx.git
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..1efda34
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,55 @@
+# Copyright (C) 2025 Andrew D Smith
+#
+# 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.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see .
+
+# to find the version of cmake do
+# $ cmake --version
+cmake_minimum_required(VERSION 3.30)
+project(
+ preseq
+ VERSION 3.2.0
+ DESCRIPTION
+ "predict properties of genomic sequencing libraries"
+ HOMEPAGE_URL https://github.com/smithlabcode/preseq
+ LANGUAGES CXX)
+
+# Set language version used
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED yes)
+set(CMAKE_CXX_EXTENSIONS off) # prevents std=gnu++17
+set(CMAKE_EXPORT_COMPILE_COMMANDS on)
+
+include(CheckIncludeFileCXX)
+include(CheckFunctionExists)
+include(CheckCXXCompilerFlag)
+
+include(GNUInstallDirs)
+
+configure_file(data/config.h.in config.h)
+
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+
+add_compile_options(
+ -Wall
+ -Wextra
+ -Wpedantic
+ -Werror
+ -Wfatal-errors
+)
+
+if(STATIC_ANALYSIS)
+ include(cmake/static_analysis.cmake)
+endif()
+
+add_subdirectory(src)
diff --git a/CPPLINT.cfg b/CPPLINT.cfg
index 52bd4ce..51ed1b8 100644
--- a/CPPLINT.cfg
+++ b/CPPLINT.cfg
@@ -1,19 +1,16 @@
# This file is part of preseq
#
-# Copyright (C) 2024: Andrew D. Smith
+# Copyright (C) 2023-2025 Andrew D. Smith
#
-# Authors: Andrew D. Smith
+# This 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.
#
-# This 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.
-#
-# This software 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.
-
+# This software 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.
set noparent
filter=-runtime/references
filter=-build/include_subdir
@@ -26,3 +23,6 @@ filter=-whitespace/newline
filter=-readability/braces
filter=-whitespace/semicolon
filter=-whitespace/indent
+filter=-whitespace/braces
+filter=-whitespace/parens
+filter=-readability/nolint
diff --git a/Makefile b/Makefile
deleted file mode 100644
index a92b07a..0000000
--- a/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (C) 2011-2020 University of Southern California and
-# Andrew D. Smith and Timothy Daley
-#
-# Authors: Timothy Daley and Andrew D. Smith
-#
-# 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.
-#
-# 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.
-
-ifndef install_dir
-install_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
-endif
-
-all:
- @make -C src
-
-install:
- @make -C src install_dir=$(install_dir) install
-
-clean:
- @make -C src clean
-
-distclean: clean
- @rm -rf $(install_dir)/bin
-
-.PHONY: all distclean clean install
diff --git a/Makefile.am b/Makefile.am
index 04f3747..33b397d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,30 +1,28 @@
# This file is part of preseq
#
-# Copyright (C) 2018-2024: Andrew D. Smith
+# Copyright (C) 2018-2025: Andrew D. Smith
#
# Authors: Andrew D. Smith
#
-# This 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.
+# This 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.
#
-# This software 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.
+# This software 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.
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS := src/smithlab_cpp
-install installdirs: SUBDIRS := $(filter-out src/smithlab_cpp, $(SUBDIRS))
-AM_CPPFLAGS = -I $(top_srcdir)/src/smithlab_cpp
-if ENABLE_HTS
+AM_CPPFLAGS =
+if ENABLE_HTSLIB
AM_CPPFLAGS += -I $(top_srcdir)/src/bamxx
endif
AM_CPPFLAGS += -Wall -Wextra -Wpedantic -Wno-unknown-attributes
-if ENABLE_HTS
+if ENABLE_HTSLIB
AM_CPPFLAGS += -DHAVE_HTSLIB
endif
@@ -36,7 +34,7 @@ EXTRA_DIST = \
docs \
tests/md5sum.txt \
tests/data/lc_extrap_input.vals \
- tests/data/gc_extrap_input.mr \
+ tests/data/gc_extrap_input.bed \
tests/data/c_curve_input.hist \
tests/scripts/test_c_curve.test \
tests/scripts/test_gc_extrap.test \
@@ -49,8 +47,6 @@ TESTS = \
TEST_EXTENSIONS = .test
-LDADD = src/smithlab_cpp/libsmithlab_cpp.a
-
bin_PROGRAMS = preseq
preseq_SOURCES = \
@@ -71,10 +67,12 @@ preseq_SOURCES = \
src/continued_fraction.cpp \
src/load_data_for_complexity.hpp \
src/load_data_for_complexity.cpp \
+ src/Interval6.hpp \
+ src/Interval6.cpp \
src/moment_sequence.hpp \
src/moment_sequence.cpp
-if ENABLE_HTS
+if ENABLE_HTSLIB
preseq_SOURCES += \
src/bamxx/bamxx.hpp \
src/bam_record_utils.hpp \
diff --git a/cmake/FindHTSLIB.cmake b/cmake/FindHTSLIB.cmake
new file mode 100644
index 0000000..fcd85ea
--- /dev/null
+++ b/cmake/FindHTSLIB.cmake
@@ -0,0 +1,182 @@
+# SPDX-License-Identifier: GPL-3.0-or-later; (c) 2025 Andrew D Smith (author)
+#[=======================================================================[.rst:
+FindHTSLIB
+--------
+
+Find the native HTSLib includes and library. Based on the ZLIB module.
+
+#]=======================================================================]
+
+cmake_policy(PUSH)
+cmake_policy(SET CMP0159 NEW) # file(STRINGS) with REGEX updates CMAKE_MATCH_
+
+if(HTSLIB_FIND_COMPONENTS AND NOT HTSLIB_FIND_QUIETLY)
+ message(AUTHOR_WARNING
+ "HTSLib does not provide any COMPONENTS. Calling\n"
+ " find_package(HTSLIB COMPONENTS ...)\n"
+ "will always fail."
+ )
+endif()
+
+set(_HTSLIB_SEARCHES)
+
+# Search HTSLIB_ROOT first if it is set.
+if(HTSLIB_ROOT)
+ set(_HTSLIB_SEARCH_ROOT PATHS ${HTSLIB_ROOT} NO_DEFAULT_PATH)
+ list(APPEND _HTSLIB_SEARCHES _HTSLIB_SEARCH_ROOT)
+endif()
+
+# Normal search.
+# Windows stuff
+set(_HTSLIB_x86 "(x86)")
+set(_HTSLIB_SEARCH_NORMAL
+ PATHS "$ENV{ProgramFiles}/htslib"
+ "$ENV{ProgramFiles${_HTSLIB_x86}}/htslib")
+unset(_HTSLIB_x86)
+list(APPEND _HTSLIB_SEARCHES _HTSLIB_SEARCH_NORMAL)
+
+if(HTSLIB_USE_STATIC_LIBS)
+ set(HTSLIB_NAMES hts)
+ set(HTSLIB_NAMES_DEBUG hts)
+else()
+ set(HTSLIB_NAMES hts)
+ set(HTSLIB_NAMES_DEBUG hts)
+endif()
+
+# Try each search configuration.
+foreach(search ${_HTSLIB_SEARCHES})
+ find_path(HTSLIB_INCLUDE_DIR NAMES htslib ${${search}} PATH_SUFFIXES include)
+endforeach()
+
+# Allow HTSLIB_LIBRARY to be set manually, as the location of the htslib library
+if(NOT HTSLIB_LIBRARY)
+ if(DEFINED CMAKE_FIND_LIBRARY_PREFIXES)
+ set(_htslib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_FIND_LIBRARY_PREFIXES}")
+ else()
+ set(_htslib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES)
+ endif()
+ if(DEFINED CMAKE_FIND_LIBRARY_SUFFIXES)
+ set(_htslib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_FIND_LIBRARY_SUFFIXES}")
+ else()
+ set(_htslib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
+ endif()
+ # Prefix/suffix of the win32/Makefile.gcc build
+ if(WIN32)
+ list(APPEND CMAKE_FIND_LIBRARY_PREFIXES "" "lib")
+ list(APPEND CMAKE_FIND_LIBRARY_SUFFIXES ".dll.a")
+ endif()
+ # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES
+ if(HTSLIB_USE_STATIC_LIBS)
+ if(WIN32)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ else()
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
+ endif()
+ endif()
+
+ foreach(search ${_HTSLIB_SEARCHES})
+ find_library(HTSLIB_LIBRARY_RELEASE NAMES ${HTSLIB_NAMES} NAMES_PER_DIR ${${search}} PATH_SUFFIXES lib)
+ find_library(HTSLIB_LIBRARY_DEBUG NAMES ${HTSLIB_NAMES_DEBUG} NAMES_PER_DIR ${${search}} PATH_SUFFIXES lib)
+ endforeach()
+
+ # Restore the original find library ordering
+ if(DEFINED _htslib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES "${_htslib_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}")
+ else()
+ set(CMAKE_FIND_LIBRARY_SUFFIXES)
+ endif()
+ if(DEFINED _htslib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES)
+ set(CMAKE_FIND_LIBRARY_PREFIXES "${_htslib_ORIG_CMAKE_FIND_LIBRARY_PREFIXES}")
+ else()
+ set(CMAKE_FIND_LIBRARY_PREFIXES)
+ endif()
+
+ include(SelectLibraryConfigurations)
+ select_library_configurations(HTSLIB)
+endif()
+
+unset(HTSLIB_NAMES)
+unset(HTSLIB_NAMES_DEBUG)
+
+mark_as_advanced(HTSLIB_INCLUDE_DIR)
+
+if(HTSLIB_INCLUDE_DIR AND EXISTS "${HTSLIB_INCLUDE_DIR}/htslib/hts.h")
+ # Example: #define HTS_VERSION 101300
+ file(STRINGS "${HTSLIB_INCLUDE_DIR}/htslib/hts.h" HTSLIB_H_LIST REGEX "^#define HTS_VERSION")
+ list(GET HTSLIB_H_LIST 0 HTSLIB_H) # Take the first matching line
+ if (HTSLIB_H MATCHES "#define[ \t]+HTS_VERSION[ \t]+\([0-9]+\)")
+ set(NUMERIC_VERSION "${CMAKE_MATCH_1}")
+ # Extract digits by position in string
+ # XYYYZZ => X = major, YYY = minor, ZZ = patch
+ string(SUBSTRING "${NUMERIC_VERSION}" 0 1 HTSLIB_VERSION_MAJOR)
+ string(SUBSTRING "${NUMERIC_VERSION}" 1 3 HTSLIB_VERSION_MINOR)
+ string(SUBSTRING "${NUMERIC_VERSION}" 4 2 HTSLIB_VERSION_PATCH)
+ else()
+ set(HTSLIB_VERSION_STRING "")
+ set(HTSLIB_VERSION_MAJOR "")
+ set(HTSLIB_VERSION_MINOR "")
+ set(HTSLIB_VERSION_PATCH "")
+ endif()
+
+ # Make sure the version numbers don't have leading zeros
+ # The minor version is encoded in such a way that it often will
+ foreach(part HTSLIB_VERSION_MAJOR HTSLIB_VERSION_MINOR HTSLIB_VERSION_PATCH)
+ if(${${part}} MATCHES "^[0]+$")
+ set(${part} "0")
+ else()
+ string(REGEX REPLACE "^0+" "" ${part} "${${part}}")
+ endif()
+ endforeach()
+
+ # Set canonical variables
+ set(HTSLIB_MAJOR_VERSION "${HTSLIB_VERSION_MAJOR}")
+ set(HTSLIB_MINOR_VERSION "${HTSLIB_VERSION_MINOR}")
+ set(HTSLIB_PATCH_VERSION "${HTSLIB_VERSION_PATCH}")
+ # Build the standard version string
+ set(HTSLIB_VERSION "${HTSLIB_VERSION_MAJOR}.${HTSLIB_VERSION_MINOR}")
+ # Only append patch if it's not "00"
+ if(NOT HTSLIB_VERSION_PATCH STREQUAL "00")
+ set(HTSLIB_VERSION "${HTSLIB_VERSION}.${HTSLIB_VERSION_PATCH}")
+ endif()
+endif()
+
+include(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(
+ HTSLIB
+ REQUIRED_VARS
+ HTSLIB_LIBRARY
+ HTSLIB_INCLUDE_DIR
+ VERSION_VAR
+ HTSLIB_VERSION
+ HANDLE_COMPONENTS
+)
+
+if(HTSLIB_FOUND)
+ set(HTSLIB_INCLUDE_DIRS ${HTSLIB_INCLUDE_DIR})
+ if(NOT HTSLIB_LIBRARIES)
+ set(HTSLIB_LIBRARIES ${HTSLIB_LIBRARY})
+ endif()
+ if(NOT TARGET HTSLIB::HTSLIB)
+ add_library(HTSLIB::HTSLIB UNKNOWN IMPORTED)
+ set_target_properties(HTSLIB::HTSLIB PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${HTSLIB_INCLUDE_DIRS}")
+ if(HTSLIB_LIBRARY_RELEASE)
+ set_property(TARGET HTSLIB::HTSLIB APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS RELEASE)
+ set_target_properties(HTSLIB::HTSLIB PROPERTIES
+ IMPORTED_LOCATION_RELEASE "${HTSLIB_LIBRARY_RELEASE}")
+ endif()
+ if(HTSLIB_LIBRARY_DEBUG)
+ set_property(TARGET HTSLIB::HTSLIB APPEND PROPERTY
+ IMPORTED_CONFIGURATIONS DEBUG)
+ set_target_properties(HTSLIB::HTSLIB PROPERTIES
+ IMPORTED_LOCATION_DEBUG "${HTSLIB_LIBRARY_DEBUG}")
+ endif()
+ if(NOT HTSLIB_LIBRARY_RELEASE AND NOT HTSLIB_LIBRARY_DEBUG)
+ set_property(TARGET HTSLIB::HTSLIB APPEND PROPERTY
+ IMPORTED_LOCATION "${HTSLIB_LIBRARY}")
+ endif()
+ endif()
+endif()
+
+cmake_policy(POP)
diff --git a/cmake/static_analysis.cmake b/cmake/static_analysis.cmake
new file mode 100644
index 0000000..f1323ad
--- /dev/null
+++ b/cmake/static_analysis.cmake
@@ -0,0 +1,119 @@
+# Copyright (C) 2025 Andrew D Smith
+#
+# 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.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see .
+
+# StaticAnalysis
+message(STATUS "Enabling static analysis")
+# If no specific static analysis is requested, do them all
+if(NOT RUN_CPPCHECK AND NOT RUN_IWYU AND
+ NOT RUN_CPPLINT AND NOT RUN_CLANG_TIDY)
+ set(RUN_CPPCHECK on)
+ set(RUN_IWYU on)
+ set(RUN_CPPLINT on)
+ set(RUN_CLANG_TIDY on)
+endif()
+
+set(STATIC_ANALYSIS_CHECKS "")
+if(RUN_CPPCHECK)
+ list(APPEND STATIC_ANALYSIS_CHECKS "cppcheck")
+endif()
+if(RUN_CPPLINT)
+ list(APPEND STATIC_ANALYSIS_CHECKS "cpplint")
+endif()
+if(RUN_IWYU)
+ list(APPEND STATIC_ANALYSIS_CHECKS "iwyu")
+endif()
+if(RUN_CLANG_TIDY)
+ list(APPEND STATIC_ANALYSIS_CHECKS "clang-tidy")
+endif()
+
+message(STATUS "Requested static analysis: ${STATIC_ANALYSIS_CHECKS}")
+
+# cpplint: all options are in the config file
+if ("cpplint" IN_LIST STATIC_ANALYSIS_CHECKS)
+ find_program(FOUND_CPPLINT cpplint)
+ if(FOUND_CPPLINT)
+ message(STATUS "Enabling cpplint analysis")
+ set(CMAKE_CXX_CPPLINT cpplint --quiet)
+ else()
+ message(STATUS "Could not find cpplint; disabling cpplint")
+ endif()
+endif()
+
+# include-what-you-use: config is a mappings file
+if ("iwyu" IN_LIST STATIC_ANALYSIS_CHECKS)
+ find_program(FOUND_IWYU include-what-you-use)
+ if(FOUND_IWYU)
+ message(STATUS "Enabling include-what-you-use analysis")
+ set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE
+ include-what-you-use
+ -Xiwyu
+ --comment_style=none
+ -Xiwyu
+ --quoted_includes_first
+ -Xiwyu
+ --mapping_file=${PROJECT_SOURCE_DIR}/iwyu.json
+ )
+ else()
+ message(STATUS "Could not find iwyu; disabling iwyu")
+ endif()
+endif()
+
+# cppcheck: options on the command line as there is no config file
+if ("cppcheck" IN_LIST STATIC_ANALYSIS_CHECKS)
+ find_program(FOUND_CPPCHECK cppcheck)
+ if(FOUND_CPPCHECK)
+ message(STATUS "Enabling cppcheck analysis")
+ set(CMAKE_CXX_CPPCHECK
+ cppcheck
+ --quiet
+ --enable=all
+ --inline-suppr
+ --max-configs=1
+ --suppressions-list=${PROJECT_SOURCE_DIR}/.cppcheck_suppress
+ )
+ else()
+ message(STATUS "Could not find cppcheck; disabling cppcheck")
+ endif()
+endif()
+
+# clang-tidy: need to make sure version is at least 20
+if ("clang-tidy" IN_LIST STATIC_ANALYSIS_CHECKS)
+ find_program(CLANG_TIDY_EXECUTABLE NAMES clang-tidy)
+ # Minimum required version
+ set(MIN_CLANG_TIDY_VERSION "20.0.0")
+ if(CLANG_TIDY_EXECUTABLE)
+ execute_process(
+ COMMAND
+ bash -c
+ "${CLANG_TIDY_EXECUTABLE} --version | grep version | tr -cd '0-9.\n'"
+ OUTPUT_VARIABLE CLANG_TIDY_VERSION
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ # Compare the version numbers
+ if(CLANG_TIDY_VERSION VERSION_GREATER_EQUAL MIN_CLANG_TIDY_VERSION)
+ message(STATUS "Enabling clang-tidy (version: ${CLANG_TIDY_VERSION})")
+ set(CMAKE_CXX_CLANG_TIDY
+ clang-tidy
+ --quiet
+ --allow-no-checks
+ -p ${PROJECT_BINARY_DIR}
+ )
+ else()
+ message(STATUS "Not enabling clang-tidy (min version not found")
+ endif()
+ else()
+ message(STATUS "Could not find clang-tidy; disabling clang-tidy")
+ endif()
+endif()
diff --git a/configure.ac b/configure.ac
index a01bfda..bcf4ddf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,50 +1,86 @@
-dnl This file is part of preseq
-dnl
-dnl Copyright (C) 2018-2024: Andrew D. Smith
+dnl Copyright (C) 2018-2025: Andrew D. Smith
dnl
dnl Authors: Andrew D. Smith
dnl
-dnl This is free software: you can redistribute it and/or modify it
-dnl under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation, either version 3 of the License, or
-dnl (at your option) any later version.
+dnl This is free software: you can redistribute it and/or modify it under the
+dnl terms of the GNU General Public License as published by the Free Software
+dnl Foundation, either version 3 of the License, or (at your option) any later
+dnl version.
dnl
-dnl This software is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-dnl General Public License for more details.
-
-AC_INIT([preseq], [3.2.0], [andrewds@usc.edu],
- [preseq], [https://github.com/smithlabcode/preseq])
-dnl the config.h is not currently #included in the source, and only
-dnl used to keep command lines short.
+dnl This software is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+
+AC_INIT([preseq],
+ [3.2.0],
+ [andrewds@usc.edu],
+ [preseq],
+ [https://github.com/smithlabcode/preseq])
+
+dnl the config.h is not currently #included in the source, and only used to
+dnl keep command lines short.
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([subdir-objects foreign])
AC_CONFIG_MACRO_DIR([m4])
AC_LANG(C++)
AC_PROG_CXX
-AX_CXX_COMPILE_STDCXX_17([noext], [mandatory])
+AX_CXX_COMPILE_STDCXX(17, [noext], [mandatory])
AC_PROG_RANLIB
-dnl recursively configure smithlab_cpp
-AC_CONFIG_SUBDIRS([src/smithlab_cpp])
-
-dnl check for HTSLib if requested
hts_fail_msg="
-Failed to locate HTSLib on your system. Please use the LDFLAGS and
-CPPFLAGS variables to specify the directories where the HTSLib library
-and headers can be found.
+Failed to locate the HTSLib library on your system. Please use the LDFLAGS and
+CPPFLAGS variables to specify the directories where the HTSLib library and
+headers can be found.
+
+If you want to disable HTSLib when building preseq, use the --disable-htslib
+argument to the configure script.
+"
+
+libdeflate_fail_msg="
+
+Failed to locate libdeflate on your system. This is a common dependency of
+HTSLib. If your HTSLib was built without libdeflate, you can give the
+--disable-libdeflate argument to configure. If you do not need to directly
+process SAM/BAM files with preseq, consider using the argument
+--without-htslib to build preseq without support for reading SAM/BAM.
+
+If you need libdeflate, please use the LDFLAGS and CPPFLAGS variables to
+specify the directories where the library and headers can be found on your
+system.
"
-AC_ARG_ENABLE([hts],
- [AS_HELP_STRING([--enable-hts], [Enable HTSLib @<:@yes@:>@])],
- [enable_hts=yes], [enable_hts=no])
-AS_IF([test "x$enable_hts" = "xyes"],
- [AC_CHECK_LIB([hts], [hts_version], [],
- [AC_MSG_FAILURE([$hts_fail_msg])])]
+
+AC_ARG_ENABLE([htslib],
+ [AS_HELP_STRING([--enable-htslib], [use HTSLib to allow BAM/SAM input])],
+ [enable_htslib=$enableval], [enable_htslib=no]
)
-AM_CONDITIONAL([ENABLE_HTS], [test "x$enable_hts" = "xyes"])
+
+AC_ARG_ENABLE([libdeflate],
+ [AS_HELP_STRING([--enable-libdeflate],
+ [use libdeflate which might be needed by HTSLib])],
+ [enable_libdeflate=$enableval], [enable_libdeflate=no]
+)
+
+AS_IF([test "x$enable_htslib" = xyes], [
+ AX_PTHREAD([],
+ [AC_MSG_ERROR([Threads required for HTSLib but threads library not found])]
+ )
+ AC_SEARCH_LIBS(
+ [gzopen], [z], [],
+ [AC_MSG_FAILURE(["ZLib required for HTSLib but not found"])]
+ )
+ AS_IF([test "x$enable_libdeflate" = xyes], [
+ AC_SEARCH_LIBS([libdeflate_deflate_compress], [deflate],
+ [AC_CHECK_LIB([hts], [hts_version], [], [
+ AC_MSG_FAILURE([$hts_fail_msg])], [-pthread -lz -ldeflate])],
+ [AC_MSG_ERROR([$libdeflate_fail_msg])])
+ ],
+ [AC_CHECK_LIB([hts], [hts_version], [],
+ [AC_MSG_FAILURE([$hts_fail_msg])], [-pthread -lz])])
+])
+AM_CONDITIONAL([ENABLE_HTSLIB], [test "x$enable_htslib" = "xyes"])
AC_CONFIG_FILES([Makefile])
@@ -53,7 +89,7 @@ AC_CONFIG_LINKS([
tests/md5sum.txt:tests/md5sum.txt
tests/c_curve_input.hist:tests/data/c_curve_input.hist
tests/lc_extrap_input.vals:tests/data/lc_extrap_input.vals
-tests/gc_extrap_input.mr:tests/data/gc_extrap_input.mr
+tests/gc_extrap_input.bed:tests/data/gc_extrap_input.bed
])
AC_OUTPUT
diff --git a/data/LICENSE b/data/LICENSE
new file mode 100644
index 0000000..0c0d820
--- /dev/null
+++ b/data/LICENSE
@@ -0,0 +1,159 @@
+LICENSES
+
+preseq
+
+Copyright (C) 2012-2025 Andrew D Smith and Timothy Daley
+
+This 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.
+
+This software 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.
+
+========================================================================
+
+Additional licenses/copyrights that apply to preseq pre-built binaries, which
+link statically to Adler and Gailly's ZLib, to HTSlib, to Eric Biggers'
+libdeflate, to Henry Schreiner's CLI11 and to Niels Lohmann's JSON library.
+
+=======================================================================
+ZLib
+
+This copyright notice is taken from:
+https://github.com/madler/zlib/blob/develop/LICENSE
+
+Copyright notice:
+
+(C) 1995-2024 Jean-loup Gailly and Mark Adler
+
+This software is provided 'as-is', without any express or implied warranty.
+In no event will the authors be held liable for any damages arising from the
+use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
+subject to the following restrictions:
+
+1. The origin of this software must not be misrepresented; you must not claim
+ that you wrote the original software. If you use this software in a
+ product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+3. This notice may not be removed or altered from any source distribution.
+
+Jean-loup Gailly Mark Adler
+jloup@gzip.org madler@alumni.caltech.edu
+
+=======================================================================
+libdeflate
+
+This copyright notice is taken from:
+https://github.com/ebiggers/libdeflate/blob/master/COPYING
+
+Copyright 2016 Eric Biggers
+Copyright 2024 Google LLC
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+=======================================================================
+HTSlib
+
+This copyright notice is taken from:
+https://github.com/samtools/htslib/blob/develop/LICENSE
+
+The MIT/Expat License
+
+Copyright (C) 2012-2025 Genome Research Ltd.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+========================================================================
+JSON
+
+MIT License
+
+Copyright (c) 2013-2025 Niels Lohmann
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+========================================================================
+CLI11
+
+CLI11 2.2 Copyright (c) 2017-2025 University of Cincinnati, developed by Henry
+Schreiner under NSF AWARD 1414736. All rights reserved.
+
+Redistribution and use in source and binary forms of CLI11, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its contributors
+ may be used to endorse or promote products derived from this software without
+ specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/data/LICENSES.inc.in b/data/LICENSES.inc.in
new file mode 100644
index 0000000..3c67a96
--- /dev/null
+++ b/data/LICENSES.inc.in
@@ -0,0 +1,3 @@
+static const char *license_text = R"(
+@LICENSE_TEXT@
+)";
diff --git a/data/config.h.in b/data/config.h.in
new file mode 100644
index 0000000..14cefd4
--- /dev/null
+++ b/data/config.h.in
@@ -0,0 +1,17 @@
+/* Copyright (C) 2025 Andrew D. Smith
+ *
+ * This file is part of preseq.
+ *
+ * preseq 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.
+ *
+ * preseq 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.
+ */
+
+#define PROJECT_NAME "@PROJECT_NAME@"
+#define VERSION "@PROJECT_VERSION@"
diff --git a/documentation/README.md b/documentation/README.md
index 2f1ba48..1a2cd90 100644
--- a/documentation/README.md
+++ b/documentation/README.md
@@ -1,11 +1,11 @@
# preseq documentation
This is the (new) documentation for preseq that uses
-[mkdocs](https://mkdocs.readthedocs.io) to generate readthedocs pages.
-The public web verison of this documentation is available at
-[preseq.readthedocs.io](https://preseq.readthedocs.io), but for users
-who wish to see the documentation on a web browser offline, you can
-build the documentation locally as described below.
+[mkdocs](https://mkdocs.readthedocs.io) to generate readthedocs pages. The
+public web verison of this documentation is available at
+[preseq.readthedocs.io](https://preseq.readthedocs.io), but for users who wish
+to see the documentation on a web browser offline, you can build the
+documentation locally as described below.
### Dependencies
diff --git a/iwyu.json b/iwyu.json
new file mode 100644
index 0000000..2896ec4
--- /dev/null
+++ b/iwyu.json
@@ -0,0 +1,5 @@
+[
+ { "include": ["", "private", "", "public"] },
+ { "include": ["@[\"<]htslib/kstring.h[\">]", "private", "", "public"] },
+ { "include": ["@[\"<]htslib/hts.h[\">]", "private", "", "public"] },
+]
diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
new file mode 100644
index 0000000..6cf2c04
--- /dev/null
+++ b/m4/ax_pthread.m4
@@ -0,0 +1,522 @@
+# ===========================================================================
+# https://www.gnu.org/software/autoconf-archive/ax_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+# This macro figures out how to build C programs using POSIX threads. It
+# sets the PTHREAD_LIBS output variable to the threads library and linker
+# flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+# flags that are needed. (The user can also force certain compiler
+# flags/libs to be tested by setting these environment variables.)
+#
+# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is
+# needed for multi-threaded programs (defaults to the value of CC
+# respectively CXX otherwise). (This is necessary on e.g. AIX to use the
+# special cc_r/CC_r compiler alias.)
+#
+# NOTE: You are assumed to not only compile your program with these flags,
+# but also to link with them as well. For example, you might link with
+# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+# If you are only building threaded programs, you may wish to use these
+# variables in your default LIBS, CFLAGS, and CC:
+#
+# LIBS="$PTHREAD_LIBS $LIBS"
+# CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
+# CC="$PTHREAD_CC"
+# CXX="$PTHREAD_CXX"
+#
+# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
+# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the
+# PTHREAD_PRIO_INHERIT symbol is defined when compiling with
+# PTHREAD_CFLAGS.
+#
+# ACTION-IF-FOUND is a list of shell commands to run if a threads library
+# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+# is not found. If ACTION-IF-FOUND is not specified, the default action
+# will define HAVE_PTHREAD.
+#
+# Please let the authors know if this macro fails on any platform, or if
+# you have any other suggestions or comments. This macro was based on work
+# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
+# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
+# Alejandro Forero Cuervo to the autoconf macro repository. We are also
+# grateful for the helpful feedback of numerous users.
+#
+# Updated for Autoconf 2.68 by Daniel Richard G.
+#
+# LICENSE
+#
+# Copyright (c) 2008 Steven G. Johnson
+# Copyright (c) 2011 Daniel Richard G.
+# Copyright (c) 2019 Marc Stevens
+#
+# 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.
+#
+# 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.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program. If not, see .
+#
+# As a special exception, the respective Autoconf Macro's copyright owner
+# gives unlimited permission to copy, distribute and modify the configure
+# scripts that are the output of Autoconf when processing the Macro. You
+# need not follow the terms of the GNU General Public License when using
+# or distributing such scripts, even though portions of the text of the
+# Macro appear in them. The GNU General Public License (GPL) does govern
+# all other use of the material that constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the Autoconf
+# Macro released by the Autoconf Archive. When you make and distribute a
+# modified version of the Autoconf Macro, you may extend this special
+# exception to the GPL to apply to your modified version as well.
+
+#serial 31
+
+AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
+AC_DEFUN([AX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_PROG_SED])
+AC_LANG_PUSH([C])
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on Tru64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
+ ax_pthread_save_CC="$CC"
+ ax_pthread_save_CFLAGS="$CFLAGS"
+ ax_pthread_save_LIBS="$LIBS"
+ AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
+ AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"])
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
+ AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes])
+ AC_MSG_RESULT([$ax_pthread_ok])
+ if test "x$ax_pthread_ok" = "xno"; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ CC="$ax_pthread_save_CC"
+ CFLAGS="$ax_pthread_save_CFLAGS"
+ LIBS="$ax_pthread_save_LIBS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try. Items with a "," contain both
+# C compiler flags (before ",") and linker flags (after ","). Other items
+# starting with a "-" are C compiler flags, and remaining items are
+# library names, except for "none" which indicates that we try without
+# any flags at all, and "pthread-config" which is a program returning
+# the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64
+# (Note: HP C rejects this with "bad form for `-t' option")
+# -pthreads: Solaris/gcc (Note: HP C also rejects)
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads and
+# -D_REENTRANT too), HP C (must be checked before -lpthread, which
+# is present but should not be used directly; and before -mthreads,
+# because the compiler interprets this as "-mt" + "-hreads")
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case $host_os in
+
+ freebsd*)
+
+ # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+ # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+
+ ax_pthread_flags="-kthread lthread $ax_pthread_flags"
+ ;;
+
+ hpux*)
+
+ # From the cc(1) man page: "[-mt] Sets various -D flags to enable
+ # multi-threading and also sets -lpthread."
+
+ ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags"
+ ;;
+
+ openedition*)
+
+ # IBM z/OS requires a feature-test macro to be defined in order to
+ # enable POSIX threads at all, so give the user a hint if this is
+ # not set. (We don't define these ourselves, as they can affect
+ # other portions of the system API in unpredictable ways.)
+
+ AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING],
+ [
+# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS)
+ AX_PTHREAD_ZOS_MISSING
+# endif
+ ],
+ [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])])
+ ;;
+
+ solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (N.B.: The stubs are missing
+ # pthread_cleanup_push, or rather a function called by this macro,
+ # so we could check for that, but who knows whether they'll stub
+ # that too in a future libc.) So we'll check first for the
+ # standard Solaris way of linking pthreads (-mt -lpthread).
+
+ ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags"
+ ;;
+esac
+
+# Are we compiling with Clang?
+
+AC_CACHE_CHECK([whether $CC is Clang],
+ [ax_cv_PTHREAD_CLANG],
+ [ax_cv_PTHREAD_CLANG=no
+ # Note that Autoconf sets GCC=yes for Clang as well as GCC
+ if test "x$GCC" = "xyes"; then
+ AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG],
+ [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */
+# if defined(__clang__) && defined(__llvm__)
+ AX_PTHREAD_CC_IS_CLANG
+# endif
+ ],
+ [ax_cv_PTHREAD_CLANG=yes])
+ fi
+ ])
+ax_pthread_clang="$ax_cv_PTHREAD_CLANG"
+
+
+# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC)
+
+# Note that for GCC and Clang -pthread generally implies -lpthread,
+# except when -nostdlib is passed.
+# This is problematic using libtool to build C++ shared libraries with pthread:
+# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
+# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333
+# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555
+# To solve this, first try -pthread together with -lpthread for GCC
+
+AS_IF([test "x$GCC" = "xyes"],
+ [ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"])
+
+# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first
+
+AS_IF([test "x$ax_pthread_clang" = "xyes"],
+ [ax_pthread_flags="-pthread,-lpthread -pthread"])
+
+
+# The presence of a feature test macro requesting re-entrant function
+# definitions is, on some systems, a strong hint that pthreads support is
+# correctly enabled
+
+case $host_os in
+ darwin* | hpux* | linux* | osf* | solaris*)
+ ax_pthread_check_macro="_REENTRANT"
+ ;;
+
+ aix*)
+ ax_pthread_check_macro="_THREAD_SAFE"
+ ;;
+
+ *)
+ ax_pthread_check_macro="--"
+ ;;
+esac
+AS_IF([test "x$ax_pthread_check_macro" = "x--"],
+ [ax_pthread_check_cond=0],
+ [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"])
+
+
+if test "x$ax_pthread_ok" = "xno"; then
+for ax_pthread_try_flag in $ax_pthread_flags; do
+
+ case $ax_pthread_try_flag in
+ none)
+ AC_MSG_CHECKING([whether pthreads work without any flags])
+ ;;
+
+ *,*)
+ PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"`
+ PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"`
+ AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"])
+ ;;
+
+ -*)
+ AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag])
+ PTHREAD_CFLAGS="$ax_pthread_try_flag"
+ ;;
+
+ pthread-config)
+ AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no])
+ AS_IF([test "x$ax_pthread_config" = "xno"], [continue])
+ PTHREAD_CFLAGS="`pthread-config --cflags`"
+ PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+ ;;
+
+ *)
+ AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag])
+ PTHREAD_LIBS="-l$ax_pthread_try_flag"
+ ;;
+ esac
+
+ ax_pthread_save_CFLAGS="$CFLAGS"
+ ax_pthread_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include
+# if $ax_pthread_check_cond
+# error "$ax_pthread_check_macro must be defined"
+# endif
+ static void *some_global = NULL;
+ static void routine(void *a)
+ {
+ /* To avoid any unused-parameter or
+ unused-but-set-parameter warning. */
+ some_global = a;
+ }
+ static void *start_routine(void *a) { return a; }],
+ [pthread_t th; pthread_attr_t attr;
+ pthread_create(&th, 0, start_routine, 0);
+ pthread_join(th, 0);
+ pthread_attr_init(&attr);
+ pthread_cleanup_push(routine, 0);
+ pthread_cleanup_pop(0) /* ; */])],
+ [ax_pthread_ok=yes],
+ [])
+
+ CFLAGS="$ax_pthread_save_CFLAGS"
+ LIBS="$ax_pthread_save_LIBS"
+
+ AC_MSG_RESULT([$ax_pthread_ok])
+ AS_IF([test "x$ax_pthread_ok" = "xyes"], [break])
+
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
+
+
+# Clang needs special handling, because older versions handle the -pthread
+# option in a rather... idiosyncratic way
+
+if test "x$ax_pthread_clang" = "xyes"; then
+
+ # Clang takes -pthread; it has never supported any other flag
+
+ # (Note 1: This will need to be revisited if a system that Clang
+ # supports has POSIX threads in a separate library. This tends not
+ # to be the way of modern systems, but it's conceivable.)
+
+ # (Note 2: On some systems, notably Darwin, -pthread is not needed
+ # to get POSIX threads support; the API is always present and
+ # active. We could reasonably leave PTHREAD_CFLAGS empty. But
+ # -pthread does define _REENTRANT, and while the Darwin headers
+ # ignore this macro, third-party headers might not.)
+
+ # However, older versions of Clang make a point of warning the user
+ # that, in an invocation where only linking and no compilation is
+ # taking place, the -pthread option has no effect ("argument unused
+ # during compilation"). They expect -pthread to be passed in only
+ # when source code is being compiled.
+ #
+ # Problem is, this is at odds with the way Automake and most other
+ # C build frameworks function, which is that the same flags used in
+ # compilation (CFLAGS) are also used in linking. Many systems
+ # supported by AX_PTHREAD require exactly this for POSIX threads
+ # support, and in fact it is often not straightforward to specify a
+ # flag that is used only in the compilation phase and not in
+ # linking. Such a scenario is extremely rare in practice.
+ #
+ # Even though use of the -pthread flag in linking would only print
+ # a warning, this can be a nuisance for well-run software projects
+ # that build with -Werror. So if the active version of Clang has
+ # this misfeature, we search for an option to squash it.
+
+ AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread],
+ [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG],
+ [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown
+ # Create an alternate version of $ac_link that compiles and
+ # links in two steps (.c -> .o, .o -> exe) instead of one
+ # (.c -> exe), because the warning occurs only in the second
+ # step
+ ax_pthread_save_ac_link="$ac_link"
+ ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
+ ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"`
+ ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
+ ax_pthread_save_CFLAGS="$CFLAGS"
+ for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
+ AS_IF([test "x$ax_pthread_try" = "xunknown"], [break])
+ CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS"
+ ac_link="$ax_pthread_save_ac_link"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
+ [ac_link="$ax_pthread_2step_ac_link"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])],
+ [break])
+ ])
+ done
+ ac_link="$ax_pthread_save_ac_link"
+ CFLAGS="$ax_pthread_save_CFLAGS"
+ AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no])
+ ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try"
+ ])
+
+ case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in
+ no | unknown) ;;
+ *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;;
+ esac
+
+fi # $ax_pthread_clang = yes
+
+
+
+# Various other checks:
+if test "x$ax_pthread_ok" = "xyes"; then
+ ax_pthread_save_CFLAGS="$CFLAGS"
+ ax_pthread_save_LIBS="$LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+
+ # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+ AC_CACHE_CHECK([for joinable pthread attribute],
+ [ax_cv_PTHREAD_JOINABLE_ATTR],
+ [ax_cv_PTHREAD_JOINABLE_ATTR=unknown
+ for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ],
+ [int attr = $ax_pthread_attr; return attr /* ; */])],
+ [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break],
+ [])
+ done
+ ])
+ AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \
+ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \
+ test "x$ax_pthread_joinable_attr_defined" != "xyes"],
+ [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE],
+ [$ax_cv_PTHREAD_JOINABLE_ATTR],
+ [Define to necessary symbol if this constant
+ uses a non-standard name on your system.])
+ ax_pthread_joinable_attr_defined=yes
+ ])
+
+ AC_CACHE_CHECK([whether more special flags are required for pthreads],
+ [ax_cv_PTHREAD_SPECIAL_FLAGS],
+ [ax_cv_PTHREAD_SPECIAL_FLAGS=no
+ case $host_os in
+ solaris*)
+ ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
+ ;;
+ esac
+ ])
+ AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \
+ test "x$ax_pthread_special_flags_added" != "xyes"],
+ [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS"
+ ax_pthread_special_flags_added=yes])
+
+ AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT],
+ [ax_cv_PTHREAD_PRIO_INHERIT],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]],
+ [[int i = PTHREAD_PRIO_INHERIT;
+ return i;]])],
+ [ax_cv_PTHREAD_PRIO_INHERIT=yes],
+ [ax_cv_PTHREAD_PRIO_INHERIT=no])
+ ])
+ AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \
+ test "x$ax_pthread_prio_inherit_defined" != "xyes"],
+ [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.])
+ ax_pthread_prio_inherit_defined=yes
+ ])
+
+ CFLAGS="$ax_pthread_save_CFLAGS"
+ LIBS="$ax_pthread_save_LIBS"
+
+ # More AIX lossage: compile with *_r variant
+ if test "x$GCC" != "xyes"; then
+ case $host_os in
+ aix*)
+ AS_CASE(["x/$CC"],
+ [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
+ [#handle absolute path differently from PATH based program lookup
+ AS_CASE(["x$CC"],
+ [x/*],
+ [
+ AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])
+ AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])])
+ ],
+ [
+ AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])
+ AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])])
+ ]
+ )
+ ])
+ ;;
+ esac
+ fi
+fi
+
+test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
+test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
+
+AC_SUBST([PTHREAD_LIBS])
+AC_SUBST([PTHREAD_CFLAGS])
+AC_SUBST([PTHREAD_CC])
+AC_SUBST([PTHREAD_CXX])
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test "x$ax_pthread_ok" = "xyes"; then
+ ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1])
+ :
+else
+ ax_pthread_ok=no
+ $2
+fi
+AC_LANG_POP
+])dnl AX_PTHREAD
diff --git a/src/CLI11/CLI11.hpp b/src/CLI11/CLI11.hpp
new file mode 100644
index 0000000..8a5b4c5
--- /dev/null
+++ b/src/CLI11/CLI11.hpp
@@ -0,0 +1,10998 @@
+// CLI11: Version 2.4.2
+// Originally designed by Henry Schreiner
+// https://github.com/CLIUtils/CLI11
+//
+// This is a standalone header file generated by MakeSingleHeader.py in CLI11/scripts
+// from: v2.4.2
+//
+// CLI11 2.4.2 Copyright (c) 2017-2024 University of Cincinnati, developed by Henry
+// Schreiner under NSF AWARD 1414736. All rights reserved.
+//
+// Redistribution and use in source and binary forms of CLI11, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+// list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+// this list of conditions and the following disclaimer in the documentation
+// and/or other materials provided with the distribution.
+// 3. Neither the name of the copyright holder nor the names of its contributors
+// may be used to endorse or promote products derived from this software without
+// specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#pragma once
+
+// Standard combined includes:
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include