LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-21-2012, 02:31 AM   #1
tramni1980
Member
 
Registered: Jul 2006
Location: Gießen, Germany
Distribution: Slackware64-14.2
Posts: 786

Rep: Reputation: 49
trouble compiling udunits-1.11.7 on Slackware64-13.37


Hello,

I am running Slackware64-13.37 with kernel 2.6.38.4. I need to install the udunits-1.11.7 ftp://grads.iges.org/grads/Supplibs/...-1.11.7.tar.gz library. Yes, I do know that there is a new version, which compiles successfully on Slackware, but I actually need GrADS, and GrADS needs exactly udunits-1.11.7. Here is the compile-time error I get:

Code:
making `all' in directory /home/marto/build/source/udunits/udunits-1.11.7/src/lib

make[1]: Entering directory `/home/marto/build/source/udunits/udunits-1.11.7/src/lib'
cc -c -O -I../port/misc -I../port/cfortran -DUT_DEFAULT_PATH='"/home/marto/build/source/udunits/udunits-1.11.7/etc/udunits.dat"'  utlib.c
cc -c -O -I../port/misc -I../port/cfortran -DUT_DEFAULT_PATH='"/home/marto/build/source/udunits/udunits-1.11.7/etc/udunits.dat"'  utparse.c
cc -c -O -I../port/misc -I../port/cfortran -DUT_DEFAULT_PATH='"/home/marto/build/source/udunits/udunits-1.11.7/etc/udunits.dat"'  utscan.c
In file included from ../port/misc/stddef.h:9:0,
                 from utscan.l:15:
///usr/lib64/gcc/x86_64-slackware-linux/4.5.2/include/stddef.h:411:0: warning: "offsetof" redefined
../port/misc/stddef.h:24:0: note: this is the location of the previous definition
cc -c -O -I../port/misc -I../port/cfortran -DUT_DEFAULT_PATH='"/home/marto/build/source/udunits/udunits-1.11.7/etc/udunits.dat"'  udalloc.c
ar rcuv libudunits.a utlib.o utparse.o utscan.o udalloc.o
a - utlib.o
a - utparse.o
a - utscan.o
a - udalloc.o
case "" in \
'') ;; \
*)  ar rucv libudunits.a ;; \
esac
ranlib libudunits.a
make[1]: Leaving directory `/home/marto/build/source/udunits/udunits-1.11.7/src/lib'

returning to directory /home/marto/build/source/udunits/udunits-1.11.7/src


making `all' in directory /home/marto/build/source/udunits/udunits-1.11.7/src/udunits

make[1]: Entering directory `/home/marto/build/source/udunits/udunits-1.11.7/src/udunits'
make[2]: Entering directory `/home/marto/build/source/udunits/udunits-1.11.7/src/udunits'
cc -c -O -I../lib -I../port/misc  udunits.c
udunits.c: In function 'main':
udunits.c:113:6: warning: incompatible implicit declaration of built-in function 'exit'
cc -o udunits -O udunits.o -L/home/marto/build/source/udunits/udunits-1.11.7/src/lib -ludunits -L/home/marto/build/source/udunits/udunits-1.11.7/src/port/misc -ludport
/home/marto/build/source/udunits/udunits-1.11.7/src/lib/libudunits.a(utlib.o): In function `dectime':
utlib.c:(.text+0x4a7): undefined reference to `floor'
utlib.c:(.text+0x523): undefined reference to `fmod'
/home/marto/build/source/udunits/udunits-1.11.7/src/lib/libudunits.a(utlib.o): In function `utRaise':
utlib.c:(.text+0xc47): undefined reference to `pow'
/home/marto/build/source/udunits/udunits-1.11.7/src/lib/libudunits.a(utlib.o): In function `utPrint':
utlib.c:(.text+0xf00): undefined reference to `log10'
utlib.c:(.text+0xf05): undefined reference to `ceil'
collect2: ld returned 1 exit status
make[2]: *** [udunits] Error 1
make[2]: Leaving directory `/home/marto/build/source/udunits/udunits-1.11.7/src/udunits'
make[1]: *** [program] Error 2
make[1]: Leaving directory `/home/marto/build/source/udunits/udunits-1.11.7/src/udunits'
make: *** [udunits/all] Error 1
Any suggestions will be appreciated.
 
Old 04-21-2012, 03:08 AM   #2
Petri Kaukasoina
Member
 
Registered: Mar 2007
Posts: 269

Rep: Reputation: 115Reputation: 115
Link with -lm.
 
Old 04-21-2012, 03:45 AM   #3
tramni1980
Member
 
Registered: Jul 2006
Location: Gießen, Germany
Distribution: Slackware64-14.2
Posts: 786

Original Poster
Rep: Reputation: 49
Quote:
Originally Posted by Petri Kaukasoina View Post
Link with -lm.
Hello,
I am not a programmer, but so long as I understand your suggestion, it says just to add the
Code:
CFLAGS='-lm'
option before running the configure script, am I right?
This made no difference.

If I have wrongly understood you, could you tell me the exact command which chooses the '-lm' linker?
 
Old 04-21-2012, 04:11 AM   #4
Petri Kaukasoina
Member
 
Registered: Mar 2007
Posts: 269

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by tramni1980 View Post
If I have wrongly understood you, could you tell me the exact command which chooses the '-lm' linker?
Hi,

In your original message, this was the command that caused the error:
Code:
cc -o udunits -O udunits.o -L/home/marto/build/source/udunits/udunits-1.11.7/src/lib -ludunits -L/home/marto/build/source/udunits/udunits-1.11.7/src/port/misc -ludport
You should see -lm in the end of that line. You could try setting LDFLAGS before configure:
Code:
LDFLAGS='-lm' ./configure
 
Old 04-21-2012, 04:38 AM   #5
tramni1980
Member
 
Registered: Jul 2006
Location: Gießen, Germany
Distribution: Slackware64-14.2
Posts: 786

Original Poster
Rep: Reputation: 49
Thanks for the clarification, please apologise my ignorance.
Code:
LDFLAGS='-lm' ./configure; make
outputs the following, which I think marks no difference:
Code:
make[1]: Entering directory `/home/marto/build/source/udunits/udunits-1.11.7/src/udunits'
make[2]: Entering directory `/home/marto/build/source/udunits/udunits-1.11.7/src/udunits'
cc -c -O -I../lib -I../port/misc  udunits.c
udunits.c: In function 'main':
udunits.c:113:6: warning: incompatible implicit declaration of built-in function 'exit'
cc -o udunits -O udunits.o -L/home/marto/build/source/udunits/udunits-1.11.7/src/lib -ludunits -L/home/marto/build/source/udunits/udunits-1.11.7/src/port/misc -ludport
/home/marto/build/source/udunits/udunits-1.11.7/src/lib/libudunits.a(utlib.o): In function `dectime':
utlib.c:(.text+0x4a7): undefined reference to `floor'
utlib.c:(.text+0x523): undefined reference to `fmod'
/home/marto/build/source/udunits/udunits-1.11.7/src/lib/libudunits.a(utlib.o): In function `utRaise':
utlib.c:(.text+0xc47): undefined reference to `pow'
/home/marto/build/source/udunits/udunits-1.11.7/src/lib/libudunits.a(utlib.o): In function `utPrint':
utlib.c:(.text+0xf00): undefined reference to `log10'
utlib.c:(.text+0xf05): undefined reference to `ceil'
collect2: ld returned 1 exit status
make[2]: *** [udunits] Error 1
make[2]: Leaving directory `/home/marto/build/source/udunits/udunits-1.11.7/src/udunits'
make[1]: *** [program] Error 2
make[1]: Leaving directory `/home/marto/build/source/udunits/udunits-1.11.7/src/udunits'
make: *** [udunits/all] Error 1
 
Old 04-21-2012, 04:52 AM   #6
Petri Kaukasoina
Member
 
Registered: Mar 2007
Posts: 269

Rep: Reputation: 115Reputation: 115
OK, I fetched the tar ball and this seemed to work: after configure,
Code:
make CFLAGS='-fPIC' LDFLAGS='-lm'
-lm links the math library into the binary. It is needed because the error message tells that it needs log10 which is not found. See man log10. And after -lm is succesfully added to the link command, the build stops at an error which tells to compile with -fPIC.
 
Old 04-21-2012, 05:27 AM   #7
tramni1980
Member
 
Registered: Jul 2006
Location: Gießen, Germany
Distribution: Slackware64-14.2
Posts: 786

Original Poster
Rep: Reputation: 49
Thumbs up

Than you very much, that did the trick!!! I also had to give the same arguments to the make install command. I wonder why
the settings do not work if they are passed only to configure, as is usually done ?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] compiling 32bit programs in slackware64 animeresistance Slackware 7 08-05-2011 06:35 PM
[SOLVED] compiling 32 bit on Slackware64 business_kid Slackware 9 05-21-2010 04:17 AM
[SOLVED] Trouble compiling virtualbox-ose.Slackbuild 3.1.6 on Slackware64 13.0 with multilibs. kslen Slackware 2 04-28-2010 05:47 PM
Compiling CinePaint under Slackware64-current mats_b_tegner Slackware 0 03-21-2010 10:13 AM
Compiling Crafty in Slackware64 13 arubin Slackware 5 11-19-2009 04:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration