Fórum Ubuntu Linux - PT
Suporte Técnico => Programação e Scripts => Tópico iniciado por: cleberv em 26 de Novembro de 2011, 17:56
-
Boa noite,
Baixei o OpenQM em:
http://www.billabong-services.co.uk/anji/
http://billabong-services.co.uk/anji/qm/qmsrc_2-6-6.tgz
Descompactei e rodei um script para compilar que vem com o OpenQM.
O script divide a compilação em 9 partes, Stage 1,2...9
Na primeira fase deu um erro:
k_error
gplsrc/k_error.c: Na função ‘k_error’:
gplsrc/k_error.c:246:4: aviso: format not a string literal and no format arguments [-Wformat-security]
E não compilou o qm na 2a. parte.
...
/usr/qmsys/gplsrc/op_arith.c:1760: undefined reference to `tan'
gplobj/op_ccall.o: In function `ccall_c':
/usr/qmsys/gplsrc/op_ccall.c:93: undefined reference to `dlopen'
/usr/qmsys/gplsrc/op_ccall.c:101: undefined reference to `dlsym'
gplobj/op_misc.o: In function `op_pwcrypt':
/usr/qmsys/gplsrc/op_misc.c:388: undefined reference to `sqrt'
collect2: ld returned 1 exit status
Da fase 3 a 9 funcionou.
Fiz o seguinte:
"This step wil likely not work! Edit the buildgpl script, and remove -Werror from the QM_GCC_OPTIONS line, and try again. If that don't work, try adding -Wno-packed. If that don't work , try adding -Wno-pointer-sign. If you are using Redhat, Fedora or similar, you will need to remove the -Werror, and insert -Wno-pointer-sign. "
Não funcionou.
Alguém sabe o que eu devo fazer?
Segue o script:
# This script builds the GPL OpenQM source
#
# The first argument can be a stage number to continue from the given stage
#
# This script requires a standard installed QMSYS for the same release.
# The directory from which this script is executed should have subdirectories
# for the source (gplsrc), object (gplobj) and executables (bin). The
# default names shown in brackets can be modified below.
# The gpl.src file must be in the current directory and contains a list of
# the source modules that are used to build the qm executable.
# Define a few things:
# QMSYS Pathname of QMSYS directory
# GPLSRC Source directory
# GPLOBJ Target directory for object files
# GPLBIN Target directory for executables
# QM_GCC_OPTIONS Compiler options
# QMLIBS Libraries
QMSYS=/usr/qmsys
GPLSRC=gplsrc
GPLOBJ=gplobj
GPLBIN=bin
QM_GCC_OPTIONS="-Wno-pointer-sign -DLINUX -D_FILE_OFFSET_BITS=64 -DGPL -g"
QMLIBS="-lm -lcrypt -ldl"
STAGE=$1
if test "$STAGE" = ""
then
STAGE=1
fi
######################### STAGE 1 - Build QM #########################
if test $STAGE -le 1
then
echo ===== Stage 1 =====
echo Building C program modules...
errors=0
errorprogs=""
for file in `cat gpl.src`
do
echo $file
gcc -c $QM_GCC_OPTIONS -I$GPLSRC -o $GPLOBJ/$file.o $GPLSRC/$file.c
if test $? -ne 0
then
errors=`expr $errors + 1`
errorprogs="$errorprogs$file "
fi
done
if test $errors -ne 0
then
echo "Build aborted due to compilation errors in $errors program(s):"
echo $errorprogs
exit
fi
echo
fi
######################### STAGE 2 - Link QM ##########################
if test $STAGE -le 2
then
echo ===== Stage 2 =====
echo "Linking qm"
objects=''
for file in `cat gpl.src`
do
objects="$objects $GPLOBJ/$file.o"
done
gcc -o $GPLBIN/qm $QMLIBS $objects
echo
fi
###################### STAGE 3 - Build QMCLILIB ######################
if test $STAGE -le 3
then
echo ===== Stage 3 =====
echo "Building qmclilib.o and qmclilib.so"
gcc -c $QM_GCC_OPTIONS -I$GPLSRC -o $GPLOBJ/qmclilib.o $GPLSRC/qmclilib.c
cp $GPLOBJ/qmclilib.o $GPLBIN/qmclilib.o
gcc -shared -Wl,-soname,$GPLOBJ/qmclilib.so -o $GPLOBJ/qmclilib.so $GPLOBJ/qmclilib.o -lc
cp $GPLOBJ/qmclilib.so $GPLBIN/qmclilib.so
echo
fi
####################### STAGE 4 - Build QMTic ########################
if test $STAGE -le 4
then
echo ===== Stage 4 =====
echo "Building qmtic"
gcc -o $GPLBIN/qmtic $QM_GCC_OPTIONS -I$GPLSRC -lc $GPLSRC/qmtic.c \
$GPLSRC/inipath.c
echo
fi
####################### STAGE 5 - Build QMFix ########################
if test $STAGE -le 5
then
echo ===== Stage 5 =====
echo "Building qmfix"
gcc -o $GPLBIN/qmfix $QM_GCC_OPTIONS -I$GPLSRC -lc $GPLSRC/qmfix.c \
$GPLOBJ/ctype.o $GPLOBJ/linuxlb.o $GPLOBJ/dh_hash.o $GPLOBJ/inipath.o
echo
fi
####################### STAGE 6 - Build QMConv #######################
if test $STAGE -le 6
then
echo ===== Stage 6 =====
echo Building qmconv
gcc -o $GPLBIN/qmconv $QM_GCC_OPTIONS -I$GPLSRC -lc $GPLSRC/qmconv.c \
$GPLOBJ/linuxlb.o $GPLOBJ/dh_hash.o $GPLOBJ/ctype.o
echo
fi
####################### STAGE 7 - Build qmidx ########################
if test $STAGE -le 7
then
echo ===== Stage 7 =====
echo Building qmidx
gcc -o $GPLBIN/qmidx $QM_GCC_OPTIONS -I$GPLSRC -lc $GPLSRC/qmidx.c
echo
fi
####################### STAGE 8 - Build qmlnxd #######################
if test $STAGE -le 8
then
# Build qmlnxd
echo ===== Stage 8 =====
echo Building qmlnxd
gcc -o $GPLBIN/qmlnxd $QM_GCC_OPTIONS -I$GPLSRC -lc \
$GPLSRC/qmlnxd.c $GPLSRC/qmsem.c
echo
fi
#################### STAGE 9 - Compile terminfo ######################
if test $STAGE -le 9
then
echo ===== Stage 9 =====
echo Compiling terminfo library
mkdir terminfo
$GPLBIN/qmtic -pterminfo terminfo.src
echo
fi
-
Sorry... mas, que que é isso? OpenQM?!
-
É um gerenciador de banco de dados pós-relacional e/ou MultiValue.
http://www.openqm.com/cgi/lbscgi.exe?T0=h&X=038ry9e3he&t1=openqm
http://www.openqm.com/cgi/lbscgi.exe?T0=h&X=038ry9e3he&t1=mv.overview
http://www.pickwiki.com/cgi-bin/wiki.pl?MultiValuedDatabases
Mas isto não importa, o problema é que a compilação não está funcionando na fase 1 e 2 do script no Ubuntun 11.10. Funciona em versões anteriores e no Fedora.
Enviei a dúvida para o forum do openqm, mas não tive resposta satisfatória.
https://groups.google.com/group/openqm/browse_thread/thread/ffbf88dea59fc962?hl=pt-BR
Obrigado pela atenção,
Cleber
-
Cleber, com relação ao post no grupo do google:
Stage 1
gplsrc/k_error.c: Na função ‘k_error’:
gplsrc/k_error.c:246:4: aviso: format not a string literal and no
format arguments [-Wformat-security]
Stage 2
...
/usr/qmsys/gplsrc/op_arith.c:1760: undefined reference to `tan'
gplobj/op_ccall.o: In function `ccall_c':
/usr/qmsys/gplsrc/op_ccall.c:93: undefined reference to `dlopen'
/usr/qmsys/gplsrc/op_ccall.c:101: undefined reference to `dlsym'
gplobj/op_misc.o: In function `op_pwcrypt':
/usr/qmsys/gplsrc/op_misc.c:388: undefined reference to `sqrt'
collect2: ld returned 1 exit status
Stage 2...9 OK
Com relação ao erro em k_error.c, linha 246, você terá que ver isso, com relação aos demais erros (stage 2), parece que está falando a inclusão de headers math.h (em op_arith.c e op_misc.c) e dlfcn.h (em op_ccall.c).
[]s
Fred
-
em op_arith.c tem o include math.h
...
#include "qm.h"
#include "config.h"
#include "options.h"
#include <math.h>
#include <time.h>
...
em op_ccall.c tem include dlfcn.h
...
#include <qm.h>
#include <stdarg.h>
#include <setjmp.h>
#include <time.h>
#ifdef __BORLANDC__
#pragma warn -pro
#endif
#include <dlfcn.h>
...
em op_misc.c tem math.h
...
#include "qm.h"
#include "header.h"
#include "syscom.h"
#include "tio.h"
#include "config.h"
#include <math.h>
#include <time.h>
....
-
Então, dado o erro:
collect2: ld returned 1 exit status
Só posso julgar que as libs libm e libdl não estejam sendo linkadas...
Verifique no Makefile (ou equivalente) se -lm e -ldl estão sendo usados no gcc na etapa do linker.
-
Oi,
Makefile é o script que faz a compilação?
Se for, eu colei o script em uma mensagem anterior e tem isso:
QMLIBS="-lm -lcrypt -ldl"
no Script também. tem QM_GCC_OPTIONS="-Wno-pointer-sign -DLINUX -D_FILE_OFFSET_BITS=64 -DGPL -g"
Mas o Ubuntun que eu estou usando é de 32 bits, coloquei BITS=34 aí que não fez nada, deu um monte de erros.
t+
Cleber
-
O símbolo _FILE_OFFSET_BITS refere-se às funções que lidam com sistema de arquivos, não à plataforma. Funções como stat(), por exemplo, estão preparadas para lidar com arquivos de até 4 GB de tamanho. Ao informar _FILE_OFFSET_BITS=64 você diz ao compilador para usar offsets e tamanhos de arquivos de 64 bits, ao invés de 32.
Recomendo o uso de -D__USE_LARGEFILE64 -D__USE_FILE_OFFSET64 também.
Dê uma olhada em /usr/include/features.h
Com relação a compilar com gcc versão 32 ou 64 bits... geralmente isso não é problemático...