diff --git a/CHANGELOG b/CHANGELOG index 9314b7cb..a5ecfeb1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +v3.6.1 2023-05-16 + * Tiny update with a quick workaround for gcc12 compilation issues + (github issue #125). + v3.6.0 2023-05-16 * This milestone release primarily brings a massive restructuring and update of the Python API of NCrystal. The changes should be backwards diff --git a/CMakeLists.txt b/CMakeLists.txt index d29be39d..95c06655 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,7 @@ endif() cmake_policy( SET CMP0048 NEW )#Not sure if this is really needed -project( NCrystal VERSION 3.6.0 ${_project_metadata} ) +project( NCrystal VERSION 3.6.1 ${_project_metadata} ) unset( _project_metadata ) diff --git a/VERSION b/VERSION index 40c341bd..9575d51b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.6.0 +3.6.1 diff --git a/ncrystal_core/include/NCrystal/NCMem.hh b/ncrystal_core/include/NCrystal/NCMem.hh index 95f8ebb0..a680f593 100644 --- a/ncrystal_core/include/NCrystal/NCMem.hh +++ b/ncrystal_core/include/NCrystal/NCMem.hh @@ -306,13 +306,21 @@ namespace NCrystal { nc_assert( size>0 );//size 0 malloc is UB nc_assert( alignment>0 );//duh! nc_assert( (alignment & (alignment - 1)) == 0 );//checks if (non-zero) alignment is power of 2. + +#if defined(__GNUC__) && (__GNUC__ > 11 ) + if ( false ) {//Very temporary workaround for gcc 12! This is of course pretty nasty! +#else + # if defined(__GNUC__) && (__GNUC__*1000+__GNUC_MINOR__)<4009 //gcc didn't add max_align_t to std:: until gcc 4.9 constexpr auto alignof_max_align_t = alignof(max_align_t); # else constexpr auto alignof_max_align_t = alignof(std::max_align_t); # endif + + if ( alignment <= alignof_max_align_t ) { +#endif //std::malloc is supposed to work in this case (and std::aligned_alloc //might NOT work!): void * result = std::malloc(size); diff --git a/ncrystal_core/include/NCrystal/NCSmallVector.hh b/ncrystal_core/include/NCrystal/NCSmallVector.hh index 09f26b0d..e1c728cd 100644 --- a/ncrystal_core/include/NCrystal/NCSmallVector.hh +++ b/ncrystal_core/include/NCrystal/NCSmallVector.hh @@ -489,6 +489,7 @@ namespace NCrystal { std::swap(m_count,o.m_count); this->setBeginPtr( m_data.large.data = o.m_data.large.data); m_data.large.capacity = o.m_data.large.capacity; + o.m_data.large.capacity = 0;//why did we leave out this line earlier? Impl::setBeginPtrSmallData(&o); } assert(o.empty()); diff --git a/ncrystal_core/include/NCrystal/NCVersion.hh b/ncrystal_core/include/NCrystal/NCVersion.hh index bc0c607a..ed1221c9 100644 --- a/ncrystal_core/include/NCrystal/NCVersion.hh +++ b/ncrystal_core/include/NCrystal/NCVersion.hh @@ -39,9 +39,9 @@ #define NCRYSTAL_VERSION_MAJOR 3 #define NCRYSTAL_VERSION_MINOR 6 -#define NCRYSTAL_VERSION_PATCH 0 -#define NCRYSTAL_VERSION 3006000 /* (1000000*MAJOR+1000*MINOR+PATCH) */ -#define NCRYSTAL_VERSION_STR "3.6.0" +#define NCRYSTAL_VERSION_PATCH 1 +#define NCRYSTAL_VERSION 3006001 /* (1000000*MAJOR+1000*MINOR+PATCH) */ +#define NCRYSTAL_VERSION_STR "3.6.1" #include "NCrystal/ncapi.h" #include diff --git a/ncrystal_core/include/NCrystal/ncrystal.h b/ncrystal_core/include/NCrystal/ncrystal.h index 1cc6c6b8..003a99a1 100644 --- a/ncrystal_core/include/NCrystal/ncrystal.h +++ b/ncrystal_core/include/NCrystal/ncrystal.h @@ -580,9 +580,9 @@ extern "C" { #endif #define NCRYSTAL_VERSION_MAJOR 3 #define NCRYSTAL_VERSION_MINOR 6 -#define NCRYSTAL_VERSION_PATCH 0 -#define NCRYSTAL_VERSION 3006000 /* (1000000*MAJOR+1000*MINOR+PATCH) */ -#define NCRYSTAL_VERSION_STR "3.6.0" +#define NCRYSTAL_VERSION_PATCH 1 +#define NCRYSTAL_VERSION 3006001 /* (1000000*MAJOR+1000*MINOR+PATCH) */ +#define NCRYSTAL_VERSION_STR "3.6.1" NCRYSTAL_API int ncrystal_version(); /* returns NCRYSTAL_VERSION */ NCRYSTAL_API const char * ncrystal_version_str(); /* returns NCRYSTAL_VERSION_STR */ diff --git a/ncrystal_core/src/NCNCMATData.cc b/ncrystal_core/src/NCNCMATData.cc index 0ce81da3..0b090d8b 100644 --- a/ncrystal_core/src/NCNCMATData.cc +++ b/ncrystal_core/src/NCNCMATData.cc @@ -645,6 +645,7 @@ const char * NC::NCMATData::DynInfo::diType2Str( DynInfoType di) case DynInfoType::ScatKnl: return "ScatKnl"; default: nc_assert_always(false); + return "";//need a return statement here to avoid spurious compiler warning with gcc12 case DynInfoType::Undefined: return "Undefined"; } diff --git a/ncrystal_mcstas/NCrystal_sample.comp b/ncrystal_mcstas/NCrystal_sample.comp index fa964212..a3de74d6 100644 --- a/ncrystal_mcstas/NCrystal_sample.comp +++ b/ncrystal_mcstas/NCrystal_sample.comp @@ -21,7 +21,7 @@ * * %I * Written by: NCrystal developers -* Version: 3.6.0 +* Version: 3.6.1 * Origin: NCrystal Developers (European Spallation Source ERIC and DTU Nutech) * * McStas sample component for the NCrystal library for thermal neutron transport diff --git a/ncrystal_python/__init__.py b/ncrystal_python/__init__.py index 573abbd0..534de6d3 100644 --- a/ncrystal_python/__init__.py +++ b/ncrystal_python/__init__.py @@ -52,7 +52,7 @@ #NB: Synchronize meta-data below with fields in setup.py.in meta data: __license__ = "Apache 2.0, http://www.apache.org/licenses/LICENSE-2.0" -__version__ = '3.6.0' +__version__ = '3.6.1' __status__ = "Production" __author__ = "NCrystal developers (Thomas Kittelmann, Xiao Xiao Cai)" __copyright__ = "Copyright 2015-2023 %s"%__author__