forked from JuliaPackaging/Yggdrasil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update MKL recipe (JuliaPackaging#3641)
* [MKL] Reorganize script to so that selecting individual platforms works * MKL is one of the few packages with a different source archive for each architecture. Previously, the script would download and generate packages for multiple platforms even if they were not selected. * Here, we associate each ArchiveSource and other build parameters with each platform and filter the install list appropriately. * [MKL] Deduplicate macOS dylibs The macOS archive we are currently installing contains byte-identical .dylib files (e.g., libmkl_core.dylib and libmkl_core.1.dylib), which take up a lot of space. Normally, these would be symlinks (or possibly hard links). Until these are fixed upstream, we deduplicate them here when building the tarballs for macOS. * [MKL] Ensure "--register" is passed only on the last invocation of build_tarballs()
- Loading branch information
Showing
3 changed files
with
117 additions
and
42 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
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,8 @@ | ||
cd ${WORKSPACE}/srcdir/mkl-${target} | ||
if [[ ${target} == *-mingw* ]]; then | ||
cp -r Library/bin/* ${libdir} | ||
else | ||
cp -r lib/* ${libdir} | ||
fi | ||
|
||
install_license info/licenses/*.txt |
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,38 @@ | ||
|
||
sha256() { sha256sum "$1" | awk '{ print $1 }'; } | ||
|
||
exists() { | ||
if [ "$2" != in ]; then | ||
echo "Incorrect usage. Use: exists {key} in {array}" | ||
return | ||
fi | ||
eval '[ ${'$3'[$1]+x} ]' | ||
} | ||
|
||
cd ${WORKSPACE}/srcdir/mkl-${target}/lib | ||
|
||
##### | ||
## Replace duplicate library files with symlinks | ||
## (https://github.com/JuliaPackaging/Yggdrasil/issues/3632) | ||
|
||
declare -A SHAs | ||
|
||
# Iterate over files in reverse order of name length. | ||
# This ensures any symlinks go to the longer name. | ||
for file in $(find . -type f | awk '{ print length, $0 }' | sort -n -r | cut -d" " -f2-); do | ||
sha=$(sha256 "$file") | ||
|
||
if ! exists $sha in SHAs; then | ||
SHAs[$sha]="$file" | ||
continue | ||
fi | ||
|
||
src_file="${SHAs[$sha]}" | ||
ln -sf $src_file $file | ||
done | ||
|
||
##### | ||
|
||
cd .. | ||
cp -r lib/* ${libdir} | ||
install_license info/licenses/*.txt |