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

Make GLM include directory portable. #1074

Merged
merged 2 commits into from
Jul 31, 2023
Merged

Make GLM include directory portable. #1074

merged 2 commits into from
Jul 31, 2023

Conversation

Robadob
Copy link
Member

@Robadob Robadob commented Jul 5, 2023

  • pyflamegpu.GLM now reports GLM status
    • FLAMEGPU_USE_GLM is the pre-existing C macro
  • When searching for GLM include files, RTC now tries the GLM_INC_DIR environment variable
  • Package GLM include inside wheel alongside FLAMEGPU headers
  • When importing pyflamegpu, GLM_INC_DIR is set to the location of GLM include dir within the module's install
  • Package GLM headers/license inside python wheel
  • Setup GLM_INC_DIR environment variable to be used
  • Document GLM_INC_DIR environment variable
  • Add GLM flag to SWIG
  • Only setup GLM_INC_DIR inside wheel when GLM enabled in build

Closes #1001

@Robadob Robadob self-assigned this Jul 5, 2023
@Robadob Robadob force-pushed the portable_glm branch 2 times, most recently from 1b07ff0 to 3daa46a Compare July 5, 2023 14:54
@Robadob
Copy link
Member Author

Robadob commented Jul 5, 2023

All tests ran using --gtest_filter=*glm*, With Windows/Debug/GLM=ON

C, Without using environment var

[----------] Global test environment tear-down
[==========] 34 tests from 24 test suites ran. (270287 ms total)
[  PASSED  ] 34 tests.

C, after deleting tmp/flamegpu/jitifycache and SET GLM_INC_DIR=c:/windows.

[----------] 2 tests from DeviceRTCAPITest
[ RUN      ] DeviceRTCAPITest.AgentFunction_array_get_glm
C:\Users\Robert\fgpu2\fgpu2\src\flamegpu\detail\JitifyCache.cu(235): Error environment variable GLM_INC_DIR (c:/windows) does not contain glm/glm.hpp. Please correct this environment variable.

C, after SET GLM_INC_DIR=C:\Users\Robert\fgpu2\fgpu2\build\_deps\glm-src2 (renamed dir to be sure it wasn't cheating).

[----------] Global test environment tear-down
[==========] 34 tests from 24 test suites ran. (271615 ms total)
[  PASSED  ] 34 tests.

@Robadob
Copy link
Member Author

Robadob commented Jul 5, 2023

Can't find any GLM tests in python test suite (would explain pyflamegpu.GLM) not being a thing.

Doesn't appear SWIG has GLM mappings setup either (did this get left on hold because of the Jitify slow compilation?). Regardless, the current changes should be appropriate, as it can still be used within RTC without being directly used in Python.

@Robadob Robadob marked this pull request as ready for review July 5, 2023 15:23
Copy link
Member

@ptheywood ptheywood left a comment

Choose a reason for hiding this comment

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

Needs atleast one python test which uses GLM (if GLM is enabled. Call pytest.skip(message) in the test(s) if pyflamegpu.GLM is not enabled)

Env var should be prefixed with FLAMEGPU_GLM_INC_DIR (unless GLM_INC_DIR is an env var set by GLM if centrally installed, which I doubt, and even then it needs to match the version used to build flamegpu, so should be a flamegpu specific one).

Not sure the warning on module import is a good addition either. importing a python module should be quiet IMO.

README.md Outdated Show resolved Hide resolved
src/flamegpu/detail/JitifyCache.cu Outdated Show resolved Hide resolved
swig/python/__init__.py.in Outdated Show resolved Hide resolved
swig/python/__init__.py.in Outdated Show resolved Hide resolved
@Robadob
Copy link
Member Author

Robadob commented Jul 10, 2023

Not sure the warning on module import is a good addition either. importing a python module should be quiet IMO.

Line 6 of the same file, there's already a warning for the FLAMEGPU inc dir version, I just copied similar pattern.

Otherwise good suggestions, will apply later in the week when I'm back on proper FGPU stuff. GLM + py is still a bit experimental.

@ptheywood
Copy link
Member

Line 6 of the same file, there's already a warning for the FLAMEGPU inc dir version, I just copied similar pattern.

That's fair (and I'd prolly lean towards getting rid of that too to be honest, but can be a future thing)

GLM include files and license are now embedded into Python wheels when enabled.
pyflamegpu.GLM now returns whether GLM support is enabled within the wheel.
Added GLM_INC_DIR as portable way to locate GLM include dir
ptheywood
ptheywood previously approved these changes Jul 31, 2023
GLM is not currently covered by CI, so warning was previously unnoticed.
Copy link
Member

@ptheywood ptheywood left a comment

Choose a reason for hiding this comment

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

Fixed a linux warning from ~1 year ago in a glm-only test, but otherwise looks good and tests pass for me.

@ptheywood ptheywood merged commit aa9c48d into master Jul 31, 2023
18 checks passed
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.

GLM RTC include path is not portable
2 participants