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 OpenCL an optional dependency #54

Open
diiigle opened this issue Sep 29, 2023 · 5 comments
Open

Make OpenCL an optional dependency #54

diiigle opened this issue Sep 29, 2023 · 5 comments
Labels
good first issue Good for newcomers

Comments

@diiigle
Copy link

diiigle commented Sep 29, 2023

Is there any way to make OpenCL (quite a heavy chunk to the otherwise small and lightweight library) fully optional?
I see you have a CMake option to not use it, however git submodules still downloads the whole subtree, even if one doesn't want it.

https://cmake.org/cmake/help/latest/module/FetchContent.html comes to mind.

@lfreist
Copy link
Owner

lfreist commented Sep 30, 2023

Hi, valid point! I'll check the options and will change how OpenCL is added.

@barracuda156
Copy link

Yes, please. At the moment it does not work correctly at all:

CMake Error at external/miss-opencl/CMakeLists.txt:22 (add_subdirectory):
  The source directory

    /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_devel_hwinfo/hwinfo/work/hwinfo-a1ae945ab784780af5fc166150a6f6612d41e7bf/external/miss-opencl/external/OpenCL

  does not contain a CMakeLists.txt file.


-- Configuring incomplete, errors occurred!

@lfreist
Copy link
Owner

lfreist commented Oct 3, 2023

You need to run git update --init --recursive first. However, building on Mac has some issues atm since I do not have access to a Mac...

@lfreist lfreist added the good first issue Good for newcomers label Oct 5, 2023
@diiigle
Copy link
Author

diiigle commented Oct 12, 2023

This OpenCL repo does have another downside (for your users) which you might be not aware of:

fatal: clone of 'https://github.com/throwtheswitch/cexception.git' into submodule path 'C:/Users/myname/repositories/my-looongish-repo-name/ext/hwinfo/external/miss-opencl/external/OpenCL/external/OpenCL-CLHPP/external/CMock/vendor/c_exception' failed
Failed to clone 'vendor/c_exception'. Retry scheduled
Cloning into 'C:/Users/myname/repositories/my-looongish-repo-name/ext/hwinfo/external/miss-opencl/external/OpenCL/external/OpenCL-CLHPP/external/CMock/vendor/c_exception'...
fatal: cannot write keep file 'C:/Users/myname/repositories/my-looongish-repo-name/.git/modules/ext/hwinfo/modules/external/miss-opencl/modules/external/OpenCL/modules/headers-cpp/modules/external/CMock/modules/vendor/c_exception/objects/pack/pack-fd8baa50a07a4317443b1e3b5520f09f92fa84cf.keep': Filename too long

The submodules are nested so deep, that some filenames run out of MAX_PATH=260 on Windows. I can't even clone my own repo any more because of that unless I go to C:\tmp\ or something.

Fruit for thought, if OpenCL isn't a bit of an overkill.

Edit:
git -c submodule."external/miss-opencl".update=none submodule update --init --recursive seems to be a workaround for now. https://stackoverflow.com/a/52185169

@lfreist
Copy link
Owner

lfreist commented Oct 13, 2023

Yes, OpenCL kind of is an overkill, but for now, I found no other way to retrieve GPU Memory information...

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

No branches or pull requests

3 participants