Skip to content

Commit

Permalink
import from dgcode ncrystaldev git: version 3.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tkittel committed May 16, 2023
1 parent 6d01bad commit 75e108e
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 )

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.0
3.6.1
8 changes: 8 additions & 0 deletions ncrystal_core/include/NCrystal/NCMem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions ncrystal_core/include/NCrystal/NCSmallVector.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
6 changes: 3 additions & 3 deletions ncrystal_core/include/NCrystal/NCVersion.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdexcept>
Expand Down
6 changes: 3 additions & 3 deletions ncrystal_core/include/NCrystal/ncrystal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
1 change: 1 addition & 0 deletions ncrystal_core/src/NCNCMATData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand Down
2 changes: 1 addition & 1 deletion ncrystal_mcstas/NCrystal_sample.comp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ncrystal_python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
Expand Down

0 comments on commit 75e108e

Please sign in to comment.