Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated DAGMC code to be compatible with Geant4 v11.1.1 #860

Closed
wants to merge 0 commits into from
Closed

Updated DAGMC code to be compatible with Geant4 v11.1.1 #860

wants to merge 0 commits into from

Conversation

ahnaf-tahmid-chowdhury
Copy link
Member

Description

In this pull request, I have updated the DAGMC code to be compatible with Geant4 v11.1.1. This involved making changes to exampleN01.cc , ExN01Analysis.hh, ExN01DetectorConstruction.cc, ExN01UserScoreWriter.cc and generate_geant4 which previously were only compatible with Geant4 v10.5.

Motivation and Context

This change is required because many users are currently using Geant4 v11.1.1 and need DAGMC to be compatible with it. The previous version of DAGMC was causing issues for users attempting to use it with this version of Geant4, as described in issue #857.

Changes

This PR introduces a bug fix, updating the DAGMC code to be compatible with Geant4 v11.1.1.

Behavior

Previously, DAGMC was only compatible with Geant4 v10.5. This pull request updates the code to be compatible with Geant4 v11.1.1, allowing users to use DAGMC with this newer version of Geant4.

Other Information

I have tested these changes and verified that they work correctly.

./dagsolid_unit_tests
[==========] Running 16 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 16 tests from DagSolidTest
[ RUN      ] DagSolidTest.SetUp
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.SetUp (92 ms)
[ RUN      ] DagSolidTest.point_in_volume
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.point_in_volume (34 ms)
[ RUN      ] DagSolidTest.point_on_surface
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.point_on_surface (35 ms)
[ RUN      ] DagSolidTest.point_out_outside_tolerance
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.point_out_outside_tolerance (34 ms)
[ RUN      ] DagSolidTest.point_out_surface_tolerance
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.point_out_surface_tolerance (34 ms)
[ RUN      ] DagSolidTest.point_on_surface_tolerance
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.point_on_surface_tolerance (35 ms)
[ RUN      ] DagSolidTest.point_outside_volume
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.point_outside_volume (34 ms)
[ RUN      ] DagSolidTest.test_2
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.test_2 (34 ms)
[ RUN      ] DagSolidTest.test_3
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.test_3 (34 ms)
[ RUN      ] DagSolidTest.test_4
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.test_4 (35 ms)
[ RUN      ] DagSolidTest.test_5
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.test_5 (34 ms)
[ RUN      ] DagSolidTest.test_6
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.test_6 (34 ms)
[ RUN      ] DagSolidTest.test_7
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.test_7 (35 ms)
[ RUN      ] DagSolidTest.test_8
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.test_8 (35 ms)
[ RUN      ] DagSolidTest.volume_test
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
[       OK ] DagSolidTest.volume_test (36 ms)
[ RUN      ] DagSolidTest.surface_area_test
Set overlap thickness = 0
Set numerical precision = 0.001
Loading file test_geom.h5m
Initializing the GeomQueryTool...
Using faceting tolerance: 0.0001
Building acceleration data structures...
0
[       OK ] DagSolidTest.surface_area_test (35 ms)
[----------] 16 tests from DagSolidTest (610 ms total)

[----------] Global test environment tear-down
[==========] 16 tests from 1 test case ran. (610 ms total)
[  PASSED  ] 16 tests.

Changelog file

In the CHANGELOG file, I have added a new entry describing the changes made in this PR, including a reference to the pull request number.

@helen-brooks
Copy link
Collaborator

This PR is backwards compatible, yes by testing the version of Geant4 with CMake. Given the renewed interest in this I am now dedicating some time to testing with a matrix of geant4 versions so this can be merged in. Then if you require additional changes, those could be merged in on top?

@ahnaf-tahmid-chowdhury
Copy link
Member Author

Thank you for your dedication to testing the compatibility of the PR with multiple versions of Geant4. I'm glad to see that there is renewed interest in this proposal. Please let me know if there is anything I can do to help with the testing or make any necessary changes. I look forward to seeing this PR merged into the main codebase.

@helen-brooks
Copy link
Collaborator

This PR is backwards compatible, yes by testing the version of Geant4 with CMake. Given the renewed interest in this I am now dedicating some time to testing with a matrix of geant4 versions so this can be merged in. Then if you require additional changes, those could be merged in on top?

Apologies, I believe I have confused matters. This comment was referring to my PR, #803. This is backwards compatible and works up to the latest in the 10.xx series. My recommendation to the developers would be to merge #803 first, providing there are no additional changes required, then your PR can be merged in on top of that one, to extend compatibility up the 11.xxx series.

My suspicion is that your changes are not backwards compatible as you have not wrapped protected the changes in header files with macros. You might want to take a look at how I did this... But I will leave requests for changes at the discretion on the DAGMC developers.

@ahnaf-tahmid-chowdhury ahnaf-tahmid-chowdhury marked this pull request as draft March 8, 2023 12:51
@gonuke
Copy link
Member

gonuke commented Mar 9, 2023

I've merged #803 (thanks @helen-brooks ) and recommend that you rebase this PR with those changes and see where we stand.

@ahnaf-tahmid-chowdhury
Copy link
Member Author

I have changed MOAB from version 5.3 to 5.4 and getting the following error

Starting job container
  /usr/bin/docker --config /home/runner/work/_temp/.docker_f73d88b4-b405-4a4c-8e61-b7256efa74dc login ghcr.io -u ahnaf-tahmid-chowdhury --password-stdin
  /usr/bin/docker --config /home/runner/work/_temp/.docker_f73d88b4-b405-4a4c-8e61-b7256efa74dc pull ghcr.io/svalinn/dagmc-ci-ubuntu-18.04-clang-ext-hdf5_1.10.4-moab_5.4.0:stable
  Error response from daemon: manifest unknown
  Warning: Docker pull failed with exit code 1, back off 7.917 seconds before retry.
  /usr/bin/docker --config /home/runner/work/_temp/.docker_f73d88b4-b405-4a4c-8e61-b7256efa74dc pull ghcr.io/svalinn/dagmc-ci-ubuntu-18.04-clang-ext-hdf5_1.10.4-moab_5.4.0:stable
  Error response from daemon: manifest unknown
  Warning: Docker pull failed with exit code 1, back off 2.095 seconds before retry.
  /usr/bin/docker --config /home/runner/work/_temp/.docker_f73d88b4-b405-4a4c-8e61-b7256efa74dc pull ghcr.io/svalinn/dagmc-ci-ubuntu-18.04-clang-ext-hdf5_1.10.4-moab_5.4.0:stable
  Error response from daemon: manifest unknown
  Error: Docker pull failed with exit code 1

The error message indicates that the Docker pull command failed with exit code 1, which means that Docker was unable to download the required image from the specified repository.
Any suggestion?

@ahnaf-tahmid-chowdhury ahnaf-tahmid-chowdhury marked this pull request as ready for review March 11, 2023 04:25
Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this update @ahnaf-tahmid-chowdhury. I think you've introduced a big question to our team about which/how many versions of Geant4 we should actively support and regularly test! It's a heavy dependency and resource intensive to support multiple versions.

Do you have any perspective on which versions are most common?

.github/workflows/docker_publish.yml Outdated Show resolved Hide resolved
@@ -3,10 +3,10 @@
set -ex

# Geant version and corresponding SHASUM
export geant4_version=10.5.1
export geant4_version=11.1.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will useful to test these changes with v10.5 first and then upgrade to other versions. We may also want a strategy for which versions we'll support over time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have set the version to 10.5.1 again. Regarding the strategy for the supported versions, we can discuss and decide on that together to ensure a smooth and reliable development process.

Copy link
Member Author

@ahnaf-tahmid-chowdhury ahnaf-tahmid-chowdhury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the Geant4 website, the latest stable version as of my knowledge cutoff (Fab 2023) was Geant4 version 11.1.1, and it's recommended for new users to start with the latest version. Additionally, they are also supporting version 10.7 and the latest version is 10.7.4 which was released in Sep 2022.

Based on the latest Geant4 release notes, version 11 introduces significant updates and improvements that could benefit the performance and accuracy of simulations using DAGMC. Therefore, it may be advantageous for users to consider upgrading to the latest version of Geant4 when working with the latest release of DAGMC.

.github/workflows/docker_publish.yml Outdated Show resolved Hide resolved
@@ -3,10 +3,10 @@
set -ex

# Geant version and corresponding SHASUM
export geant4_version=10.5.1
export geant4_version=11.1.1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have set the version to 10.5.1 again. Regarding the strategy for the supported versions, we can discuss and decide on that together to ensure a smooth and reliable development process.

@ahnaf-tahmid-chowdhury
Copy link
Member Author

I am getting the following error while doing Windows Build:

D:\a\DAGMC\install_dir\include\moab/Matrix3.hpp(968): message : see reference to function template instantiation 'bool moab::Util::is_finite<double>(T)' being compiled [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
          with
          [
              T=double
          ]
D:\a\DAGMC\install_dir\include\moab/Util.hpp(65): error C2062: type 'unknown-type' unexpected [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Util.hpp(65,1): error C2059: syntax error: ')' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
  uwuw_unit_test_driver.cpp
  Generating Code...
  Building Custom Rule D:/a/DAGMC/DAGMC/src/uwuw/tests/CMakeLists.txt
  uwuw_unit_tests_tally.cpp
D:\a\DAGMC\DAGMC\src\pyne\pyne.h(149,1): warning C4005: 'isnan': macro redefinition [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_tally.vcxproj]
D:\a\DAGMC\DAGMC\src\pyne\pyne.h(145): message : see previous definition of 'isnan' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_tally.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Range.hpp(392,14): warning C4251: 'moab::Range::mHead': struct 'moab::Range::PairNode' needs to have dll-interface to be used by clients of class 'moab::Range' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_tally.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Range.hpp(372): message : see declaration of 'moab::Range::PairNode' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_tally.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Range.hpp(944,50): warning C4267: '+=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_tally.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Range.hpp(949,39): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_tally.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Range.hpp(954,35): warning C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_tally.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Interface.hpp(96,1): warning C4275: non dll-interface class 'moab::UnknownInterface' used as base for dll-interface class 'moab::Interface' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_tally.vcxproj]
D:\a\DAGMC\install_dir\include\moab/UnknownInterface.hpp(96): message : see declaration of 'moab::UnknownInterface' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_tally.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Interface.hpp(95): message : see declaration of 'moab::Interface' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_tally.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Interface.hpp(2056,28): warning C4305: 'return': truncation from 'double' to 'float' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_tally.vcxproj]
  uwuw_unit_test_driver.cpp
  Generating Code...
  uwuw_unit_tests_tally.vcxproj -> D:\a\DAGMC\build\src\uwuw\tests\Release\uwuw_unit_tests_tally.exe
Error: Process completed with exit code 1.
##[debug]Finishing: build DAGMC

@ahnaf-tahmid-chowdhury
Copy link
Member Author

Dear @gonuke, I think it is time to run our tests as the windows build issue is solved. After that, I may replace Gent4 version from 10.5.1 to 11.1.1 in build_geant4.sh and run the tests again.

@ahnaf-tahmid-chowdhury
Copy link
Member Author

  uwuw_unit_test_driver.cpp
  Generating Code...
  uwuw_unit_tests.vcxproj -> D:\a\DAGMC\build\src\uwuw\tests\Release\uwuw_unit_tests.exe
  Building Custom Rule D:/a/DAGMC/DAGMC/src/uwuw/tests/CMakeLists.txt
  uwuw_unit_tests_preprocessor.cpp
D:\a\DAGMC\DAGMC\src\pyne\pyne.h(149,1): warning C4005: 'isnan': macro redefinition [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\DAGMC\src\pyne\pyne.h(145): message : see previous definition of 'isnan' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Range.hpp(392,14): warning C4251: 'moab::Range::mHead': struct 'moab::Range::PairNode' needs to have dll-interface to be used by clients of class 'moab::Range' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Range.hpp(372): message : see declaration of 'moab::Range::PairNode' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Range.hpp(944,50): warning C4267: '+=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Range.hpp(949,39): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Range.hpp(954,35): warning C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Interface.hpp(96,1): warning C4275: non dll-interface class 'moab::UnknownInterface' used as base for dll-interface class 'moab::Interface' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/UnknownInterface.hpp(96): message : see declaration of 'moab::UnknownInterface' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Interface.hpp(95): message : see declaration of 'moab::Interface' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Interface.hpp(2056,28): warning C4305: 'return': truncation from 'double' to 'float' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/FileOptions.hpp(240,32): warning C4251: 'moab::FileOptions::mOptions': class 'std::vector<const char *,std::allocator<const char *>>' needs to have dll-interface to be used by clients of class 'moab::FileOptions' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/FileOptions.hpp(240): message : see declaration of 'std::vector<const char *,std::allocator<const char *>>' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/FileOptions.hpp(241,33): warning C4251: 'moab::FileOptions::mSeen': class 'std::vector<bool,std::allocator<bool>>' needs to have dll-interface to be used by clients of class 'moab::FileOptions' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/FileOptions.hpp(241): message : see declaration of 'std::vector<bool,std::allocator<bool>>' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/FileOptions.hpp(208,1): warning C4267: 'return': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/GeomTopoTool.hpp(355,34): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/GeomTopoTool.hpp(363,53): warning C4267: 'initializing': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
  WARNING: You need to implement DEPRECATED for this compiler
D:\a\DAGMC\install_dir\include\moab/GeomQueryTool.hpp(95,1): warning C4267: 'return': conversion from 'size_t' to 'int', possible loss of data [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\DAGMC\src\dagmc\DagMC.hpp(574,42): warning C4267: 'return': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Util.hpp(65,12): error C2589: '(': illegal token on right side of '::' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Matrix3.hpp(968): message : see reference to function template instantiation 'bool moab::Util::is_finite<double>(T)' being compiled [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
          with
          [
              T=double
          ]
D:\a\DAGMC\install_dir\include\moab/Util.hpp(65): error C2062: type 'unknown-type' unexpected [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
D:\a\DAGMC\install_dir\include\moab/Util.hpp(65,1): error C2059: syntax error: ')' [D:\a\DAGMC\build\src\uwuw\tests\uwuw_unit_tests_preprocessor.vcxproj]
  uwuw_unit_test_driver.cpp

@ahnaf-tahmid-chowdhury
Copy link
Member Author

Ok. There is a syntax issue with MOAB v5.4.1. With v5.3 its passing the windows build.

@makeclean
Copy link
Contributor

Do you know the delta change between MOAB 5.3.0 and MOAB 5.4.1 for Matrix3.hpp?

@ahnaf-tahmid-chowdhury
Copy link
Member Author

Dear @makeclean, I apologize for my limited knowledge of MOAB, but based on the release notes, MOAB 5.4 introduced an improved iMOAB API for Fortran compatibility, while MOAB 5.4.1 added a new routine, iMOAB_SetDoubleTagStorageWithGid, to store values in a MOAB double Tag in iMOAB.

@makeclean
Copy link
Contributor

Ah, ok this issue with MOAB is this line, (RHS is MOAB 5.3.1)

image

So it looks like the VSC++ compiler doesn't like the std::isfinite, maybe theres and additonal flag we can pass it?

@ahnaf-tahmid-chowdhury
Copy link
Member Author

Ah, ok this issue with MOAB is this line, (RHS is MOAB 5.3.1)

image

So it looks like the VSC++ compiler doesn't like the std::isfinite, maybe theres and additonal flag we can pass it?

I have added additional compiler flag for Visual Studio std:c++17. Let's see

However, moab_isfinite macro is defined based on whether certain macros (MOAB_HAVE_ISFINITE, MOAB_HAVE_STDISFINITE and MOAB_HAVE_FINITE) are defined or not. I think we need to ensure that one of the macros is defined in our system.

@ahnaf-tahmid-chowdhury
Copy link
Member Author

I am going to make a new PR for this new MOAB. For now, I think we may fix the Geant4 with MOAB 5.3.

@ahnaf-tahmid-chowdhury
Copy link
Member Author

Without running clang-format, housekeeping is successful. But after running clang-format, it fails. Log

@ahnaf-tahmid-chowdhury
Copy link
Member Author

We've successfully passed v10.5 and I believe it's about time we consider upgrading to newer versions. @gonuke, please share your thoughts on this.

@gonuke
Copy link
Member

gonuke commented Jul 29, 2023

We're definitely getting closer! Unfortunately, our testing is still not fully converted to the new system until I resolve #880. Then it should be straightforward to test this update with newer versions of Geant

Copy link
Member

@gonuke gonuke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noted a few things here, but we'll also want to consider how we start adding different geant versions to our build environment.

I think if you rebase this branch on the recent additions to develop you can include something in the github workflows to make other Geant versions available.

.github/workflows/mac_build_test.yml Outdated Show resolved Hide resolved
CI/update_docker.sh Outdated Show resolved Hide resolved
Comment on lines 8 to 15
find_path(Geant4_CMAKE_CONFIG_VERSION
NAMES Geant4ConfigVersion.cmake
PATHS ${Geant4_SEARCH_DIRS}
NO_DEFAULT_PATH
)
# Extract the version number from the first directory in Geant4_SEARCH_DIRS
if(Geant4_SEARCH_DIRS)
# Extract the version number from the directory name
list(GET Geant4_SEARCH_DIRS 0 Geant4_LIB_DIR)
file(RELATIVE_PATH Geant4_VERSION ${GEANT4_DIR} ${Geant4_LIB_DIR})
string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" Geant4_VERSION ${Geant4_VERSION})

if (Geant4_CMAKE_CONFIG_VERSION)
set(Geant4_CMAKE_CONFIG_VERSION ${Geant4_CMAKE_CONFIG_VERSION}/Geant4ConfigVersion.cmake)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Geant no longer provide a cmake file that we can interrogate? That seems preferable to parsing a string based on a directory name....

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure whether Geant4 provides and maintains this file within its distribution. I have developed a method to extract the version of the directory structure itself. The advantage is that it can work even if Geant4 doesn't provide a version-specific configuration file. It directly extracts version information from the installation path. However, the downside is that it's vulnerable to changes in the directory structure, which could potentially lead to parsing errors. It relies on consistent naming conventions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the values of CMake is that is automates this in a robust way. I'll take a look to see what I find in a new distribution

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Geant4 provides and maintains this file within its distribution.

I am testing DAGMC with following arguments and its working. Let's see if it passes the workflow.

  cmake ../ -DMOAB_CMAKE_CONFIG=$env_dir/lib/cmake/MOAB \
    -DMOAB_DIR=$env_dir \
    -DBUILD_STATIC_LIBS=OFF \
    -DBUILD_GEANT4=ON \
    -DGeant4_CMAKE_CONFIG=$env_dir/lib/cmake/Geant4 \
    -DGEANT4_DIR=$env_dir \
    -DBUILD_TALLY=ON \
    -DCMAKE_INSTALL_PREFIX=$env_dir

@@ -2,9 +2,11 @@

from optparse import OptionParser
import os,errno
from itaps import iMesh,iBase
import sys
import meshio
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should convert the itaps code to use the pyne.dagmc class rather than the meshio module

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unable to run the tests as I am unfamiliar how to run this code.
It seams the code take some arguments and need some geometry_file.h5m. Can you please provide me the tutorial link?
and are you asking to use pyne.dagmc.load?

@gonuke
Copy link
Member

gonuke commented Sep 17, 2023

I think all of our workflows are in place to test this properly now. You may need to rebase and then launch some tests manually on your fork, and/or add Geant 11.x to the workflow matrix?

@gonuke
Copy link
Member

gonuke commented Sep 18, 2023

I’m a little confused by the current state of this PR. There are many files that are included here that are already changed in the current develop branch.

I think the best approach is to rebase this branch onto svalinn/develop so that it is more clear exactly which changes are from your addition here.

@ahnaf-tahmid-chowdhury
Copy link
Member Author

I accidentally forked @shimwell's repo, and it is not synced with the upstream svalinn/develop branch. Should I close this PR and create a new one? Or, if @shimwell kindly updates his develop branch, then I can rebase this branch.

@gonuke
Copy link
Member

gonuke commented Sep 19, 2023

I accidentally forked @shimwell's repo, and it is not synced with the upstream svalinn/develop branch. Should I close this PR and create a new one? Or, if @shimwell kindly updates his develop branch, then I can rebase this

I think it's too late now because you force pushed over your develop branch, but for future reference, you can rebase from any branch on any repo on the command-line/client-side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants