1

I'm trying to install and build from source the package devEMF but it doesn't build. I've tried to install on macOS 10.11.6 and 10.13.4 with the same exact result. In both system I have a R install with Homebrew.

Any idea about what could be the problem?

Thanks!

Installing package into ‘/Users/lpuerto/Library/R/3.x/library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/devEMF_3.6.tar.gz'
Content type 'application/x-gzip' length 201425 bytes (196 KB)
==================================================
downloaded 196 KB

* installing *source* package ‘devEMF’ ...
** package ‘devEMF’ successfully unpacked and MD5 sums checked
configure: creating ./config.status
config.status: creating src/Makevars
** libs
/usr/local/opt/llvm/bin/clang++  -I"/usr/local/Cellar/r/3.5.0/lib/R/include" -DNDEBUG   -I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include   -fPIC  -g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe -c devEMF.cpp -o devEMF.o
In file included from devEMF.cpp:45:
./fontmetrics.h:470:19: error: no matching function for call to 'CTFontGetBoundingRectsForGlyphs'
        extents = CTFontGetBoundingRectsForGlyphs(m_FontInfo, 0, &glyph,
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h:875:8: note: candidate function not viable: no known conversion from 'int' to 'CTFontOrientation' for 2nd argument
CGRect CTFontGetBoundingRectsForGlyphs(
       ^
In file included from devEMF.cpp:45:
./fontmetrics.h:474:17: error: no matching function for call to 'CTFontGetAdvancesForGlyphs'
        width = CTFontGetAdvancesForGlyphs(m_FontInfo, 0, &glyph, NULL, 1);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h:933:8: note: candidate function not viable: no known conversion from 'int' to 'CTFontOrientation' for 2nd argument
double CTFontGetAdvancesForGlyphs(
       ^
In file included from devEMF.cpp:45:
./fontmetrics.h:486:20: error: no matching function for call to 'CTFontGetAdvancesForGlyphs'
        double w = CTFontGetAdvancesForGlyphs(m_FontInfo, 0, glyphs, NULL,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/CoreText.framework/Headers/CTFont.h:933:8: note: candidate function not viable: no known conversion from 'int' to 'CTFontOrientation' for 2nd argument
double CTFontGetAdvancesForGlyphs(
       ^
3 errors generated.
make: *** [devEMF.o] Error 1
ERROR: compilation failed for package ‘devEMF’
* removing ‘/Users/lpuerto/Library/R/3.x/library/devEMF’
Warning in install.packages :
  installation of package ‘devEMF’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/wf/41gjf2mx7m7fmvfd8dr22_5h0000gn/T/RtmpvEhMHs/downloaded_packages’
2
  • 1
    I realize this may not help too much but FWIW macOS 10.13.5 Beta (17F45c), AT&T R 3.5 binaries, clang++ == install from source worked fine. Homebrew R is great and all, but it might be worth trying the official R installation as well and report back if that fixed it, since that, then, means the issue is very likely Homebrew R-related.
    – hrbrmstr
    Commented Apr 28, 2018 at 12:25
  • 1
    You helped me a lot because you make me realize that perhaps the makevars were involved.
    – lpuerto
    Commented Apr 28, 2018 at 12:48

2 Answers 2

1

A recent change in some combination of clang / OSX CoreText API / R exposed a bug in the devEMF package, whereby it relied on an "int" data type being automatically cast to an "enum" data type.

devEMF version 3.6-1 fixes this bug by directly using the appropriate enum constant.

1

Ok! I figured it out! Seems that the problem was the makevars.

This is my makevars file

# Remove the comment on -fopenmp for compiling data.table package
CC=/usr/local/opt/llvm/bin/clang #-fopenmp
CXX=/usr/local/opt/llvm/bin/clang++ #-fopenmp
# -O3 should be faster than -O2 (default) level optimisation ..
CFLAGS=-g -O3 -Wall -pedantic -std=gnu99 -mtune=native -pipe
CXXFLAGS=-g -O3 -Wall -pedantic -std=c++11 -mtune=native -pipe
LDFLAGS=-L/usr/local/opt/gettext/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib
CPPFLAGS=-I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include

I commented all lines and installed it perfectly. Perhaps it isn't compatible with LLVM. I don't know.

1
  • 1
    Definitely make sure to accept your answer when whatever the current time limit for that is up. You did a great deal of 👍 debugging for this.
    – hrbrmstr
    Commented Apr 28, 2018 at 23:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.