How to install mysql2 on Ubuntu server 10.04 with ree-1.8.7 - ruby

When I try to install mysql2 on Ubuntu with ree-1.8.7-2011.03 I get:
# gem install mysql2
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ree-1.8.7-2011.03/bin/ruby 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/opt/local/include -I. -I/usr/local/rvm/rubies/ree-1.8.7-
2011.03/lib/ruby/1.8/i686-linux -I. -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -D_FILE_OFFSET_BITS=64 -I/usr/include -fPIC -g -static-libgcc -fno-omit-frame-pointer -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1 -fPIC -g -O2 -Wall -funroll-loops -c client.c
gcc -I. -I/opt/local/include -I. -I/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/i686-linux -I. -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -D_FILE_OFFSET_BITS=64 -I/usr/include -fPIC -g -static-libgcc -fno-omit-frame-pointer -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1 -fPIC -g -O2 -Wall -funroll-loops -c mysql2_ext.c
./client.h:16: warning: ‘rb_thread_blocking_region’ defined but not used
gcc -I. -I/opt/local/include -I. -I/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/i686-linux -I. -DHAVE_MYSQL_H -DHAVE_ERRMSG_H -DHAVE_MYSQLD_ERROR_H -D_FILE_OFFSET_BITS=64 -I/usr/include -fPIC -g -static-libgcc -fno-omit-frame-pointer -fPIC -g -static-libgcc -fno-omit-frame-pointer -fno-strict-aliasing -DMY_PTHREAD_FASTMUTEX=1 -fPIC -g -O2 -Wall -funroll-loops -c result.c
gcc -shared -o mysql2.so client.o mysql2_ext.o result.o -L. -L/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib -Wl,-R/usr/local/rvm/rubies/ree-1.8.7-2011.03/lib -L. -rdynamic -Wl,- export-dynamic -Wl,-rpath,/usr/lib -L/usr/lib -lmysqlclient_r -lpthread -lm -lrt -ldl -L/opt/local/lib -lrt -ldl -lcrypt -lm -lc
/usr/bin/ld: cannot find -lmysqlclient_r
collect2: ld returned 1 exit status
make: *** [mysql2.so] Error 1
I am not sure what the error is. Any idea of the cause?

Related

Installing Compass on Windows - fail - can't find dependency ffi

I run cygwin-64 bits on Windows 7. I have installed Ruby2.3 64 bit and Ruby DevKit.
I try to install Compass using ruby gems. I get this:
$gem install compass
Building native extensions. This could take a while...
Successfully installed ffi-1.9.10
ERROR: Error installing compass:
rb-inotify requires ffi (>= 0.5.0)
This is the verbose version:
$ gem install compass --verbose
HEAD https://api.rubygems.org/api/v1/dependencies
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=compass
200 OK
Getting SRV record failed: DNS result has no information for _rubygems._tcp.api.rubygems.org
GET https://api.rubygems.org/api/v1/dependencies?gems=chunky_png,compass-core,compass-import-once,rb-fsevent,rb-inotify,sass
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=ffi,multi_json
200 OK
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/COPYING
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/LICENSE
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/README.md
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/Rakefile
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/AbstractMemory.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/AbstractMemory.h
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/ArrayType.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/ArrayType.h
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/Buffer.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/Call.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/Call.h
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/ClosurePool.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/ClosurePool.h
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/DataConverter.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/DynamicLibrary.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/DynamicLibrary.h
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/Function.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/Function.h
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/FunctionInfo.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/LastError.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/LastError.h
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/LongDouble.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/LongDouble.h
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/MappedType.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c/MappedType.h
...
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/lib/ffi/struct.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/lib/ffi/struct_layout_builder.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/lib/ffi/tools/const_generator.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/lib/ffi/tools/generator.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/lib/ffi/tools/generator_task.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/lib/ffi/tools/struct_generator.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/lib/ffi/tools/types_generator.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/lib/ffi/types.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/lib/ffi/union.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/lib/ffi/variadic.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/lib/ffi/version.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/Benchmark.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/BoolTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/BufferTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/ClosureTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/EnumTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/FunctionTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/GNUmakefile
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/GlobalVariable.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/LastErrorTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/NumberTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/PointerTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/ReferenceTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/StringTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/StructTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/UnionTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/libtest/VariadicTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/LICENSE.SPECS
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/async_callback_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/bool_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/buffer_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/callback_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/custom_param_type.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/custom_type_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/dup_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/enum_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/errno_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/ffi_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/Benchmark.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/BoolTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/BufferTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/ClosureTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/EnumTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/FunctionTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/GNUmakefile
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/GlobalVariable.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/LastErrorTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/NumberTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/PointerTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/ReferenceTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/StringTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/StructTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/UnionTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/VariadicTest.c
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/fixtures/classes.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/function_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/io_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/library_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/long_double.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/managed_struct_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/memorypointer_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/number_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/platform_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/pointer_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/rbx/attach_function_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/rbx/memory_pointer_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/rbx/spec_helper.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/rbx/struct_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/spec_helper.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/string_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/strptr_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/struct_by_ref_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/struct_callback_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/struct_initialize_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/struct_packed_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/struct_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/typedef_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/union_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/ffi/variadic_spec.rb
C:/cygwin64/home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/spec/spec.opts
Building native extensions. This could take a while...
current directory: /home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c
/usr/bin/ruby.exe -r ./siteconf20160419-7812-1d7ip8w.rb extconf.rb
checking for ffi_call() in -lffi... yes
checking for ffi_prep_closure()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... yes
creating extconf.h
creating Makefile
current directory: /home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c
make "DESTDIR=" clean
rm -f
rm -f ffi_c.so *.o *.bak mkmf.log .*.time
current directory: /home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c
make "DESTDIR="
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o AbstractMemory.o -c AbstractMemory.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o ArrayType.o -c ArrayType.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o Buffer.o -c Buffer.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o Call.o -c Call.c
In file included from Call.c:62:0:
Call.c: In function ‘do_blocking_call’:
Thread.h:78:39: warning: implicit declaration of function ‘rb_thread_call_without_gvl’ [-Wimplicit-function-declaration]
# define rbffi_thread_blocking_region rb_thread_call_without_gvl
^
Call.c:368:5: note: in expansion of macro ‘rbffi_thread_blocking_region’
rbffi_thread_blocking_region(call_blocking_function, data, (void *) -1, NULL);
^
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o ClosurePool.o -c ClosurePool.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o DataConverter.o -c DataConverter.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o DynamicLibrary.o -c DynamicLibrary.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o ffi.o -c ffi.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o Function.o -c Function.c
Function.c: In function ‘async_cb_event’:
Function.c:563:9: warning: implicit declaration of function ‘rb_thread_call_without_gvl’ [-Wimplicit-function-declaration]
rb_thread_call_without_gvl(async_cb_wait, &w, async_cb_stop, &w);
^
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o FunctionInfo.o -c FunctionInfo.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o LastError.o -c LastError.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o LongDouble.o -c LongDouble.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o MappedType.o -c MappedType.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o MemoryPointer.o -c MemoryPointer.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o MethodHandle.o -c MethodHandle.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o Platform.o -c Platform.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o Pointer.o -c Pointer.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o Struct.o -c Struct.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o StructByReference.o -c StructByReference.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o StructByValue.o -c StructByValue.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o StructLayout.o -c StructLayout.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o Thread.o -c Thread.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o Type.o -c Type.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o Types.o -c Types.c
gcc -I. -I/usr/include/ruby-2.2.0 -I/usr/include/ruby-2.2.0/ruby/backward -I/usr/include/ruby-2.2.0 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -ggdb -O2 -pipe -Wimplicit-function-declaration -o Variadic.o -c Variadic.c
rm -f ffi_c.so
gcc -shared -o ffi_c.so AbstractMemory.o ArrayType.o Buffer.o Call.o ClosurePool.o DataConverter.o DynamicLibrary.o ffi.o Function.o FunctionInfo.o LastError.o LongDouble.o MappedType.o MemoryPointer.o MethodHandle.o Platform.o Pointer.o Struct.o StructByReference.o StructByValue.o StructLayout.o Thread.o Type.o Types.o Variadic.o -L. -L/usr/lib -L. -fstack-protector -Wl,--export-all-symbols -Wl,--enable-auto-image-base,--enable-auto-import -lruby220 -lffi -lffi -lpthread -lgmp -ldl -lcrypt
current directory: /home/vsxxame/.gem/ruby/gems/gems/ffi-1.9.10/ext/ffi_c
make "DESTDIR=" install
/usr/bin/mkdir -p . ./.gem.20160419-7812-9fvqix
exit > .RUBYARCHDIR.time
/usr/bin/install -c -m 0755 ffi_c.so ./.gem.20160419-7812-9fvqix
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/cygwin64/home/vsxxame/.gem/ruby/gems/extensions/x86_64-cygwin/ffi-1.9.10/mkmf.log
Successfully installed ffi-1.9.10
ERROR: Error installing compass:
rb-inotify requires ffi (>= 0.5.0)
I get the same if I try to install rb-inotify. Other gems are installed ok, . Any hints?

ruby gem install pg with ruby 1.8.7 on CentOS 6.5

When trying to install the ruby gem pg with the command gem install pg
I get the following error message:
Building native extensions. This could take a while.:
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/pg-0.18.0 for inspection. Results logged to /usr/lib/ruby/gems/0.18.0/ext/gem_make.out
I have ruby 1.8.7 running.
I have installed yum install postgresql-devel.
Thanks for the help.
The gem.make.out contains the following:
/usr/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQconnectionUsedPassword()... yes
checking for PQisthreadsafe()... yes
checking for PQprepare()... yes
checking for PQexecParams()... yes
checking for PQescapeString()... yes
checking for PQescapeStringConn()... yes
checking for PQescapeLiteral()... no
checking for PQescapeIdentifier()... no
checking for PQgetCancel()... yes
checking for lo_create()... yes
checking for pg_encoding_to_char()... yes
checking for pg_char_to_encoding()... yes
checking for PQsetClientEncoding()... yes
checking for PQlibVersion()... no
checking for PQping()... no
checking for PQsetSingleRowMode()... no
checking for PQconninfo()... no
checking for PQhostaddr()... no
checking for rb_encdb_alias()... no
checking for rb_enc_alias()... no
checking for rb_thread_call_without_gvl()... no
checking for rb_thread_call_with_gvl()... no
checking for rb_thread_fd_select()... no
checking for rb_w32_wrap_io_handle()... no
checking for rb_str_modify_expand()... no
checking for rb_hash_dup()... no
checking for PGRES_COPY_BOTH in libpq-fe.h... no
checking for PGRES_SINGLE_TUPLE in libpq-fe.h... no
checking for PG_DIAG_TABLE_NAME in libpq-fe.h... no
checking for struct pgNotify.extra in libpq-fe.h... yes
checking for unistd.h... yes
checking for ruby/st.h... no
checking for st.h... yes
creating extconf.h
creating Makefile
make
gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/include -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -c pg_type_map_by_class.c
pg_type_map_by_class.c: In function ‘pg_tmbk_lookup_klass’:
pg_type_map_by_class.c:68: warning: implicit declaration of function ‘RB_TYPE_P’
gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/include -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -c pg_result.c
pg_result.c:428: warning: ‘pgresult_ntuples_for_enum’ defined but not used
gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/include -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -c pg_type_map.c
gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/include -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -c pg_type_map_by_column.c
pg_type_map_by_column.c: In function ‘pg_tmbc_result_value’:
pg_type_map_by_column.c:102: warning: implicit declaration of function ‘ENCODING_GET’
gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/include -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -c pg_copy_coder.c
pg_copy_coder.c: In function ‘pg_copycoder_encoder_allocate’:
pg_copy_coder.c:38: warning: implicit declaration of function ‘rb_str_new_cstr’
gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/include -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -c util.c
gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/include -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -c pg_binary_encoder.c
pg_binary_encoder.c: In function ‘pg_bin_enc_from_base64’:
pg_binary_encoder.c:122: warning: implicit declaration of function ‘RSTRING_LENINT’
gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/include -fPIC -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fno-strict-aliasing -fPIC -c pg_type_map_by_mri_type.c
pg_type_map_by_mri_type.c: In function ‘pg_tmbmt_typecast_query_param’:
pg_type_map_by_mri_type.c:61: error: ‘T_COMPLEX’ undeclared (first use in this function)
pg_type_map_by_mri_type.c:61: error: (Each undeclared identifier is reported only once
pg_type_map_by_mri_type.c:61: error: for each function it appears in.)
pg_type_map_by_mri_type.c:61: error: ‘T_RATIONAL’ undeclared (first use in this function)
pg_type_map_by_mri_type.c: In function ‘pg_tmbmt_aset’:
pg_type_map_by_mri_type.c:197: warning: implicit declaration of function ‘RB_TYPE_P’
make: *** [pg_type_map_by_mri_type.o] Error 1

GNU scientific library linking

My GNU scientific library (http://www.gnu.org/software/gsl/) installed in the path: /home/myname/gsl-1.6
My mlRho 1.7-stat prog (http://guanine.evolbio.mpg.de/mlRho/mlRho_1.7.tgz) which uses GNU scientific library-installed in:/home/myname/MlRho_1.7
my operating system: Fedora 16
original make file in mlRho
cd /home/myname/MlRho_1.7/
vim make
CC=gcc
CFLAGS= -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 \
-I/opt/local/include/ -L/opt/local/lib/
I have changed path in mlRho
CC=gcc
CFLAGS= -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 \
-I/home/myname/gsl-1.6 -L/home/myname/gsl-1.6
after making changes, I tried running make, it gives error
make
gcc -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/home/myname/gsl-1.6/include/ -L/home/myname/gsl-1.6/lib/ -c -o mlRho.o mlRho.c
In file included from mlRho.c:16:0:
mlComp.h:7:30: fatal error: gsl/gsl_sf_gamma.h: No such file or directory
compilation terminated.
make: *** [mlRho.o] Error 1
when i do make test- it gives me error below
make test
make[1]: Entering directory `/home/myname/MlRho_1.7/TestMlPi'
gcc -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/opt/local/include/ -L/opt/local/lib/ -c -o testMlPi.o testMlPi.c
testMlPi.c: In function ‘main’:
testMlPi.c:62:67: warning: variable ‘sderr’ set but not used [-Wunused-but-set-variable]
testMlPi.c:62:60: warning: variable ‘sdhet’ set but not used [-Wunused-but-set-variable]
gcc -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/opt/local/include/ -L/opt/local/lib/ -c -o interface.o interface.c
gcc -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/opt/local/include/ -L/opt/local/lib/ -c -o eprintf.o eprintf.c
gcc -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/opt/local/include/ -L/opt/local/lib/ -c -o ranNum.o ranNum.c
gcc -O3 -Wall -Wshadow -pedantic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DVER32 -I/opt/local/include/ -L/opt/local/lib/ -o testMlPi testMlPi.o interface.o eprintf.o ranNum.o -lm
make[1]: Leaving directory `/home/myname/MlRho_1.7/TestMlPi'
Output from testMlPi:
pi: 5.00e-05 epsilon: 4.90e-04 -log(L): 1.40e+05
Output from mlRho:
make: ./mlRho: Command not found
make: *** [testPi] Error 127
Output from mlRho:
make: ./mlRho: Command not found
make: *** [testPi] Error 127
It somehow GNU library not linking to mlRho programme. How to fix it?

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

R package installation is successful on all machines but one

We are a team working on an R package containing C/C++ code. The package can successfully be installed on all the machines but one. These all run the same version of Mac OS X. I have provided the log files for the installation of the package on my computer (success) and a colleague's computer (error). The package depends on the Rcpp package and the GSL library, both of which were successfully installed on both machines.
My Computer
WARNING: ignoring environment value of R_HOME
* installing to library '/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15'
* installing *source* package 'mrenci' ...
** libs
*** arch - x86_64
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c MRMRTree.cc -o MRMRTree.o
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c Matrix.cc -o Matrix.o
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c MiMBuilder.cc -o MiMBuilder.o
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c SymmetricMatrix.cc -o SymmetricMatrix.o
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c adaptor.cc -o adaptor.o
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c memory.cc -o memory.o
/opt/local/bin/g++-mp-4.5 -I/opt/local/lib/R/include -I/opt/local/lib/R/include/x86_64 -DNDEBUG -fopenmp -fopenmp -I/opt/local/include -I"/Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/include" -fPIC -pipe -O2 -m64 -c tools.cc -o tools.o
/opt/local/bin/g++-mp-4.5 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/opt/local/lib -o mrenci.so MRMRTree.o Matrix.o MiMBuilder.o SymmetricMatrix.o adaptor.o memory.o tools.o /Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/Rcpp/lib/x86_64/libRcpp.a -fopenmp -fopenmp -L/opt/local/lib/R/lib/x86_64 -lR
installing to /Users/dejayn/R/x86_64-apple-darwin10.8.0-library/2.15/mrenci/libs/x86_64
** R
** preparing package for lazy loading
** testing if installed package can be loaded
* DONE (mrenci)
Colleague's Computer
WARNING: ignoring environment value of R_HOME
* installing to library '/Library/Frameworks/R.framework/Versions/2.15/Resources/library'
* installing *source* package 'mrenci' ...
** libs
*** arch - x86_64
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG  -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -g -O2  -c MRMRTree.cc -o MRMRTree.o
MRMRTree.cc: In member function 'double* const MRMRTree::bootstrap(unsigned int)':
MRMRTree.cc:73: warning: iteration variable 'i' is unsigned
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG  -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -g -O2  -c Matrix.cc -o Matrix.o
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG  -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -g -O2  -c MiMBuilder.cc -o MiMBuilder.o
MiMBuilder.cc: In member function 'Matrix* const MiMBuilder::createMiM(unsigned int*, unsigned int, unsigned int*, unsigned int)':
MiMBuilder.cc:102: warning: iteration variable 'i' is unsigned
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG  -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -g -O2  -c SymmetricMatrix.cc -o SymmetricMatrix.o
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG  -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -g -O2  -c adaptor.cc -o adaptor.o
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG  -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -g -O2  -c memory.cc -o memory.o
g++ -arch x86_64 -I/Library/Frameworks/R.framework/Resources/include -I/Library/Frameworks/R.framework/Resources/include/x86_64 -DNDEBUG  -fopenmp -I/usr/local/include -I"/Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/include"   -fPIC  -g -O2  -c tools.cc -o tools.o
g++ -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o mrenci.so MRMRTree.o Matrix.o MiMBuilder.o SymmetricMatrix.o adaptor.o memory.o tools.o /Library/Frameworks/R.framework/Versions/2.15/Resources/library/Rcpp/lib/x86_64/libRcpp.a -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/2.15/Resources/library/mrenci/libs/x86_64
** R
** preparing package for lazy loading
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
 unable to load shared object '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/mrenci/libs/x86_64/mrenci.so':
 dlopen(/Library/Frameworks/R.framework/Versions/2.15/Resources/library/mrenci/libs/x86_64/mrenci.so, 6): Symbol not found: _GOMP_critical_name_end
 Referenced from: /Library/Frameworks/R.framework/Versions/2.15/Resources/library/mrenci/libs/x86_64/mrenci.so
 Expected in: flat namespace
in /Library/Frameworks/R.framework/Versions/2.15/Resources/library/mrenci/libs/x86_64/mrenci.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing '/Library/Frameworks/R.framework/Versions/2.15/Resources/library/mrenci'
At first, the installation on my colleague's computer would result in the compilation of the package for both architectures, upon which g++ complained about an unknown -arch argument. This issue, however, appears to have been mitigated by forcing the targeting of a single architecture x86_64. It is also worth noting that as a result of these errors, all computers now have several versions of R and g++. Is this an issue with the linker? Does the same compiler need to be used for both R and its packages? In the case of my computer, I never explicitly asked for g++-mp-4.5 to be used rather than the default g++ (version 4.2), so I figured R automatically detects it.
In case this is of any help, here is what my Makevars contains:
PKG_LIBS=`$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` $(SHLIB_OPENMP_CFLAGS) -fopenmp
PKG_CPPFLAGS=$(SHLIB_OPENMP_CXXFLAGS) -fopenmp
PKG_CFLAGS=$(SHLIB_OPENMP_CFLAGS) -fopenmp
The $(SHLIB_OPENMP_*FLAGS) flags seem to be defined only on my computer; -fopenmp flags were explicitly added for the package to work on all the machines.
Has anyone experienced similar issues? Any help would be appreciated.
I changed my colleague's ~/.R/Makevars to conform to my configs
LDFLAGS=-L/opt/local/lib
CC=/opt/local/bin/gcc-mp-4.5 -std=gnu99
CXX=/opt/local/bin/g++-mp-4.5
CPP=/opt/local/bin/gcc-mp-4.5 -std=gnu99 -E
CXXCPP=/opt/local/bin/g++-mp-4.5 -E
CFLAGS=-pipe -O2 -m64
CXXFLAGS=-pipe -O2 -m64
SHLIB_CXXLD=/opt/local/bin/g++-mp-4.5
SHLIB_CXXLDFLAGS=-dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
SHLIB_LD=/opt/local/bin/gcc-mp-4.5 -std=gnu99
SHLIB_LDFLAGS=-dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress
Additionally, the --no-multiarch argument was used when issuing the installation command. And it now works on his computer.
The problem was because the use of openMP was hardwired (no checks) inside the code and clang did not support openMP at the same I asked the question. My colleague's R was installed using the default (Xcode) compiler when we were trying to use gcc via Mac Ports.

Resources