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

Any plan to support vcpkg? #297

Closed
eladmaimoni opened this issue Jan 27, 2022 · 12 comments
Closed

Any plan to support vcpkg? #297

eladmaimoni opened this issue Jan 27, 2022 · 12 comments

Comments

@eladmaimoni
Copy link

I've been using vcpkg lately and found it to be very productive. I didn't see a port for cuda-api-wrappers.

Is there a plan to support this in the near future?
What is the recommended way to integrate this api into existing projects?

@eyalroz
Copy link
Owner

eyalroz commented Jan 28, 2022

@elad8a : TBH, I don't have experience with vcpkg. But I would consider PR with vcpkg support.

@eyalroz
Copy link
Owner

eyalroz commented Mar 9, 2022

@elad8a : Ping.

Anyway, the recommended way to integrate this is:

  1. Download a release tarball.
  2. Decompress.
  3. cd cuda-api-wrappers
  4. cmake -B build -DCMAKE_INSTALL_PREFIX=/opt/cuda-api-wrappers (or wherever you want it)
  5. cmake --build build
  6. cmake --install build

and then at the install location you have include files, library files, and CMake package configuration files.

@eyalroz
Copy link
Owner

eyalroz commented Mar 18, 2022

Feel free to reopen if you have a PR.

@eyalroz eyalroz closed this as completed Mar 18, 2022
@eladm-ultrawis
Copy link

@eyalroz Hi!

Just came back to this issue.

I made a preliminary attempt to create a vcpkg port for this library. It's basically 2 commits in my vcpkg fork here:

If I am not mistaken, the contributing guide for vcpkg says you need to sign a CLA.

Let me me know if we can proceed with this.

@eyalroz
Copy link
Owner

eyalroz commented Apr 14, 2023

@eladm-ultrawis : As I'm not a vcpkg user, I will need some more explanation.

The files you added seem not to fit as a part of the repository itself, but rather to refer to it:

  • versions/c-/cuda-api-wrappers.json - seems to be one of several JSON files, having hashed the packaged repository or its files.
  • ports/cuda-api-wrappers/portfile.cmake - seems to describe how to get the repository from GitHub and build it.

Should this really be in the repository, or in some other, VCPKG-related, repository referring to many libraries' independent repos? I'm looking for such files in libraries such as spdlog, Boost and cxxopts, and not finding any. Is it common to include them?

Also, in Martin Moene's nonstd_lite, we have this directory, apparently with the same purpose, but being a lot less verbose, without any hashes etc. Is something like that not good enough?

@eyalroz eyalroz reopened this Apr 14, 2023
@eyalroz
Copy link
Owner

eyalroz commented Apr 14, 2023

Also note that I have a problem with the setting up the Windows testing environment here on GitHub, due to a CMake issue with locating NVTX.

@eladm-ultrawis
Copy link

@eyalroz vcpkg way of working is quite complicated. But it is basically a repository of recipes that instruct vcpkg how to download and compile your library to a certain target "triplet" (architecture-compiler-os).

To add a library to vcpkg, you need to do a PR to the vcpkg repository with the added recipe (AKA "port"). You don't need to add anything to your library (unless you use vcpkg yourself).

The new portfile (located in port directory) is basically the recipe. It tells vcpkg to download the sources from github and do a cmake install (the triplet configures the right cmake stuff such as compiler and generator).

The stuff inside "version" is autogenerated by the vcpkg executable once you correctly write the "port".

@eladm-ultrawis
Copy link

Also note that I have a problem with the setting up the Windows testing environment here on GitHub, due to a CMake issue with locating NVTX.

I never submitted a PR to vcpkg, so we will have to see about this one. I am currently testing my new vcpkg port on my local windows environment with cuda 12.1.

@eyalroz
Copy link
Owner

eyalroz commented Apr 14, 2023

To add a library to vcpkg, you need to do a PR to the vcpkg repository with the added recipe (AKA "port"). You don't need to add anything to your library (unless you use vcpkg yourself).

Oh, well, in that case - you have my blessing to submit a PR that works to the VCPKG repository... :-)

@eladm-ultrawis
Copy link

eladm-ultrawis commented Apr 15, 2023

@eyalroz indeed trying to link cuda-api-wrappers::nvtx fails on windows. However since this is a header only library I hope this won't be an issue with vcpkg.

In recent cuda versions there is the CUDA::nvtx3 target that seems to work fine. could using it serve as a workaround on windows?

@eyalroz
Copy link
Owner

eyalroz commented Apr 15, 2023

It won't be an issue if you don't compile the examples; but the dependency will need to be met when the library is used.

As for nvtx3 ... hmm. Yes, that's new in CMake 3.25. Let's see if it does the trick.

@eyalroz
Copy link
Owner

eyalroz commented Apr 22, 2023

Well, I resolved the NVTX problems - sort of - with issue #490 . Closing this one, feel free to let me know if this makes it into vcpkg.

@eyalroz eyalroz closed this as completed Apr 22, 2023
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

No branches or pull requests

3 participants