perl module UUID-0.05 make failed in ubuntu 12.04 - gcc

I am facing problems on installing perl module UUID-0.05.
$ sudo make
cc -c -D_REENTRANT -D_GNU_SOURCE -DDEBIAN
-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -DVERSION=\"0.05\" -DXS_VERSION=\"0.05\" -fPIC "-I/usr/lib/perl/5.14/CORE"
UUID.c UUID.xs:5:23: fatal error: uuid/uuid.h: No such file or directory
compilation terminated. make: * [UUID.o] Error 1
See my answer below.

Slaven Rezic,
You are right.
/usr/bin$ apt-file search uuid/uuid.h
libboost1.46-dev: /usr/include/boost/uuid/uuid.hpp
libboost1.46-doc: /usr/share/doc/libboost1.46-doc/HTML/libs/uuid/uuid.html
libboost1.48-dev: /usr/include/boost/uuid/uuid.hpp
libboost1.48-doc: /usr/share/doc/libboost1.48-doc/HTML/libs/uuid/uuid.html
uuid-dev: /usr/include/uuid/uuid.h
this works great. thanks for the info.

Related

gcc 4.9.2 build error on RHEL6

I'm trying to build gcc 4.9.2 on RHEL6, as follows:
unpack the source tarball (to ~/gcc-4.9.2)
in the source dir:
./contrib/download_prerequisites
create a separate build directory ~/gcc-4.9.2-build
in the build dir:
~/gcc-4.9.2/configure --prefix=/usr/local/gcc-4.9.2
make
This fails with:
make[6]: Entering directory `/root/gcc-4.9.2-build-try0/x86_64-unknown-linux-gnu/libjava/classpath/native/jni/java-math'
/bin/sh ../../../libtool --tag=CC --mode=compile /root/gcc-4.9.2-build-try0/./gcc/xgcc -B/root/gcc-4.9.2-build-try0/./gcc/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I/root/gcc-4.9.2/libjava/classpath/native/jni/java-math -I../../../include -I/root/gcc-4.9.2/libjava/classpath/include -I/root/gcc-4.9.2/libjava/classpath/native/jni/classpath -I/root/gcc-4.9.2/libjava/classpath/native/jni/native-lib -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long -I/usr/include -g -O2 -MT gnu_java_math_GMP.lo -MD -MP -MF .deps/gnu_java_math_GMP.Tpo -c -o gnu_java_math_GMP.lo /root/gcc-4.9.2/libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c
libtool: compile: /root/gcc-4.9.2-build-try0/./gcc/xgcc -B/root/gcc-4.9.2-build-try0/./gcc/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/sys-include -DHAVE_CONFIG_H -I. -I/root/gcc-4.9.2/libjava/classpath/native/jni/java-math -I../../../include -I/root/gcc-4.9.2/libjava/classpath/include -I/root/gcc-4.9.2/libjava/classpath/native/jni/classpath -I/root/gcc-4.9.2/libjava/classpath/native/jni/native-lib -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long -I/usr/include -g -O2 -MT gnu_java_math_GMP.lo -MD -MP -MF .deps/gnu_java_math_GMP.Tpo -c /root/gcc-4.9.2/libjava/classpath/native/jni/java-math/gnu_java_math_GMP.c -fPIC -DPIC -o .libs/gnu_java_math_GMP.o
mv -f .deps/gnu_java_math_GMP.Tpo .deps/gnu_java_math_GMP.Plo
/bin/sh ../../../libtool --tag=CC --mode=link /root/gcc-4.9.2-build-try0/./gcc/xgcc -B/root/gcc-4.9.2-build-try0/./gcc/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/sys-include -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long -I/usr/include -g -O2 -module -version-info 0:0:0 -no-undefined -lgmp -avoid-version -o libjavamath.la -rpath /usr/local/gcc-4.9.2/lib/../lib64/gcj-4.9.2-15 gnu_java_math_GMP.lo ../../../native/jni/classpath/jcl.lo -lrt
libtool: link: /root/gcc-4.9.2-build-try0/./gcc/xgcc -B/root/gcc-4.9.2-build-try0/./gcc/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/sys-include -shared .libs/gnu_java_math_GMP.o ../../../native/jni/classpath/.libs/jcl.o /root/gcc-4.9.2-build-try0/./gmp/.libs/libgmp.a -lrt -Wl,-soname -Wl,libjavamath.so -o .libs/libjavamath.so
/usr/bin/ld: /root/gcc-4.9.2-build-try0/./gmp/.libs/libgmp.a(mp_set_fns.o): relocation R_X86_64_32 against `__gmp_default_allocate' can not be used when making a shared object; recompile with -fPIC
/root/gcc-4.9.2-build-try0/./gmp/.libs/libgmp.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[6]: *** [libjavamath.la] Error 1
make[6]: Leaving directory `/root/gcc-4.9.2-build-try0/x86_64-unknown-linux-gnu/libjava/classpath/native/jni/java-math'
A little googling pointed me at the --disable-shared option, which sort of helped, but now:
in the build dir:
~/gcc-4.9.2/configure --prefix=/usr/local/gcc-4.9.2 --disable-shared
make
yielded a slightly different error:
make[8]: Entering directory `/root/gcc-4.9.2-build/x86_64-unknown-linux-gnu/32/libjava/classpath/native/jni/classpath'
/bin/sh ../../../libtool --tag=CC --mode=compile /root/gcc-4.9.2-build/./gcc/xgcc -B/root/gcc-4.9.2-build/./gcc/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/bin/ -B/usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/include -isystem /usr/local/gcc-4.9.2/x86_64-unknown-linux-gnu/sys-include -m32 -DHAVE_CONFIG_H -I. -I/root/gcc-4.9.2/libjava/classpath/native/jni/classpath -I../../../include -I/root/gcc-4.9.2/libjava/classpath/include -I/root/gcc-4.9.2/libjava/classpath/native/jni/classpath -I/root/gcc-4.9.2/libjava/classpath/native/jni/native-lib -W -Wall -Wmissing-declarations -Wwrite-strings -Wmissing-prototypes -Wno-long-long -Wstrict-prototypes -pedantic -fexceptions -fasynchronous-unwind-tables -g -O2 -m32 -MT jcl.lo -MD -MP -MF .deps/jcl.Tpo -c -o jcl.lo /root/gcc-4.9.2/libjava/classpath/native/jni/classpath/jcl.c
libtool: compile: not configured to build any kind of library
libtool: compile: See the libtool documentation for more information.
libtool: compile: Fatal configuration error.
make[8]: *** [jcl.lo] Error 1
make[8]: Leaving directory `/root/gcc-4.9.2-build/x86_64-unknown-linux-gnu/32/libjava/classpath/native/jni/classpath'
Adding the --enable-static option made no difference.
Any suggestions on what might be wrong?
BTW, gcc 4.9.1 gave the same errors.
System: Linux 2.6.32-431.29.2.el6.x86_64 #1 SMP Sun Jul 27 15:55:46 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux
System is RHEL6, fully updated via Redhat, and has no custom RPMs that I know of.
Just completed building 4.9.2 on a CentOS 6.4 VM using 4.4.7 gcc. Ran into an out of space issue, which caused the build to fail, but once resolved, everything else went smoothly.
Looks like your build is failing in the Java side of town? Not sure if you need the Java support, so have you tried compiling just the c/c++ language support?
~/gcc-4.9.2/configure --enable-languages=c,c++ ...
I also don't require 32-bit binaries, so I add --disable-multilib to the list of configure parameters.

GIMP 2.6 compilation fails on Fedora 17 with fatal error: gegl.h: No such file or directory

yum installs GIMP 2.8 on Fedora 17, but I want to use 2.6 so I'm trying to compile it. However, I keep getting this error saying it can't find gegl.h, which is installed and on the include path:
[root#life gegl]# pwd
/home/james/packages/gimp-2.6.12/app/gegl
[root#life gegl]# make
gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../app -I../../app /usr/include/gegl-0.1/ -pthread -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng15 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/local/include -DG_LOG_DOMAIN=\"Gimp-GEGL\" -DGIMP_DISABLE_DEPRECATED -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE -g -O2 -Wall -Wdeclaration-after-statement -Wmissing-prototypes -Wmissing-declarations -Winit-self -Wpointer-arith -Wold-style-definition -Wformat-security -MT gimp-gegl.o -MD -MP -MF .deps/gimp-gegl.Tpo -c -o gimp-gegl.o gimp-gegl.c
gimp-gegl.c:24:18: fatal error: gegl.h: No such file or directory
compilation terminated.
make: *** [gimp-gegl.o] Error 1
[root#life gegl]# ls -l /usr/include/gegl-0.1/gegl.h
-rw-r--r--. 1 root root 31086 Nov 18 2011 /usr/include/gegl-0.1/gegl.h
Please re-run config:
gcc -DHAVE_CONFIG_H
-I.
-I../..
-I../..
-I../..
-I../../app
-I../../app
/usr/include/gegl-0.1/ // THIS IS WRONG: it should be "-I/usr/include/gegl-0.1"
-pthread
...
Please also make sure your "-L" and/or "-l" library paths are correct at link time, too.

Error installing mysql2 gem on Ubuntu Server 11.10: /usr/bin/ld: cannot find -lmysqlclient_r

I got the same error on Ubuntu Server 11.10 x64 mentioned in some other posts:
Post #1
Post #2
The mysql2 gem cannot be compiled due "cannot find -lmysqlclient_r "
I'm using:
Ruby v1.8.7
MySQL v5.5.25-1
Rails 3.2.3
Gem 1.8.24
I installed the package libmysqlclient-dev and it still doesn't work.
The files
- libmysqlclient_r.a
- libmysqlclient_r.so
- libmysqlclient_r.so.18
- libmysqlclient_r.so.18.0.0
are located at /usr/lib/x86_64-linux-gnu/
So I created symlinks in /usr/lib/
Ii still doesn't work :(
Any idea??
$ sudo gem install mysql2
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for rb_thread_blocking_region()... no
checking for rb_wait_for_single_fd()... no
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
creating Makefile
make
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -funroll-loops -c mysql2_ext.c
./client.h:16:1: warning: ârb_thread_blocking_regionâ defined but not used [-Wunused-function]
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -funroll-loops -c result.c
result.c: In function ârb_mysql_result_fetch_rowâ:
result.c:258:31: warning: variable âtokensâ set but not used [-Wunused-but-set-variable]
result.c:272:58: warning: variable âtokensâ set but not used [-Wunused-but-set-variable]
result.c:315:33: warning: variable âtokensâ set but not used [-Wunused-but-set-variable]
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -Wall -funroll-loops -c client.c
client.c: In function ârb_mysql_client_infoâ:
client.c:539:3: warning: variable âwrapperâ set but not used [-Wunused-but-set-variable]
gcc -shared -o mysql2.so mysql2_ext.o result.o client.o -L. -L/usr/lib -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -Wl,-rpath,/usr/lib/x86_64-linux-gnu -lruby1.8 -L/usr/lib/x86_64-linux-gnu -lmysqlclient_r -lpthread -lz -lm -lrt -ldl -lpthread -lrt -ldl -lcrypt -lm -lc
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status
make: *** [mysql2.so] Error 1

Cloog-ppl make error

I'm trying to install cloog-ppl 0.15-11 in my 64 bit ubuntu 10.10. I get the following error during make. I guess it is wrt linking.
gcc -DHAVE_CONFIG_H -I. -I./include/cloog -I./include -I./include -Wall -fomit-frame-pointer -g -O2 -MT cloog.o -MD -MP -MF .deps/cloog.Tpo -c -o cloog.o `test -f 'source/cloog.c' || echo './'`source/cloog.c
mv -f .deps/cloog.Tpo .deps/cloog.Po
/bin/bash ./libtool --tag=CC --mode=link gcc -Wall -fomit-frame-pointer -g -O2 -o cloog cloog.o libcloog.la -lgmp -lppl_c -lppl -lgmpxx
libtool: link: gcc -Wall -fomit-frame-pointer -g -O2 -o .libs/cloog cloog.o ./.libs/libcloog.so /usr/lib/libgmp.so -lppl_c -lppl /usr/lib/libgmpxx.so
//usr/local/lib/libppl_c.so: undefined reference to `std::__detail::_List_node_base::_M_unhook()#GLIBCXX_3.4.15'
//usr/local/lib/libppl_c.so: undefined reference to `std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*)#GLIBCXX_3.4.15'
//usr/local/lib/libppl_c.so: undefined reference to `std::__detail::_List_node_base::swap(std::__detail::_List_node_base&, std::__detail::_List_node_base&)#GLIBCXX_3.4.15'
//usr/local/lib/libppl_c.so: undefined reference to `std::__detail::_List_node_base::_M_transfer(std::__detail::_List_node_base*, std::__detail::_List_node_base*)#GLIBCXX_3.4.15'
collect2: ld returned 1 exit status
make[1]: *** [cloog] Error 1
make[1]: Leaving directory `/home/praveen/cloog-ppl-0.15.11'
make: *** [all-recursive] Error 1
Can some one help me out on this ?
I have the same problem that I worked for a whole day!! I have a hit, as least this bug disappeared.
When it refers to GLIBCXX_3.4.15 it means that you are using a g++ or gcc with the library not providing the functions or classes you need, very likely 4.4 or 4.5. I changed my g++ and gcc to 4.6 and the problem was solved. For some references, you can check out the following:
How standard lib linked by libstdc++.so.6
Notice: I only get libstdc++.so.5 in /usr/lib when I have g++-4.5 installed. I think libstdc++ is the library that g++ and gcc used.
for changing the compiler version in Linux, see the following link:
Upgrade your compiler
Hope it helps!

Installing PL/Ruby for PostgreSQL 8.3

This is to enable the development of postgres functions with embedded ruby code,
but I have been unable to build it.
As advised by
http://www.robbyonrails.com/articles/2005/08/22/installing-untrusted-pl-ruby-for-postgresql
I am trying to build the needed plruby.so from the latest version (plruby-0.5.3.tar.gz) provided at ftp://moulon.inra.fr/pub/ruby/
I've sorted out where my local postgres set up is and adjusted the invocation to:
ruby extconf.rb --with-pgsql-include=/usr/postgresql-8.3.4/include/server --enable-shared --disable-conversion --with-pgsql-version=83
I've tried quite number of variations on that, but it does not seem to be able to successfully make
the 'conftest.c' file
It says this:
checking for catalog/pg_proc.h... yes
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
And here is what I end up with in my mkmf.log
have_header: checking for catalog/pg_proc.h... -------------------- yes
"gcc -E -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -I/usr/postgresql-8.3.4/include/server -g -O2 -fPIC conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include <catalog/pg_proc.h>
/* end */
When I run the gcc line manually, it says there is no 'conftest.c' (and there is not, but
it is supposed to be generated).
'uname -a' ... gives
Linux vdev1 2.6.18.8-xen #2 SMP Thu May 8 11:52:29 PDT 2008 x86_64 x86_64 x86_64 GNU/Linux
'ruby -v' ... gives
ruby 1.8.6 (2008-08-11 patchlevel 287) [x86_64-linux]
Any help and/or advice would be appreciated.
-- Mike Berrow
OK, I managed to hand build this (bypassing the fragile extconf.rb and makefile) by googling for a logfile of
a successful build, starting with the gcc lines I saw there, then fiddling with the gcc compile
flags and paths until it worked.
In plruby.h change the SAFE_LEVEL to 0
as shown below
#ifndef SAFE_LEVEL
//#define SAFE_LEVEL 12
#define SAFE_LEVEL 0
#endif
Compile each from shell then link
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_CATALOG_PG_PROC_H -DHAVE_RB_HASH_DELETE -DHAVE_ST_H -DHAVE_UTILS_ARRAY_H -I/usr/postgresql-8.3.4/include/server -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -DHAVE_RB_HASH_DELETE -DHAVE_RB_INITIALIZE_COPY -DPG_UTILS_ARRAY -DPG_PL_TRYCATCH -DPG_PL_VERSION=83 -DPLRUBY_CALL_HANDLER=plruby_call_handler -DPLRUBY_VALIDATOR=plruby_validator -c plruby.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_CATALOG_PG_PROC_H -DHAVE_RB_HASH_DELETE -DHAVE_ST_H -DHAVE_UTILS_ARRAY_H -I/usr/postgresql-8.3.4/include/server -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -DHAVE_RB_HASH_DELETE -DHAVE_RB_INITIALIZE_COPY -DPG_UTILS_ARRAY -DPG_PL_TRYCATCH -DPG_PL_VERSION=83 -DPLRUBY_CALL_HANDLER=plruby_call_handler -DPLRUBY_VALIDATOR=plruby_validator -c plplan.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_CATALOG_PG_PROC_H -DHAVE_RB_HASH_DELETE -DHAVE_ST_H -DHAVE_UTILS_ARRAY_H -I/usr/postgresql-8.3.4/include/server -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -DHAVE_RB_HASH_DELETE -DHAVE_RB_INITIALIZE_COPY -DPG_UTILS_ARRAY -DPG_PL_TRYCATCH -DPG_PL_VERSION=83 -DPLRUBY_CALL_HANDLER=plruby_call_handler -DPLRUBY_VALIDATOR=plruby_validator -c plpl.c
gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -DHAVE_CATALOG_PG_PROC_H -DHAVE_RB_HASH_DELETE -DHAVE_ST_H -DHAVE_UTILS_ARRAY_H -I/usr/postgresql-8.3.4/include/server -D_FILE_OFFSET_BITS=64 -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -DHAVE_RB_HASH_DELETE -DHAVE_RB_INITIALIZE_COPY -DPG_UTILS_ARRAY -DPG_PL_TRYCATCH -DPG_PL_VERSION=83 -DPLRUBY_CALL_HANDLER=plruby_call_handler -DPLRUBY_VALIDATOR=plruby_validator -c pltrans.c
gcc -shared -o plruby.so plruby.o plplan.o plpl.o pltrans.o -L. -L/usr/lib -L/usr/postgresql-8.3.4/lib -L. -Wl,-Bsymbolic -rdynamic -Wl,-export-dynamic -lruby -lpthread -ldl -lcrypt -lm -lc
Place the '.so' file built above in the dynamic library path ($libdir)
[ determined using pg_config --pkglibdir giving (in my case) /usr/postgresql-8.3.4/lib ]
Others taking this approach will most likely have to do their own tweaking.
Add these functions ...
CREATE OR REPLACE FUNCTION plruby_call_handler()
RETURNS language_handler AS
'$libdir/plruby', 'plruby_call_handler'
LANGUAGE 'c' VOLATILE
COST 1;
ALTER FUNCTION plruby_call_handler() OWNER TO postgres;
CREATE OR REPLACE FUNCTION plruby_validator(oid)
RETURNS void AS
'$libdir/plruby', 'plruby_validator'
LANGUAGE 'c' VOLATILE
COST 1;
ALTER FUNCTION plruby_validator(oid) OWNER TO postgres;
Add 'plruby' as a procedural language
CREATE PROCEDURAL LANGUAGE 'plruby' HANDLER plruby_call_handler;
Test it:
CREATE FUNCTION ruby_max(int4, int4) RETURNS text AS '
if args[0].to_i > args[1].to_i
return "The one on the left is bigger"
else
return "The one on the right is bigger"
end
' LANGUAGE 'plruby';
select ruby_max(8, 9);
There are other build options for this that enable type 'conversions'.
The above build is the simplest one and all function parameters actually
come into ruby as strings (even though they are declared as int4).
Thus the need for the 'to_i' call here.

Resources