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

[POC|Invalid] Testing vcpkg without installed MSVC #42129

Draft
wants to merge 14 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ __pycache__/
/packages/
/scripts/buildsystems/tmp/
#ignore custom triplets
/triplets/*

#add vcpkg-designed triplets back in
!/triplets/arm-uwp.cmake
!/triplets/arm64-windows.cmake
Expand Down
1 change: 1 addition & 0 deletions ports/gmp/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ vcpkg_extract_source_archive(SOURCE_PATH
subdirs.patch
msvc_symbol.patch
arm64-coff.patch
remove_compiler_info.patch
)

vcpkg_list(SET OPTIONS)
Expand Down
15 changes: 15 additions & 0 deletions ports/gmp/remove_compiler_info.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/gmp-h.in b/gmp-h.in
index 648c933582..fa37296fe4 100644
--- a/gmp-h.in
+++ b/gmp-h.in
@@ -2330,10 +2330,6 @@ enum
GMP_ERROR_MPZ_OVERFLOW = 16
};

-/* Define CC and CFLAGS which were used to build this version of GMP */
-#define __GMP_CC "@CC@"
-#define __GMP_CFLAGS "@CFLAGS@"
-
/* Major version number is the value of __GNU_MP__ too, above. */
#define __GNU_MP_VERSION 6
#define __GNU_MP_VERSION_MINOR 3
2 changes: 1 addition & 1 deletion ports/gmp/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "gmp",
"version": "6.3.0",
"port-version": 1,
"port-version": 2,
"description": "The GNU Multiple Precision Arithmetic Library",
"homepage": "https://gmplib.org",
"license": "LGPL-3.0-only OR GPL-2.0-only",
Expand Down
51 changes: 51 additions & 0 deletions ports/intel-hpc/intel-msvc-env.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
include_guard(GLOBAL)

if(NOT DEFINED ENV{INTEL_TOOLCHAIN_ENV_ALREADY_SET})
set(ONEAPIROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../intel-compiler/")
file(GLOB CMPLR_ROOT LIST_DIRECTORIES true "${ONEAPIROOT_DIR}/compiler/*")

cmake_path(CONVERT "$ENV{INCLUDE}" TO_CMAKE_PATH_LIST include_env)
list(PREPEND include_env
"${CMPLR_ROOT}/include"
)
cmake_path(CONVERT "${include_env}" TO_NATIVE_PATH_LIST include_env NORMALIZE)
set(ENV{INCLUDE} "${include_env}")

cmake_path(CONVERT "$ENV{LIB}" TO_CMAKE_PATH_LIST lib_env)
list(PREPEND lib_env
"${CMPLR_ROOT}/lib/clang/19/lib/windows"
"${CMPLR_ROOT}/opt/compiler/lib"
"${CMPLR_ROOT}/lib"
)
cmake_path(CONVERT "${lib_env}" TO_NATIVE_PATH_LIST lib_env NORMALIZE)
set(ENV{LIB} "${lib_env}")

cmake_path(CONVERT "$ENV{PATH}" TO_CMAKE_PATH_LIST path)
list(APPEND path
"${CMPLR_ROOT}/bin"
)
cmake_path(CONVERT "${path}" TO_NATIVE_PATH_LIST path NORMALIZE)
set(ENV{PATH} "${path}")

set(ENV{INTEL_TOOLCHAIN_ENV_ALREADY_SET} "1")
endif()

# rem OpenCL FPGA runtime
# if exist "%CMPLR_ROOT%\opt\oclfpga\fpgavars.bat" (
# call "%CMPLR_ROOT%\opt\oclfpga\fpgavars.bat"
# )

# set "PATH=%CMPLR_ROOT%\bin;%PATH%"
# set "PATH=%CMPLR_ROOT%\lib\ocloc;%PATH%"
# if /i "%USE_INTEL_LLVM%"=="1" (
# set "PATH=%CMPLR_ROOT%\bin\compiler;%PATH%"
# )

# set "CPATH=%CMPLR_ROOT%\include;%CPATH%"
# set "INCLUDE=%CMPLR_ROOT%\include;%INCLUDE%"
# set "LIB=%CMPLR_ROOT%\lib\clang\19\lib\windows;%CMPLR_ROOT%\opt\compiler\lib;%CMPLR_ROOT%\lib;%LIB%"
# set "PKG_CONFIG_PATH=%CMPLR_ROOT%\lib\pkgconfig;%PKG_CONFIG_PATH%"

# set "OCL_ICD_FILENAMES=%OCL_ICD_FILENAMES%;%CMPLR_ROOT%\bin\intelocl64_emu.dll;%CMPLR_ROOT%\bin\intelocl64.dll"

# set "CMAKE_PREFIX_PATH=%CMPLR_ROOT%;%CMAKE_PREFIX_PATH%"
81 changes: 81 additions & 0 deletions ports/intel-hpc/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)

set(url "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/f07e32fa-b505-4b90-8a79-e328ce9ad9d6/intel-oneapi-hpc-toolkit-2025.0.0.822_offline.exe")

cmake_path(GET url FILENAME filename )
vcpkg_download_distfile(archive_path
URLS "${url}"
FILENAME "${filename}"
SHA512 589b27f7d67487d87a24c25b651ffef79d4cf4e1dd55c128a50b27c63a8fa3f4675fa7412ebad1e7f6832bfd78a14a978d0889c23583f80b813be724ec9492e4
)

vcpkg_find_acquire_program(7Z)

set(out_dir "${CURRENT_BUILDTREES_DIR}/intel/compiler/")
file(MAKE_DIRECTORY "${out_dir}")

message(STATUS "Extracting ${archive_path} ....")
vcpkg_execute_in_download_mode(
COMMAND "${7Z}" x "${archive_path}" "-o${out_dir}" "-y" "-bso0" "-bsp0"
WORKING_DIRECTORY "${out_dir}"
)
message(STATUS "Finished extracting!")

#configure_file("${CURRENT_PACKAGES_DIR}/intel-extract/license.txt" "${CURRENT_PACKAGES_DIR}/share/${PORT}/coypright" COPYONLY)
# vcpkg_execute_in_download_mode(
# COMMAND "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}/bootstrapper.exe"
# "-s " "--action install"
# "--components=intel.oneapi.win.cpp-compiler:intel.oneapi.win.ifort-compiler"
# "--eula=accept"
# "--install-dir=${CURRENT_PACKAGES_DIR}/manual-tools/intel"
# "--intel-sw-improvement-program-consent=decline"
# "-p=NEED_VS2017_INTEGRATION=0" "-p=NEED_VS2019_INTEGRATION=0" "-p=NEED_VS2022_INTEGRATION=0"
# "--log-dir=${CURRENT_BUILDTREES_DIR}"
# WORKING_DIRECTORY "${CURRENT_PACKAGES_DIR}/manual-tools/${PORT}"
# )

set(packages
"openmp"
"compilers-common-runtime"
"compilers-common"
"ifort-compiler"
"oneapi-common.vars"
# "intel-pti-dev"
# "ipp" # .devel .runtime cp
# "mkl" # .devel .runtime
# "mpi" # .devel .runtime
"ocloc"
# "tbb" # .devel .runtime
)

list(TRANSFORM packages PREPEND "intel.oneapi.win.")

string(REPLACE "." "\\." package_regex "${packages}")
list(JOIN package_regex "|" package_regex)

file(GLOB extracted_folders LIST_DIRECTORIES true "${out_dir}/packages/*")
file(GLOB extracted_files LIST_DIRECTORIES false "${out_dir}/packages/*")
list(REMOVE_ITEM extracted_folders "${extracted_files}")

list(FILTER extracted_folders INCLUDE REGEX "(${package_regex}),")

foreach(package_folder IN LISTS extracted_folders)
cmake_path(GET package_folder STEM LAST_ONLY packstem)
message(STATUS "Extracting ${packstem} ....")
vcpkg_execute_required_process(
COMMAND "${CMAKE_COMMAND}" "-E" "tar" "-xf" "${package_folder}/cupPayload.cup"
WORKING_DIRECTORY "${CURRENT_PACKAGES_DIR}"
LOGNAME "extract-${TARGET_TRIPLET}-${packstem}"
)
message(STATUS "Finsihed extracting ${packstem}!")

endforeach()

file(RENAME "${CURRENT_PACKAGES_DIR}/_installdir" "${CURRENT_PACKAGES_DIR}/intel-compiler")
file(REMOVE
"${CURRENT_PACKAGES_DIR}/filelist.json"
"${CURRENT_PACKAGES_DIR}/filelist.json.sig"
)

configure_file("${CMAKE_CURRENT_LIST_DIR}/intel-msvc-env.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/intel-msvc-env.cmake" @ONLY)

8 changes: 8 additions & 0 deletions ports/intel-hpc/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "intel-hpc",
"version": "2025.0.0",
"license": "MIT",
"dependencies": [
"vcpkg-tool-lessmsi"
]
}
Loading
Loading