r-lib / ragg

Graphic Devices Based on AGG
https://ragg.r-lib.org
Other
172 stars 24 forks source link

86_64-conda-linux-gnu/bin/ld: cannot find -lpng15: No such file or directory #133

Closed Weiyifan closed 11 months ago

Weiyifan commented 1 year ago

When I install ragg by: install.package('ragg') The final error was: /lib/gcc/x86_64-conda-linux-gnu/12.2.0/../../../../x86_64-conda-linux-gnu/bin/ld: cannot find -lpng15: No such file or directory collect2: error: ld returned 1 exit status make: *** [/public/home/myname/anaconda3/envs/myconda/lib/R/share/make/shlib.mk:10: ragg.so] Error 1 ERROR: compilation failed for package ‘ragg’

The downloaded source packages are in ‘/tmp/RtmpnNdGrr/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

zyllifeworld commented 1 year ago

the problem here is the pkg-config in your path detected the libpng in /usr/local/lib, but the conda in your env has updated the libpng to libpng16, you can check path "/public/home/myname/anaconda3/envs/myconda/lib", only libpng16 existed. so one possible solution is to give two soft links of libpng15 in "/public/home/myname/anaconda3/envs/myconda/lib"

ln -s /usr/lib64/libpng15.so.15.13.0 /youpath/lib/libpng15.so

ln -s /usr/lib64/libpng15.so.15.13.0 /youpath/lib/libpng15.so.15

let me know if it works.

tyner commented 1 year ago

If you are using anaconda, then another potential solution is to let its bundled pkg-config do the heavy lifting. For example this worked for me on Amazon Linux 2,

export PKG_CONFIG_PATH=~/anaconda3/lib/pkgconfig

for good measure you might also need to put anaconda's linker into the toolchain via:

export PATH=~/anaconda3/compiler_compat:$PATH
airbj31 commented 1 year ago

If you are using anaconda, then another potential solution is to let its bundled pkg-config do the heavy lifting. For example this worked for me on Amazon Linux 2,

export PKG_CONFIG_PATH=~/anaconda3/lib/pkgconfig

for good measure you might also need to put anaconda's linker into the toolchain via:

export PATH=~/anaconda3/compiler_compat:$PATH

Thanks! it works

yuw444 commented 1 year ago

For conda environment, an easy workaround for me is conda install -c conda-forge r-ragg

jiangyun-fun commented 1 year ago

For conda environment, an easy workaround for me is conda install -c conda-forge r-ragg

it works for me, thanks :)