Skip to content

vcpkg manifest file for ease of development; support to use as many vcpkg ports as possible #3119

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

Merged
merged 1 commit into from
May 21, 2021

Conversation

9prady9
Copy link
Member

@9prady9 9prady9 commented Apr 8, 2021

Needs microsoft/vcpkg#17099 to be merged so that ArrayFire's manifest baseline is correct

Description

Developers can now invoke cmake as shown below to install dependencies automatically when using vcpkg and cmake.

```cmake
cmake .. -DVCPKG_ROOT:PATH=<path to vcpkg repository tool>
```
or
```cmake
export VCPKG_ROOT=<path to vcpkg repository tool>
cmake ..
```

One may add `-DAF_BUILD_CUDA:BOOL=ON` command line argument to enable CUDA dependency check.
Even if not provided, ArrayFire will silently check for CUDA and enable the backend if available.

There are couple of caveats though for the following dependencies
- cuda
- cudnn
- intel-mkl

As these libraries have complex installation mechanisms, their respective vcpkg dependency is merely a check
for user. They have to be installed using respective vendor provided installers.

A few important notes regarding using vcpg manifest file:

1. For linux developers, currently full support for only Intel MKL compute backend is availalbe.
2. As x64-linux triplet creates static builds only as of now, forge cannot be part of vcpkg dependency list
   on non windows platforms. Nevertheless, the user doesn't need to do anything as fetchcontent workflow is
   the fallback.
3. vcpkg manifest is for development puporses only and isn't intended to be production ready dependency
   management for arrayfire as there are dependencies that don't get built with vcpkg at all.

Changes to Users

ArrayFire development using vcpkg becomes a better experience. I am going to send in a another PR with cmake presets which should further improve development experience of ArrayFire.

Checklist

  • Rebased on latest master
  • Code compiles
  • [x ] Tests pass
  • [ ] Functions added to unified API
  • [ ] Functions documented

@9prady9 9prady9 added this to the 3.8.1 milestone Apr 8, 2021
@9prady9
Copy link
Member Author

9prady9 commented Apr 8, 2021

@jacobkahn Please let me know your thoughts on the manifest file content.

Note that, the following dependencies are still retrieved using CMake's fetch content workflow. I did notice a problem with this approach while update forge package port on vcpkg project - their ci doesn't have git and thus all fetch content commands are failing from we setup a repo from github. I have requested a work around on microsoft/vcpkg#17099 for such scenarios - no response so far.

@9prady9 9prady9 marked this pull request as draft April 12, 2021 13:02
@jacobkahn
Copy link
Contributor

@9prady9 we spoke offline a bit about this -- the manifest looks good to me though!

@9prady9
Copy link
Member Author

9prady9 commented May 12, 2021

  • Local windows and linux build completed successfully
  • Tests on Arch Linux except the expected ones passed
  • Windows tests are in progress
  • Test using cmake 3.5.1

@9prady9 9prady9 force-pushed the vcpkg branch 10 times, most recently from 363c7a2 to 74c0643 Compare May 15, 2021 05:33
@9prady9 9prady9 changed the title vcpkg manifest file vcpkg manifest file for ease of development; support to use as many vcpkg ports as possible May 15, 2021
@9prady9 9prady9 marked this pull request as ready for review May 18, 2021 03:55
@9prady9 9prady9 force-pushed the vcpkg branch 2 times, most recently from 41f4aa9 to 2055a9e Compare May 20, 2021 04:16
Developers can now invoke cmake as shown below to install dependencies automatically when using vcpkg and cmake.

```cmake
cmake .. -DVCPKG_ROOT:PATH=<path to vcpkg repository tool>
```
or
```cmake
export VCPKG_ROOT=<path to vcpkg repository tool>
cmake ..
```

One may add `-DAF_BUILD_CUDA:BOOL=ON` command line argument to enable CUDA dependency check.
Even if not provided, ArrayFire will silently check for CUDA and enable the backend if available.

There are couple of caveats though for the following dependencies
- cuda
- cudnn
- intel-mkl

As these libraries have complex installation mechanisms, their respective vcpkg dependency is merely a check
for user. They have to be installed using respective vendor provided installers.

A few important notes regarding using vcpg manifest file:

1. For linux developers, currently full support for only Intel MKL compute backend is availalbe.
2. As x64-linux triplet creates static builds only as of now, forge cannot be part of vcpkg dependency list
   on non windows platforms. Nevertheless, the user doesn't need to do anything as fetchcontent workflow is
   the fallback.
3. vcpkg manifest is for development puporses only and isn't intended to be production ready dependency
   management for arrayfire as there are dependencies that don't get built with vcpkg at all.
@9prady9 9prady9 merged commit 9738a31 into arrayfire:master May 21, 2021
@9prady9 9prady9 deleted the vcpkg branch May 21, 2021 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants