Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Using Armadillo library on QT creator
QtWS25 Last Chance

[SOLVED] Using Armadillo library on QT creator

Scheduled Pinned Locked Moved General and Desktop
libraryarmadillolinkingcompile
7 Posts 3 Posters 7.0k 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.
  • R Offline
    R Offline
    RDiGuida
    wrote on 8 Jun 2015, 15:11 last edited by RDiGuida 6 Nov 2015, 09:12
    #1

    Hello, I am trying to run a test for the Armadillo library (5.2) which I have downloaded and I have uncommented the lines cmakedefine ARMA_USE_LAPACK and cmakedefine ARMA_USE_BLAS in the config.hpp.cmake file as recommended for Windows here. I have set the .pro file as such

    QT       += core
    
    QT       -= gui
    
    TARGET = armatest
    CONFIG   += console
    CONFIG   -= app_bundle
    
    TEMPLATE = app
    
    SOURCES += \
        main.cpp
    
    INCLUDEPATH += C:\Armadillo\include
    
    
    LIBS += -LC:\Armadillo\lib_win64
        -llapack_win64_MT
        -lblas_win64_MT
    

    Considering that lapack_win64_MT.lib and blas_win64_MT.lib are the libraries located in C:\Armadillo\lib_win64\

    The error I keep on receiving is

    undefined reference to 'dgetrf_'
    undefined reference to 'ddot_'
    undefined reference to 'dgemv_'
    

    etc. as if I am not linking the libraries properly. What am I missing?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Pablo J. Rogina
      wrote on 8 Jun 2015, 16:13 last edited by
      #2

      @RDiGuida said:
      Just seaching "undefined reference to 'dgetrf_'" I came across this post which seems to refer the issue as a linking problem based on the order of LAPACK and BLAS libraries. If the suggestion works for you, please confirm here. Good luck!

      Upvote the answer(s) that helped you solve the issue
      Use "Topic Tools" button to mark your post as Solved
      Add screenshots via postimage.org
      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 8 Jun 2015, 21:23 last edited by
        #3

        Hi,

        To add to @Pablo-J.-Rogina: is it a typo or are you missing the backslashes on the LIBS lines ?

        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
        0
        • R Offline
          R Offline
          RDiGuida
          wrote on 9 Jun 2015, 10:10 last edited by
          #4

          Update: I found out one of the problems was the wrong version for the BLAS and LAPACK libraries. I downloaded the 32-bit and compiles fine with Code::Blocks but I still have the problem with Qt creator (which uses the same compiler as Code::Blocks!). I reckon it may be a problem with the .pro file. @SGaist where should I add the backslashes? Can you give me an example?

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 9 Jun 2015, 22:10 last edited by SGaist 6 Sept 2015, 22:11
            #5
            LIBS += \ 
                -LC:\Armadillo\lib_win64 \
                -llapack_win64_MT \
                -lblas_win64_MT
            

            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
            • R Offline
              R Offline
              RDiGuida
              wrote on 10 Jun 2015, 10:45 last edited by
              #6

              Yes! That was the problem! Thanks @SGaist

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 10 Jun 2015, 22:49 last edited by
                #7

                You're welcome !

                Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

                Up voting the answers that helped you will also allow other users to more easily find them.

                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
                0

                2/7

                8 Jun 2015, 16:13

                topic:navigator.unread, 5
                • Login

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