r-lib / textshaping

Bindings to the HarfBuzz library for Text Shaping
Other
17 stars 8 forks source link

Error: package or namespace load failed for ‘textshaping’ in dyn.load #19

Open dulunar opened 3 years ago

dulunar commented 3 years ago

I have installed harfbuzz, fribidi and freetype2, but when I install the textshaping, it failed.

The following is the log of installation:

> install.packages("textshaping")
Installing package into ‘/home/luna/Desktop/Software/RSoft/lib64/R/library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/textshaping_0.3.4.tar.gz'
Content type 'application/x-gzip' length 35201 bytes (34 KB)
==================================================
downloaded 34 KB

* installing *source* package ‘textshaping’ ...
** package ‘textshaping’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/local/include/harfbuzz -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2
Using PKG_LIBS=-L/usr/local/lib -lharfbuzz -lfreetype -lfribidi
** libs
rm -f textshaping.so cpp11.o face_feature.o hb_shaper.o init.o string_bidi.o string_metrics.o string_shape.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c cpp11.cpp -o cpp11.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c face_feature.cpp -o face_feature.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c hb_shaper.cpp -o hb_shaper.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c init.cpp -o init.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c string_bidi.cpp -o string_bidi.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c string_metrics.cpp -o string_metrics.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c string_shape.cpp -o string_shape.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o textshaping.so cpp11.o face_feature.o hb_shaper.o init.o string_bidi.o string_metrics.o string_shape.o -L/usr/local/lib -lharfbuzz -lfreetype -lfribidi -L/usr/lib/R/lib -lR
installing to /home/luna/Desktop/Software/RSoft/lib64/R/library/00LOCK-textshaping/00new/textshaping/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘textshaping’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/luna/Desktop/Software/RSoft/lib64/R/library/00LOCK-textshaping/00new/textshaping/libs/textshaping.so':
  /home/luna/Desktop/Software/RSoft/lib64/R/library/00LOCK-textshaping/00new/textshaping/libs/textshaping.so: undefined symbol: hb_font_get_h_extents
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/luna/Desktop/Software/RSoft/lib64/R/library/textshaping’

The downloaded source packages are in
        ‘/tmp/RtmpsrDVcY/downloaded_packages’
Warning message:
In install.packages("textshaping") :
  installation of package ‘textshaping’ had non-zero exit status
> 

What should I do if I still want to install it? Thanks.

thomasp85 commented 3 years ago

what version of harfbuzz have you installed?

dulunar commented 3 years ago

what version of harfbuzz have you installed?

harfbuzz-2.6.4 freetype-2.10.1 fribidi-1.0.9

Thanks.

thomasp85 commented 3 years ago

Are you sure you are linking to the correct harfbuzz version? i.e. is /usr/local/include/harfbuzz v 2.6.4?

The fact that hb_font_get_h_extents is missing indicates that you are trying to link to an ancient version🤷‍♂️

dulunar commented 3 years ago

Are you sure you are linking to the correct harfbuzz version? i.e. is /usr/local/include/harfbuzz v 2.6.4?

The fact that hb_font_get_h_extents is missing indicates that you are trying to link to an ancient version🤷‍♂️

I installed it on this folder: /usr/local/include/harfbuzz

root@wanjun-QSSC-S4R:~# lt /usr/local/include/harfbuzz
total 224K
-rw-r--r-- 1 root root 1.8K May 18 14:40 hb-version.h
-rw-r--r-- 1 root root  12K May 18 14:40 hb-unicode.h
-rw-r--r-- 1 root root 3.6K May 18 14:40 hb-shape-plan.h
-rw-r--r-- 1 root root 1.8K May 18 14:40 hb-shape.h
-rw-r--r-- 1 root root 4.1K May 18 14:40 hb-set.h
-rw-r--r-- 1 root root 3.8K May 18 14:40 hb-ot-var.h
-rw-r--r-- 1 root root 1.7K May 18 14:40 hb-ot-shape.h
-rw-r--r-- 1 root root 3.7K May 18 14:40 hb-ot-name.h
-rw-r--r-- 1 root root 5.6K May 18 14:40 hb-ot-metrics.h
-rw-r--r-- 1 root root 2.5K May 18 14:40 hb-ot-meta.h
-rw-r--r-- 1 root root 7.7K May 18 14:40 hb-ot-math.h
-rw-r--r-- 1 root root  16K May 18 14:40 hb-ot-layout.h
-rw-r--r-- 1 root root 1.5K May 18 14:40 hb-ot.h
-rw-r--r-- 1 root root 1.4K May 18 14:40 hb-ot-font.h
-rw-r--r-- 1 root root 3.2K May 18 14:40 hb-ot-deprecated.h
-rw-r--r-- 1 root root 3.9K May 18 14:40 hb-ot-color.h
-rw-r--r-- 1 root root 2.5K May 18 14:40 hb-map.h
-rw-r--r-- 1 root root  20K May 18 14:40 hb-font.h
-rw-r--r-- 1 root root 3.8K May 18 14:40 hb-face.h
-rw-r--r-- 1 root root 6.0K May 18 14:40 hb-deprecated.h
-rw-r--r-- 1 root root  18K May 18 14:40 hb-common.h
-rw-r--r-- 1 root root  19K May 18 14:40 hb-buffer.h
-rw-r--r-- 1 root root 3.6K May 18 14:40 hb-blob.h
-rw-r--r-- 1 root root  23K May 18 14:40 hb-aat-layout.h
-rw-r--r-- 1 root root 1.3K May 18 14:40 hb-aat.h
-rw-r--r-- 1 root root 2.6K May 18 14:40 hb-subset.h
-rw-r--r-- 1 root root 1.5K May 18 14:40 hb-icu.h
-rw-r--r-- 1 root root 1.5K May 18 14:40 hb.h
-rw-r--r-- 1 root root 1.6K May 18 14:40 hb-glib.h
-rw-r--r-- 1 root root 4.0K May 18 14:40 hb-ft.h

But when I ldd /home/luna/Desktop/Software/RSoft/lib64/R/library/00LOCK-textshaping/00new/textshaping/libs/textshaping.so, it link to "/usr/lib/x86_64-linux-gnu/libharfbuzz.so", and I found it is libharfbuzz.so.0.927.0.

But when I replaced it with "/usr/local/lib/libharfbuzz.so.0.20600.4", it also reported error, but not this.

The error is like "libharfbuzz.so.0: undefined symbol: FT_Done_MM_Var", this type.

So I am not sure what can I do?

Thanks.

thomasp85 commented 3 years ago

textshaping uses pkg-config for setting up the compiler - can you check that everything looks as it should there?

dulunar commented 3 years ago

I am sorry that I check the issue not timely.

Here is my pkg-config report:

luna@wanjun-QSSC-S4R 15:20:59 Wed May 19 ~ 43
$ pkg-config --cflags freetype2
-I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
luna@wanjun-QSSC-S4R 15:21:03 Wed May 19 ~ 44
$ pkg-config --libs harfbuzz
-L/usr/local/lib -lharfbuzz
luna@wanjun-QSSC-S4R 15:21:14 Wed May 19 ~ 45
$ pkg-config --libs freetype2
-L/usr/local/lib -lfreetype
luna@wanjun-QSSC-S4R 15:21:18 Wed May 19 ~ 46
dulunar commented 3 years ago

Also, I used ldd to check lib of this package when it was test if it was installed:

Here,

ldd /home/luna/Desktop/Software/RSoft/lib64/R/library/00LOCK-textshaping/00new/textshaping/libs/textshaping.so
        linux-vdso.so.1 =>  (0x00007ffd9ebcb000)
        libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f88ef48d000)
        libfreetype.so.6 => /usr/local/lib/libfreetype.so.6 (0x00007f88ef1d2000)
        libfribidi.so.0 => /usr/local/lib/libfribidi.so.0 (0x00007f88eefb6000)
        libR.so => /usr/lib/libR.so (0x00007f88ee937000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f88ee5ed000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f88ee3d5000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f88ee00c000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f88edd04000)
        libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f88edadd000)
        libz.so.1 => /usr/local/lib/libz.so.1 (0x00007f88ed8c2000)
        libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f88ed6b2000)
        libpng16.so.16 => /usr/local/lib/libpng16.so.16 (0x00007f88ed480000)
        libblas.so.3 => /usr/lib/libblas.so.3 (0x00007f88ebc77000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f88eb971000)
        libreadline.so.6 => /lib/x86_64-linux-gnu/libreadline.so.6 (0x00007f88eb72b000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f88eb4ed000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f88eb2cb000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f88eb0c3000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f88eaebf000)
        libgomp.so.1 => /usr/local/lib/libgomp.so.1 (0x00007f88eac9d000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f88eaa7f000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f88ef910000)
        libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f88ea856000)
thomasp85 commented 3 years ago

I'm honestly a bit at a loss as to why it links to the wrong harfbuzz lib... @jeroen do you know anything about this?

dulunar commented 3 years ago

Because the harfbuzz is wrong in the ldd report. libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f88ef48d000)

So I delete the file " /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0" and reinstall the textshaping, I all so get same error, but I cheeck the "textshaping.so" using ldd, I found the harfbuzz is ture:

luna@wanjun-QSSC-S4R 16:29:55 Wed May 19 ~ 49
$ ldd /home/luna/Desktop/Software/RSoft/lib64/R/library/00LOCK-textshaping/00new/textshaping/libs/textshaping.so
        linux-vdso.so.1 =>  (0x00007fffc691a000)
        libharfbuzz.so.0 => /usr/local/lib/libharfbuzz.so.0 (0x00007f3528717000)
        libfreetype.so.6 => /usr/local/lib/libfreetype.so.6 (0x00007f352845c000)
        libfribidi.so.0 => /usr/local/lib/libfribidi.so.0 (0x00007f3528240000)
        libR.so => /home/luna/Desktop/Software/RSoft//lib/libR.so (0x00007f3527c7e000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f3527934000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f352771c000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3527353000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f352704d000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f3526d45000)
        libz.so.1 => /usr/local/hdf5/lib/libz.so.1 (0x00007f3526b2d000)
        libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f352691d000)
        libpng16.so.16 => /usr/local/lib/libpng16.so.16 (0x00007f35266eb000)
        libRblas.so => /home/luna/Desktop/Software/RSoft//lib/libRblas.so (0x00007f35264be000)
        libreadline.so.6 => /lib/x86_64-linux-gnu/libreadline.so.6 (0x00007f3526278000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f352603a000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f3525e18000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f3525c10000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3525a0c000)
        libiconv.so.2 => /usr/local/lib/libiconv.so.2 (0x00007f3525727000)
        libgomp.so.1 => /usr/local/lib/libgomp.so.1 (0x00007f3525505000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f35252e7000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f3528c41000)
        libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f35250be000)
luna@wanjun-QSSC-S4R 16:29:55 Wed May 19 ~ 50

Please check this reply, thanks.

I reinstalled the packages by using the following command:

luna@wanjun-QSSC-S4R 16:04:59 Wed May 19 ~ 17
$ R CMD INSTALL textshaping_0.3.4.tar.gz
WARNING: ignoring environment value of R_HOME
* installing to library ‘/home/luna/Desktop/Software/RSoft/lib64/R/library’
* installing *source* package ‘textshaping’ ...
** package ‘textshaping’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
Using PKG_LIBS=-L/usr/local/lib -lharfbuzz -lfreetype -lfribidi
** libs
rm -f textshaping.so cpp11.o face_feature.o hb_shaper.o init.o string_bidi.o string_metrics.o string_shape.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c cpp11.cpp -o cpp11.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c face_feature.cpp -o face_feature.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c hb_shaper.cpp -o hb_shaper.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c init.cpp -o init.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c string_bidi.cpp -o string_bidi.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c string_metrics.cpp -o string_metrics.o
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -DNDEBUG -I/usr/local/include/harfbuzz -I/usr/local/include/freetype2 -I/usr/local/include -I/usr/local/include/libpng16 -I/usr/local/include/fribidi -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/cpp11/include" -I"/home/luna/Desktop/Software/RSoft/lib64/R/library/systemfonts/include"   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c string_shape.cpp -o string_shape.o
g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o textshaping.so cpp11.o face_feature.o hb_shaper.o init.o string_bidi.o string_metrics.o string_shape.o -L/usr/local/lib -lharfbuzz -lfreetype -lfribidi -L/usr/lib/R/lib -lR
installing to /home/luna/Desktop/Software/RSoft/lib64/R/library/00LOCK-textshaping/00new/textshaping/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘textshaping’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/luna/Desktop/Software/RSoft/lib64/R/library/00LOCK-textshaping/00new/textshaping/libs/textshaping.so':
  /home/luna/Desktop/Software/RSoft/lib64/R/library/00LOCK-textshaping/00new/textshaping/libs/textshaping.so: undefined symbol: hb_ft_font_create
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/luna/Desktop/Software/RSoft/lib64/R/library/textshaping’
luna@wanjun-QSSC-S4R 16:29:56 Wed May 19 ~ 18
$
thomasp85 commented 3 years ago

This is a new error, though (new symbol missing)... Somehow it seems your installed harfbuzz hasn't been compiled with freetype support. I'm sorry I can't be of more help - I've never seen these compilation issues before

jeroen commented 3 years ago

If you have multiple versions of the same shared library on your machine, you have to set LD_LIBRARY_PATH at package load time to load the correct one, otherwise linux use the first one found via /etc/ld.so.conf.

But your life will be much easier if you use the library that comes with your OS via apt or yum (you didn't mention your os)

dulunar commented 3 years ago

If you have multiple versions of the same shared library on your machine, you have to set LD_LIBRARY_PATH at package load time to load the correct one, otherwise linux use the first one found via /etc/ld.so.conf.

But your life will be much easier if you use the library that comes with your OS via apt or yum (you didn't mention your os)

My ubuntu system (Ubuntu 14.04.06) is too old to install the newer version by apt. So I had only install these libraries manually.

albert-ying commented 2 years ago

Got same problem when I try to reinstall it... It persists even after I remove the old harfbuzz and link to the harfbuzz 3.2.0.

* installing *source* package ‘textshaping’ ...
** package ‘textshaping’ successfully unpacked and MD5 sums checked
** using staged installation
Found pkg-config cflags and libs!
Using PKG_CFLAGS=-I/usr/local/harfbuzz/3.2.0/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/fribidi
Using PKG_LIBS=-L/usr/local/harfbuzz/3.2.0/lib -lharfbuzz -lfreetype -lfribidi
** libs
rm -f textshaping.so cpp11.o face_feature.o hb_shaper.o init.o string_bidi.o string_metrics.o string_shape.o
g++ -std=gnu++11 -I"/home/kying/lib/R/include" -DNDEBUG -DNDEBUG -I/usr/local/harfbuzz/3.2.0/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/fribidi -I'/home/kying/lib/R/library/cpp11/include' -I'/home/kying/lib/R/library/systemfonts/include' -I/home/kying/include   -fpic  -g -O2  -c cpp11.cpp -o cpp11.o
g++ -std=gnu++11 -I"/home/kying/lib/R/include" -DNDEBUG -DNDEBUG -I/usr/local/harfbuzz/3.2.0/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/fribidi -I'/home/kying/lib/R/library/cpp11/include' -I'/home/kying/lib/R/library/systemfonts/include' -I/home/kying/include   -fpic  -g -O2  -c face_feature.cpp -o face_feature.o
g++ -std=gnu++11 -I"/home/kying/lib/R/include" -DNDEBUG -DNDEBUG -I/usr/local/harfbuzz/3.2.0/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/fribidi -I'/home/kying/lib/R/library/cpp11/include' -I'/home/kying/lib/R/library/systemfonts/include' -I/home/kying/include   -fpic  -g -O2  -c hb_shaper.cpp -o hb_shaper.o
g++ -std=gnu++11 -I"/home/kying/lib/R/include" -DNDEBUG -DNDEBUG -I/usr/local/harfbuzz/3.2.0/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/fribidi -I'/home/kying/lib/R/library/cpp11/include' -I'/home/kying/lib/R/library/systemfonts/include' -I/home/kying/include   -fpic  -g -O2  -c init.cpp -o init.o
g++ -std=gnu++11 -I"/home/kying/lib/R/include" -DNDEBUG -DNDEBUG -I/usr/local/harfbuzz/3.2.0/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/fribidi -I'/home/kying/lib/R/library/cpp11/include' -I'/home/kying/lib/R/library/systemfonts/include' -I/home/kying/include   -fpic  -g -O2  -c string_bidi.cpp -o string_bidi.o
g++ -std=gnu++11 -I"/home/kying/lib/R/include" -DNDEBUG -DNDEBUG -I/usr/local/harfbuzz/3.2.0/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/fribidi -I'/home/kying/lib/R/library/cpp11/include' -I'/home/kying/lib/R/library/systemfonts/include' -I/home/kying/include   -fpic  -g -O2  -c string_metrics.cpp -o string_metrics.o
g++ -std=gnu++11 -I"/home/kying/lib/R/include" -DNDEBUG -DNDEBUG -I/usr/local/harfbuzz/3.2.0/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/fribidi -I'/home/kying/lib/R/library/cpp11/include' -I'/home/kying/lib/R/library/systemfonts/include' -I/home/kying/include   -fpic  -g -O2  -c string_shape.cpp -o string_shape.o
g++ -std=gnu++11 -shared -L/home/kying/lib/R/lib -L/home/kying/lib -Wl,-rpath=/home/kying/lib -o textshaping.so cpp11.o face_feature.o hb_shaper.o init.o string_bidi.o string_metrics.o string_shape.o -L/usr/local/harfbuzz/3.2.0/lib -lharfbuzz -lfreetype -lfribidi -L/home/kying/lib/R/lib -lR
installing to /home/kying/lib/R/library/00LOCK-textshaping/00new/textshaping/libs
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘textshaping’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/kying/lib/R/library/00LOCK-textshaping/00new/textshaping/libs/textshaping.so':
  /home/kying/lib/R/library/00LOCK-textshaping/00new/textshaping/libs/textshaping.so: undefined symbol: hb_font_get_h_extents
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/kying/lib/R/library/textshaping’
EXGDT commented 1 year ago

Same error when I install 'devtools' package(textshaping is needed), also I have installed harfbuzz, freetype2 and fribidi manually. It was solved after I recompiled harfbuzz and the configure return that FreeType is True. image