Packages (Magick, ragg, systemfonts, textshaping) fail to install in Manjaro Linux

I am running R 4.3.1 in Manjaro Linux (arch-based) KDE (Wayland) in RStudio 2023.09.0. I cannot install the following packages:

  • Magick
  • ragg
  • systemfonts
  • textshaping

In the beginning it was only Magick that was failing but over time more and more packages seem to fail to install.

R version 4.3.1 (2023-06-16) -- "Beagle Scouts"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> 
> install.packages(c("magick", "ragg", "systemfonts", "textshaping"))
Installing packages into ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3’
(as ‘lib’ is unspecified)
trying URL 'https://mirror.aarnet.edu.au/pub/CRAN/src/contrib/magick_2.8.1.tar.gz'
Content type 'application/x-gzip' length 4601205 bytes (4.4 MB)
==================================================
downloaded 4.4 MB

trying URL 'https://mirror.aarnet.edu.au/pub/CRAN/src/contrib/ragg_1.2.6.tar.gz'
Content type 'application/x-gzip' length 425391 bytes (415 KB)
==================================================
downloaded 415 KB

trying URL 'https://mirror.aarnet.edu.au/pub/CRAN/src/contrib/systemfonts_1.0.5.tar.gz'
Content type 'application/x-gzip' length 80638 bytes (78 KB)
==================================================
downloaded 78 KB

trying URL 'https://mirror.aarnet.edu.au/pub/CRAN/src/contrib/textshaping_0.3.7.tar.gz'
Content type 'application/x-gzip' length 35100 bytes (34 KB)
==================================================
downloaded 34 KB

* installing *source* package ‘magick’ ...
** package ‘magick’ successfully unpacked and MD5 sums checked
** using staged installation
/usr/bin/Magick++-config: line 44: /usr/bin/pkg-config: No such file or directory
/usr/bin/Magick++-config: line 56: /usr/bin/pkg-config: No such file or directory
Warning: found GraphicsMagick++ instead of ImageMagick++. GraphicsMagick is not supported.
Using PKG_CFLAGS=
Using PKG_LIBS=-lMagick++-6.Q16
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the Magick++ library. Try installing:
 - deb: libmagick++-dev (Debian, Ubuntu)
 - rpm: ImageMagick-c++-devel (Fedora, CentOS, RHEL)
 - csw: imagemagick_dev (Solaris)
 - brew imagemagick@6 (MacOS)
If Magick++ is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a Magick++.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: Magick++.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘magick’
* removing ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/magick’
* restoring previous ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/magick’
Warning in install.packages :
  installation of package ‘magick’ had non-zero exit status
* installing *source* package ‘systemfonts’ ...
** package ‘systemfonts’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lfontconfig -lfreetype
** libs
using C++ compiler: ‘g++ (GCC) 13.2.1 20230801’
rm -f systemfonts.so caches.o cpp11.o dev_metrics.o font_matching.o font_registry.o ft_cache.o string_shape.o font_metrics.o font_fallback.o string_metrics.o emoji.o cache_store.o init.o unix/FontManagerLinux.o
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG  -I'/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/cpp11/include' -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects  -c caches.cpp -o caches.o
In file included from caches.h:7,
                 from caches.cpp:1:
ft_cache.h:9:10: fatal error: ft2build.h: No such file or directory
    9 | #include <ft2build.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [/usr/lib64/R/etc/Makeconf:200: caches.o] Error 1
ERROR: compilation failed for package ‘systemfonts’
* removing ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/systemfonts’
* restoring previous ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/systemfonts’
Warning in install.packages :
  installation of package ‘systemfonts’ had non-zero exit status
* installing *source* package ‘textshaping’ ...
** package ‘textshaping’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lfreetype -lharfbuzz -lfribidi -lpng
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the harfbuzz freetype2 fribidi library. Try installing:
 * deb: libharfbuzz-dev libfribidi-dev (Debian, Ubuntu, etc)
 * rpm: harfbuzz-devel fribidi-devel (Fedora, EPEL)
 * csw: libharfbuzz_dev libfribidi_dev (Solaris)
 * brew: harfbuzz fribidi (OSX)
If harfbuzz freetype2 fribidi is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a harfbuzz freetype2 fribidi.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: hb-ft.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘textshaping’
* removing ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/textshaping’
* restoring previous ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/textshaping’
Warning in install.packages :
  installation of package ‘textshaping’ had non-zero exit status
* installing *source* package ‘ragg’ ...
** package ‘ragg’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lfreetype -lpng16 -ltiff -lz -ljpeg -lbz2
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find one of freetype2 libpng libtiff-4 libjpeg. Try installing:
 * deb: libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev (Debian, Ubuntu, etc)
 * rpm: freetype-devel libpng-devel libtiff-devel libjpeg-devel (Fedora, CentOS, RHEL)
 * csw: libfreetype_dev libpng16_dev libtiff_dev libjpeg_dev (Solaris)
If freetype2 libpng libtiff-4 libjpeg is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a freetype2 libpng libtiff-4 libjpeg.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: ft2build.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘ragg’
* removing ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/ragg’
* restoring previous ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/ragg’
Warning in install.packages :
  installation of package ‘ragg’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmpA3JG9W/downloaded_packages’
> install.packages(c("magick", "ragg", "systemfonts", "textshaping"))
Installing packages into ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3’
(as ‘lib’ is unspecified)
trying URL 'https://mirror.aarnet.edu.au/pub/CRAN/src/contrib/magick_2.8.1.tar.gz'
Content type 'application/x-gzip' length 4601205 bytes (4.4 MB)
==================================================
downloaded 4.4 MB

trying URL 'https://mirror.aarnet.edu.au/pub/CRAN/src/contrib/ragg_1.2.6.tar.gz'
Content type 'application/x-gzip' length 425391 bytes (415 KB)
==================================================
downloaded 415 KB

trying URL 'https://mirror.aarnet.edu.au/pub/CRAN/src/contrib/systemfonts_1.0.5.tar.gz'
Content type 'application/x-gzip' length 80638 bytes (78 KB)
==================================================
downloaded 78 KB

trying URL 'https://mirror.aarnet.edu.au/pub/CRAN/src/contrib/textshaping_0.3.7.tar.gz'
Content type 'application/x-gzip' length 35100 bytes (34 KB)
==================================================
downloaded 34 KB

* installing *source* package ‘magick’ ...
** package ‘magick’ successfully unpacked and MD5 sums checked
** using staged installation
/usr/bin/Magick++-config: line 44: /usr/bin/pkg-config: No such file or directory
/usr/bin/Magick++-config: line 56: /usr/bin/pkg-config: No such file or directory
Warning: found GraphicsMagick++ instead of ImageMagick++. GraphicsMagick is not supported.
Using PKG_CFLAGS=
Using PKG_LIBS=-lMagick++-6.Q16
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the Magick++ library. Try installing:
 - deb: libmagick++-dev (Debian, Ubuntu)
 - rpm: ImageMagick-c++-devel (Fedora, CentOS, RHEL)
 - csw: imagemagick_dev (Solaris)
 - brew imagemagick@6 (MacOS)
If Magick++ is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a Magick++.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: Magick++.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘magick’
* removing ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/magick’
* restoring previous ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/magick’
Warning in install.packages :
  installation of package ‘magick’ had non-zero exit status
* installing *source* package ‘systemfonts’ ...
** package ‘systemfonts’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lfontconfig -lfreetype
** libs
using C++ compiler: ‘g++ (GCC) 13.2.1 20230801’
rm -f systemfonts.so caches.o cpp11.o dev_metrics.o font_matching.o font_registry.o ft_cache.o string_shape.o font_metrics.o font_fallback.o string_metrics.o emoji.o cache_store.o init.o unix/FontManagerLinux.o
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG  -I'/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/cpp11/include' -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects  -c caches.cpp -o caches.o
In file included from caches.h:7,
                 from caches.cpp:1:
ft_cache.h:9:10: fatal error: ft2build.h: No such file or directory
    9 | #include <ft2build.h>
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [/usr/lib64/R/etc/Makeconf:200: caches.o] Error 1
ERROR: compilation failed for package ‘systemfonts’
* removing ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/systemfonts’
* restoring previous ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/systemfonts’
Warning in install.packages :
  installation of package ‘systemfonts’ had non-zero exit status
* installing *source* package ‘textshaping’ ...
** package ‘textshaping’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lfreetype -lharfbuzz -lfribidi -lpng
--------------------------- [ANTICONF] --------------------------------
Configuration failed to find the harfbuzz freetype2 fribidi library. Try installing:
 * deb: libharfbuzz-dev libfribidi-dev (Debian, Ubuntu, etc)
 * rpm: harfbuzz-devel fribidi-devel (Fedora, EPEL)
 * csw: libharfbuzz_dev libfribidi_dev (Solaris)
 * brew: harfbuzz fribidi (OSX)
If harfbuzz freetype2 fribidi is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a harfbuzz freetype2 fribidi.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: hb-ft.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘textshaping’
* removing ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/textshaping’
* restoring previous ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/textshaping’
Warning in install.packages :
  installation of package ‘textshaping’ had non-zero exit status
* installing *source* package ‘ragg’ ...
** package ‘ragg’ successfully unpacked and MD5 sums checked
** using staged installation
Using PKG_CFLAGS=
Using PKG_LIBS=-lfreetype -lpng16 -ltiff -lz -ljpeg -lbz2
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find one of freetype2 libpng libtiff-4 libjpeg. Try installing:
 * deb: libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev (Debian, Ubuntu, etc)
 * rpm: freetype-devel libpng-devel libtiff-devel libjpeg-devel (Fedora, CentOS, RHEL)
 * csw: libfreetype_dev libpng16_dev libtiff_dev libjpeg_dev (Solaris)
If freetype2 libpng libtiff-4 libjpeg is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a freetype2 libpng libtiff-4 libjpeg.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
-------------------------- [ERROR MESSAGE] ---------------------------
<stdin>:1:10: fatal error: ft2build.h: No such file or directory
compilation terminated.
--------------------------------------------------------------------
ERROR: configuration failed for package ‘ragg’
* removing ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/ragg’
* restoring previous ‘/home/alpha/R/x86_64-pc-linux-gnu-library/4.3/ragg’
Warning in install.packages :
  installation of package ‘ragg’ had non-zero exit status

The downloaded source packages are in
	‘/tmp/RtmpA3JG9W/downloaded_packages’

In Linux I tried reinstalling the following already installed packages in my system but it did not fix the issue:

  • imagemagick
  • harfbuz
  • harfbuzz-icu
  • lib32-harfbuzz
  • freetype2
  • lib32-freetype2

Do the system packages you installed include the development headers, or there are separate -dev packages? If the latter, then you'll need to install the -dev packages.

Does your system use pkg-config? If yes, make sure that it is installed.

Otherwise you'll probably need to provide the location of the headers and libs individually to each package.

1 Like

Thank you for that. What was weird is that all those R packages were installing just fine a few weeks ago that is why I tried re-installing my already installed system.

Turns out that installing pkgconf fixed everything.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.