net-snmp compilation issue (505 Views)
Reply
Frequent Advisor
Fefers
Posts: 53
Registered: ‎09-30-2011
Message 1 of 8 (505 Views)

net-snmp compilation issue

[ Edited ]

Hello experts, I hope you're doing great :D

 

I need to compile net-snmp on some HP-UX (PA-RISC and IA64) servers and I had an issue during the compilation.

 

 

HP-UX hostname B.11.31 U 9000/800 

net-snmp-5.7.2

 

The output and log file is attached.

 

Could someone help me please?

 

 

thanks in advance

 

 

P.S. This thread has been moved from HP-UX > General to HP-UX > languages. - HP Forum Moderatir

Occasional Advisor
RudyW
Posts: 12
Registered: ‎01-04-2013
Message 2 of 8 (489 Views)

Re: net-snmp compilation issue

Hello Fefers--

 

   I am curious if you have a full version of an ANSI C compiler. Can you show the output of "swlist"?

 

Rudy

 

Frequent Advisor
Fefers
Posts: 53
Registered: ‎09-30-2011
Message 3 of 8 (480 Views)

Re: net-snmp compilation issue

Hi Rudy..

 

# swlist |grep -i C-ANSI-C
#

 

well.. I've found this url:

http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=850807844...

 

do you know if it is free?

 

Occasional Advisor
RudyW
Posts: 12
Registered: ‎01-04-2013
Message 4 of 8 (476 Views)

Re: net-snmp compilation issue

Hi Fefers--

 

   OK, so you don't have HP's ANSI C compiler. It is free for HP partners, not for end users.

 

   You can always try the GNU C compiler. http://hpux.connect.org.uk/hppd/hpux/Gnu/gcc-4.2.3/

 

Rudy

Frequent Advisor
Fefers
Posts: 53
Registered: ‎09-30-2011
Message 5 of 8 (467 Views)

Re: net-snmp compilation issue

Rudy,

 

I've already tried to compile using gcc.

 

# swlist |grep -i gcc
gcc 4.2.3 gcc
libgcc 4.2.3 libgcc

 

 

./configure will avoid this prompt.

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... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for grep that handles long lines and -e... (cached) /usr/bin/grep
checking for a BSD-compatible install... ./install-sh -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a sed that does not truncate output... /usr/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/bin/perl
checking for ps... /usr/bin/ps
checking for python... no
checking for uname... /usr/bin/uname
checking whether the Perl function system() invokes a POSIX shell... syntax error at -e line 1, at EOF
Execution of -e aborted due to compilation errors.
./configure[6503]: : Execute permission denied.
./configure[6503]: "');': A test command parameter is not valid.
yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/net-snmp-5.7.2':
configure: error: C compiler cannot create executables
See `config.log' for more details

 

 

the log is attached

Acclaimed Contributor
Dennis Handly
Posts: 25,091
Registered: ‎03-06-2006
Message 6 of 8 (448 Views)

Re: net-snmp compilation issue

[ Edited ]

>Could someone help me please?

 

in config.log:

configure:6836: cc --version >&5
(Bundled) cc: warning 422: Unknown option "-" ignored.

You're not going to be able to use the bundled C compiler to build this.  You'll need to use gcc.

 

You're going to have to look at your files where the errors are:

target/target_counters_5_5 target/snmpTargetAddrEntrycpp: "./agent/mibgroup/target/snmpTargetParamsEntry.h", line 75: error 4029: #endif without matching #if.

 

ucd-snmp/pass_common hardware/memory hardware/cpu header_complexcpp: "./agent/mibgroup/snmp-notification-mib/snmpNotifyFilterTable/snmpNotifyFilterTable.h", line 32: error 4036: Can't open include file 'snmpNotifyFilterTable_constants.h'.

 

And a whole bunch more with other .h files.  This could be due to a missing -I?

 

And before those errors is:

checking for and configuring mib modules to use... default_modules. default_modules snmpv3mibs mibII ucd_snmp notification notification-log-mib target agent_mibs agentx disman/event

 

I don't see the gcc compile line??  It appears to be using the C compiler to compile C++??

 

>I've already tried to compile using gcc.

 

gcc doesn't seem to be in your PATH.

Frequent Advisor
SoumitraC
Posts: 26
Registered: ‎03-21-2012
Message 7 of 8 (434 Views)

Re: net-snmp compilation issue

As already pointed out, you must use the right compiler for the build. If it can't find gcc by default, use the environment variable 'CC' to point to the compiler. Use "./configure --help" for instructions.

 

I assume you have installed net-snmp in the default location? If not, you'll need to pass in the right set of -I and -L to help pick up the required headers and libraries.

 

It seems that the missing header "snmpNotifyFilterTable_constants.h" has been previously reported on other platforms. You may want to research a little on that to check if a patch or workaround is available. You may even want to reinstall net-snmp afresh and ensure the missing headers are indeed available on the system.

 

 

Soumitra C
HP-UX Compilers
Advisor
Kannan M Jeganathan
Posts: 16
Registered: ‎05-11-2009
Message 8 of 8 (427 Views)

Re: net-snmp compilation issue

 

The latest HP-UX GNU C/C++compiler is 4.7.1. You can download it from www.hp.com/go/gcc. Direct link for downloading the depot is  http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801/?ciid=2a08725cc.... For any queries related to HP-UX GNU C/C++ compiler tool chain please write to gcc-help@lists.hp.com.

 

Regards,

Kannan

 

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.