Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Building static 1.2 agent

Building static 1.2 agent

Scheduled Pinned Locked Moved Support
5 Posts 2 Posters 23.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K
    K
    KjellO
    wrote on last edited by
    #1

    Hi!

    I'm trying to build a static 1.2 agent,

    ./configure --with-static-agent
    

    Configure script is happy, but make fails:

      CXX    snmpproxy.o
    ../../../tools/create_ssa_list.sh "linux ecs logwatch ping portcheck ups" > static_subagents.cpp
      CXX    static_subagents.o
      CXX    subagent.o
      CXX    sysinfo.o
      CXX    tools.o
      CXX    trap.o
      CXX    upgrade.o
      CXX    watchdog.o
    make[4]: *** No rule to make target `../../../src/db/libnxdb/libnxdb.la', needed by `nxagentd'.  Stop.
    

    Other configurations are building fine.

    Any workarounds? Also, is there a way to control what subagents that are compiled in? (Trying to optimizing footprint for use in embedded devices )

    Best regards.

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi!

      Looks like a bug in makefiles. I'll check it later today and let you know.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • K
        K
        KjellO
        wrote on last edited by
        #3

        Just curious... is there a chance for a fix for this issue? No panic, otherwise I'll go for a "normal" build.

        Thanks!

        1 Reply Last reply
        0
        • V
          V
          Victor Kirhenshtein
          wrote on last edited by
          #4

          Hi!

          I've fixed that. You can download updated source archive from https://www.netxms.org/download/rc/netxms-1.2.1-rc1.tar.gz. I also add two new options for configure:

          --with-all-static

          linker will produce really static executable, with system libraries statically linked too;

          --with-static-subagents=list

          specify list of subagents to be included into static agent. For example,

          ./configure --with-static-agent --with-static-subagents="logwatch ping"

          will produce static agent with only logwatch and ping subagents.

          Best regards,
          Victor

          1 Reply Last reply
          0
          • K
            K
            KjellO
            wrote on last edited by
            #5

            Hi, thank you very much for your efforts!

            But, I wonder if something still is broken?

            Building on an old Debian etch (32-bit) with configuration

            ./configure --with-static-agent --with-all-static --with-static-subagents="pingcheck"
            

            Configure script ok, but make complains:

            ../../../tools/create_ssa_list.sh "linux pingcheck" > static_subagents.cpp
              CXX    static_subagents.o
            make[4]: *** No rule to make target `../../../src/db/libnxdb/libnxdb.la', needed by `nxagentd'.  Stop.
            

            Also, seems to be some 64bit issues in RC1. When building on SuSE 64 bit, I get this:

              CXX    extagent.o
            extagent.cpp: In function CSCPMessage* ReadMessageFromPipe(void*, void*):
            extagent.cpp:131:34: error: cast from void to SOCKET loses precision
            make[4]: *** [extagent.o] Error 1
            

            Changed file include/nms_common.h, from int to intptr_t in the SOCKET typedef:

            typedef intptr_t SOCKET;
            

            Got a bit longer, next error was

            push.cpp: In function void* PushConnector(void*):
            push.cpp:245:63: error: cannot convert size_t* to socklen_t* for argument 3 to int accept(int, sock  addr*, socklen_t*)
            make[4]: *** [push.o] Error 1
            

            changed push.cpp,

             from: size_t size = sizeof(struct sockaddr_un);
             to: socklen_t size = sizeof(struct sockaddr_un);
            

            Then a normal build is ok, but when building with
            ./configure --with-static-agent --with-all-static

            it complains,

            /usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: attempted static link of dynamic object `../../../src/db/libnxdb/.libs/libnxdb.so'
            collect2: ld returned 1 exit status
            

            I think I give up on this for now 🙂 Will try again when next release is out. Again, thanks for your support.

            1 Reply Last reply
            0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            Powered by NodeBB Contributors
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups