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

Adds opencascade as an optional dependency #1441

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from

Conversation

kennyweiss
Copy link
Member

@kennyweiss kennyweiss commented Oct 8, 2024

Summary

  • This PR is a feature
  • It adds opencascade as an optional axom dependency
  • We're planning to use this mainly to import mesh formats, such as STEP files

TODO

  • Add Windows support through vcpkg
  • Enable this in at least one CI plan
  • Update documentation

@kennyweiss kennyweiss changed the title pwdFeature/kweiss/optional opencascade dep Adds opencascade as an optional dependency Oct 8, 2024
@kennyweiss kennyweiss marked this pull request as draft October 8, 2024 21:08
@kennyweiss kennyweiss force-pushed the feature/kweiss/optional-opencascade-dep branch from f5c930e to ba9bf06 Compare October 11, 2024 23:27
@kennyweiss
Copy link
Member Author

/style

kennyweiss and others added 21 commits October 14, 2024 21:10
Only currently tested on LLNL's toss4.
Misc: Fixes typo in comments about exported targets
Includes a test for reading and writing STEP files.
I am not sure why this has not shown up previously.
I had to copy the opencascade port files from vcpkg to
* remove the default-dependency on freetype
* patch a typo where a number was being quoted in a CMake file
The candidates are currently returned as a std::vector.

Misc: Uses locales to improve output of these tests.
@kennyweiss kennyweiss force-pushed the feature/kweiss/optional-opencascade-dep branch from 27552e8 to 4d1304e Compare October 15, 2024 04:11
@kennyweiss kennyweiss marked this pull request as ready for review October 15, 2024 04:11
@kennyweiss kennyweiss self-assigned this Oct 15, 2024
@kennyweiss kennyweiss added TPL Issues related to Axom's third party libraries Build system Issues related to Axom's build system labels Oct 15, 2024
set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.07.0-4bdhkgxmckkcfnhfv76gutbzn7gzrcum" CACHE PATH "")
set(UMPIRE_DIR "${TPL_ROOT}/umpire-2024.07.0-et2uff5thiprgch43uftatndduzssxay" CACHE PATH "")

set(OPENCASCADE_DIR "${TPL_ROOT}/opencascade-7.8.1-epyyoyevoozkzqoxdqxku2q4anwlqw52" CACHE PATH "")
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 tested configs on all platforms w/ opencascade, but only enabled it on a single toss4 config on LC.
I also enabled opencascade in Windows configs.

buildable: False
externals:
- spec: [email protected] # found via: glxinfo | grep -i version
prefix: /
Copy link
Member Author

@kennyweiss kennyweiss Oct 15, 2024

Choose a reason for hiding this comment

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

@white238 -- the opengl and X libraries were in /lib64 on toss4_cray and blueos, so I made the prefix / instead of /usr. Is that the correct prefix? I tested this w/ one of our blueos configs and it worked.

Comment on lines +32 to +39
### BEGIN AXOM PATCH

# replace a quoted number in a flag -- /wd"26812" with /wd26812
set(_file "${SOURCE_PATH}/adm/cmake/occt_defs_flags.cmake")
file(READ "${_file}" _filedata)
string(REPLACE [[/wd\"26812\"]] [[/wd26812]] _filedata "${_filedata}")
file(WRITE "${_file}" "${_filedata}")
### END AXOM PATCH
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: I had to copy the whole opencascade portfile to add this patch, which converts /wd"26812" to /wd26812

"host": true
}
],
"default-features": [],
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: I copied the opencascade portfile from vcpkg to remove the freetype default-feature.
More direct ways to do this would involve updates to uberenv to have a project package file.

Compare to:
https://github.com/microsoft/vcpkg/blob/98ffd29b9e6a07db04a0899d1be351e9e3bd1e54/ports/opencascade/vcpkg.json#L27-L32

Comment on lines +4 to +5
REF 85c58eb7d25ac5a7ff1c6a3cc6bb74bf8351e36e # HEAD of bugfix/dayton8/win32 branch; a bit past v2024.07.0
SHA512 263346ff91c17f48fa40efdd6826331e1fecb995fef289bf997500d058c57e4dc706512baa8fc5dfc912c54939b973c56c8677a4705e261a2740c55851446341
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: This points to @adayton1's bugfix commit -- LLNL/RAJA#1746

I can update it to the current HEAD of raja@develop now that the PR is merged (or leave it as is).

Copy link
Member

@rhornung67 rhornung67 Oct 15, 2024

Choose a reason for hiding this comment

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

I'm OK with either. If users need this, I can tag a patch release for RAJA because Mike C. won't build any TPL sets that don't point at releases.

Please let me know if I should do a RAJA release.

@@ -351,6 +352,11 @@ class PointFinder
return m_cellBBoxes[cellIdx];
}

std::vector<IndexType> getCandidates(SpacePoint const& pt) const
{
return m_grid.getCandidatesAsArray(pt);
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: ImplicitGrid returns a std::vector for its getCandidatesAsArray. We should probably change this to an axom::Array so it's amenable w/ usage on a device.

Comment on lines +118 to +123
#if(defined(__x86_64__) && defined(__GNUC__)) || \
(defined(_WIN64) && (_MSC_VER >= 1600))
using Word = std::uint64_t;
#else
using Word = std::uint32_t;
#endif
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: BitSet now uses 32-bit words in x86 mode on windows.

Comment on lines +1063 to +1064
const int numBits =
axom::utilities::min(bitsPerWord, nbits - (iword * bitsPerWord));
Copy link
Member Author

Choose a reason for hiding this comment

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

Note: I lost way too much time trying to track down this bug! It hardcoded 64-bit words for the underlying slam::BitSet!

@agcapps
Copy link
Member

agcapps commented Oct 17, 2024

Thank you for this work, @kennyweiss . So far it looks good. What docs do you plan to add?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build system Issues related to Axom's build system TPL Issues related to Axom's third party libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants