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

Update FindMOAB to use MOAB config file #1526

Merged
merged 9 commits into from May 23, 2024

Conversation

ahnaf-tahmid-chowdhury
Copy link
Member

Description

This PR updates the FindMOAB.cmake file to utilize the MOAB config file for obtaining the MOAB_INCLUDE_DIRS variable. Previously, this variable was configured manually, causing issues with newer versions of MOAB.

Changes Made

  • Updated FindMOAB.cmake to use MOAB config file for MOAB_INCLUDE_DIRS.
  • Removed manual configuration of MOAB_INCLUDE_DIRS to prevent conflicts with newer MOAB versions.
  • Added env dir in .gitignore file.

@ahnaf-tahmid-chowdhury
Copy link
Member Author

@gonuke, could you please take a look at this? This PR should be merged unless we encounter issues installing PyNE with the latest MOAB.

Copy link
Contributor

@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 have a few changes here about what's required. It's technically possible to build PyNE without MOAB and DAGMC and many folks may want to do that if they are only interested in the more fundamental capabilities. This is also reflected in our CI testing process.

CMakeLists.txt Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
@@ -103,17 +103,7 @@ if(WITH_MOAB)
set(MOAB_ROOT "${DEPS_ROOT_DIR}")
endif()
MESSAGE("-- MOAB Root: ${MOAB_ROOT}")
find_package(MOAB)
message("-- MOAB Found: ${MOAB_FOUND}")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think some kind of message about what is found in MOAB would be useful, unless the MOAB cmake file does that? Like the version string, perhaps?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, I see. For the current latest release, the MOAB config file does not come with version strings, since my PR was recently merged to the develop branch. It will then be available in the master branch. So, we need to wait for a new release of MOAB, like 5.6. For now, I think I can add some message strings to the FindMOAB file.

CMakeLists.txt Show resolved Hide resolved
Copy link
Contributor

@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 think we can remove this custom FindMOAB - see #1537

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we just delete this now and rely on MOAB to install the right info? It may require changing some variables later in the file to match the ones MOAB sets

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 think it is good practice to have a custom find method. This will let the user set a custom path for MOAB, for example, in the /opt or /home directory or anywhere else. Additionally, in the updated FindMOAB, I am using the MOAB config file to set all the necessary variables.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also added some custom messages for more information. Let me know if you are still interested to remove this file.

Copy link
Contributor

Choose a reason for hiding this comment

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

I disagree with the idea of a custom FindMOAB as it frequently can become out of date with the software it is trying to find. Relying on the files installed by the package is the most robust and CMake's search rules (https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure) still allow a user to specify a custom location.

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 think we are also ready to remove FindDAGMC as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about that one because I'm not sure if we are installing the appropriate file with DAGMC yet... that's a new issue for us to tackle in DAGMC

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 dropped FindDAGMC file and it seems tests are passing.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I'd like to test this with DAGMC installed in an unusual location and confirm that the build process still works/finds it. Perhaps it does because if we set DAGMC_ROOT in the build process, the build in CMake FindPackage macro will recognize that variable and use it as a hint?

Copy link
Member Author

Choose a reason for hiding this comment

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

-- HDF5 Root: /root/opt/hdf5/hdf5-1_14_3
-- Found HDF5: /root/opt/hdf5/hdf5-1_14_3/lib/libhdf5.so;/root/opt/hdf5/hdf5-1_14_3/lib/libhdf5_hl.so;/root/opt/hdf5/hdf5-1_14_3/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.a;/usr/lib/x86_64-linux-gnu/libm.so (found version "1.14.3")  
--    HDF5 Include directory: /root/opt/hdf5/hdf5-1_14_3/include
--    HDF5 Library directories: /root/opt/hdf5/hdf5-1_14_3/lib
--    HDF5 Libraries: /root/opt/hdf5/hdf5-1_14_3/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libdl.a;/usr/lib/x86_64-linux-gnu/libm.so
--    HDF5 library version: 1.14.3
-- MOAB library Version: 
-- MOAB Include Directory: /root/opt/moab/include;/usr/include/eigen3
-- MOAB Library Directories: /root/opt/moab/lib
-- MOAB Libraries: -L/root/opt/moab/lib -lMOAB /root/opt/hdf5/hdf5-1_14_3/lib/libhdf5_hl.so;/root/opt/hdf5/hdf5-1_14_3/lib/libhdf5.so;/usr/lib/x86_64-linux-gnu/libdl.a;/usr/lib/x86_64-linux-gnu/libz.so;/usr/lib/x86_64-linux-gnu/libm.so
-- Configuring DAGMC 3.2.3
-- DAGMC library version: 3.2.3
-- DAGMC Include directory: /root/opt/dagmc/include;/root/opt/moab/include;/usr/include/eigen3
-- DAGMC Library directories: /root/opt/dagmc/lib;/root/opt/moab/lib
-- DAGMC Libraries: MOAB;dagmc

We have already installed different libraries in a custom location: /root/*.

Copy link
Contributor

@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.

This should fix a few problems and clean up our build maintenance burden - thanks @ahnaf-tahmid-chowdhury

@gonuke gonuke merged commit 7e38b25 into pyne:develop May 23, 2024
5 checks passed
@ahnaf-tahmid-chowdhury ahnaf-tahmid-chowdhury deleted the FindMOAB-fix branch May 23, 2024 12:17
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.

None yet

2 participants