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

[alpaka] Add new port #26812

Merged
merged 1 commit into from
Sep 19, 2022
Merged

[alpaka] Add new port #26812

merged 1 commit into from
Sep 19, 2022

Conversation

bernhardmgruber
Copy link
Contributor

This PR adds a new port called alpaka, which adds the alpaka header-only library.
There is already an equally named package on spack.

  • Which triplets are supported/not supported? Have you updated the [CI baseline]

Alpaka supports Windows, Linux and MacOS. It should work on all triplets.

I tried.

  • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

Yes

github-actions[bot]
github-actions bot previously approved these changes Sep 15, 2022
@JonLiu1993 JonLiu1993 changed the title Add alpaka 0.9.0 [alpaka] Add new port Sep 16, 2022
@JonLiu1993 JonLiu1993 self-assigned this Sep 16, 2022
@JonLiu1993 JonLiu1993 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Sep 16, 2022
github-actions[bot]
github-actions bot previously approved these changes Sep 16, 2022
github-actions[bot]
github-actions bot previously approved these changes Sep 16, 2022
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

PRs must add only one version and must not modify any published versions

When making any changes to a library, the version or port-version in vcpkg.json or CONTROL must be modified.

error: checked-in files for alpaka have changed but the version was not updated
version: 0.9.0
old SHA: 3ffad67273f1e214a7bfbc407a5cacde236e1c82
new SHA: 8afc1b74dc92c51ef944368ce80e4a7d77672cec
Did you remember to update the version or port version?
Use --overwrite-version to bypass this check
***No files were updated***

@JonLiu1993
Copy link
Member

@bernhardmgruber , Thanks for your pr, when I tested the alpakax64-windows usage, I got a error:
could you please take a look:

Rebuild started...
1>------ Rebuild All started: Project: ZERO_CHECK, Configuration: Debug x64 ------
1>Checking Build System
2>------ Rebuild All started: Project: main, Configuration: Debug x64 ------
2>Building Custom Rule C:/Users/test/source/repos/CMakeProject42/CMakeProject42/CMakeLists.txt
2>CMakeProject42.cpp
2>LINK : fatal error LNK1104: cannot open file '<name>.lib'
2>Done building project "main.vcxproj" -- FAILED.
3>------ Skipped Rebuild All: Project: ALL_BUILD, Configuration: Debug x64 ------
3>Project not selected to build for this solution configuration 
========== Rebuild All: 1 succeeded, 1 failed, 1 skipped ==========

CMakelists.txt:

cmake_minimum_required (VERSION 3.8)

project(test)

find_package(alpaka CONFIG REQUIRED)

add_executable (main "CMakeProject42.cpp" "CMakeProject42.h")

target_link_libraries(main PRIVATE <name> alpaka alpaka::alpaka)

CMakeProject42.cpp

// CMakeProject42.cpp : Defines the entry point for the application.
//

#include "CMakeProject42.h"
#include "alpaka/alpaka.hpp"

using namespace std;

int main()
{
	cout << "Hello CMake." << endl;
	return 0;
}

github-actions[bot]
github-actions bot previously approved these changes Sep 19, 2022
@bernhardmgruber
Copy link
Contributor Author

bernhardmgruber commented Sep 19, 2022

@JonLiu1993, please remove the library <name> from target_link_libraries: and just link against alpaka:

target_link_libraries(main PRIVATE alpaka::alpaka)

Then your example builds locally on my machine. Mind though, that alpaka requires at least CMake 3.18 and if you want to use the CUDA backend, you must use alpaka_add_executable instead of add_executable, because we need to change the source language from CXX to CUDA for all source files.

@JonLiu1993
Copy link
Member

JonLiu1993 commented Sep 19, 2022

@bernhardmgruber, I remove from target_link_libraries and test usage successfully

JonLiu1993
JonLiu1993 previously approved these changes Sep 19, 2022
@JonLiu1993 JonLiu1993 added info:reviewed Pull Request changes follow basic guidelines and removed requires:author-response labels Sep 19, 2022
@dg0yt
Copy link
Contributor

dg0yt commented Sep 19, 2022

target_link_libraries(main PRIVATE <name> alpaka alpaka::alpaka)

If this was the usage proposal from vcpkg tool, then the new port needs a usage file, or it will be recorded in #20190.

github-actions[bot]
github-actions bot previously approved these changes Sep 19, 2022
@bernhardmgruber
Copy link
Contributor Author

target_link_libraries(main PRIVATE <name> alpaka alpaka::alpaka)

If this was the usage proposal from vcpkg tool, then the new port needs a usage file, or it will be recorded in #20190.

I just checked, this is how the usage is reported:

alpaka provides CMake targets:

    # this is heuristically generated, and may not be correct
    find_package(alpaka CONFIG REQUIRED)
    target_link_libraries(main PRIVATE <name> alpaka alpaka::alpaka)

I added a usage file now. In this process, I also squashed the commits.

github-actions[bot]
github-actions bot previously approved these changes Sep 19, 2022
Co-authored-by: Jonliu1993 <13720414433@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants