skip to Main Content
> install.packages("ragg")
trying URL 'https://cloud.r-project.org/src/contrib/ragg_1.1.3.tar.gz'
Content type 'application/x-gzip' length 420401 bytes (410 KB)
==================================================
downloaded 410 KB


Welcome at Tue Aug 17 23:24:09 2021
Library path: /home/roy/miniconda3/envs/r-4.1/lib/R/library

Repositories set.
R_MAX_NUM_DLLS set to 1000.
* installing *source* package ‘ragg’ ...
** package ‘ragg’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/x86_64-linux-gnu
Using PKG_LIBS=-lfreetype -lpng16 -lm -lz -lm -lz -ltiff -lwebp -lzstd -llzma -ljbig -ljpeg -lz -lm
-----------------------------[ ANTICONF ]-------------------------------
Configuration failed to find one of freetype2 libpng libtiff-4. Try installing:
 * deb: libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev (Debian, Ubuntu, etc)
 * rpm: freetype-devel libpng-devel libtiff-devel libjpeg-turbo-devel (Fedora, CentOS, RHEL)
 * csw: libfreetype_dev libpng16_dev libtiff_dev libjpeg_dev (Solaris)
If freetype2 libpng libtiff-4 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a freetype2 libpng libtiff-4.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] ---------------------------
In file included from /home/roy/miniconda3/envs/r-4.1/x86_64-conda-linux-gnu/sysroot/usr/include/features.h:361,
                 from /home/roy/miniconda3/envs/r-4.1/x86_64-conda-linux-gnu/sysroot/usr/include/limits.h:27,
                 from /home/roy/miniconda3/envs/r-4.1/lib/gcc/x86_64-conda-linux-gnu/9.3.0/include-fixed/limits.h:194,
                 from /home/roy/miniconda3/envs/r-4.1/lib/gcc/x86_64-conda-linux-gnu/9.3.0/include-fixed/syslimits.h:7,
                 from /home/roy/miniconda3/envs/r-4.1/lib/gcc/x86_64-conda-linux-gnu/9.3.0/include-fixed/limits.h:34,
                 from /usr/include/libpng16/pngconf.h:31,
                 from /usr/include/libpng16/png.h:339,
                 from <stdin>:2:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:492:49: error: missing binary operator before token "("
  492 | #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
      |                                                 ^
In file included from /home/roy/miniconda3/envs/r-4.1/x86_64-conda-linux-gnu/sysroot/usr/include/stdio.h:932,
                 from /usr/include/libpng16/pngconf.h:46,
                 from /usr/include/libpng16/png.h:339,
                 from <stdin>:2:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:228:17: error: missing binary operator before token "("
  228 | #if __GLIBC_USE (DEPRECATED_GETS)
      |                 ^
--------------------------------------------------------------------
ERROR: configuration failed for package ‘ragg’
* removing ‘/home/roy/miniconda3/envs/r-4.1/lib/R/library/ragg’

The downloaded source packages are in
    ‘/tmp/RtmpL1ZZnL/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("ragg") :
  installation of package ‘ragg’ had non-zero exit status

Session info

sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 4.1.0 (2021-05-18)
#>  os       Ubuntu 20.04.2 LTS          
#>  system   x86_64, linux-gnu           
#>  ui       X11                         
#>  language en_GB:en                    
#>  collate  en_GB.UTF-8                 
#>  ctype    en_GB.UTF-8                 
#>  tz       Europe/Stockholm            
#>  date     2021-08-17                  

This issue happens in a conda environment. The suggested linux libraries are installed (see below, run in the same conda env).

sudo apt-get install -y libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev            
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libjpeg-dev is already the newest version (8c-2ubuntu8).
libpng-dev is already the newest version (1.6.37-2).
libfreetype6-dev is already the newest version (2.10.1-2ubuntu0.1).
libtiff5-dev is already the newest version (4.1.0+git191117-2ubuntu0.20.04.1).
0 to upgrade, 0 to newly install, 0 to remove and 26 not to upgrade.

ragg installation outside the conda env works fine. My guess is that when installing from the conda env, it doesn’t find the path to something. Any tips?

3

Answers


  1. The solution is in the log:

    Configuration failed to find one of freetype2 libpng libtiff-4. Try installing:
     * deb: libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev (Debian, Ubuntu, etc)
     * rpm: freetype-devel libpng-devel libtiff-devel libjpeg-turbo-devel (Fedora, CentOS, RHEL)
     * csw: libfreetype_dev libpng16_dev libtiff_dev libjpeg_dev (Solaris)
    

    Install those packages and try again.

    Login or Signup to reply.
  2. It looks like something connected to this question answer. I encountered the same issue when was trying to install "ragg" package inside my conda env, and the suggested fix in the log (mentioned by @BlackBear answer) is not the real cause of the issue, the issue’s cause is showed below in the log:

        -------------------------- [ERROR MESSAGE] ---------------------------
    In file included from /home/roy/miniconda3/envs/r-4.1/x86_64-conda-linux-gnu/sysroot/usr/include/features.h:361,
                     from /home/roy/miniconda3/envs/r-4.1/x86_64-conda-linux-gnu/sysroot/usr/include/limits.h:27,
                     from /home/roy/miniconda3/envs/r-4.1/lib/gcc/x86_64-conda-linux-gnu/9.3.0/include-fixed/limits.h:194,
                     from /home/roy/miniconda3/envs/r-4.1/lib/gcc/x86_64-conda-linux-gnu/9.3.0/include-fixed/syslimits.h:7,
                     from /home/roy/miniconda3/envs/r-4.1/lib/gcc/x86_64-conda-linux-gnu/9.3.0/include-fixed/limits.h:34,
                     from /usr/include/libpng16/pngconf.h:31,
                     from /usr/include/libpng16/png.h:339,
                     from <stdin>:2:
    /usr/include/x86_64-linux-gnu/sys/cdefs.h:492:49: error: missing binary operator before token "("
      492 | #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
          |                                                 ^
    In file included from /home/roy/miniconda3/envs/r-4.1/x86_64-conda-linux-gnu/sysroot/usr/include/stdio.h:932,
                     from /usr/include/libpng16/pngconf.h:46,
                     from /usr/include/libpng16/png.h:339,
                     from <stdin>:2:
    /usr/include/x86_64-linux-gnu/bits/stdio2.h:228:17: error: missing binary operator before token "("
      228 | #if __GLIBC_USE (DEPRECATED_GETS)
          |                 ^
    --------------------------------------------------------------------
    

    And it is maybe somehow connected to macros definition confusing. I’m not a big specialist in glibc and other things, for me the suggestion from the @MrFlick in comments to the question to install package directly via conda worked (mamba install -c conda-forge r-ragg)

    Login or Signup to reply.
  3. I saw the same error. The fix is to install pkg-config to the conda environment:

    conda install -c conda-forge pkg-config

    Somehow it seems that R c compiler under conda environment can not call system pkg-config correctly.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search