From: João V. <vva...@ho...> - 2008-02-22 11:27:34
|
Hi all, I'm using the round function from math.h in a program that runs on the gumstix, however is getting very difficult to compile with my makefile. I'm getting always the same error whatever i try to do. /home/joao/gumstix-buildroot/build_arm_nofpu/staging_dir/bin/arm-linux-g++ -static -O2 -march=armv5te -mtune=xscale -Wa,-mcpu=xscale wall.o svn-version.h i2c_connection.o i2c-api.o i2c-io-api.o AvrInfo.o BootLoader-api.o Crc8.o DumpMem.o Log.o myLaserScanner.o Controller.o -lm -o wall Controller.o: In function `Controller::p(double, double)': Controller.cpp:(.text+0xc4): undefined reference to `round' collect2: ld returned 1 exit status ...with the follow MAKEFILE: ################ # # Makefile # # ########### ifeq ($(DEBUG),y) CFLAGS += -O -g # -O is need to expand inlines else CFLAGS += -O2 endif PWD := $(shell pwd) MYNAME = wall BUILD_ARM = $(GUMSTIX_BUILDROOT)/build_arm_nofpu CROSS_COMPILE = $(BUILD_ARM)/staging_dir/bin/arm-linux- COMMON = $(ROBOSTIX_SVN_PATH)/robostix/gumstix/Common SHARED = $(ROBOSTIX_SVN_PATH)/robostix/Shared vpath %.c $(COMMON) $(SHARED) vpath %.cpp ../i2c_connection CPPFLAGS += -I . -I $(COMMON) -I $(SHARED) -I ../i2c_connection \ -I ../Shared -Wall CFLAGS += -Wall LDLIBS += -lm TARGET_ARCH = -O2 -march=armv5te -mtune=xscale -Wa,-mcpu=xscale CC = $(CROSS_COMPILE)g++ -static CXX = $(CROSS_COMPILE)g++ OBJS = $(MYNAME).o \ i2c_connection.o\ i2c-api.o\ i2c-io-api.o\ AvrInfo.o\ BootLoader-api.o\ Crc8.o\ DumpMem.o\ Log.o\ myLaserScanner.o \ Controller.o #LINK.o = $(CXX) $(LDFLAGS) $(TARGET_ARCH) all: $(MYNAME) $(MYNAME): svn-version.h $(OBJS) clean: rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions $(MYNAME) depend .depend dep: svn-version.h @echo "Creating dependencies ..." $(CC) $(CFLAGS) $(CPPFLAGS) -M *.c $(COMMON)/*.c > .depend FORCE: .PHONY: FORCE PREPROCESS.c = $(CC) $(CPPFLAGS) $(TARGET_ARCH) -E -Wp,-C,-dD,-dI %.pp : %.c FORCE $(PREPROCESS.c) $< > $@ include $(ROBOSTIX_SVN_PATH)/robostix/svn-version.mk ifeq ($(strip $(filter clean, $(MAKECMDGOALS))),) -include .depend endif It compiles fine if i take the round function. The -lm flag is also there, i can't figured out the error. Can someone help me please! Thank very much!!!! joão. Receba GRÁTIS as mensagens do Messenger no seu celular quando você estiver offline. Conheça o MSN Mobile! Crie já o seu! _________________________________________________________________ Conheça o Windows Live Spaces, a rede de relacionamentos do Messenger! http://www.amigosdomessenger.com.br/ |
From: Dave H. <dhy...@gm...> - 2008-02-22 15:01:53
|
Hi João, > I'm using the round function from math.h in a program that runs on the > gumstix, however is getting very difficult to compile with my makefile. > I'm getting always the same error whatever i try to do. > > /home/joao/gumstix-buildroot/build_arm_nofpu/staging_dir/bin/arm-linux-g++ > -static -O2 -march=armv5te -mtune=xscale -Wa,-mcpu=xscale wall.o > svn-version.h i2c_connection.o i2c-api.o i2c-io-api.o AvrInfo.o > BootLoader-api.o Crc8.o DumpMem.o Log.o myLaserScanner.o Controller.o -lm > -o wall > Controller.o: In function `Controller::p(double, double)': > Controller.cpp:(.text+0xc4): undefined reference to `round' > collect2: ld returned 1 exit status Which version of buildroot are you using? I tried modifying my i2c-io to add a C++ function which calls round, and after I added -lm everything worked perfectly. I even repeated using your Makefile just to make sure. So I can only conclude that the round function is missing from your libm.a file. cd gumstix_buildroot/build_arm_nofpu/staging_dir/lib nm libm.a | grep round I got the following output: s_lround.os: 00000000 T __GI_lround 00000000 T lround s_llround.os: 00000000 T __GI_llround 00000000 T llround s_round.os: 00000000 T __GI_round 00000000 T round llroundf.os: U __GI_llround 00000000 T llroundf lroundf.os: U __GI_lround 00000000 T lroundf roundf.os: U __GI_round 00000000 T roundf -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: João V. <vva...@ho...> - 2008-02-25 15:42:13
|
Hello Dave, Thank you very much for your time! In fact i'm suprised with this libm.a file. if i do, cd gumstix_buildroot/build_arm_nofpu/staging_dir/lib nm libm.a | grep round i get this output, lroundf.o: roundf.o: But if i try sin,cos,exp i get the same output that you got, for exemple exp: U __ieee754_exp U expm1 e_exp.o: 00000000 T __ieee754_exp U __ieee754_exp U expm1 U __ieee754_exp s_expm1.o: 00000000 T expm1 s_frexp.o: 00000000 T frexp s_ldexp.o: 00000000 T ldexp U expm1 w_exp.o: U __ieee754_exp 00000000 T exp exp2f.o: expf.o: U exp 00000000 T expf expm1f.o: U expm1 00000000 T expm1f frexpf.o: U frexp 00000000 T frexpf ldexpf.o: U ldexp 00000000 T ldexpf For now i solved the problem defining the round as: #define round(x) (x<0?ceil((x)-0.5):floor((x)+0.5)) But would be nice to solve the problem without "shortcuts"!!! Any ideia how i could fix this problem?Thank you very much once again!!! João. > Date: Fri, 22 Feb 2008 07:01:56 -0800 > From: dhy...@gm... > To: gum...@li... > Subject: Re: [Gumstix-users] FW: Gumstix Makefile,include problems! > > Hi João, > > > I'm using the round function from math.h in a program that runs on the > > gumstix, however is getting very difficult to compile with my makefile. > > I'm getting always the same error whatever i try to do. > > > > /home/joao/gumstix-buildroot/build_arm_nofpu/staging_dir/bin/arm-linux-g++ > > -static -O2 -march=armv5te -mtune=xscale -Wa,-mcpu=xscale wall.o > > svn-version.h i2c_connection.o i2c-api.o i2c-io-api.o AvrInfo.o > > BootLoader-api.o Crc8.o DumpMem.o Log.o myLaserScanner.o Controller.o -lm > > -o wall > > Controller.o: In function `Controller::p(double, double)': > > Controller.cpp:(.text+0xc4): undefined reference to `round' > > collect2: ld returned 1 exit status > > Which version of buildroot are you using? > > I tried modifying my i2c-io to add a C++ function which calls round, > and after I added -lm everything worked perfectly. I even repeated > using your Makefile just to make sure. > > So I can only conclude that the round function is missing from your libm.a file. > > cd gumstix_buildroot/build_arm_nofpu/staging_dir/lib > nm libm.a | grep round > > I got the following output: > > s_lround.os: > 00000000 T __GI_lround > 00000000 T lround > s_llround.os: > 00000000 T __GI_llround > 00000000 T llround > s_round.os: > 00000000 T __GI_round > 00000000 T round > llroundf.os: > U __GI_llround > 00000000 T llroundf > lroundf.os: > U __GI_lround > 00000000 T lroundf > roundf.os: > U __GI_round > 00000000 T roundf > > -- > Dave Hylands > Vancouver, BC, Canada > http://www.DaveHylands.com/ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users _________________________________________________________________ Veja mapas e encontre as melhores rotas para fugir do trânsito com o Live Search Maps! http://www.livemaps.com.br/index.aspx?tr=true |
From: Dave H. <dhy...@gm...> - 2008-02-25 15:55:49
|
Hi João, > Thank you very much for your time! > In fact i'm suprised with this libm.a file. > if i do, > > cd gumstix_buildroot/build_arm_nofpu/staging_dir/lib > nm libm.a | grep round > > i get this output, > > lroundf.o: > roundf.o: The file that contains round is only compiled into libm.a if the uClibc config option DO_C99_MATH is defined. On my system, if i do cd gumstix-buildroot/toochain_build_arm_nofpu/uClibc grep DO_C99_MATH .config I get: DO_C99_MATH=y Perhaps that option is off for you? -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: João V. <vva...@ho...> - 2008-02-27 12:09:23
|
Hi again, I got the same output that you: grep DO_C99_MATH uClibc.config DO_C99_MATH=y i done: grep --color -R -w round /usr/avr/include/ and i don't get any output, it isn't defined in math.h, instead all other functions like abs,sin,cos,exp are there and i use it without any problems. it should be normal that round function is not defined in math.h? > Date: Mon, 25 Feb 2008 07:55:50 -0800 > From: dhy...@gm... > To: gum...@li... > Subject: Re: [Gumstix-users] FW: Gumstix Makefile,include problems! > > Hi João, > > > Thank you very much for your time! > > In fact i'm suprised with this libm.a file. > > if i do, > > > > cd gumstix_buildroot/build_arm_nofpu/staging_dir/lib > > nm libm.a | grep round > > > > i get this output, > > > > lroundf.o: > > roundf.o: > > The file that contains round is only compiled into libm.a if the > uClibc config option DO_C99_MATH is defined. > > On my system, if i do > > cd gumstix-buildroot/toochain_build_arm_nofpu/uClibc > grep DO_C99_MATH .config > > I get: > > DO_C99_MATH=y > > Perhaps that option is off for you? > > -- > Dave Hylands > Vancouver, BC, Canada > http://www.DaveHylands.com/ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users _________________________________________________________________ Confira vídeos com notícias do NY Times, gols direto do Lance, videocassetadas e muito mais no MSN Video! http://video.msn.com/?mkt=pt-br |
From: Dave H. <dhy...@gm...> - 2008-02-27 15:35:34
|
Hi João, > I got the same output that you: > grep DO_C99_MATH uClibc.config > > DO_C99_MATH=y Hmmm. > i done: > > grep --color -R -w round /usr/avr/include/ > > and i don't get any output, it isn't defined in math.h, instead all other functions like abs,sin,cos,exp are there and i use it without any problems. > > it should be normal that round function is not defined in math.h? /usr/avr/include is used when compiling code using the AVR cross compiler. I thought you were compiling stuff for the gumstix? In which case you want to look in gumstix-buildroot/build_arm_nofpu/staging_dir/include, and you should find the following include/bits/mathcalls.h:__MATHCALLX (round,, (_Mdouble_ __x), (__const__)); which is #included from math.h Whether its defined in the header file is a separate issue from it being defined in the appropriate library. Which version of buildroot are you using? -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: João V. <vva...@ho...> - 2008-02-28 11:29:43
|
Hi dave, > Date: Wed, 27 ,Feb 2008 07:35:36 -0800 > From: dhy...@gm... > To: gum...@li... > Subject: Re: [Gumstix-users] FW: Gumstix Makefile,include problems! > > Hi João, > > > I got the same output that you: > > grep DO_C99_MATH uClibc.config > > > > DO_C99_MATH=y > > Hmmm. > > > i done: > > > > grep --color -R -w round /usr/avr/include/ > > > > and i don't get any output, it isn't defined in math.h, instead all other functions like abs,sin,cos,exp are there and i use it without any problems. > > > > it should be normal that round function is not defined in math.h? > > /usr/avr/include is used when compiling code using the AVR cross > compiler. I thought you were compiling stuff for the gumstix? Misunderstanding, just gumstix stuff! > In which case you want to look in > gumstix-buildroot/build_arm_nofpu/staging_dir/include, and you should > find the following > > include/bits/mathcalls.h:__MATHCALLX (round,, (_Mdouble_ __x), (__const__)); > > which is #included from math.h > i found it! __MATHCALL (round,, (_Mdouble_ __x)); In last mail i told you that i have done this: cd gumstix-buildroot/build_arm_nofpu/staging_dir/lib nm libm.a | grep round i get only this output lroundf.o: roundf.o:it should be normal? if i do the same thing to other functions like sin,cos,exp,abs, sqrt i got bigger outputs like: U __ieee754_sqrt U __ieee754_sqrt U sqrt U __ieee754_sqrt U __ieee754_sqrt U sqrt U sqrt U sqrt U __ieee754_sqrt e_sqrt.o: 00000000 T __ieee754_sqrt U __ieee754_sqrt w_sqrt.o: U __ieee754_sqrt 00000000 T sqrt sqrtf.o: U sqrt 00000000 T sqrtf > Whether its defined in the header file is a separate issue from it > being defined in the appropriate library. > > Which version of buildroot are you using? Revision: 1161 (I just checked and is the same both on gumstix and computer!) João. > > -- > Dave Hylands > Vancouver, BC, Canada > http://www.DaveHylands.com/ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users _________________________________________________________________ Veja mapas e encontre as melhores rotas para fugir do trânsito com o Live Search Maps! http://www.livemaps.com.br/index.aspx?tr=true |
From: Dave H. <dhy...@gm...> - 2008-02-28 15:19:05
|
Hi João, > > Which version of buildroot are you using? > > > Revision: 1161 > (I just checked and is the same both on gumstix and computer!) Ahhh. I just checked my 1161 build and it's missing the round function as well. So it would appear that it was added into uClibc somwhere along the way. So if you're going to stick to 1161, then you'll have to implement your own round function. You could always steal it from a newer version of uClibc. -- Dave Hylands Vancouver, BC, Canada http://www.DaveHylands.com/ |
From: João V. <vva...@ho...> - 2008-02-28 17:44:21
|
Thanks a lot dave, for now is solved, but soon or later i will have to update my GUM! > Date: Thu, 28 Feb 2008 07:19:07 -0800 > From: dhy...@gm... > To: gum...@li... > Subject: Re: [Gumstix-users] FW: Gumstix Makefile,include problems! > > Hi João, > > > > Which version of buildroot are you using? > > > > > > Revision: 1161 > > (I just checked and is the same both on gumstix and computer!) > > Ahhh. I just checked my 1161 build and it's missing the round function > as well. So it would appear that it was added into uClibc somwhere > along the way. > > So if you're going to stick to 1161, then you'll have to implement > your own round function. You could always steal it from a newer > version of uClibc. > > -- > Dave Hylands > Vancouver, BC, Canada > http://www.DaveHylands.com/ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > gumstix-users mailing list > gum...@li... > https://lists.sourceforge.net/lists/listinfo/gumstix-users _________________________________________________________________ Receba GRÁTIS as mensagens do Messenger no seu celular quando você estiver offline. Conheça o MSN Mobile! http://mobile.live.com/signup/signup2.aspx?lc=pt-br |