LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-06-2014, 04:28 AM   #1
dharm_sk
LQ Newbie
 
Registered: Jul 2014
Posts: 13

Rep: Reputation: Disabled
NET-SNMP make fails


I am using Ubuntu 14.04. I have downloaded the net-snmp package net-snmp-5.7.3.pre5. The configure went well. Make gives the following error :

/usr/bin/ld: /usr/local/lib/perl5/5.18.2/x86_64-linux/CORE/libperl.a(op.o): relocation R_X86_64_32S against `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/perl5/5.18.2/x86_64-linux/CORE/libperl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [libnetsnmpagent.la] Error 1
make[1]: Leaving directory `/home/dell/Desktop/net-snmp-5.7.3.pre5/agent'
make: *** [subdirs] Error 1

Any solutions?

Thanks
 
Old 09-06-2014, 04:32 AM   #2
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Quote:
recompile with -fPIC
Have you tried doing this as they suggest?
jdk
 
Old 09-06-2014, 06:40 AM   #3
dharm_sk
LQ Newbie
 
Registered: Jul 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Yes i tried recompiling with fPIC : ./configure --with-cflags=fPIC.

It gave the following error :

Location to write persistent information (/var/net-snmp):
setting Location to write persistent information to... /var/net-snmp
checking if I need to feed myself to ksh... no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for grep that handles long lines and -e... (cached) /bin/grep
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a sed that does not truncate output... /bin/sed
checking for file... file
checking for find... find
checking for whoami... whoami
checking for autoconf... no
checking for autoheader... no
checking for perl... /usr/local/bin/perl
checking for ps... /bin/ps
checking for python... /usr/bin/python
checking for uname... /bin/uname
checking whether the Perl function system() invokes a POSIX shell... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/dell/Desktop/net-snmp-5.7.3.pre5':
configure: error: C compiler cannot create executables
 
Old 09-06-2014, 06:54 AM   #4
dharm_sk
LQ Newbie
 
Registered: Jul 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
im sorry... the make was run as

make CFLAGS=-fPIC

it ran till it gave this :

libtool: compile: gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -I/usr/local/ssl/include -fPIC -c snmp_perl.c -fPIC -DPIC -o .libs/snmp_perl.o
snmp_perl.c:5:20: fatal error: EXTERN.h: No such file or directory
#include <EXTERN.h>
^
compilation terminated.
make[1]: *** [snmp_perl.lo] Error 1
make[1]: Leaving directory `/home/dell/Desktop/net-snmp-5.7.3.pre5/agent'
make: *** [subdirs] Error 1
 
Old 09-06-2014, 09:23 AM   #5
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Have you installed the perl package? That's the package that seems to provide EXTERN.h all in caps.
jdk

Last edited by jdkaye; 09-06-2014 at 09:32 AM.
 
Old 09-06-2014, 11:48 AM   #6
dharm_sk
LQ Newbie
 
Registered: Jul 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
i have installed perl 5.18.2.

i moved all header files to include directory in net-snmp. it still gives the error.

/usr/bin/ld: /usr/local/lib/perl5/5.18.2/x86_64-linux/CORE/libperl.a(op.o): relocation R_X86_64_32S against `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/perl5/5.18.2/x86_64-linux/CORE/libperl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [libnetsnmpagent.la] Error 1
make[1]: Leaving directory `/home/dell/Desktop/net-snmp-5.7.2/agent'
make: *** [subdirs] Error 1
 
Old 09-06-2014, 12:22 PM   #7
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
Quote:
Originally Posted by dharm_sk View Post
i have installed perl 5.18.2.

i moved all header files to include directory in net-snmp. it still gives the error.
But it gives a different error. It is no longer complaining about EXTERN.h Are you still compiling using the -fPIC switch?
jdk
 
Old 09-06-2014, 01:21 PM   #8
dharm_sk
LQ Newbie
 
Registered: Jul 2014
Posts: 13

Original Poster
Rep: Reputation: Disabled
Its working fine now. I recompiled perl5.18.2 package as below

./Configure -de -Dprefix=/usr/local -Dusethreads -Duseshrplib, make , make install

referred the following link : http://sourceforge.net/p/net-snmp/ma...sage/24080522/

And then compiled net-snmp package as ./configure , make CFLAGS=-fPIC, make install went well.

Thank You jdkaye.

Last edited by dharm_sk; 09-06-2014 at 01:23 PM.
 
Old 09-07-2014, 12:04 AM   #9
jdkaye
LQ Guru
 
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465

Rep: Reputation: Disabled
I'm glad your problem is solved and pleased to have been of service. Have fun!
jdk
 
Old 11-18-2015, 07:52 AM   #10
idontlikeusernames
LQ Newbie
 
Registered: Nov 2015
Posts: 1

Rep: Reputation: Disabled
Hello dharm_sk,

I'm following this thread cause i'm getting the exact same issues. I'm hoping you didn't forget what you did to solve the problem...
I'm stuck at "i moved all header files to include directory in net-snmp" . What header files are you talking about, and where did you put them ?

Thanks in advance

-- EDIT

Ok i had read "include" as a verb, and not as THE "include" directory in net-snmp, makes much more sense now. So i guess the header files you're talking about are the ones in the perl_5.18.2 folder ?

-- EDIT #2

Ok guys i spent all afternoon trying to fix this, i really don't get it.
When i follow post #8, i get (at the "make CFLAGS=-fPIC" step for net-snmp, without moving the perl h files to net-snmp/include) :

libtool: compile: gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -I/usr/local/ssl/include -fPIC -c snmp_perl.c -fPIC -DPIC -o .libs/snmp_perl.o
snmp_perl.c:5:20: fatal error: EXTERN.h: No such file or directory
#include <EXTERN.h>
^
compilation terminated.
make[1]: *** [snmp_perl.lo] Error 1
make[1]: Leaving directory `/home/dell/Desktop/net-snmp-5.7.3.pre5/agent'
make: *** [subdirs] Error 1


And when i DO put these files in net-snmp/include, i still get:

/usr/bin/ld: /usr/local/lib/perl5/5.18.2/x86_64-linux/CORE/libperl.a(op.o): relocation R_X86_64_32S against `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/perl5/5.18.2/x86_64-linux/CORE/libperl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [libnetsnmpagent.la] Error 1
make[1]: Leaving directory `/home/dell/Desktop/net-snmp-5.7.2/agent'
make: *** [subdirs] Error 1


I don't know what i'm missing. My perl version is same as yours, though my net-snmp is 5.5.1, could that be what's making it go wrong ?

Last edited by idontlikeusernames; 11-18-2015 at 11:05 AM.
 
Old 11-18-2015, 09:06 PM   #11
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,434

Rep: Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790Reputation: 2790
@idontlikeusernames: this thread finished over a year ago. Please start a new one
 
  


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
Integrate Mod-Apache-Snmp with Net-SNMP source kirukan Linux - Server 2 05-11-2011 01:48 AM
Net-SNMP writing a Subagent - snmp.conf Unknown token: master AustinMarton Programming 0 12-16-2008 07:34 PM
SLES9 net-snmp-5.1-80.16 fails to load marscoast Linux - Networking 1 02-04-2008 07:33 AM
Net-SNMP Fails to Build (RH ES 4.0) jhmathis Linux - Enterprise 1 10-26-2007 04:00 AM
snmp (ucd-snmp, net-snmp) markus1982 Linux - Software 1 11-21-2002 10:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:03 PM.

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
Open Source Consulting | Domain Registration