-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
[samurai] Add new port #31051
base: master
Are you sure you want to change the base?
[samurai] Add new port #31051
Conversation
dfbf922
to
f239629
Compare
@FrankXie05 I don't understand why the |
If you are |
I finally fixed this issue. |
Now linux failed but I didn't change anything. It said that the configure_file defined here https://github.com/hpc-maths/samurai/blob/master/CMakeLists.txt#L13 doesn't exist. But it's not the case... |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@gouarin #31051 (comment) Good suggestion. :) |
ce8f922
to
a344f00
Compare
configure_file( | ||
- ${CMAKE_CURRENT_SOURCE_DIR}/version.hpp.in | ||
- ${CMAKE_CURRENT_SOURCE_DIR}/include/samurai/version.hpp | ||
+ "${CMAKE_CURRENT_SOURCE_DIR}/version.hpp.in" | ||
+ "${CMAKE_CURRENT_SOURCE_DIR}/include/samurai/version.hpp" | ||
@ONLY | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vpckg configures debug and release variant in parallel. This is incompatible with generating any files in the source dir at configuration time. (Race!) Ideally, generate files only in the binary dir, or not at all.
As a mitigation, you can supply DISABLE_PARALLEL_CONFIGURE
to vcpkg_cmake_configure
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dg0yt for the explanation!
I will fix that in a future release if you are ok with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then don't patch for quotes now, but add DISABLE_PARALLEL_CONFIGURE
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I don't make the debug version anymore, I don't think I have to set DISABLE_PARALLEL_CONFIGURE
, right ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In theory it might be obsolete. In practice vcpkg still sets a CMake option which forbids source writes.
f04a8a9
to
6e2aeb6
Compare
ports/samurai/portfile.cmake
Outdated
vcpkg_cmake_get_vars(cmake_vars_file) | ||
include(${cmake_vars_file}) | ||
|
||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
-DFETCHCONTENT_FULLY_DISCONNECTED=OFF | ||
-DCMAKE_SYSTEM_PROCESSOR=${VCPKG_DETECTED_CMAKE_SYSTEM_PROCESSOR} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On a second thought, the whole CMAKE_SYSTEM_PROCESSOR
must be removed. vcpkg_cmake_get_vars
won't give any result which differs from what would be achieved by not explicitly passing CMAKE_SYSTEM_PROCESSOR
.
Let's take a look at https://learn.microsoft.com/en-us/vcpkg/contributing/maintainer-guide#portfiles-are-run-in-script-mode
The portfiles run in script mode. All target information in script mode comes from the triplet file. The target system processor is represented by VCPKG_TARGET_ARCHITECTURE
, but it is not a value which is meant to be literally for CMAKE_SYSTEM_PROCESSOR
. You can check the files in scripts/toolchains
for some mappings.
Now you don't use the default vcpkg (sub) toolchains but want to chainload another one which takes CMAKE_SYSTEM_PROCESSOR
as an input variable. In that case you should use custom (overlay) triplets which provide the necessary parameter to your toolchain via VCPKG_CMAKE_CONFIGURE_OPTIONS
, or you must wrap your toolchain in a another scripts which takes care of setting this variable.
In any case, it doesn't belong into this port.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dg0yt. I will take some time to think about how to solve this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a note about WindowsToolchain and VCPkg. I don't know if it is useful.
Anyway, it seems to be hard to disable the call of WindowsToolchain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The note seems incorrect in key aspects. Maybe you should open a separate question here in discussion, "How to use WindowsToolchain with vcpkg".
Note: I will be converting your PR to draft status. When you respond, please revert to "ready for review". |
@dg0yt could you explain to me how to make working the Windows build using |
Keep it simpel. Just don't touch it for the official triplets. They do have working toolchain files. |
find_package
calls are REQUIRED, are satisfied byvcpkg.json
's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxxvcpkg.json
matches what upstream says.vcpkg.json
matches what upstream says../vcpkg x-add-version --all
and committing the result.