-
Notifications
You must be signed in to change notification settings - Fork 6.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[intel-mkl] Overhaul, install osx (#30483)
* [intel-mkl] Install osx * Do less work for --only-downloads * Try harder to ensure DMG unmount * Adjust port warning * Always install usage * Fix log names * Merge copyright * Revise pc file handling * Cleanup * More uniform staging and variables * Update messages * Update versions * Typo * More cleanup * Do nothing for unsupported targets The old code was already broken. * Fix and simplify copy-from-dmg * Change extract_0_dir * Mount to tmp dir
- Loading branch information
Showing
7 changed files
with
244 additions
and
216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
find_program(HDIUTIL NAMES hdiutil REQUIRED) | ||
set(dmg_path "NOTFOUND" CACHE FILEPATH "Where to find the DMG") | ||
set(output_dir "output_dir" CACHE FILEPATH "Where to put the packages") | ||
|
||
if(NOT EXISTS "${dmg_path}") | ||
message(FATAL_ERROR "'dmg_path' (${dmg_path}) does not exist.") | ||
endif() | ||
if(NOT IS_DIRECTORY "${output_dir}") | ||
message(FATAL_ERROR "'output_dir' (${output_dir}) is not a directory.") | ||
endif() | ||
|
||
execute_process( | ||
COMMAND mktemp -d | ||
RESULT_VARIABLE mktemp_result | ||
OUTPUT_VARIABLE mount_point | ||
OUTPUT_STRIP_TRAILING_WHITESPACE | ||
) | ||
if(NOT mktemp_result STREQUAL "0") | ||
message(FATAL_ERROR "mktemp -d failed: ${mktemp_result}") | ||
elseif(NOT IS_DIRECTORY "${mount_point}") | ||
message(FATAL_ERROR "'mount_point' (${mount_point}) is not a directory.") | ||
endif() | ||
|
||
execute_process( | ||
COMMAND "${HDIUTIL}" attach "${dmg_path}" -mountpoint "${mount_point}" -readonly | ||
RESULT_VARIABLE mount_result | ||
) | ||
if(mount_result STREQUAL "0") | ||
set(dmg_packages_dir "${mount_point}/bootstrapper.app/Contents/Resources/packages") | ||
file(GLOB packages | ||
"${dmg_packages_dir}/intel.oneapi.mac.mkl.devel,*" | ||
"${dmg_packages_dir}/intel.oneapi.mac.mkl.runtime,*" | ||
"${dmg_packages_dir}/intel.oneapi.mac.mkl.product,*" | ||
"${dmg_packages_dir}/intel.oneapi.mac.openmp,*" | ||
) | ||
# Using execute_process to avoid direct errors | ||
execute_process( | ||
COMMAND cp -R ${packages} "${output_dir}/" | ||
RESULT_VARIABLE copy_result | ||
) | ||
endif() | ||
execute_process( | ||
COMMAND "${HDIUTIL}" detach "${mount_point}" | ||
RESULT_VARIABLE unmount_result | ||
) | ||
|
||
if(NOT mount_result STREQUAL "0") | ||
message(FATAL_ERROR "Mounting ${dmg_path} failed: ${mount_result}") | ||
elseif(NOT copy_result STREQUAL "0") | ||
message(FATAL_ERROR "Coyping packages failed: ${copy_result}") | ||
elseif(NOT unmount_result STREQUAL "0") | ||
message(FATAL_ERROR "Unounting ${dmg_path} failed: ${unmount_result}") | ||
endif() |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters