Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Linking issues with armadillo
Forum Updated to NodeBB v4.3 + New Features

Linking issues with armadillo

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
5 Posts 3 Posters 1.5k Views 1 Watching
  • 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.
  • T Offline
    T Offline
    thmann
    wrote on last edited by
    #1

    Hi,
    I am trying to get armadillo running with QT Creator on macOS Mojave 10.14. I have located the unpacked armadillo archive in my user directory. My .pro file currently looks like this:

    TEMPLATE = app
    CONFIG += console c++11
    CONFIG -= app_bundle
    CONFIG -= qt

    SOURCES +=
    main.cpp

    LIBS += -larmadillo
    INCLUDEPATH += /Users/xyz/armadillo-9.100.6/include

    Upon running I get "library not found for -larmadillo". On windows-related threads I have seen people also adding a library path to LIBS, something like LIBS += -L/path/armadillo-xyz/lib_win64. However, I do not see which -L path would be relevant for MacOS. Could this be the issue or is it something else?

    aha_1980A 1 Reply Last reply
    0
    • T thmann

      Hi,
      I am trying to get armadillo running with QT Creator on macOS Mojave 10.14. I have located the unpacked armadillo archive in my user directory. My .pro file currently looks like this:

      TEMPLATE = app
      CONFIG += console c++11
      CONFIG -= app_bundle
      CONFIG -= qt

      SOURCES +=
      main.cpp

      LIBS += -larmadillo
      INCLUDEPATH += /Users/xyz/armadillo-9.100.6/include

      Upon running I get "library not found for -larmadillo". On windows-related threads I have seen people also adding a library path to LIBS, something like LIBS += -L/path/armadillo-xyz/lib_win64. However, I do not see which -L path would be relevant for MacOS. Could this be the issue or is it something else?

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @thmann

      Could this be the issue

      Sure. The linker has a fixed search path (which I know better on Windows and Linux, but mac should be similar to Linux). So you need to specify the directory, where libarmadillo.so (I guess that should be the name) resides if the lib is outside the default search paths.

      Please note that you need to specify the -L/path/to/library before the -larmadillo, otherwise it will not work.

      Qt has to stay free or it will die.

      1 Reply Last reply
      2
      • T Offline
        T Offline
        thmann
        wrote on last edited by thmann
        #3

        I'm afraid I don't have any such file on my system. Possibly interesting files I could find are "libarmadillo.9.10.6.dylib" right in the armadillo directory and "wrapper.cpp.o" in ./CMakeFiles/armadillo.dir/src which both seem to have been created at the runtime library installation with cmake. These are not the same as the shared library format you are proposing, right? Sorry for asking this question, I am rather new to these terms. Anyway, the armadillo readme only provides instructions on how to compile directly. The standard advice is

        g++ example1.cpp -o example1 -O2 -larmadillo

        while they also tell you how to compile without using the runtime library by

        g++ example1.cpp -o example1 -O2 -I /home/blah/armadillo-7.200.3/include -DARMA_DONT_USE_WRAPPER -lblas -llapack

        Can I somehow reference the installed runtime library if I do everything in QT Creator?
        Also, the first of the above commands did not yield any error at compilation. At runtime I got

        dyld: Library not loaded: @rpath/libhdf5.101.dylib
        Referenced from: /usr/local/lib/libarmadillo.9.dylib
        Reason: image not found

        It seems to think I have the dylib in /usr/local/lib/libarmadillo.9.dylib while actually my armadillo directory is /Users/xyz/armadillo-9.100.6 and there is a /Users/xyz/armadillo-9.100.6/libarmadillo.9.dylib alias pointing to /Users/xyz/armadillo-9.100.6/libarmadillo.9.100.6.dylib.

        aha_1980A 1 Reply Last reply
        0
        • T thmann

          I'm afraid I don't have any such file on my system. Possibly interesting files I could find are "libarmadillo.9.10.6.dylib" right in the armadillo directory and "wrapper.cpp.o" in ./CMakeFiles/armadillo.dir/src which both seem to have been created at the runtime library installation with cmake. These are not the same as the shared library format you are proposing, right? Sorry for asking this question, I am rather new to these terms. Anyway, the armadillo readme only provides instructions on how to compile directly. The standard advice is

          g++ example1.cpp -o example1 -O2 -larmadillo

          while they also tell you how to compile without using the runtime library by

          g++ example1.cpp -o example1 -O2 -I /home/blah/armadillo-7.200.3/include -DARMA_DONT_USE_WRAPPER -lblas -llapack

          Can I somehow reference the installed runtime library if I do everything in QT Creator?
          Also, the first of the above commands did not yield any error at compilation. At runtime I got

          dyld: Library not loaded: @rpath/libhdf5.101.dylib
          Referenced from: /usr/local/lib/libarmadillo.9.dylib
          Reason: image not found

          It seems to think I have the dylib in /usr/local/lib/libarmadillo.9.dylib while actually my armadillo directory is /Users/xyz/armadillo-9.100.6 and there is a /Users/xyz/armadillo-9.100.6/libarmadillo.9.dylib alias pointing to /Users/xyz/armadillo-9.100.6/libarmadillo.9.100.6.dylib.

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @thmann I'm sorry, but my mac knowledge is too limited to answer this correctly.

          Qt has to stay free or it will die.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi and welcome to devnet,

            Did you call make install after building armadillo ?

            You can add the DYLD_LIBRARY_PATH environment variable in the Run part of the Project panel in Qt Creator and list the folders where the dependencies of your libraries can be found.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved