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

WIP: [x64-windows-intel] new Triplet: #15053

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a53d79f
revive vcpkg_load_environment_from_batch
Neumann-A Dec 10, 2020
b901bdd
add intel triplet.
Neumann-A Dec 10, 2020
932c118
playing around with lapack
Neumann-A Dec 11, 2020
3a9369a
Merge remote-tracking branch 'upstream/master' into community_intel_t…
Neumann-A Jan 8, 2021
d6b5075
update lapack-reference to 3.9
Neumann-A Jan 8, 2021
b9610c5
add triplet x64-windows-ifort for testing.
Neumann-A Jan 8, 2021
5895440
force blas vendor in lapack for now
Neumann-A Jan 8, 2021
52174bc
add fortran flags so that find_package finds blas
Neumann-A Jan 8, 2021
b9f9d29
playing around with blas somehow i cannot get it to work without
Neumann-A Jan 8, 2021
48cc205
patch lapack to link with intel compiler and changed name mangling
Neumann-A Jan 9, 2021
7dea36d
update triplets
Neumann-A Jan 9, 2021
0f58307
force blas vendor with wrapper
Neumann-A Jan 9, 2021
8160eba
fix wrapper.
Neumann-A Jan 9, 2021
e865e9a
add wrapper to lapack
Neumann-A Jan 9, 2021
48c2967
refine blas wrapper.
Neumann-A Jan 10, 2021
e13a546
update intel-mkl port
Neumann-A Jan 10, 2021
f72480c
update lapack
Neumann-A Jan 10, 2021
2c6f4ca
Merge remote-tracking branch 'upstream/master' into community_intel_t…
Neumann-A Jun 7, 2021
7d1244a
fix missing include
Neumann-A Jun 7, 2021
4ae012a
use cmake defaults.
Neumann-A Jun 7, 2021
62cf865
Merge remote-tracking branch 'upstream/master' into community_intel_t…
Neumann-A Aug 6, 2021
b2e50bd
[skip ci] works with zlib
Neumann-A Aug 6, 2021
f02280f
Merge remote-tracking branch 'upstream/master' into community_intel_t…
May 5, 2022
ed4f550
Merge remote-tracking branch 'upstream/master' into community_intel_t…
Neumann-A Jun 28, 2022
75ef783
update triplets
Neumann-A Jun 28, 2022
c9f5087
mess with ci
Neumann-A Jun 28, 2022
fbeba5b
Merge remote-tracking branch 'upstream/master' into community_intel_t…
Neumann-A Jul 12, 2022
2f2bb83
mess a bit more with ci [skip actions]
Neumann-A Jul 12, 2022
47bba8c
use explicit triplet names instead of variable for ci
Neumann-A Jul 13, 2022
4427219
make environment manipulations more robust.
Neumann-A Jul 13, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion ports/blas/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)

list(APPEND FEATURES openblas) # change in Build-Depends and here for overlay

if("generic" IN_LIST FEATURES)
set(BLA_VENDOR Generic)
elseif("mkl" IN_LIST FEATURES)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x64)
set(BLA_VENDOR Intel10_64lp)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
set(BLA_VENDOR Intel10_32)
else()
message(FATAL_ERROR "Unsupported target architecture for Intel MKL!")
endif()
elseif("openblas" IN_LIST FEATURES)
set(BLA_VENDOR OpenBLAS)
elseif("apple" IN_LIST FEATURES)
set(BLA_VENDOR Apple)
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(BLA_STATIC ON)
else()
set(BLA_STATIC OFF)
endif()

configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
# Make sure BLAS can be found
vcpkg_configure_cmake(SOURCE_PATH ${CURRENT_PORT_DIR}
OPTIONS -DCMAKE_PREFIX_PATH="${CURRENT_PACKAGES_DIR}")
OPTIONS -DCMAKE_PREFIX_PATH="${CURRENT_PACKAGES_DIR}"
-DBLA_VENDOR=${BLA_VENDOR}
-DBLA_STATIC=${BLA_STATIC})
5 changes: 5 additions & 0 deletions ports/blas/vcpkg-cmake-wrapper.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(BLA_VENDOR @BLA_VENDOR@)
set(BLA_STATIC @BLA_STATIC@)
_find_package(${ARGS})
unset(BLA_VENDOR)
unset(BLA_STATIC)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/SRC/sorhr_col.f b/SRC/sorhr_col.f
index 38976245c..600c19fbb 100644
--- a/SRC/sorhr_col.f
+++ b/SRC/sorhr_col.f
@@ -282,7 +282,8 @@ SUBROUTINE SORHR_COL( M, N, NB, A, LDA, T, LDT, D, INFO )
$ NPLUSONE
* ..
* .. External Subroutines ..
- EXTERNAL SCOPY, SLAORHR_COL_GETRFNP, SSCAL, STRSM, XERBLA
+ EXTERNAL SCOPY, SLAORHR_COL_GETRFNP, SSCAL, STRSM,
+ $ XERBLA
* ..
* .. Intrinsic Functions ..
INTRINSIC MAX, MIN
@@ -436,4 +437,4 @@ SUBROUTINE SORHR_COL( M, N, NB, A, LDA, T, LDT, D, INFO )
*
* End of SORHR_COL
*
- END
\ No newline at end of file
+ END
28 changes: 28 additions & 0 deletions ports/lapack-reference/intel.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/INSTALL/dsecnd_EXT_ETIME.f b/INSTALL/dsecnd_EXT_ETIME.f
index 35377643b..f98aad7a9 100644
--- a/INSTALL/dsecnd_EXT_ETIME.f
+++ b/INSTALL/dsecnd_EXT_ETIME.f
@@ -34,6 +34,9 @@
*
* =====================================================================
DOUBLE PRECISION FUNCTION DSECND( )
+#if defined(__INTEL_COMPILER)
+ USE IFPORT
+#endif
*
* -- LAPACK auxiliary routine (version 3.7.0) --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
diff --git a/INSTALL/second_EXT_ETIME.f b/INSTALL/second_EXT_ETIME.f
index 43044cda7..0e2a9a331 100644
--- a/INSTALL/second_EXT_ETIME.f
+++ b/INSTALL/second_EXT_ETIME.f
@@ -34,6 +34,9 @@
*
* =====================================================================
REAL FUNCTION SECOND( )
+#if defined(__INTEL_COMPILER)
+ USE IFPORT
+#endif
*
* -- LAPACK auxiliary routine (version 3.7.0) --
* -- LAPACK is a software package provided by Univ. of Tennessee, --
14 changes: 13 additions & 1 deletion ports/lapack/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled)

set(BLA_VENDOR Generic)
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(BLA_STATIC ON)
else()
set(BLA_STATIC OFF)
endif()

# Make sure LAPACK can be found
vcpkg_configure_cmake(SOURCE_PATH ${CURRENT_PORT_DIR}
OPTIONS -DCMAKE_PREFIX_PATH="${CURRENT_PACKAGES_DIR}")
OPTIONS -DCMAKE_PREFIX_PATH="${CURRENT_PACKAGES_DIR}"
-DBLA_VENDOR=${BLA_VENDOR}
-DBLA_STATIC=${BLA_STATIC})

5 changes: 5 additions & 0 deletions ports/lapack/vcpkg-cmake-wrapper.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(BLA_VENDOR @BLA_VENDOR@)
set(BLA_STATIC @BLA_STATIC@)
_find_package(${ARGS})
unset(BLA_VENDOR)
unset(BLA_STATIC)
70 changes: 35 additions & 35 deletions scripts/azure-pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,58 +16,58 @@ jobs:
- template: windows/azure-pipelines.yml
parameters:
triplet: x86-windows
jobName: x86_windows
jobName: x64_windows_ifort
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: windows/azure-pipelines.yml
parameters:
triplet: x64-windows
jobName: x64_windows
jobName: x64_windows_intel
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: windows/azure-pipelines.yml
parameters:
triplet: x64-windows-static
jobName: x64_windows_static
jobName: x64_windows_intel_llvm
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: windows/azure-pipelines.yml
parameters:
triplet: x64-windows-static-md
jobName: x64_windows_static_md
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
# - template: windows/azure-pipelines.yml
# parameters:
# triplet: x64-windows-static-md
# jobName: x64_windows_static_md
# poolName: $(windows-pool)
# vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: windows/azure-pipelines.yml
parameters:
triplet: x64-uwp
jobName: x64_uwp
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
# - template: windows/azure-pipelines.yml
# parameters:
# triplet: x64-uwp
# jobName: x64_uwp
# poolName: $(windows-pool)
# vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: windows/azure-pipelines.yml
parameters:
triplet: arm64-windows
jobName: arm64_windows
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
# - template: windows/azure-pipelines.yml
# parameters:
# triplet: arm64-windows
# jobName: arm64_windows
# poolName: $(windows-pool)
# vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: windows/azure-pipelines.yml
parameters:
triplet: arm-uwp
jobName: arm_uwp
poolName: $(windows-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
# - template: windows/azure-pipelines.yml
# parameters:
# triplet: arm-uwp
# jobName: arm_uwp
# poolName: $(windows-pool)
# vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: osx/azure-pipelines.yml
parameters:
poolName: $(osx-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
# - template: osx/azure-pipelines.yml
# parameters:
# poolName: $(osx-pool)
# vcpkgToolSha: ${{ parameters.vcpkgToolSha }}

- template: linux/azure-pipelines.yml
parameters:
poolName: $(linux-pool)
vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
# - template: linux/azure-pipelines.yml
# parameters:
# poolName: $(linux-pool)
# vcpkgToolSha: ${{ parameters.vcpkgToolSha }}
30 changes: 23 additions & 7 deletions scripts/cmake/vcpkg_configure_make.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,31 @@ function(vcpkg_configure_make)
debug_message("Using make triplet: ${arg_BUILD_TRIPLET}")
endif()
if(CMAKE_HOST_WIN32)
set(append_env)
set(append_env "")
if(arg_USE_WRAPPERS)
set(append_env ";${MSYS_ROOT}/usr/share/automake-1.16")
string(APPEND append_env ";${SCRIPTS}/buildsystems/make_wrapper") # Other required wrappers are also located there
set(append_env "${MSYS_ROOT}/usr/share/automake-1.16")
list(APPEND append_env "${SCRIPTS}/buildsystems/make_wrapper") # Other required wrappers are also located there
endif()
# This inserts msys before system32 (which masks sort.exe and find.exe) but after MSVC (which avoids masking link.exe)
string(REPLACE ";$ENV{SystemRoot}\\System32;" "${append_env};${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\System32;" NEWPATH "$ENV{PATH}")
string(REPLACE ";$ENV{SystemRoot}\\system32;" "${append_env};${MSYS_ROOT}/usr/bin;$ENV{SystemRoot}\\system32;" NEWPATH "$ENV{PATH}")
set(ENV{PATH} "${NEWPATH}")

debug_message(STATUS "PATH BEFORE:$ENV{PATH}")
cmake_path(CONVERT "$ENV{PATH}" TO_CMAKE_PATH_LIST PATH_LIST NORMALIZE)
cmake_path(CONVERT "$ENV{SystemRoot}" TO_CMAKE_PATH_LIST SYSTEM_ROOT)
debug_message(STATUS "PATH_LIST:${PATH_LIST}")
list(FIND PATH_LIST "${SYSTEM_ROOT}/system32/" index)
if(index EQUAL "-1")
list(FIND PATH_LIST "${SYSTEM_ROOT}/System32/" index)
endif()
if(index GREATER_EQUAL "0")
list(INSERT PATH_LIST "${index}" ${append_env} "${MSYS_ROOT}/usr/bin")
else()
message(WARNING "Unable to find system32 in the PATH variable to insert additional paths! Appending msys paths!")
list(APPEND PATH_LIST "${index}" ${append_env} "${MSYS_ROOT}/usr/bin")
endif()

cmake_path(CONVERT "${PATH_LIST}" TO_NATIVE_PATH_LIST NATIVE_PATH_LIST)
set(ENV{PATH} "${NATIVE_PATH_LIST}")
debug_message(STATUS "PATH AFTER:${NATIVE_PATH_LIST}")

set(bash_executable "${MSYS_ROOT}/usr/bin/bash.exe")
endif()

Expand Down
69 changes: 69 additions & 0 deletions scripts/cmake/vcpkg_load_environment_from_batch.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
include(vcpkg_execute_in_download_mode)
include(vcpkg_execute_required_process)
function(vcpkg_load_environment_from_batch)
cmake_parse_arguments(_lefb "" "BATCH_FILE_PATH" "ARGUMENTS" ${ARGN})

#message(STATUS "LOADING ENV")
# Get original environment
vcpkg_execute_required_process(
COMMAND "${CMAKE_COMMAND}" "-E" "environment"
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}
LOGNAME environment-initial
)
file(READ ${CURRENT_BUILDTREES_DIR}/environment-initial-out.log ENVIRONMENT_INITIAL)

# Get modified envirnoment
string (REPLACE ";" " " SPACE_SEPARATED_ARGUMENTS "${_lefb_ARGUMENTS}")
file(WRITE ${CURRENT_BUILDTREES_DIR}/get-modified-environment.bat "call \"${_lefb_BATCH_FILE_PATH}\" ${SPACE_SEPARATED_ARGUMENTS}\n\"${CMAKE_COMMAND}\" -E environment")
vcpkg_execute_required_process(
COMMAND "cmd" "/c" "${CURRENT_BUILDTREES_DIR}/get-modified-environment.bat"
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}
LOGNAME environment-after
)
file(READ ${CURRENT_BUILDTREES_DIR}/environment-after-out.log ENVIRONMENT_AFTER)

# Escape characters that have a special meaning in CMake strings.
string(REPLACE "\\" "/" ENVIRONMENT_INITIAL "${ENVIRONMENT_INITIAL}")
string(REPLACE ";" "\\\\;" ENVIRONMENT_INITIAL "${ENVIRONMENT_INITIAL}")
string(REPLACE "\n" ";" ENVIRONMENT_INITIAL "${ENVIRONMENT_INITIAL}")

string(REPLACE "\\" "/" ENVIRONMENT_AFTER "${ENVIRONMENT_AFTER}")
string(REPLACE ";" "\\\\;" ENVIRONMENT_AFTER "${ENVIRONMENT_AFTER}")
string(REPLACE "\n" ";" ENVIRONMENT_AFTER "${ENVIRONMENT_AFTER}")

# Apply the environment changes to the current CMake environment
foreach(AFTER_LINE ${ENVIRONMENT_AFTER})
if("${AFTER_LINE}" MATCHES "^([^=]+)=(.+)$")
set(AFTER_VAR_NAME "${CMAKE_MATCH_1}")
set(AFTER_VAR_VALUE "${CMAKE_MATCH_2}")

set(FOUND "FALSE")
foreach(INITIAL_LINE ${ENVIRONMENT_INITIAL})
if("${INITIAL_LINE}" MATCHES "^([^=]+)=(.+)$")
set(INITIAL_VAR_NAME "${CMAKE_MATCH_1}")
set(INITIAL_VAR_VALUE "${CMAKE_MATCH_2}")

if("${AFTER_VAR_NAME}" STREQUAL "${INITIAL_VAR_NAME}")
set(FOUND "TRUE")
if(NOT "${AFTER_VAR_VALUE}" STREQUAL "${INITIAL_VAR_VALUE}")

# Variable has been modified
# NOTE: we do not revert the escape changes that have previously been applied
# since the only change that should be visible in a single environment variable
# should be a conversion from `\` to `/` and this should not have any effect on
# windows paths.
#message(STATUS "MODIFIED ${AFTER_VAR_NAME}=${AFTER_VAR_VALUE}")
set(ENV{${AFTER_VAR_NAME}} ${AFTER_VAR_VALUE})
endif()
endif()
endif()
endforeach()

if(NOT ${FOUND})
# Variable has been added
#message(STATUS "ADDING ${AFTER_VAR_NAME}=${AFTER_VAR_VALUE}")
set(ENV{${AFTER_VAR_NAME}} ${AFTER_VAR_VALUE})
endif()
endif()
endforeach()
endfunction()
28 changes: 28 additions & 0 deletions triplets/community/x64-windows-ifort.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#Toolset-Name: Intel C++ Compiler 2021
#C:\Program Files (x86)\Intel\oneAPI>setvars.bat
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_LIBRARY_LINKAGE dynamic)
set(VCPKG_CRT_LINKAGE dynamic)

set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/x64-windows-ifort.toolchain.cmake")

if(NOT PORT MATCHES "(lapack)")
set(VCPKG_LIBRARY_LINKAGE static)
endif()

#set(VCPKG_POLICY_SKIP_ARCHITECTURE_CHECK enabled)
#set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled)
set(VCPKG_LOAD_VCVARS_ENV ON)

include(vcpkg_load_environment_from_batch OPTIONAL RESULT_VARIABLE ENV_LOADABLE) # Trick to skip the internal compiler detection for this file.
if(ENV_LOADABLE)
if (DEFINED ENV{ProgramW6432})
file(TO_CMAKE_PATH "$ENV{ProgramW6432}" PROG_ROOT)
else()
file(TO_CMAKE_PATH "$ENV{PROGRAMFILES}" PROG_ROOT)
endif()
if(NOT PROG_ROOT MATCHES "(x86)")
set(PROG_ROOT "${PROG_ROOT} (x86)")
endif()
vcpkg_load_environment_from_batch(BATCH_FILE_PATH "${PROG_ROOT}/Intel/OneAPI/setvars.bat")
endif()
Loading