diff options
authorRaul Infante-Sainz <infantesainz@gmail.com>2022-06-09 17:15:33 +0200
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2022-06-10 23:21:20 +0200
commit502abf6870882f31b312c42773cd11779a8c72fc (patch)
parentab811d0952ac93ce608c81ab2cc44d67c7b02dbe (diff)
Configuration: num Apple M1 cores, ImageMagick dep. on GhostScript
Until now, we never had the opportunity of testing Maneage in a macOS laptop with an Apple M1 CPU (tested on macOS Monterey; version 12.3). The way of getting the number of cores for this type of CPU is different from other macOSs. It was therefore necessary to change the parameters of the 'sysctl' for properly accounting this CPU. Furthermore, until now, GhostScript and ImageMagick were built independently. However, they were not linked. As a consequence, when trying to obtain an image with the program 'convert' (that belongs to ImageMagick'), it complains about not having some fonts. This can be fixed by letting 'ImakeMagick' know that 'GhostScript' libraries are available. With this commit, GhostScript has been set as a dependency of ImageMagick, and ImageMagick is configured with the '--with-gslib' flag. Furthermore, to read the number of M1 CPU cores, we distinguish between the Apple M1 and all other CPU types. However, Maneage still does not successfully build all the software until the end of the configure step. There are other problems that need to be fixed for Apple's M1.
2 files changed, 15 insertions, 4 deletions
diff --git a/reproduce/software/make/high-level.mk b/reproduce/software/make/high-level.mk
index 62004a8..4ca6e89 100644
--- a/reproduce/software/make/high-level.mk
+++ b/reproduce/software/make/high-level.mk
@@ -1162,11 +1162,13 @@ $(ibidir)/icu-$(icu-version): $(ibidir)/python-$(python-version)
$(ibidir)/imagemagick-$(imagemagick-version): \
$(ibidir)/zlib-$(zlib-version) \
$(ibidir)/libjpeg-$(libjpeg-version) \
- $(ibidir)/libtiff-$(libtiff-version)
+ $(ibidir)/libtiff-$(libtiff-version) \
+ $(ibidir)/ghostscript-$(ghostscript-version)
$(call import-source, $(imagemagick-url), $(imagemagick-checksum))
$(call gbuild, ImageMagick-$(imagemagick-version), static, \
- --without-x --disable-openmp, V=1 -j$(numthreads))
+ --with-gslib --without-x --disable-openmp, \
+ V=1 -j$(numthreads))
echo "ImageMagick $(imagemagick-version)" > $@
# 'imfit' doesn't use the traditional 'configure' and 'make' to install
diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh
index 7f5f9c4..b946c3b 100755
--- a/reproduce/software/shell/configure.sh
+++ b/reproduce/software/shell/configure.sh
@@ -274,8 +274,17 @@ elif [ x$on_mac_os = xyes ]; then
if [ x$hw_byteorder = x1234 ]; then byte_order="Little Endian";
elif [ x$hw_byteorder = x4321 ]; then byte_order="Big Endian";
- address_size_physical=$(sysctl -n machdep.cpu.address_bits.physical)
- address_size_virtual=$(sysctl -n machdep.cpu.address_bits.virtual)
+ # On macOS, the way of obtaining the number of cores is different
+ # between Intel or Apple M1 CPUs. Here we disinguish between Apple M1
+ # or others.
+ maccputype=$(sysctl -n machdep.cpu.brand_string)
+ if [ x"$maccputype" = x"Apple M1" ]; then
+ address_size_physical=$(sysctl -n machdep.cpu.thread_count)
+ address_size_virtual=$(sysctl -n machdep.cpu.logical_per_package)
+ else
+ address_size_physical=$(sysctl -n machdep.cpu.address_bits.physical)
+ address_size_virtual=$(sysctl -n machdep.cpu.address_bits.virtual)
+ fi
address_sizes="$address_size_physical bits physical, "
address_sizes+="$address_size_virtual bits virtual"