Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmake/CompilerFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" O
# depending on the level of overflow check selected, the stringop-overflow can also emit false positives
# https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wstringop-overflow
target_compile_options(project_warnings INTERFACE -Wno-stringop-overflow)
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0)
# GCC 15 emits false positives through libstdc++ when compiling bundled fmt 8.0.1 with -Werror
target_compile_options(project_warnings INTERFACE -Wno-restrict)
endif()
# for RelWithDebInfo builds, lets turn OFF NDEBUG, which will re-enable assert statements
target_compile_options(project_options INTERFACE $<$<CONFIG:RelWithDebInfo>:-UNDEBUG>)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
Expand Down
3 changes: 3 additions & 0 deletions src/EnergyPlus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,9 @@ target_link_libraries(

target_link_libraries(energypluslib PRIVATE project_options project_fp_options project_warnings)
ep_enable_pch(energypluslib)
if(LINK_WITH_PYTHON)
set_source_files_properties(PluginManager.cc PythonEngine.cc PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
endif()

if(OPENGL_FOUND)
target_link_libraries(energypluslib PUBLIC penumbra)
Expand Down
27 changes: 14 additions & 13 deletions src/EnergyPlus/PluginManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,7 @@
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#include <EnergyPlus/Data/EnergyPlusData.hh>
#include <EnergyPlus/DataGlobalConstants.hh>
#include <EnergyPlus/DataStringGlobals.hh>
#include <EnergyPlus/FileSystem.hh>
#include <EnergyPlus/InputProcessing/InputProcessor.hh>
#include <EnergyPlus/OutputProcessor.hh>
#include <EnergyPlus/PluginManager.hh>
#include <EnergyPlus/UtilityRoutines.hh>

#include <algorithm>
#include <nlohmann/json.hpp>

#if LINK_WITH_PYTHON

# ifdef _DEBUG
// We don't want to try to import a debug build of Python here
// so if we are building a Debug build of the C++ code, we need
Expand All @@ -70,7 +57,21 @@
# else
# include <Python.h>
# endif
#endif

#include <EnergyPlus/Data/EnergyPlusData.hh>
#include <EnergyPlus/DataGlobalConstants.hh>
#include <EnergyPlus/DataStringGlobals.hh>
#include <EnergyPlus/FileSystem.hh>
#include <EnergyPlus/InputProcessing/InputProcessor.hh>
#include <EnergyPlus/OutputProcessor.hh>
#include <EnergyPlus/PluginManager.hh>
#include <EnergyPlus/UtilityRoutines.hh>

#include <algorithm>
#include <nlohmann/json.hpp>

#if LINK_WITH_PYTHON
# include <fmt/format.h>
template <> struct fmt::formatter<PyStatus>
{
Expand Down
12 changes: 7 additions & 5 deletions src/EnergyPlus/PythonEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#include <EnergyPlus/DataStringGlobals.hh>
#include <EnergyPlus/PluginManager.hh>
#include <EnergyPlus/PythonEngine.hh>
#include <EnergyPlus/UtilityRoutines.hh>

#if LINK_WITH_PYTHON
# ifdef _DEBUG
// We don't want to try to import a debug build of Python here
Expand All @@ -62,7 +57,14 @@
# else
# include <Python.h>
# endif
#endif

#include <EnergyPlus/DataStringGlobals.hh>
#include <EnergyPlus/PluginManager.hh>
#include <EnergyPlus/PythonEngine.hh>
#include <EnergyPlus/UtilityRoutines.hh>

#if LINK_WITH_PYTHON
# include <fmt/format.h>
namespace fmt {
template <> struct formatter<PyStatus>
Expand Down
3 changes: 3 additions & 0 deletions third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ set(CMAKE_CXX_STANDARD 20)

if(NOT MSVC)
add_compile_options(-Wno-pedantic -Wno-unused-parameter -Wno-unknown-pragmas)
if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-dangling-reference> $<$<COMPILE_LANGUAGE:CXX>:-Wno-restrict>)
endif()
else()
add_compile_options(/wd4267 /wd4996 /wd4068 /wd4244 /wd4589)
endif()
Expand Down
31 changes: 21 additions & 10 deletions third_party/ObjexxFCL/src/ObjexxFCL/AlignedAllocator.hh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <new>

namespace ObjexxFCL {

Expand All @@ -38,16 +40,29 @@ public: // Types

public: // Static Methods

// Allocate Raw Array Memory with ::operator new
// Raw allocation size including optional alignment padding
static
void *
allocate( size_type const n )
size_type
allocation_size( size_type const n )
{
#ifdef OBJEXXFCL_ALIGN
void * mem( n > 0u ? ::operator new( ( n * sizeof( T ) ) + ( OBJEXXFCL_ALIGN - 1 ) ) : nullptr );
constexpr size_type alignment_overhead( OBJEXXFCL_ALIGN > 0u ? OBJEXXFCL_ALIGN - 1u : 0u );
#else
void * mem( n > 0u ? ::operator new( n * sizeof( T ) ) : nullptr );
constexpr size_type alignment_overhead( 0u );
#endif
constexpr size_type max_size( static_cast< size_type >( std::numeric_limits< std::ptrdiff_t >::max() ) );
if ( n > ( max_size - alignment_overhead ) / sizeof( T ) ) {
throw std::bad_array_new_length();
}
return ( n * sizeof( T ) ) + alignment_overhead;
}

// Allocate Raw Array Memory with ::operator new
static
void *
allocate( size_type const n )
{
void * mem( n > 0u ? ::operator new( allocation_size( n ) ) : nullptr );
assert( ( n == 0u ) || ( mem != nullptr ) );
return mem;
}
Expand All @@ -57,11 +72,7 @@ public: // Static Methods
void *
allocate_zero( size_type const n )
{
#ifdef OBJEXXFCL_ALIGN
void * mem( ::operator new( ( n * sizeof( T ) ) + ( OBJEXXFCL_ALIGN - 1 ) ) );
#else
void * mem( ::operator new( n * sizeof( T ) ) );
#endif
void * mem( ::operator new( allocation_size( n ) ) );
assert( ( n == 0u ) || ( mem != nullptr ) );
return mem;
}
Expand Down
1 change: 1 addition & 0 deletions third_party/ssc/shared/lib_battery_dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <math.h>
#include <algorithm>
#include <cstdint>

/*
Dispatch base class
Expand Down
2 changes: 1 addition & 1 deletion tst/EnergyPlus/unit/FluidProperties.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include <EnergyPlus/Data/EnergyPlusData.hh>
#include <EnergyPlus/FluidProperties.hh>

#include <ctgmath>
#include <cmath>

#include "Fixtures/EnergyPlusFixture.hh"

Expand Down