Skip to content

Commit

Permalink
Merge pull request #1116 from TeamCOMPAS/g++17
Browse files Browse the repository at this point in the history
Move compiler standard from c++11 to c++17
  • Loading branch information
ilyamandel committed May 9, 2024
2 parents d364d77 + cd92cb9 commit 62b3d6a
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 8 deletions.
4 changes: 2 additions & 2 deletions online-docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
# -- Project information -----------------------------------------------------

project = 'COMPAS'
copyright = '2021, 2022, 2023 The Authors'
copyright = '2021, 2022, 2023, 2024 The Authors'
author = 'TeamCOMPAS'


# -- General configuration ---------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#
needs_sphinx = '4.3.2'
#needs_sphinx = '4.3.2'

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
Expand Down
6 changes: 5 additions & 1 deletion online-docs/pages/whats-new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Following is a brief list of important updates to the COMPAS code. A complete r

**LATEST RELEASE** |br|

**02.45.00 Apr 09, 2024**

* Changed compiler standard in Makefile from ``c++11`` to ``c++17``. This is required for ``boost v1.82`` and above. ``c++11`` can still be used if boost version is below ``v1.82``, but moving to ``c++17`` and boost ``v1.8x`` is preferred (and will eventually be mandatory). Tested with ``Ubuntu v20.04, g++ v11.04, and boost v1.74``; and ``macOS v14.1.1, clang v15.0.0, and boost v1.85``.

**02.44.00 Apr 04, 2024**

* Added 'realistic' tides option, which implements dynamical and equilibrium tides using the formalism described in Kapil et al. (2024).
Expand All @@ -20,7 +24,7 @@ Following is a brief list of important updates to the COMPAS code. A complete r
**02.42.00 Jan 04, 2023**

* Timesteps are now quantised to an integral multiple of 1e-12Myr.
* New option provided to allow user-defined timesteps: ``--timesteps-filename`` (See :doc:`Timestep files <../"User guide"/timestep-files>`).
* New option provided to allow user-defined timesteps: ``--timesteps-filename`` (See :doc:`./User guide/timestep-files`).
* Code changes to make SSE and BSE evolution more consistent (See `PR 1052 <https://github.com/TeamCOMPAS/COMPAS/pull/1052>`_).

**02.41.03 Dec 28, 2023**
Expand Down
3 changes: 3 additions & 0 deletions online-docs/requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx<7
sphinx_rtd_theme

4 changes: 2 additions & 2 deletions src/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ void Log::Start(const string p_LogBasePath,
try { // yes - copy it
boost::filesystem::path srcPath(OPTIONS->GridFilename()); // grid file fully-qualified name
string dstFn = dstPath + srcPath.filename().string(); // fully-qualified grid filename (inside container)
boost::filesystem::copy_file(OPTIONS->GridFilename(), dstFn, boost::filesystem::copy_option::overwrite_if_exists); // copy grid file - overwrite any existing file (shouldn't be one, but just in case we want this one)
boost::filesystem::copy_file(OPTIONS->GridFilename(), dstFn, BOOST_OVERWRITE_EXISTING); // copy grid file - overwrite any existing file (shouldn't be one, but just in case we want this one)
} catch(const boost::filesystem::filesystem_error& e) {
Squawk("ERROR: Unable to copy grid file " + OPTIONS->GridFilename() + " to output container " + dstPath); // announce error
m_Enabled = false; // fail
Expand All @@ -435,7 +435,7 @@ void Log::Start(const string p_LogBasePath,
try { // yes - copy it
boost::filesystem::path srcPath(OPTIONS->LogfileDefinitionsFilename()); // logfile-definitions file fully-qualified name
string dstFn = dstPath + srcPath.filename().string(); // fully-qualified logfile-definitions filename (inside container)
boost::filesystem::copy_file(OPTIONS->LogfileDefinitionsFilename(), dstFn, boost::filesystem::copy_option::overwrite_if_exists); // copy logfile-definitions file - overwrite any existing file (shouldn't be one, but just in case we want this one)
boost::filesystem::copy_file(OPTIONS->LogfileDefinitionsFilename(), dstFn, BOOST_OVERWRITE_EXISTING); // copy logfile-definitions file - overwrite any existing file (shouldn't be one, but just in case we want this one)
} catch(const boost::filesystem::filesystem_error& e) {
Squawk("ERROR: Unable to copy logfile-definitions file " + OPTIONS->LogfileDefinitionsFilename() + " to output container " + dstPath); // announce error
m_Enabled = false; // fail
Expand Down
10 changes: 9 additions & 1 deletion src/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@

using std::string;

// fix for deprecated boost copy_option
#if BOOST_VERSION >= 107400
#define BOOST_OVERWRITE_EXISTING boost::filesystem::copy_options::overwrite_existing
#else
#define BOOST_OVERWRITE_EXISTING boost::filesystem::copy_option::overwrite_if_exists
#endif


/*
* Log Singleton
*
Expand Down Expand Up @@ -456,7 +464,7 @@ class Log {
m_DbgClasses = {}; // no default debug classes
m_DbgToLogfile = false; // default is not to log debug records to the log file
m_DbgLogfileId = -1; // default is not valid
m_Logfiles.empty(); // default is no log files
m_Logfiles.clear(); // default is no log files
m_OpenStandardLogFileIds = {}; // no open COMPAS standard log files

m_ObjectIdSwitching = -1L; // object id of the Star object switching stellar type - default none
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ifneq ($(filter staticfast,$(MAKECMDGOALS)),)
endif


CXXFLAGS := -std=c++11 -Wall -Woverloaded-virtual $(OPTFLAGS)
CXXFLAGS := -std=c++17 -Wall -Woverloaded-virtual $(OPTFLAGS)
ICFLAGS := -I$(GSLINCDIR) -I$(BOOSTINCDIR) -I$(HDF5INCDIR) -I.

LIBS := -lm -lz -ldl -lpthread
Expand Down
7 changes: 6 additions & 1 deletion src/changelog.h
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,12 @@
// - set PISN massless remnant mass to zero (see issue #1051)
// 02.44.05 JR - May 07, 2024 - Defect repair:
// - fix for HG-CHeB transition for low metallicities
// 02.45.00 JR - May 09, 2024 - Enhancements:
// - changed compiler standard from c++11 to c++17 in Makefile - see issue #984
// (Tested ok with Ubuntu v20.04, g++ v11.04, and boost v1.74; and macOS v14.1.1, clang v15.0.0, and boost v1.85.)
// - added check for boost version to allow for deprecated filesystem option
// - added `requirements.in` file to online docs to specify requirements for latest dependencies

const std::string VERSION_STRING = "02.44.05";
const std::string VERSION_STRING = "02.45.00";

# endif // __changelog_h__

0 comments on commit 62b3d6a

Please sign in to comment.