Skip to content

Commit

Permalink
Add redirection NCrystal/NCRNG.hh header for OpenMC
Browse files Browse the repository at this point in the history
  • Loading branch information
tkittel committed Jan 23, 2025
1 parent e586d27 commit 14e8dab
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/openmc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,5 @@ jobs:
- name: Install OpenMC python
run: pip install ./src_openmc

- name: Import openmc
run: python3 -c 'import openmc'
6 changes: 5 additions & 1 deletion devel/pypath/ncrystal_repo_tools/_check_incguards.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def check_NCrystal_hh( content, incguards ):
expected_missing = ( 'NCrystal/NCrystal.hh',#self
'NCrystal/NCPluginBoilerplate.hh',
'NCrystal/ncrystal.h',
'NCrystal/cinterface/ncrystal.h'
'NCrystal/cinterface/ncrystal.h',
'NCrystal/NCRNG.hh'#deprecated header
)

for ig, include in incguards.items():
Expand All @@ -67,6 +68,7 @@ def main():
f_NCrystal_hh = incroot/'NCrystal/NCrystal.hh'
f_ncrystal_h = incroot/'NCrystal/cinterface/ncrystal.h'
f_ncrystal_h_redirect = incroot/'NCrystal/ncrystal.h'
f_NCRNG_redirection_hh = incroot/'NCrystal/NCRNG.hh'#deprecated header

for f in all_files_iter('*.h','*.hh',root=incroot):
is_c = ( f.suffix == '.h' )
Expand All @@ -87,6 +89,8 @@ def main():
ig = 'ncrystal_redirection_h'
elif f.samefile(f_ncrystal_h):
ig = 'ncrystal_h'
elif f.samefile(f_NCRNG_redirection_hh):
ig = 'NCrystal_NCRNG_redirectionhdr_hh'

assert ig not in incguards_seen, "duplicate include guard: %s"%repr(ig)
incguards_seen.add(ig)
Expand Down
1 change: 1 addition & 0 deletions ncrystal_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ ncinstall(
"${ncapi_include_path}/NCrystal/ncapi.h"
"${PROJECT_SOURCE_DIR}/include/NCrystal/ncrystal.h" #redirects to cinterface/ncrystal.h
"${PROJECT_SOURCE_DIR}/include/NCrystal/NCrystal.hh" #includes all public non-C headers
"${PROJECT_SOURCE_DIR}/include/NCrystal/NCRNG.hh" #deprecated (kept for openmc compilation for now)
"${PROJECT_SOURCE_DIR}/include/NCrystal/NCPluginBoilerplate.hh"
DESTINATION
"${NCrystal_INCDIR}/NCrystal"
Expand Down
30 changes: 30 additions & 0 deletions ncrystal_core/include/NCrystal/NCRNG.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#ifndef NCrystal_NCRNG_redirectionhdr_hh
#define NCrystal_NCRNG_redirectionhdr_hh

////////////////////////////////////////////////////////////////////////////////
// //
// This file is part of NCrystal (see https://mctools.github.io/ncrystal/) //
// //
// Copyright 2015-2024 NCrystal developers //
// //
// Licensed under the Apache License, Version 2.0 (the "License"); //
// you may not use this file except in compliance with the License. //
// You may obtain a copy of the License at //
// //
// http://www.apache.org/licenses/LICENSE-2.0 //
// //
// Unless required by applicable law or agreed to in writing, software //
// distributed under the License is distributed on an "AS IS" BASIS, //
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
// See the License for the specific language governing permissions and //
// limitations under the License. //
// //
////////////////////////////////////////////////////////////////////////////////

// Obsolete redirection header (mostly added to not break OpenMC builds during
// the transition).

#pragma message("Header `NCrystal/NCRNG.hh` is deprecated in favour of `NCrystal/NCrystal.hh`")
#include "NCrystal/interfaces/NCRNG.hh"

#endif

0 comments on commit 14e8dab

Please sign in to comment.