Closed brainprint closed 2 years ago
Try running:
brew install libpng
at a Terminal prompt and recompiling.
Perfect. Thank you very much.
I had the same issue and followed the instructions. It works now. Thanks, @hrbrmstr!
At first I got this error:
bash: brew: command not found
I installed Homebrew (https://brew.sh/), then called brew install libpng
, and then was able to install svglite as expected.
Did not work for me. Getting the same error message
you're missing libpng
in your link path somewhere. this works for everyone who has a proper homebrew or macports setup and the png library installed. these are table stakes for doing dev-based installs.
Me neither @cattapre. I wonder if you, like me, have homebrew installed in a non-standard location?
Also @cattapre I find that the problem as arisen in version 2.0.0.
So for me this fails, throwing the error you mention:
devtools::install_version("svglite", version = "2.0.0", repos = "http://cran.us.r-project.org")
But this works fine:
devtools::install_version("svglite", version = "1.2.3", repos = "http://cran.us.r-project.org")
Can you confirm?
Good morning, I am also trying to install svglite and have a similar error. I am on R version 3.6.1, I have libpng installed and up to date. I am getting the following error:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/systemfonts/libs/systemfonts.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/systemfonts/libs/systemfonts.so, 6): Library not loaded: /opt/X11/lib/libfreetype.6.dylib
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/systemfonts/libs/systemfonts.so
Reason: image not found
Calls:
Also @cattapre I find that the problem as arisen in version 2.0.0.
So for me this fails, throwing the error you mention:
devtools::install_version("svglite", version = "2.0.0", repos = "http://cran.us.r-project.org")
But this works fine:
devtools::install_version("svglite", version = "1.2.3", repos = "http://cran.us.r-project.org")
Can you confirm?
My issue is gone. The binary provided fixed the problem.
I also have this problem. Like @danmackinlay, I too have homebrew installed in a nonstandard location ($HOME/homebrew; this is required by my organization). We are also required to install R via homebrew, which prevents most R binaries from working (they can't find shared libraries where they expect) and forces us to compile from source in most cases.
I can see that png.h is on my computer at homebrew/Cellar/libpng/1.6.37/include/libpng16/png.h
. But I don't know the magic words to get the svglite
package install process to find png.h in this location.
I too have this issue. Have brew config per default, but running on an Apple Silicon Mac.
brew behaves differently on silicon and you'll need to alert R to the different location of its libraries
put this in your global .Makevars
CFLAGS=-I/opt/homebrew/include
CPPFLAGS=-I/opt/homebrew/include
CXXFLAGS=-I/opt/homebrew/include
CXX11FLAGS=-I/opt/homebrew/include
LDFLAGS=-L/opt/homebrew/lib
Could you please tell me where to find the global .Makevars file on macOS?
Try running:
brew install libpng
Thank you!
Hi and thank you for your package. I have face this error today.
R version 4.0.3 (2020-10-10) macOS 11.2.1 - Intel svglite 2.0.0
devSVG.cpp:21:10: fatal error: 'png.h' file not found
include
1 error generated. make: *** [devSVG.o] Error 1 ERROR: compilation failed for package ‘svglite’