# Net-SNMP Build Error on 7.2-RELEASE



## pnosbsd (May 5, 2009)

When I try to build the port for Net-SNMP on 7.2-RELEASE, I receive the following errors:


. . .

```
Writing Makefile for SNMP
Checking if your kit is complete...
Looks good
Warning: prerequisite NetSNMP::OID 5.02 not found.
Warning: -L../../apps/.libs changed to -L/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/perl/TrapReceiver/../../apps/.libs
Warning: -L../../apps changed to -L/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/perl/TrapReceiver/../../apps
Warning: -L../../agent/.libs changed to -L/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/perl/TrapReceiver/../../agent/.libs
Warning: -L../../agent changed to -L/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/perl/TrapReceiver/../../agent
Warning: -L../../agent/helpers/.libs changed to -L/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/perl/TrapReceiver/../../agent/helpers/.                                                                   libs
Warning: -L../../agent/helpers changed to -L/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/perl/TrapReceiver/../../agent/helpers
Warning: -L../../snmplib/.libs changed to -L/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/perl/TrapReceiver/../../snmplib/.libs
Warning: -L../../snmplib changed to -L/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/perl/TrapReceiver/../../snmplib
Writing Makefile for NetSNMP::TrapReceiver
Writing Makefile for Bundle::NetSNMP
Makefile out-of-date with respect to /usr/local/lib/perl5/5.8.9/mach/Config.pm /usr/local/lib/perl5/5.8.9/mach/CORE/config.h
Cleaning current config before rebuilding Makefile...
make -f Makefile.old clean > /dev/null 2>&1
/usr/local/bin/perl Makefile.PL
ERROR from evaluation of /usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/perl/default_store/Makefile.PL: You need to install net-snmp fir                                                                 st (I can't find net-snmp-config) at ./Makefile.PL line 84.
*** Error code 2

Stop in /usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/perl.
*** Error code 1

Stop in /usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1.
*** Error code 1

Stop in /usr/ports/net-mgmt/net-snmp.
```


----------



## SirDice (May 5, 2009)

Please use [code][/code] tags.
http://forums.freebsd.org/misc.php?do=bbcode#code

Looks like you're trying to install net-mgmt/p5-Net-SNMP. Install net-mgmt/net-snmp first.


----------



## pnosbsd (May 5, 2009)

I am in /usr/ports/net-mgmt/net-snmp, and type "make install clean" and it stops with the above errors.  The machine was upgraded from 7.1-RELEASE to 7.2-RELEASE. Could this have anything to do with it?


----------



## DutchDaemon (May 5, 2009)

Start with a [cmd=make] clean[/cmd] first. Looks like your work directory keeps messing up. Also make sure your ports tree is clean and fresh. Also, did you upgrade Perl recently and did you forget to run [cmd=]perl-after-upgrade[/cmd]?


----------



## SirDice (May 5, 2009)

What build options did you use?

It build fine on my machine (7-stable).


----------



## pnosbsd (May 5, 2009)

I tried again as follows:

portsnap fetch
portsnap update
cd /usr/ports/net-mgmt/net-snmp
make clean
make install clean

Stops at the same point with the same error.
I am not aware of upgrading Perl recently, but I could try the perl-after-upgrade.  How do I run this?

I am not aware of any build options for Net-SNMP, or if there are any, I just used the default options.


----------



## DutchDaemon (May 5, 2009)

pnosbsd said:
			
		

> I am not aware of upgrading Perl recently, but I could try the perl-after-upgrade.  How do I run this?



Literally. Type it on the command line.



> I am not aware of any build options for Net-SNMP, or if there are any, I just used the default options.



There is no 'make config' stuff for this port. There is some stuff in the Makefile which you generally don't need to touch. Anyway, I built this port several times in the past few weeks, and it's working.

If it keeps bombing out with perl-related errors (even after perl-after-upgrade), consider rebuilding Perl and its installed (p5) modules from scratch.


----------



## pnosbsd (May 6, 2009)

I still had the same problem after running perl-after-upgrade.
However, I then rebuilt Perl from scratch, and now Net-SNMP builds with no errors.

Thanks


----------



## nicholaschew (Oct 13, 2009)

*rebuild perl?*

what do u meant by rebuilding perl? 
do u install perl package?


----------



## nicholaschew (Oct 13, 2009)

*installed perl*

i installed perl5-10 and everything is solved


----------



## pnosbsd (Oct 13, 2009)

nicholaschew,

Sounds like you solved your problem, but just for your information, this is what I did to remove and rebuild/reinstall Perl.

Update ports collection:

*portsnap fetch
portsnap update*

Proceed to Perl port:

*cd /usr/ports/lang/perl*
(I am not at a machine to check right now, but I believe this is still Perl 5.8.9 .  Not sure if you wanted to move up to Perl 5.10.1 or not, as you did.)

Remove existing install:

*make deinstall*
(You will see some warnings about other ports needing this port, but this is ok, as we will reinstall it afterwards.)

Clean the build environment:

*make clean*

Rebuild and Reinstall port

*make install clean*

After doing this, my net-snmp port built and installed with not further problems.


----------

