installing harfbuzz 1.0.1 on CentOS 5 - centos

I'm trying to install harfbuzz-1.0.1 on a CentOS 5 machine where I do NOT have sudo access, and hence need to install into non-standard locations. I have downloaded and unpacked the source code, and added what I believe to be the relevant dependences to my $PKG_CONFIG_PATH. These packages include:
freetype2
icu-uc
Checking that '$PKG_CONFIG_PATH` is correct:
$pkg-config --modversion freetype2
9.22.3
$pkg-config --modversion icu-uc
55.1
Within the unpacked source directory, I ran:
$ ./configure --prefix=/some/custom/path
# produces lots of output, but summary here
Build configuration:
Unicode callbacks (you want at least one):
Glib: true
ICU: true
UCDN: false
Font callbacks (the more the better):
FreeType: false
Tools used for command-line utilities:
Cairo: true
Fontconfig: true
Additional shapers (the more the better):
Graphite2: false
Platform shapers (not normally needed):
CoreText: false
Uniscribe: false
Other features:
Documentation: no
GObject bindings: false
Introspection: false
However, make fails with the following error:
In file included from hb-glib.cc:31:0:
hb-glib.h:50:22: error: 'GBytes' was not declared in this scope
hb_glib_blob_create (GBytes *gbytes);
^
hb-glib.h:50:30: error: 'gbytes' was not declared in this scope
hb_glib_blob_create (GBytes *gbytes);
^
hb-glib.cc:389:22: error: redefinition of 'hb_blob_t* hb_glib_blob_create'
hb_glib_blob_create (GBytes *gbytes)
^
In file included from hb-glib.cc:31:0:
hb-glib.h:50:1: error: 'hb_blob_t* hb_glib_blob_create' previously defined here
hb_glib_blob_create (GBytes *gbytes);
^
hb-glib.cc:389:22: error: 'GBytes' was not declared in this scope
hb_glib_blob_create (GBytes *gbytes)
^
hb-glib.cc:389:30: error: 'gbytes' was not declared in this scope
hb_glib_blob_create (GBytes *gbytes)
^
make[4]: *** [libharfbuzz_la-hb-glib.lo] Error 1
I can't determine anything from the config.log file, but then again I'm not exactly sure what to look for. I'm guessing that perhaps there's an unmet dependency somewhere, but I'm kind of at a loss at this point. Any help would be greatly appreciated and I'm happy to provide more info if needed. Thanks a lot.
If it's helpful, here is the full config.log.

The glib GBytes type was added in glib 2.32.
The version of glib is CentOS 5 is 2.12 which is much older.
The harfbuzz configure setup should be checking for a compatible version of glib and not getting as far as compiling before failing. That's a "bug" on their part.
You get to either use an older version of harfbuzz that can use the version of glib that CentOS 5 ships with or you get to build and "install" your own copy of glib too.

Related

Undefined reference to symbol error when linking Mongo C driver static library

I'm trying to build a program using the Mongo C driver. My CMake configuration includes this:
include_directories("/usr/local/include/libmongoc-1.0")
include_directories("/usr/local/include/libbson-1.0")
...
SET (STATIC_LIBS
...
libmongoc-static-1.0.a
libbson-static-1.0.a
)
TARGET_LINK_LIBRARIES(myapp ${STATIC_LIBS})
Compile stage goes fine (so it seems that includes are correctly found), but when the linking stage takes place I get this error:
/usr/bin/ld: /usr/local/lib/libmongoc-static-1.0.a(mongoc-counters.c.o): undefined reference to symbol 'shm_unlink##GLIBC_2.2.5'
//lib/x86_64-linux-gnu/librt.so.1: error adding symbols: DSO missing from command line
It seems it correctly find the static library file but something in it doesn't like it...
Somebody has found a similar error? Is there any known solution?
Some additional info about my system:
gcc version: 6.3.0
Mongo C driver version: 1.16.0
MongoDB version: 4.4.1
Operating system: Debian 9.3
Thanks!
EDIT: debugging on this, I have discovered that if I build the Mongo C driver without SHM counters support this way:
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF -DENABLE_SHM_COUNTERS=OFF -DENABLE_STATIC=ON ..
Then the above error disappears. However, this new and similar one happens:
/usr/bin/ld: /usr/local/lib/libmongoc-static-1.0.a(mongoc-scram.c.o): undefined reference to symbol 'usprep_close_57'
//usr/lib/x86_64-linux-gnu/libicuuc.so.57: error adding symbols: DSO missing from command line
I think I finally solved the problem this way (after looking to this piece of documentation):
include_directories("/usr/local/include/libmongoc-1.0")
include_directories("/usr/local/include/libbson-1.0")
...
find_package (mongoc-1.0 1.17.4 EXACT)
SET (STATIC_LIBS
...
mongo::mongoc_static
)
TARGET_LINK_LIBRARIES(myapp ${STATIC_LIBS})
I didn't need to use -DENABLE_SHM_COUNTERS=OFF -DENABLE_STATIC=ON to build the driver and the recommended way in documentation worked:
cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF ..

How to fix No package 'atk-bridge-2.0' found error even though atk is installed and PKG_CONIG_PATH and LD_LIBRARY_PATH is set?

First I have installed all the dependent packages including atk 2.18.
Then, I have added them to path.
# echo $LD_LIBRARY_PATH
/opt/gtk_+3.12-RHEL6/dependencies/at-spi2-atk/lib:/opt/gtk_+3.12-RHEL6/dependencies/gobject-introspection/lib:/opt/gtk_+3.12-RHEL6/dependencies/pango/lib:/opt/gtk_+3.12-RHEL6/dependencies/harfbuzz/lib:/opt/gtk_+3.12-RHEL6/dependencies/freetype/lib:/opt/gtk_+3.12-RHEL6/dependencies/icu4c/lib:/opt/gtk_+3.12-RHEL6/dependencies/cairo/lib:/opt/gtk_+3.12-RHEL6/dependencies/fontconfig/lib:/opt/gtk_+3.12-RHEL6/dependencies/libpng/lib:/opt/gtk_+3.12-RHEL6/dependencies/pixman/lib:/opt/gtk_+3.12-RHEL6/dependencies/atk/lib:/opt/gtk_+3.12-RHEL6/dependencies/gdk-pixbuf/lib:/opt/gtk_+3.12-RHEL6/dependencies/GLib/lib:
# echo $PATH
/opt/gtk_+3.12-RHEL6/dependencies/gobject-introspection/bin:/opt/gtk_+3.12-RHEL6/dependencies/pango/bin:/opt/gtk_+3.12-RHEL6/dependencies/harfbuzz/bin:/opt/gtk_+3.12-RHEL6/dependencies/freetype/bin:/opt/gtk_+3.12-RHEL6/dependencies/which/bin:/opt/gtk_+3.12-RHEL6/dependencies/icu4c/sbin:/opt/gtk_+3.12-RHEL6/dependencies/icu4c/bin:/opt/gtk_+3.12-RHEL6/dependencies/cairo/bin:/opt/gtk_+3.12-RHEL6/dependencies/fontconfig/bin:/opt/gtk_+3.12-RHEL6/dependencies/libpng/bin:/opt/gtk_+3.12-RHEL6/dependencies/gdk-pixbuf/bin:/opt/gtk_+3.12-RHEL6/dependencies/GLib/bin:/opt/python_2_7_11/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
# echo $PKG_CONFIG_PATH
/opt/gtk_+3.12-RHEL6/dependencies/at-spi2-atk/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/gobject-introspection/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/pango/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/harfbuzz/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/freetype/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/icu4c/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/cairo/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/fontconfig/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/libpng/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/pixman/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/atk/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/gdk-pixbuf/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies/GLib/lib/pkgconfig:/opt/gtk_+3.12-RHEL6/dependencies
But, when I try to run ./configure, I am getting the following error:
checking for ATK... no
configure: error: Package requirements (atk atk-bridge-2.0) were not met:
No package 'atk-bridge-2.0' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables ATK_CFLAGS
and ATK_LIBS to avoid the need to call pkg-config.
atk 2.18 is cleary added in the PKG_CONFIG_PATH and also LD_LIBRARY_PATH.
So, I though atk-bridge-2.0 is separate and found the packag: at-spi2-atk and at-spi2-core. But, no atk-bridge-2.0 is installed.
Please help.
The atk-bridge-2.0 API is provided by at-spi2-atk, not by ATK.
Your build environment is fairly broken, and it seems you're installing each component into its own prefix. You shouldn't. Create a temporary build root, and add that to $PATH, $PKG_CONFIG_PATH, $LD_LIBRARY_PATH, and $XDG_DATA_DIRS. Then, use the same prefix for every component.
You should look at how jhbuild works.

Unknown Eclipse Errors using gfortran, Cygwin

Using Windows 7 64 bit. I've followed these instructions for installing Eclipse for Parallel Application Developers and Cygwin, the latter because I want gfortran to compile Fortran code. At 18:20 in the linked tutorial he compiles in Eclipse with no errors, but I get the following 2 errors (Project is called "example"):
Description Resource Path Location Type
make: *** [example] Error 1 example C/C++ Problem
recipe for target 'example' failed makefile /example/Debug line 29 C/C++ Problem
My code (main.f90, under project "example") is simply
program main
print*, "hello world"
end program main
I've also tried compiling through the terminal, but get the following:
>>gfortran main.f90
gfortran: fatal error: -fuse-linker-plugin, but cyglto_plugin.dll not found
compilation terminated
Any help is appreciated!
The tutorial, you linked, is 2 years old...
As far as I see from the content of the packages available from http://www.cygwin.com/packages/, you have to install gcc-fortran instead of gcc4-fortran, because the latter one is labeled as obsolete.
The library cyglto_plugin.dll, which is used for Link-Time-Optimization, can be found in the package gcc-core and should be installed as a dependency. You could try to disable this library by using -fno-use-linker-plugin, but this will disable some optimization.

Rcpp+Eclipse on Mac OS X

I am trying to get started using Rccp and decided to use Eclipse as a development environment since I already use StatEt for R. I am having trouble getting even a simple program to compile and run though, and would appreciate some help!
Briefly I tried to follow the instructions on the blog: http://blog.fellstat.com/?p=170 exactly for setting up Rcpp, RInside and Eclipse, and for the example program. I am running on Mountain Lion, and installed g++ using the command line options in XCode. I think I've faithfully followed all the steps in the blog, but cannot get the program to compile. I think the problem is in the way the header files are included, as indicated from the snippet of the output below. As far as I can tell, line 52 of /usr/include/c++/4.2.1/cstring is an include statement for <string.h> and the compiler includes Rccp/include/string.h instead of the string.h from std that is found earlier on the include path.
I am a novice in C++ so I'd really appreciate some pointers on how to proceed.
-Krishna
16:22:38 **** Incremental Build of configuration Debug for project MyTestRCppPackage ****
Info: Internal Builder is used for build
g++ -DINSIDE -I/Library/Frameworks/R.framework/Versions/2.15/Resources/include -I/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include -I/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp -I/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RInside/include -O0 -g3 -Wall -c -fmessage-length=0 -arch x86_64 -v -o src/main.o ../src/main.cpp
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~182/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
/usr/llvm-gcc-4.2/bin/../libexec/gcc/i686-apple-darwin11/4.2.1/cc1plus -quiet -v -I/Library/Frameworks/R.framework/Versions/2.15/Resources/include -I/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include -I/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp -I/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RInside/include -imultilib x86_64 -iprefix /usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/ -dD -D__DYNAMIC__ -DINSIDE ../src/main.cpp -fPIC -quiet -dumpbase main.cpp -mmacosx-version-min=10.8.3 -m64 -mtune=core2 -auxbase-strip src/main.o -g3 -O0 -Wall -version -fmessage-length=0 -D__private_extern__=extern -o /var/folders/hc/vqp48jt56_v332kc3dqyf5780000gn/T//ccqdmOKI.s
ignoring nonexistent directory "/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/../../../../i686-apple-darwin11/include"
ignoring nonexistent directory "/usr/include/c++/4.2.1/i686-apple-darwin11/x86_64"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/../../../../i686-apple-darwin11/include"
#include "..." search starts here:
#include <...> search starts here:
/Library/Frameworks/R.framework/Versions/2.15/Resources/include
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/RInside/include
/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include
/usr/include/c++/4.2.1
/usr/include/c++/4.2.1/backward
/usr/local/include
/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/include
/usr/include
/System/Library/Frameworks (framework directory)
/Library/Frameworks (framework directory)
End of search list.
GNU C++ version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00) (i686-apple-darwin11)
compiled by GNU C version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00).
GGC heuristics: --param ggc-min-expand=150 --param ggc-min-heapsize=65536
Compiler executable checksum: b37fef824b01c0a99fb2679acf3b04f1
In file included from /usr/include/c++/4.2.1/cstring:52,
from /usr/include/c++/4.2.1/bits/stl_algobase.h:66,
from /usr/include/c++/4.2.1/memory:53,
from /usr/include/c++/4.2.1/tr1/hashtable:56,
from /usr/include/c++/4.2.1/tr1/unordered_map:37,
from /Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/platform/compiler.h:158,
from /Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/RcppCommon.h:26,
from /Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp.h:27,
from ../src/main.cpp:8:
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/string.h:52: error: 'internal' has not been declared
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/string.h:52: error: typedef name may not be a nested-name-specifier
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/string.h:52: error: expected ';' before '<' token
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/string.h:65: error: expected `)' before 'charsxp'
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/string.h:70: error: expected ',' or '...' before '&' token
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/string.h:75: error: expected unqualified-id before '&' token
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/string.h:75: error: expected ',' or '...' before '&' token
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/string.h:75: error: 'Rcpp::String::String()' cannot be overloaded
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/string.h:55: error: with 'Rcpp::String::String()'
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/string.h:85: error: 'Rcpp::String::String(int)' cannot be overloaded
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/string.h:70: error: with 'Rcpp::String::String(int)'
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/string.h:88: error: expected `)' before 'x'
/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include/Rcpp/string.h:89: error: expected `)' before 'x'
There are two entirely separate issues here:
Get all you need for Rcpp installed. OS X aspects should be documented on the relevant page maintained by Simon. If you have the tools, and have Rcpp install, then you should be able to do cppFunction('double nPi(int x) { return x*M_PI; }') which is uses functions supplied with Rcpp to create a callable C++ functions accessible to you as nPi() -- and nPi(2) should return a value.
Your choice of IDE and its settings. This is has little to do with 1. apart from requiring it to work to.
So I would work on 1. and see if I got that sorted out first, and only then turn to 2.
To summarize, the issue I faced was that include files in Rcpp with the sames names as those in std were in conflict. In particular, string.h from Rcpp was being included at a point where string.h from std was the right choice, and, as far as I could tell, this was due to the fact that paths specified via the -I directive are searched prior to the default paths.
I tried many different alternatives to solve this, including removing and re-installing XCode and the associated Command Line tools, as well as installing another g++ compiler using macports. None of these resolved the issue. I then used the -idirafter directive instead of the -I directive for the search path for include files for Rcpp and R. I got this hint from gcc include order broken?. This worked since these directories are now searched after the default paths. This precludes (at least so far!) the possibility that string.h from std and string.h from Rcpp come into conflict.
To get step 5 of http://blog.fellstat.com/?p=170 to work I had to set the -idirafter paths in PKG_CPPFLAGS in the file Makevars.
Thanks to everyone for your suggestions.
You simply have to remove include
/Library/Frameworks/R.framework/Resources/library/Rcpp/include/Rcpp
because it is:
unnecessary, as all R imports are in form <Rcpp/XXX>
causes this issue, as compiler looks for string.h in Rcpp directory (when it shouldn't).

Issues with g++ and Eclipse on Linux - unresolved symbols

I am running Ubuntu 64bit version, and downloaded the latest 64bit Eclipse.
Installed g++ along with build-essential. Tested g++ to make sure it works from terminal, and it works fine.
alex#ubuntu:~/Desktop$ g++ test.cpp -o test
alex#ubuntu:~/Desktop$ ./test
Hello World!alex#ubuntu:~/Desktop$
However, trying to build simple C++ Hello Word project(one of the default projects that comes with Eclipse), I am getting error.
Description Resource Path Location Type
Program "g++" not found in PATH Preferences, C++/Build/Settings/Discovery, [CDT GCC Builtin Compiler Settings] options C/C++ Scanner Discovery Problem
I have added Environment variable named g++ with value /usr/bin/g++ and the above error went away, however, now I am getting unresolved errors, though project compiles and in the Console shows !!!Hello World!!!
Description Resource Path Location Type
Symbol 'endl' could not be resolved test_hello.cpp /test_hello/src line 13 Semantic Error
Symbol 'cout' could not be resolved test_hello.cpp /test_hello/src line 13 Semantic Error
Symbol 'std' could not be resolved test_hello.cpp /test_hello/src line 10 Semantic Error
Have I correctly entered Environmental variable ?? How can I get fix the "unresolved" error ?? Thanks !
When compiling there are two important things to consider:
1.) Is my path up-to-date with executables?
2.) Is my library path correct?
It appears you satisfy 1.) but not 2.)
The unresolved symbol error means that Eclipse cannot find your library via LD_LIBRARY_PATH or some other medium. It's attempting to locate the standard compiled C++ library.
How did you install g++?
Kindly do this and post the results:
Project > Properties > C/C++ Build > Environment
If everything there appears nominal, you can try
/sbin/ldconfig
which should hopefully re-parse your system library paths and might update your environment.