Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not install ragg in R4.4.1 #169

Closed
BenxiaHu opened this issue Jul 15, 2024 · 9 comments
Closed

can not install ragg in R4.4.1 #169

BenxiaHu opened this issue Jul 15, 2024 · 9 comments

Comments

@BenxiaHu
Copy link

can not install ragg in R4.4.1

@WildPenquin
Copy link

Hi,

Not sure what is the issue BenxiaHu is having since there are no logs, but I still don't want to start another issue.

Installing ragg I get this:

* 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/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -pthread
Using PKG_LIBS=-lfreetype -lpng16 -ltiff -ljpeg
** libs
using C++ compiler: ‘g++ (GCC) 14.2.1 20240805’
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I./agg/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/systemfonts/include' -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/textshaping/include' -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects   -c capture_dev.cpp -o capture_dev.o
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I./agg/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/systemfonts/include' -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/textshaping/include' -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects   -c init.cpp -o init.o
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I./agg/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/systemfonts/include' -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/textshaping/include' -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects   -c jpeg_dev.cpp -o jpeg_dev.o
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I./agg/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/systemfonts/include' -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/textshaping/include' -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects   -c png_dev.cpp -o png_dev.o
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I./agg/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/systemfonts/include' -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/textshaping/include' -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects   -c ppm_dev.cpp -o ppm_dev.o
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I./agg/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/systemfonts/include' -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/textshaping/include' -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects   -c tiff_dev.cpp -o tiff_dev.o
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I./agg/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/systemfonts/include' -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/textshaping/include' -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects   -c agg/src/agg_curves.cpp -o agg/src/agg_curves.o
g++ -std=gnu++17 -I"/usr/include/R/" -DNDEBUG -I./agg/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-6 -pthread -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/systemfonts/include' -I'/home/ville/R/x86_64-pc-linux-gnu-library/4.4/textshaping/include' -I/usr/local/include    -fpic  -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/build/r/src=/usr/src/debug/r -flto=auto -ffat-lto-objects   -c agg/src/agg_font_freetype.cpp -o agg/src/agg_font_freetype.o
agg/src/agg_font_freetype.cpp: In instantiation of ”bool agg::decompose_ft_outline(const FT_Outline&, bool, const trans_affine&, PathStorage&) [with PathStorage = path_storage_integer<int, 6>; FT_Outline = FT_Outline_]”:
agg/src/agg_font_freetype.cpp:1071:48:   required from here
 1071 |                         if(decompose_ft_outline(m_cur_face->glyph->outline,
      |                            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1072 |                                                 m_flip_y,
      |                                                 ~~~~~~~~~
 1073 |                                                 m_affine,
      |                                                 ~~~~~~~~~
 1074 |                                                 m_path32))
      |                                                 ~~~~~~~~~
agg/src/agg_font_freetype.cpp:182:35: virhe: invalid conversion from ”unsigned char*” to ”char*” [-fpermissive]
  182 |             tags  = outline.tags  + first;
      |                     ~~~~~~~~~~~~~~^~~~~~~
      |                                   |
      |                                   unsigned char*
agg/src/agg_font_freetype.cpp: In instantiation of ”bool agg::decompose_ft_outline(const FT_Outline&, bool, const trans_affine&, PathStorage&) [with PathStorage = path_storage_integer<short int, 6>; FT_Outline = FT_Outline_]”:
agg/src/agg_font_freetype.cpp:1092:48:   required from here
 1092 |                         if(decompose_ft_outline(m_cur_face->glyph->outline,
      |                            ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1093 |                                                 m_flip_y,
      |                                                 ~~~~~~~~~
 1094 |                                                 m_affine,
      |                                                 ~~~~~~~~~
 1095 |                                                 m_path16))
      |                                                 ~~~~~~~~~
agg/src/agg_font_freetype.cpp:182:35: virhe: invalid conversion from ”unsigned char*” to ”char*” [-fpermissive]
  182 |             tags  = outline.tags  + first;
      |                     ~~~~~~~~~~~~~~^~~~~~~
      |                                   |
      |                                   unsigned char*
make: *** [/usr/lib64/R/etc/Makeconf:204: agg/src/agg_font_freetype.o] Error 1
ERROR: compilation failed for package ‘ragg’
* removing ‘/home/ville/R/x86_64-pc-linux-gnu-library/4.4/ragg’
Warning in install.packages :
  installation of package ‘ragg’ had non-zero exit status

@alexreg
Copy link
Contributor

alexreg commented Sep 6, 2024

@WildPenquin Indeed, this is the error I get. I'm on an M1 Mac, so this might be a problem with support for the ARM architecture?

@WildPenquin
Copy link

WildPenquin commented Sep 8, 2024

@alexreg I did not state my paltform, oops ;-)

This is on Arch Linux, X86_64, so it is not a platform thing. Possibly / rather a compile-from-source thing.

I should also probably mention I'm using R-Studio.

Many platform (all besides Windows?) compile everything in R from source (AFAIK! I'm just a regular user, I don't know that much about internals of R). I don't know what does and how does it set the compile options when doing install_packages. I suppose in 4.4.1 -fpermissive has been removed from compilation flags.

@alexreg
Copy link
Contributor

alexreg commented Sep 9, 2024

@WildPenquin Yeah, that's what I thought too, about -fpermissive, but then I realised that clang doesn't have such an option (or an exact equivalent, I believe). But forcing R to build with GCC instead of clang served as a work-around for me.

Going forwards, I feel like the correct solution is to fix the source code in agg, adding a reinterpret_cast at the appropriate places.

@multimeric
Copy link

Thanks! Quick fix using @alexreg's changes:

remotes::install_github("alexreg/ragg", ref="fix-build")

@j-i-l
Copy link

j-i-l commented Sep 9, 2024

What @WildPenquin and @alexreg describe belongs to #170

@BenxiaHu
Copy link
Author

BenxiaHu commented Sep 9, 2024

remotes::install_github("alexreg/ragg", ref="fix-build") does not work:

/data/anaconda3/envs/R4.4/bin/../lib/gcc/x86_64-conda-linux-gnu/14.1.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find -lpng15: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [/data/anaconda3/envs/R4.4/lib/R/share/make/shlib.mk:10: ragg.so] Error 1
ERROR: compilation failed for package ‘ragg’

  • removing ‘/data/anaconda3/envs/R4.4/lib/R/library/ragg’
  • restoring previous ‘/data/anaconda3/envs/R4.4/lib/R/library/ragg’
    Warning message:
    In i.p(...) :
    installation of package ‘/tmp/RtmpEbbGGz/file20fd73558f7eb/ragg_1.3.2.9000.tar.gz’ had non-zero exit status

@multimeric
Copy link

remotes::install_github("alexreg/ragg", ref="fix-build") does not work:

Unrelated issue. You're missing the libpng conda package.

@thomasp85
Copy link
Member

The original issue has been resolved by #172

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants