Ad Widget

Collapse

PATCH [1.3.6] r4084: MySQL & Net-SNMP compilation errors (repost)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Farzad FARID
    Member
    • Apr 2007
    • 79

    #1

    PATCH [1.3.6] r4084: MySQL & Net-SNMP compilation errors (repost)

    Hi,

    This is a repost of the patch I erroneously posted in a discussion forum: http://www.zabbix.com/forum/showthread.php?t=5925

    It corrects a problem in m4 files that prevents MySQL and Net-SNMP from compiliing on somes Linux distributions, like Fedora Core 5 (32 and 64 bits).

    Regards
    Attached Files
  • eran
    Member
    • Apr 2007
    • 36

    #2
    Thanks for this patch Farzad. I applied it on CentOS4.4 but it still doesn't pass the configuration phase with error:
    checking for net-snmp-config... /usr/bin/net-snmp-config
    checking for main in -lnetsnmp ... no
    configure: error: Not found NET-SNMP library

    Can you help?

    Thanks,
    Eran

    Comment

    • Farzad FARID
      Member
      • Apr 2007
      • 79

      #3
      Originally posted by eran
      Thanks for this patch Farzad. I applied it on CentOS4.4 but it still doesn't pass the configuration phase with error:
      checking for net-snmp-config... /usr/bin/net-snmp-config
      checking for main in -lnetsnmp ... no
      configure: error: Not found NET-SNMP library
      Hi,

      You have to re-generate the "configure" script. If you are using the SVN version, have a look at the "go" script. Otherwise, you need to have "autoconf", "automake" and such installed, and then run the following commands:

      Code:
      aclocal -I m4
      autoconf
      autoheader
      automake -a
      automake
      Regards

      Comment

      • bluesin
        Junior Member
        • May 2007
        • 12

        #4
        How to apply the patch...

        Hi I'm new around here so go easy:>)

        I'm having this exact same problem on a centos 4.4 system, it's not a 64 bit system though.

        What is the process for applying this patch, is there an updated version out on the CVS what has this patch in it? If so where can that be found?

        Thanks,

        Bluesin

        Comment

        • Farzad FARID
          Member
          • Apr 2007
          • 79

          #5
          Originally posted by bluesin
          Hi I'm new around here so go easy:>)

          I'm having this exact same problem on a centos 4.4 system, it's not a 64 bit system though.

          What is the process for applying this patch, is there an updated version out on the CVS what has this patch in it? If so where can that be found?
          Hi,

          That patch is not integrated in Subversion yet. Here are some instructions:
          • Save the patch in a file.
          • Go to the zabbix source directory
          • Apply the patch with "patch -p0 < ../mypatch.txt"
          • Check that you have autoconf, automake, etc. installed on your server
          • Run the 4 commands I gave in my previous post
          • Compile and test


          If it doesn't work or if my instructions are not clear enough your best bet is to wait for the next pre-release

          Regards

          Comment

          • bluesin
            Junior Member
            • May 2007
            • 12

            #6
            Thanks, got it

            I guess by "source" directory you mean the base zabbix-1.3.6 directory and not the actual "src" directory.

            Patch is installed and all the commands run successfully, but still getting the error,

            checking for net-snmp-config... /usr/bin/net-snmp-config
            checking for main in -lnetsnmp ... no
            configure: error: Not found NET-SNMP library

            I had this problem with the mysql libraries and we had to create symlinks in /usr/lib, is this perhaps the same type of error?

            Thanks,

            Bluesin

            Comment

            • Farzad FARID
              Member
              • Apr 2007
              • 79

              #7
              Originally posted by bluesin
              I guess by "source" directory you mean the base zabbix-1.3.6 directory and not the actual "src" directory.

              Patch is installed and all the commands run successfully, but still getting the error,

              checking for net-snmp-config... /usr/bin/net-snmp-config
              checking for main in -lnetsnmp ... no
              configure: error: Not found NET-SNMP library
              Check the config.log file and search for information on net-snmp in it.

              Originally posted by bluesin
              I had this problem with the mysql libraries and we had to create symlinks in /usr/lib, is this perhaps the same type of error?
              Bluesin
              Yes, same error for MySQL and Net-SNMP. My patch corrects both problems, at least for me. I'm surprised the patch didn't work for you, but there is one significant difference, as I directly use the Subversion "trunk" directory.

              And check "config.log" for debugging messages. Here is for example what I've got in mine, around line 6300:

              Code:
              configure:8933: checking for net-snmp-config
              configure:8951: found /usr/bin/net-snmp-config
              configure:8963: result: /usr/bin/net-snmp-config
              configure:9011: checking for main in -lnetsnmp
              configure:9040: gcc -o conftest -Wall   -I/usr/include/mysql -DBIG_JOINS=1     -I. -I/usr/include      -L/usr/lib/mysql    -L/usr/lib -L/
              usr/lib  -L/usr/lib conftest.c -lnetsnmp   -lcurl  -lresolv -lnsl    -lmysqlclient    -lcurl  -lm -lwrap -lwrap -lcrypto >&5
              configure:9046: $? = 0
              configure:9064: result: yes
              If, for example, your net-snmp library is in "/usr/lib/net-snmp" you should see something like "-L/usr/lib/net-snmp" before "-lnetsnmp".

              Also, run the 3 following commands, and compare the values with the one you found in the "config.log" file.

              Code:
              net-snmp-config --libdir
              net-snmp-config --cflags
              net-snmp-config --libs
              In the meantime, if it doesn't work, maybe you can create symlinks

              Regards

              Comment

              • bluesin
                Junior Member
                • May 2007
                • 12

                #8
                This is the error that is showing up...

                in the config.log

                /usr/lib/libnetsnmp.so: undefined reference to `__stack_chk_fail@GLIBC_2.4'
                /usr/lib/libnetsnmp.so: undefined reference to `__syslog_chk@GLIBC_2.4'
                collect2: ld returned 1 exit status

                Just a question, is there a dependency for a specific version of net-snmp?

                Bluesin

                Comment

                • Farzad FARID
                  Member
                  • Apr 2007
                  • 79

                  #9
                  Originally posted by bluesin
                  in the config.log

                  /usr/lib/libnetsnmp.so: undefined reference to `__stack_chk_fail@GLIBC_2.4'
                  /usr/lib/libnetsnmp.so: undefined reference to `__syslog_chk@GLIBC_2.4'
                  collect2: ld returned 1 exit status

                  Just a question, is there a dependency for a specific version of net-snmp?

                  Bluesin
                  This looks more like a CentOS problem or a local configuration problem than a Zabbix bug.. I can't help you much as I don't have any CentOS server, sorry.

                  Regards

                  Comment

                  • bluesin
                    Junior Member
                    • May 2007
                    • 12

                    #10
                    Do you know if...

                    any version of net-snmp will work?

                    Bluesin

                    Comment

                    • eran
                      Member
                      • Apr 2007
                      • 36

                      #11
                      I'm still having the same problem too.
                      Version 1.3.4 compiled without a problem so I don't think it's a CentOS problem.
                      I tried replacing the netsnmp.m4 file with the one from version 1.3.4 but it doesn't work either.

                      Eran

                      Comment

                      • bluesin
                        Junior Member
                        • May 2007
                        • 12

                        #12
                        Hmmmmm,

                        ok, I uninstalled the latest version and went back to the version that was orginally installed on my system and re-ran the configure, this is what is being produced in the config.log now,


                        configure:8494: gcc -o conftest -g -O2 -I/usr/include/mysql -g -pipe -m32 -march=i386 -mtune=pentium4 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -fno-strict-aliasing -I/usr/include/rpm -I/usr/include/rpm -I. -I/usr/include/net-snmp -L/usr/lib/mysql -L/usr/lib unknown option --libdir

                        Unknown option --libdir

                        Running the command

                        net-snmp-config --libdir

                        produces the same problem,

                        It seems that the proper command for my version is

                        net-snmp-config --libs

                        My version of net-snmp is 5.1.2

                        Methinks that there is a dependency for a net-snmp version...

                        Comment

                        • bluesin
                          Junior Member
                          • May 2007
                          • 12

                          #13
                          Ok...

                          I edited the configure file and replaced all occurences of --libdir with --libs and everything ran just fine...

                          Comment

                          • eran
                            Member
                            • Apr 2007
                            • 36

                            #14
                            I did something simillar. The problem is that the --libdir parameter should actually be --lib-dir. I edited the m4/netsnmp.m4 file and changed the --libdir parameter there, then run the five commands Farzad listed earlier in this thread, then the configure scripr worked fine.

                            Comment

                            • BusteR81
                              Senior Member
                              • Apr 2007
                              • 150

                              #15
                              net-snmp library solution

                              _libnetsnmp_libdir="`$_libnetsnmp_config --libdir`"

                              ya i find the above sentence in configure and change to --libs

                              net-snmp complied successfully then...

                              Comment

                              Working...