how to install glib2 package in docker - docker

I use docker to install centos 6.5 and opensource c++ mysql proxy : DBPORXY(https://github.com/Meituan-Dianping/DBProxy.git), when I run into the last command, I failed.From the error info, I think that is glib2 problem,but I have installed glib2! that is my public docker : [
docker pull xujianhai/dbproxy], the method I use to implement glib2 :
cd glib-2.42.0
./configure
make
make install
vi /etc/ld.so.conf
add a row and exit: /usr/local/lib
ldconfig
the detail error message when I run into the last command :
bash-4.1# make
make all-recursive
make[1]: Entering directory `/DBProxy'
Making all in src
make[2]: Entering directory `/DBProxy/src'
make all-am
make[3]: Entering directory `/DBProxy/src'
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -ggdb -g -O0 -MT libmysql_chassis_glibext_la-glib-ext.lo -MD -MP -MF .deps/libmysql_chassis_glibext_la-glib-ext.Tpo -c -o libmysql_chassis_glibext_la-glib-ext.lo `test -f 'glib-ext.c' || echo './'`glib-ext.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I/usr/include/mysql -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -ggdb -g -O0 -MT libmysql_chassis_glibext_la-glib-ext.lo -MD -MP -MF .deps/libmysql_chassis_glibext_la-glib-ext.Tpo -c glib-ext.c -fPIC -DPIC -o .libs/libmysql_chassis_glibext_la-glib-ext.o
glib-ext.c: In function 'g_string_get_time':
glib-ext.c:121: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'm'
glib-ext.c:121: error: 'm' undeclared (first use in this function)
glib-ext.c:121: error: (Each undeclared identifier is reported only once
glib-ext.c:121: error: for each function it appears in.)
make[3]: *** [libmysql_chassis_glibext_la-glib-ext.lo] Error 1
make[3]: Leaving directory `/DBProxy/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/DBProxy/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/DBProxy'
make: *** [all] Error 2

Related

Using hyperledger-fabric v1.0.0 make docker got an error

Because of the need of the project, we have changed the core/chaincode/shim of fabric1.0.0. The tree structure of shim is:
shim
├── chaincode.go
├── handler.go
├── inprocstream.go
├── interfaces.go
├── java
│ └── ···
├── mockstub.go
├── mockstub_test.go
├── response.go
├── myxxxutil.go
├── shim_test.go
└── myxxx.go
Some of these functions require cgo, which is writen in c++, there is some code snippet:
//myxxx.go
package shim
/*
#cgo CFLAGS: -I/opt/xxxsrc
#cgo LDFLAGS: -L/usr/lib -lmyxxx
#include "interface.hpp"
#include <stdlib.h>
*/
import "C"
func SomeFucn(){
··· //the C++ source code is in /opt/xxxsrc folder,so is interface.hpp file,the libmyxxx.so file is in /usr/lib folder
}
The, I used the make docker command to create a peer image based on hyperledger/fabric-baseimage:x86_64-0.3.1 under fabric directory. This hyperledger/fabric-baseimage:x86_64-0.3.1 has been modified by me. I put the libmyxxx. so file into /usr/lib folder of this "baseimage", and put the c++ soure code into /opt/xxxsrc, Then the execution log is:
Building build/docker/bin/peer
(the docker command line is:
docker run -i --rm --user=0 -v /home/my/gopath/src/github.com/hyperledger/fabric:/opt/gopath/src/github.com/hyperledger/fabric -w /opt/gopath/src/github.com/hyperledger/fabric -v /home/my/gopath/src/github.com/hyperledger/fabric/build/docker/bin:/opt/gopath/bin -v /home/my/gopath/src/github.com/hyperledger/fabric/build/docker/peer/pkg:/opt/gopath/pkg hyperledger/fabric-baseimage:x86_64-0.3.1
go install -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.0.0 -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.3.1 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.BaseDockerNamespace=hyperledger -linkmode external -extldflags -static -lpthread" github.com/hyperledger/fabric/peer
)
github.com/hyperledger/fabric/core/chaincode/shim
mkdir -p $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/
cd /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim
CGO_LDFLAGS="-g" "-O2" "-L/usr/lib" "-lmyxxx" "-L/usr/lib" "-lmyxxx" /opt/go/pkg/tool/linux_amd64/cgo -objdir $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/ -importpath github.com/hyperledger/fabric/core/chaincode/shim – -I $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/ -I/opt/xxxsrc -I/opt/xxxsrc myxxxutil.go myxxx.go
cd /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/ -g -O2 -I/opt/xxxsrc -I/opt/xxxsrc -o $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/_cgo_main.o -c $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/_cgo_main.c
cd /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/ -g -O2 -I/opt/xxxsrc -I/opt/xxxsrc -o $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/_cgo_export.o -c $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/_cgo_export.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/ -g -O2 -I/opt/xxxsrc -I/opt/xxxsrc -o $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/myxxxutil.cgo2.o -c $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/myxxxutil.cgo2.c
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -I $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/ -g -O2 -I/opt/xxxsrc -I/opt/xxxsrc -o $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/xxx.cgo2.o -c $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/xxx.cgo2.c
cd /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim
gcc -I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/github.com/hyperledger/fabric/core/chaincode/shim/obj/_cgo.o $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/_cgo_main.o $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/_cgo_export.o $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/myxxxutil.cgo2.o $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/myxxx.cgo2.o -g -O2 -L/usr/lib -lmyxxx -L/usr/lib -lmyxxx
cd /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim
/opt/go/pkg/tool/linux_amd64/cgo -objdir $WORK/github.com/hyperledger/fabric/core/chaincode/shim/obj/ -dynpackage shim -dynimport $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/_cgo.o -dynout $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/_cgo_import.go
gcc I . -fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=$WORK=/tmp/go-build -gno-record-gcc-switches -o $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/_all.o $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/_cgo_export.o $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/myxxxutil.cgo2.o $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/myxxx.cgo2.o -g -O2 -L/usr/lib -L/usr/lib -Wl,-r -nostdlib -no-pie -Wl,-build-id=none
/opt/go/pkg/tool/linux_amd64/compile -o $WORK/github.com/hyperledger/fabric/core/chaincode/shim.a -trimpath $WORK -p github.com/hyperledger/fabric/core/chaincode/shim -buildid 2ee9889b3f3fdd6fc02e5029d94e8c287f977ccb -importmap github.com/golang/protobuf/proto=github.com/hyperledger/fabric/vendor/github.com/golang/protobuf/proto -importmap github.com/golang/protobuf/ptypes/timestamp=github.com/hyperledger/fabric/vendor/github.com/golang/protobuf/ptypes/timestamp -importmap github.com/looplab/fsm=github.com/hyperledger/fabric/vendor/github.com/looplab/fsm -importmap github.com/op/go-logging=github.com/hyperledger/fabric/vendor/github.com/op/go-logging -importmap github.com/spf13/viper=github.com/hyperledger/fabric/vendor/github.com/spf13/viper -importmap golang.org/x/net/context=github.com/hyperledger/fabric/vendor/golang.org/x/net/context -importmap google.golang.org/grpc=github.com/hyperledger/fabric/vendor/google.golang.org/grpc -D _/opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim -I $WORK -I /opt/gopath/pkg/linux_amd64 -pack ./chaincode.go ./fileIO.go ./handler.go ./inprocstream.go ./interfaces.go ./mockstub.go ./response.go $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/_cgo_gotypes.go $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/myxxxutil.cgo1.go $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/myxxx.cgo1.go $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/_cgo_import.go
cd /opt/gopath/src/github.com/hyperledger/fabric/core/chaincode/shim
pack r $WORK/github.com/hyperledger/fabric/core/chaincode/shim.a $WORK/github.com/hyperledger/fabric/core/chaincode/shim/_obj/_all.o # internal
cp $WORK/github.com/hyperledger/fabric/core/chaincode/shim.a /opt/gopath/pkg/linux_amd64/github.com/hyperledger/fabric/core/chaincode/shim.a
/opt/go/pkg/tool/linux_amd64/link -o $WORK/github.com/hyperledger/fabric/peer/_obj/exe/a.out -L $WORK -L /opt/gopath/pkg/linux_amd64 -extld=gcc -buildmode=exe -buildid=c7ee3188106eddcbae7255ad032536402bc38b29 -X github.com/hyperledger/fabric/common/metadata.Version=1.0.0 -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.3.1 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.BaseDockerNamespace=hyperledger -linkmode external -extldflags "-static -lpthread" $WORK/github.com/hyperledger/fabric/peer.a
github.com/hyperledger/fabric/peer
/opt/go/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/bin/ld: cannot find -lmyxxx
/usr/bin/ld: cannot find -lmyxxx
/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libltdl.a(dlopen.o): In function `vm_open':
(.text+0x5e): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/tmp/go-link-940349017/000001.o: In function `_cgo_7a2d42f1a351_C2func_getaddrinfo':
/tmp/workdir/go/src/net/cgo_unix.go:66: warning: Using 'getaddrinfo' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
collect2: error: ld returned 1 exit status
Makefile:197: recipe for target 'build/docker/bin/peer' failed
make: *** [build/docker/bin/peer] Error 2
I already tried to add path (/usr/lib) in /etc/ld.so.conf file, and executed "ldconfig", and also tried to add path to environment variables LD_LIBRARY_PATH and LIBRARY_PATH, the problem still reappears, so I would like to ask if there is any solution to the problem, thank you

Error - magick/ImageMagick.h: No such file or directory

I am trying to install driver for fingerprint sensor from source. I have already ran sudo ./configure and it doesn't give any error. Then while trying to do sudo make I run into the following error.
uname#computer:~/libfprint-0.0.6$ sudo make
make all-recursive
make[1]: Entering directory '/home/nirmal/libfprint-0.0.6'
Making all in libfprint
make[2]: Entering directory '/home/nirmal/libfprint-0.0.6/libfprint'
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden -I./nbis/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/include/ImageMagick-7 -std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libfprint_la-imgdev.lo -MD -MP -MF .deps/libfprint_la-imgdev.Tpo -c -o libfprint_la-imgdev.lo `test -f 'imgdev.c' || echo './'`imgdev.c
gcc -DHAVE_CONFIG_H -I. -I.. -fvisibility=hidden -I./nbis/include -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/include/ImageMagick-7 -std=gnu99 -fgnu89-inline -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -Wno-pointer-sign -Wshadow -g -O2 -MT libfprint_la-imgdev.lo -MD -MP -MF .deps/libfprint_la-imgdev.Tpo -c imgdev.c -fPIC -DPIC -o .libs/libfprint_la-imgdev.o
imgdev.c:23:32: fatal error: magick/ImageMagick.h: No such file or directory
compilation terminated.
Makefile:456: recipe for target 'libfprint_la-imgdev.lo' failed
make[2]: *** [libfprint_la-imgdev.lo] Error 1
make[2]: Leaving directory '/home/nirmal/libfprint-0.0.6/libfprint'
Makefile:304: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/nirmal/libfprint-0.0.6'
Makefile:215: recipe for target 'all' failed
make: *** [all] Error 2
I have already installed following libraries to avoid the 'ImageMagick.h not found error' but still can't get rid of this error:
graphicsmagick
graphicsmagick-dbg
graphicsmagick-imagemagick-compat
graphicsmagick-libmagick-dev-compat
imagemagick-6.q16
imagemagick-7.0.8
imagemagick-common
imagemagick-dbg
imagemagick-doc
libgraphics-magick-perl
libgraphicsmagick++-q16-12
libgraphicsmagick++1-dev
libgraphicsmagick-q16-3
libgraphicsmagick1-dev
libmage-magick-q16-perl
libmagick++-6-headers
libmagick++-6.q16-5v5
libmagick++-6.q16-dev
libmagickcore-6-arch-config
libmagickcore-6.q16-2
libmagickcore-6.q16-2-extra
libmagickcore-6.q16-dev
libmagickwand-6-headers
libmagickwand-6.q16-2
libmagickwand-6.q16-dev
libmagickwand-dev
Thanks in advance!

FFI 1.0.11 doesn't install in cygwin

I can't install ffi gem and get the following error while perfrorming 'bundle install':
Installing ffi (1.0.11) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/home/Dmitry.Veremchuk/.rvm/rubies/ruby-1.9.3-p194/bin/ruby.exe extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include... no
checking for rb_thread_blocking_region()... yes
checking for ruby_native_thread_p()... yes
checking for rb_thread_call_with_gvl()... yes
creating extconf.h
creating Makefile
make
Configuring libffi
make -C "/home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi"
make[1]: Entering directory `/home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi'
make "AR_FLAGS=" "CC_FOR_BUILD=" "CFLAGS=" "CXXFLAGS=" "CFLAGS_FOR_BUILD="
"CFLAGS_FOR_TARGET=" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "JC1FLAGS=" "LDFLAGS=" "LIBCFLAGS=" "LIBCFLAGS_FOR_TARGET=" "MAKE=make" "MAKEINFO=/bin/sh /home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi/missing --run makeinfo " "PICFLAG=" "PICFLAG_FOR_TARGET=" "RUNTESTFLAGS=" "SHELL=/bin/sh" "exec_prefix=/usr/local" "infodir=/usr/local/share/info" "libdir=/usr/local/lib" "prefix=/usr/local" "AR=ar" "AS=as" "CC=gcc" "CXX=g++" "LD=/usr/i686-pc-cygwin/bin/ld.exe" "NM=/usr/bin/nm -B" "RANLIB=ranlib" "DESTDIR=" all-recursive
make[2]: Entering directory `/home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi'
Making all in include
make[3]: Entering directory `/home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi/include'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi/include'
Making all in testsuite
make[3]: Entering directory `/home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi/testsuite'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi/testsuite'
Making all in man
make[3]: Entering directory `/home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi/man'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi/man'
make[3]: Entering directory `/home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi'
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/debug.lo src/debug.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/debug.c -DDLL_EXPORT -DPIC -o src/.libs/debug.o
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/prep_cif.lo src/prep_cif.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/prep_cif.c -DDLL_EXPORT -DPIC -o src/.libs/prep_cif.o
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/types.lo src/types.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/types.c -DDLL_EXPORT -DPIC -o src/.libs/types.o
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/raw_api.lo src/raw_api.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/raw_api.c -DDLL_EXPORT -DPIC -o src/.libs/raw_api.o
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/java_raw_api.lo src/java_raw_api.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/java_raw_api.c -DDLL_EXPORT -DPIC -o src/.libs/java_raw_api.o
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/closures.lo src/closures.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/closures.c -DDLL_EXPORT -DPIC -o src/.libs/closures.o
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/x86/ffi.lo src/x86/ffi.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/x86/ffi.c -DDLL_EXPORT -DPIC -o src/x86/.libs/ffi.o
/bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -I. -I./include -Iinclude -I./src -c -o src/x86/win32.lo src/x86/win32.S
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -I. -I./include -Iinclude -I./src -c src/x86/win32.S -DDLL_EXPORT -DPIC -o src/x86/.libs/win32.o
/bin/sh ./libtool --tag=CC --mode=link gcc -Wall -g -fexceptions -version-info `grep -v '^#' ./libtool-version` -no-undefined -o libffi.la -rpath /usr/local/lib src/debug.lo src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo src/x86/ffi.lo src/x86/win32.lo
libtool: link: gcc -shared src/.libs/debug.o src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi.o src/x86/.libs/win32.o -o .libs/cygffi-5.dll -Wl,--enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libffi.dll.a
Creating library file: .libs/libffi.dll.a
libtool: link: ( cd ".libs" && rm -f "libffi.la" && ln -s "../libffi.la" "libffi.la" )
/bin/sh ./libtool --tag=CC --mode=link gcc -Wall -g -fexceptions -o libffi_convenience.la src/debug.lo src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo src/x86/ffi.lo src/x86/win32.lo
libtool: link: ar cru .libs/libffi_convenience.a src/.libs/debug.o src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi.o src/x86/.libs/win32.o
libtool: link: ranlib .libs/libffi_convenience.a
libtool: link: ( cd ".libs" && rm -f "libffi_convenience.la" && ln -s "../libffi_convenience.la" "libffi_convenience.la" )
make[3]: Leaving directory `/home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi'
make[2]: Leaving directory `/home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi'
make[1]: Leaving directory `/home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/libffi'
compiling AbstractMemory.c
AbstractMemory.c:271: warning: 'memory_put_bool' defined but not used
AbstractMemory.c:271: warning: 'memory_write_bool' defined but not used
AbstractMemory.c:271: warning: 'memory_get_bool' defined but not used
AbstractMemory.c:271: warning: 'memory_read_bool' defined but not used
AbstractMemory.c:271: warning: 'memory_write_array_of_bool' defined but not used
AbstractMemory.c:271: warning: 'memory_read_array_of_bool' defined but not used
AbstractMemory.c:388: warning: 'memory_read_array_of_string' defined but not used
compiling ArrayType.c
compiling Buffer.c
compiling Call.c
compiling ClosurePool.c
compiling DataConverter.c
compiling DynamicLibrary.c
compiling ffi.c
compiling Function.c
compiling FunctionInfo.c
compiling LastError.c
compiling MappedType.c
MappedType.c: In function `mapped_initialize':
MappedType.c:63: warning: unused variable `t'
compiling MemoryPointer.c
MemoryPointer.c:134: warning: 'memptr_mark' defined but not used
compiling MethodHandle.c
compiling Platform.c
compiling Pointer.c
compiling Struct.c
compiling StructByReference.c
compiling StructByValue.c
compiling StructLayout.c
compiling Thread.c
In file included from /usr/include/cygwin/sys_time.h:13,
from /usr/include/sys/time.h:28,
from /usr/include/sys/_default_fcntl.h:186,
from /usr/include/sys/fcntl.h:3,
from /usr/include/fcntl.h:14,
from Thread.c:31:
/usr/include/sys/select.h:31: error: parse error before "fd_set"
/usr/include/sys/select.h:33: error: parse error before "fd_set"
In file included from /home/Dmitry.Veremchuk/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/ruby.h:1382,
from /home/Dmitry.Veremchuk/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby.h:32,
from Thread.h:25,
from Thread.c:32:
/home/Dmitry.Veremchuk/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/intern.h:285: error: parse error before "rb_fdset_t"
/home/Dmitry.Veremchuk/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/intern.h:285: warning: type defaults to `int' in declaration of `rb_fdset_t'
/home/Dmitry.Veremchuk/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/intern.h:285: warning: data definition has no type or storage class
/home/Dmitry.Veremchuk/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/intern.h:379: error: parse error before "fd_set"
/home/Dmitry.Veremchuk/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby/intern.h:380: error: parse error before "rb_fdset_t"
Makefile:199: recipe for target `Thread.o' failed
make: *** [Thread.o] Error 1
Gem files will remain installed in /home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11 for inspection.
Results logged to /home/Dmitry.Veremchuk/.rvm/gems/ruby-1.9.3-p194/gems/ffi-1.0.11/ext/ffi_c/gem_make.out
An error occured while installing ffi (1.0.11), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.0.11'` succeeds before bundling.
FFI gem is not required in my Gemfile. Though I suppose Capybara requires it.
I have the following configuration:
PC with Windows XP and Cygwin (with devtools installed);
Ruby version 1.9.3p194 (in RVM);
Rails version 3.2.8.
I tried to install ffi-1.0.11 separately but sadly with the same result.
Would appreciate any help.
Similar bug reported on github. But no solution to it till now.

cannot install ffi gem

I'm trying to do bundle install in Windows 7 x64, but get errors while installing native extensions for ffi gem. My Gemfile has no ffi gem. The only dependency is in 'capybara'.
The second strange thing is that capybara is mentioned in my Gemfile for "test" environment only, but when I do "bundle install" the development environment should be used. Why does it parse the "test" section?
source 'http://rubygems.org'
gem 'rake', '0.9.2.2'
gem 'rails', '3.2.1'
...
group :test do
if RUBY_PLATFORM =~ /(win32|w32)/
gem 'win32console'
end
...
gem 'capybara'
...
end
I can install the previous version of ffi, but capybara needs the new one.
Error text:
Installing ffi (1.0.11) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include... no
checking for rb_thread_blocking_region()... yes
checking for ruby_native_thread_p()... yes
checking for rb_thread_call_with_gvl()... yes
creating extconf.h
creating Makefile
make
generating ffi_c-i386-mingw32.def
Configuring libffi
make -C "/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi"
make[1]: Entering directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi'
make "AR_FLAGS=" "CC_FOR_BUILD=" "CFLAGS=" "CXXFLAGS=" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=" "INSTALL=/usr/bin/in
stall -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/i
nstall -c" "JC1FLAGS=" "LDFLAGS=" "LIBCFLAGS=" "LIBCFLAGS_FOR_TARGET=" "MAKE=make" "MAKEINFO=/bin/sh /c/Ruby193/lib/
ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi/missing --run makeinfo " "PICFLAG=" "PICFLAG_FOR_TARGET=" "RUNTESTF
LAGS=" "SHELL=/bin/sh" "exec_prefix=/usr/local" "infodir=/usr/local/share/info" "libdir=/usr/local/lib" "prefix=/usr
/local" "AR=ar" "AS=as" "CC=gcc" "CXX=g++" "LD=c:/program files (x86)/mingw/mingw32/bin/ld.exe" "NM=/c/Program Files
(x86)/MinGW/bin/nm" "RANLIB=ranlib" "DESTDIR=" all-recursive
make[2]: Entering directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi'
Making all in include
make[3]: Entering directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi/include'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi/include'
Making all in testsuite
make[3]: Entering directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi/testsuite'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi/testsuite'
Making all in man
make[3]: Entering directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi/man'
make[3]: Nothing to be done for `all'.
make[3]: Leaving directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi/man'
make[3]: Entering directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi'
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fe
xceptions -c -o src/debug.lo src/debug.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/debug.c -
DDLL_EXPORT -DPIC -o src/.libs/debug.o
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fe
xceptions -c -o src/prep_cif.lo src/prep_cif.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/prep_cif.c
-DDLL_EXPORT -DPIC -o src/.libs/prep_cif.o
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fe
xceptions -c -o src/types.lo src/types.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/types.c -
DDLL_EXPORT -DPIC -o src/.libs/types.o
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fe
xceptions -c -o src/raw_api.lo src/raw_api.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/raw_api.c
-DDLL_EXPORT -DPIC -o src/.libs/raw_api.o
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fe
xceptions -c -o src/java_raw_api.lo src/java_raw_api.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/java_raw_a
pi.c -DDLL_EXPORT -DPIC -o src/.libs/java_raw_api.o
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fe
xceptions -c -o src/closures.lo src/closures.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/closures.c
-DDLL_EXPORT -DPIC -o src/.libs/closures.o
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fe
xceptions -c -o src/x86/ffi.lo src/x86/ffi.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/x86/ffi.c
-DDLL_EXPORT -DPIC -o src/x86/.libs/ffi.o
/bin/sh ./libtool --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -I. -I./include -Iinc
lude -I./src -c -o src/x86/win32.lo src/x86/win32.S
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -I. -I./include -Iinclude -I./src -c sr
c/x86/win32.S -DDLL_EXPORT -DPIC -o src/x86/.libs/win32.o
/bin/sh ./libtool --tag=CC --mode=link gcc -Wall -g -fexceptions -version-info `grep -v '^#' ./libtool-version` -
no-undefined -o libffi.la -rpath /usr/local/lib src/debug.lo src/prep_cif.lo src/types.lo src/raw_api.lo src/java_r
aw_api.lo src/closures.lo src/x86/ffi.lo src/x86/win32.lo
libtool: link: gcc -o .libs/libffi.dll.a src/.libs/debug.o src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api
.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi.o src/x86/.libs/win32.o `echo "X" | /usr/bin/
sed -e 1s/^X// -e 's/ -lc$//'` -link -dll
c:/program files (x86)/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -link
collect2: ld returned 1 exit status
make[3]: *** [libffi.la] Error 1
make[3]: Leaving directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi'
make: *** ["/c/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/libffi"/.libs/libffi_convenience.a] Error 2
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/ext/ffi_c/gem_make.out
An error occured while installing ffi (1.0.11), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.0.11'` succeeds before bundling.
Check out this troubleshooting guide at Rubyinstaller wiki: https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#wiki-gems_fails_comspec_autorun. Could be of any help.
The 1.3.1 version of FFI solved this. Still can't install Capybara.

issue in installing Sphinx on mac

Compiling the code using :-
LDFLAGS="-arch x86_64" ./configure --prefix=/usr/local --with-mysql=/usr/local/mysql-5.5.9-osx10.6-x86_64
O/p for the compilation.
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating libstemmer_c/Makefile
config.status: creating sphinx.conf.dist
config.status: creating sphinx-min.conf.dist
config.status: creating config/config.h
config.status: executing depfiles commands
configuration done
------------------
You can now run 'make' to build Sphinx binaries,
and then run 'make install' to install them.
O/p for make:--
g++ -DHAVE_CONFIG_H -I. -I../config -DSYSCONFDIR="\"/usr/local/etc\"" -I/usr/local/include -I/usr/local/mysql-5.5.9-osx10.6-x86_64/include -Os -g -fno-common -fno-strict-aliasing -arch x86_64 -Wall -g -D_FILE_OFFSET_BITS=64 -O3 -DNDEBUG -MT tests.o -MD -MP -MF .deps/tests.Tpo -c -o tests.o tests.cpp
mv -f .deps/tests.Tpo .deps/tests.Po
g++ -Wall -g -D_FILE_OFFSET_BITS=64 -O3 -DNDEBUG -arch x86_64 -o tests tests.o libsphinx.a -L/usr/local/mysql-5.5.9-osx10.6-x86_64/lib -lmysqlclient -lpthread -lodbc -lz -lexpat -L/usr/local/lib -lpthread
Making all in test
make[1]: Nothing to be done for `all'.
make[1]: Nothing to be done for `all-am'.
O/p for make install:--
Making install in src
if test -d ../.svn; then svn info .. --xml | perl svnxrev.pl; fi;
make install-am
test -z "/usr/local/bin" || ../config/install-sh -c -d "/usr/local/bin"
/usr/bin/install -c 'indexer' '/usr/local/bin/indexer'
/usr/bin/install -c 'searchd' '/usr/local/bin/searchd'
/usr/bin/install -c 'search' '/usr/local/bin/search'
/usr/bin/install -c 'spelldump' '/usr/local/bin/spelldump'
/usr/bin/install -c 'indextool' '/usr/local/bin/indextool'
make[3]: Nothing to be done for `install-data-am'.
Making install in test
make[1]: Nothing to be done for `install'.
test -z "/usr/local/etc" || config/install-sh -c -d "/usr/local/etc"
/usr/bin/install -c -m 644 'sphinx.conf.dist' '/usr/local/etc/sphinx.conf.dist'
/usr/bin/install -c -m 644 'sphinx-min.conf.dist' '/usr/local/etc/sphinx-min.conf.dist'
/usr/bin/install -c -m 644 'example.sql' '/usr/local/etc/example.sql'
make install-data-hook
mkdir -p /usr/local/var/data && mkdir -p /usr/local/var/log
If I try to run thinking sphinx server:-
rake thinking_sphinx:index
(in /Users/mohit/projects/urbanAdda)
sh: line 1: 26356 Trace/BPT trap indexer 2>&1
sh: line 1: 26359 Trace/BPT trap indexer 2>&1
Sphinx cannot be found on your system. You may need to configure the following
settings in your config/sphinx.yml file:
* bin_path
* searchd_binary_name
* indexer_binary_name
For more information, read the documentation:
http://freelancing-god.github.com/ts/en/advanced_config.html
sh: line 1: 26361 Trace/BPT trap indexer 2>&1
Generating Configuration to /Users/mohit/projects/urbanAdda/config/development.sphinx.conf
dyld: Library not loaded: libmysqlclient.16.dylib
Referenced from: /usr/local/bin/indexer
Reason: image not found
sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql-5.5.9-osx10.6-x86_64//lib/libmysqlclient.16.dylib /usr/local/bin/indexer
and
sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql-5.5.9-osx10.6-x86_64//lib/libmysqlclient.16.dylib /usr/local/bin/searchd
solved my problem
The dynamic linker cannot find the mysqlclient library.
Try to add the path where it's installed to the DYLD_LIBRARY_PATH environment variable.
And when/if you plan to rebuild it, add "-Wl,-rpath /path/to/lib" to LDFLAGS.

Resources