Build error on OpenBSD

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
mksmr
Posts: 55
Joined: Thu Sep 22, 2016 7:17 am

Build error on OpenBSD

Post by mksmr »

Nagios 4.2.2
OpenBSD 6.0
amd64 (vm on vSphere)
preinstalled Naios 4.0.8 from packages, to be superseded by 4.2.2

Good morning all, I am getting the following error message when building 4.2.2.

Configuring works out right:

Code: Select all

# ./configure --with-command-group=_nagios --with-command-user=_nagios --with-nagios-user=_nagios --with-nagios-group=_nagios

*** Configuration summary for nagios 4.2.2 10-24-2016 ***:

 General Options:
 -------------------------
        Nagios executable:  nagios
        Nagios user/group:  _nagios,_nagios
       Command user/group:  _nagios,_nagios
             Event Broker:  yes
        Install ${prefix}:  /usr/local/nagios
    Install ${includedir}:  /usr/local/nagios/include/nagios
                Lock file:  ${prefix}/var/nagios.lock
   Check result directory:  ${prefix}/var/spool/checkresults
           Init directory:  /etc/rc.d
  Apache conf.d directory:  /etc/httpd/conf.d
             Mail program:  /usr/bin/mail
                  Host OS:  openbsd6.0
          IOBroker Method:  poll

 Web Interface Options:
 ------------------------
                 HTML URL:  http://localhost/nagios/
                  CGI URL:  http://localhost/nagios/cgi-bin/
 Traceroute (used by WAP):  /usr/sbin/traceroute


Review the options above for accuracy.  If they look okay,
type 'make all' to compile the main program and CGIs.

Code: Select all

# make all
cd ./base && make
make -C ../lib
Using $< in a non-suffix rule context is a GNUmake idiom (Makefile:157)
*** Error 2 in /root/nagios-4.2.2 (Makefile:73 'all')
Can anybody help here?

TIA
Matthias
Hulluna humpasta taas
Minä olen hulluna humpasta taas
Minen toivu koskaan, luotan voimaan votkan
Hulluna humpasta taas
jfrickson

Re: Build error on OpenBSD

Post by jfrickson »

Try using gmake instead of make and see if that helps.
mksmr
Posts: 55
Joined: Thu Sep 22, 2016 7:17 am

Re: Build error on OpenBSD

Post by mksmr »

jfrickson wrote:Try using gmake instead of make and see if that helps.
gmake all ended with

Code: Select all

gmake[1]: Entering directory '/root/nagios-4.2.2/module'
gcc -I..  -g -O2 -DHAVE_CONFIG_H -o helloworld.o helloworld.c -shared
/usr/bin/ld: /tmp//ccZ4SCsv.o: relocation R_X86_64_PC32 against `helloworld_h      le_data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
gmake[1]: *** [Makefile:30: helloworld.o] Error 1
gmake[1]: Leaving directory '/root/nagios-4.2.2/module'
gmake: *** [Makefile:76: all] Error 2
Hulluna humpasta taas
Minä olen hulluna humpasta taas
Minen toivu koskaan, luotan voimaan votkan
Hulluna humpasta taas
jfrickson

Re: Build error on OpenBSD

Post by jfrickson »

mksmr wrote:gmake all ended with

Code: Select all

gmake[1]: Entering directory '/root/nagios-4.2.2/module'
gcc -I..  -g -O2 -DHAVE_CONFIG_H -o helloworld.o helloworld.c -shared
/usr/bin/ld: /tmp//ccZ4SCsv.o: relocation R_X86_64_PC32 against `helloworld_h      le_data' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
gmake[1]: *** [Makefile:30: helloworld.o] Error 1
gmake[1]: Leaving directory '/root/nagios-4.2.2/module'
gmake: *** [Makefile:76: all] Error 2
That's the same problem I just fixed for Solaris.

You can either comment out these lines at line 166 in Makefile:

Code: Select all

#modules:
#    cd $(SRC_MODULE) && $(MAKE)
or download the maint branch (https://github.com/NagiosEnterprises/na ... int.tar.gz) which I just now updated.
mksmr
Posts: 55
Joined: Thu Sep 22, 2016 7:17 am

Re: Build error on OpenBSD

Post by mksmr »

jfrickson wrote: You can either comment out these lines at line 166 in Makefile:
gmake ended with the above error
jfrickson wrote: or download the maint branch (https://github.com/NagiosEnterprises/na ... int.tar.gz) which I just now updated.
This one was able to build.

Edit: 4.2.2 is running.
Hulluna humpasta taas
Minä olen hulluna humpasta taas
Minen toivu koskaan, luotan voimaan votkan
Hulluna humpasta taas
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Build error on OpenBSD

Post by avandemore »

It sounds like you issue is resolved. Can we lock this thread?
Previous Nagios employee
mksmr
Posts: 55
Joined: Thu Sep 22, 2016 7:17 am

Re: Build error on OpenBSD

Post by mksmr »

I think we can. I hope that OpenBSD 6.1 will come with a non-buggy version of Nagios. Thank you very much for your assistance.
Matthias
Hulluna humpasta taas
Minä olen hulluna humpasta taas
Minen toivu koskaan, luotan voimaan votkan
Hulluna humpasta taas
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Build error on OpenBSD

Post by avandemore »

FYI, it's not really OpenBSD you should be waiting on, it's the Nagios port maintainer. I don't know how to find that on OpenBSD but the information is there somewhere. If the Nagios port isn't corrected, it will be buggy on every version of OpenBSD.
Previous Nagios employee
Locked