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

Please include glad directly into forge #236

Closed
StefanBruens opened this issue Sep 17, 2022 · 4 comments
Closed

Please include glad directly into forge #236

StefanBruens opened this issue Sep 17, 2022 · 4 comments
Labels

Comments

@StefanBruens
Copy link

Current setup of glad dependency makes it unnecessary hard to build:

  1. forge expects a specific configuration, as can be found in arrayfire's glad repository. A vanilla upstream glad does not work, as that has to be integrated specifically, see e.g. GLAD cmake command "ExternalProject_Add" Dav1dde/glad#376 (comment)
  2. Offline builds expects a git clone, a snapshot downloaded from githup (e.g. https://github.com/arrayfire/glad/archive/refs/heads/master.tar.gz) does not work.

forge should either include the pregenerated glad sources as a git subproject, or use a plain upstream glad and configure it at build time.

@9prady9
Copy link
Member

9prady9 commented Sep 18, 2022

Forge (ArrayFire also) uses a specific workflow for fetching dependencies like glad, glm etc. for building the concerned project. I believe it is better to be consistent on how CMake fetches dependencies if possible, which it is in the case of glad for forge/arrayfire. I am not a fan of including large source files into the repository, especially when CMake can help with the same. Also, please note that, all this dependency handling is taken care by the CMakeLists.txt without user invention. If that is not the case in your experience, please share the issue you have encountered.


forge should either include the pregenerated glad sources as a git subproject,

Sure, that is one way to do it. Again subtree is nothing but maintaining a copy of those sources in the downstream project which we want to avoid. We used to have similar dependencies as submodules, but we removed those in favor of CMake's fetch content which lets us handle the case of git not being available in offline builds.

or use a plain upstream glad and configure it at build time.

In a way, what's transpiring now is akin to the above suggestion. The difference being, we keep the glad sources that arrayfire and forge needs in separate repository and we re-use that directly in our CMake.


As far as the offline builds are concerned, every release of forge uploads a full code base of forge that includes the dependencies also as forge-full-x.x.x.tar.bz2 GitHub release asset.


I am not suggesting the workflow of arrayfire/forge is the best route but it definitely addresses the uses cases we want to handle.

  • CMake handles all build time dependencies automatically
  • Make offline builds possible without git
  • Avoid large source files of upstream dependencies

@9prady9
Copy link
Member

9prady9 commented Oct 10, 2022

Closing due to inactivity, please re-open if required after reviewing my above response.

@9prady9 9prady9 closed this as completed Oct 10, 2022
@StefanBruens
Copy link
Author

The "forge-full" tarball is broken - FetchContent_Populate, as called by fg_dep_check_and_populate requires a git checkout, i.e. including the ".git" directory.

Please try to build it without any network connection, it will fail with the following output:

[   14s] [ 11%] Creating directories for 'fg_glad-populate'
[   14s] [ 22%] Performing download step for 'fg_glad-populate'
[   14s] [ 33%] Performing disconnected update step for 'fg_glad-populate'
[   14s] CMake Error at /home/abuild/rpmbuild/BUILD/forge-1.0.8/build/extern/fg_glad-subbuild/fg_glad-populate-prefix/tmp/fg_glad-populate-gitupdate.cmake:34 (message):
[   14s]   Failed to get the hash for HEAD:
[   14s] 
[   14s]   fatal: not a git repository: '.git'

@9prady9
Copy link
Member

9prady9 commented Jan 9, 2024

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

No branches or pull requests

2 participants