Trying to build for armhf (Nvidia K1)

Help
2014-06-20
2015-01-06
  • William Smith

    William Smith - 2014-06-20

    I just checked out the svn repo, but I am not seeing any Linux makefiles anywhere. According to the readme.txt, I should be able to run qmake in the source folder, but there are no makefiles there.

     
  • Andriy Golovnya

    Andriy Golovnya - 2014-06-20

    Hi, the brave one!

    1. you need Qt and NV CUDA toolset for your target platform installed
    2. run /your/traget/tools/install/path/bin/qmake -> you will see Makefiles afterwards
    3. run 'make' to get target binary
    4. copy the binary to a target platform with all dependencies (all libs required)
    5. enjoy!?

    something like this

     
  • William Smith

    William Smith - 2014-06-20

    I found the makefile. My mistake, it was in the root of the svn repo all along.

    I've got qmake and all that installed and should have the libraries. I tried a Cuda "Hello World" and that worked.

    However, for cuda-z, I had to comment out the arch values under the CUFLAGS. compute_10, for example, was reported as unsupported. I get a bit further using compute_30, but I am getting an error:
    nvcc fatal : A Single input file is required for a non-link phase when an output file is specified.

     
  • Andriy Golovnya

    Andriy Golovnya - 2014-06-20

    The specified error message is not known to me.
    Something got wrong with a command line options I suppose. Check what it drops to console during compile if it's reasonable.

    What HW you are playing with?

     
  • William Smith

    William Smith - 2014-06-20

    Nvidia Jetson board with a K1 on it.
    Here's the full message:
    perl bld/bin/make_build_svn.pl src/build.h
    nvcc -Xcompiler -pipe,-Wall,-W \gen -DQT_NO_DEBUG -DQT_WIDGETS_LIB
    -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -c -o bld/o/cudainfo.o
    src/cudainfo.cu
    nvcc fatal : A single input file is required for a non-link phase
    when an outputfile is specified
    make: *** [bld/o/cudainfo.o] Error 255

    I think it may be that "\gen" line in there.
    I will try modifying it and see what happens.

     
  • Andriy Golovnya

    Andriy Golovnya - 2014-06-20

    Yep, "\gen".. Check cuda-z.pro again and compile.

     
  • William Smith

    William Smith - 2014-06-20

    It's doing something now. cicc is running at 96% cpu at the moment. It's taking quite a while.

     
  • Andriy Golovnya

    Andriy Golovnya - 2014-06-20

    Half way ti success! Wait a bit it can take a while.

     
  • William Smith

    William Smith - 2014-06-20

    Now I am getting quite a bit further, but I get:
    fatal error: QHttp: No such file or directory
    #include <QHttp>

     
  • Andriy Golovnya

    Andriy Golovnya - 2014-06-20

    What version of Qt do you use to compile?

     
  • William Smith

    William Smith - 2014-06-20

    I have version 5, and libqt4-dev. I also tried installing libqt4-qt3support (Ubuntu).

     
  • Andriy Golovnya

    Andriy Golovnya - 2014-06-20

    qt3support is not required.
    What is a target platform in your case? libqt4-dev is a packet for your host CPU.

     
  • William Smith

    William Smith - 2014-06-20

    I am building everything natively, on the device.

     
  • Andriy Golovnya

    Andriy Golovnya - 2014-06-20

    QHttp is missing. Perhaps some package is missing on your system. Odd case.

     
  • William Smith

    William Smith - 2014-06-20

    I am almost there. I need to get qmake to add -lm. I am getting:
    /usr/bin/ld: bld/o/cudainfo.o: undefined reference to symbol 'dlsym@@GLIBC_2.4'

     
  • Andriy Golovnya

    Andriy Golovnya - 2014-06-21

    Hmm, try to add -ldl too.
    When you succeed show me what you got, it's interesting.

     
  • William Smith

    William Smith - 2014-06-21

    Hi, I finally got it to build and run. Here are the steps I needed, before I forget:
    - comment out all the -gencode lines in the .pro file, except for the one that has arch=compute_32, code=sm_32
    - comment out #define CZ_USE_HTTP from czdialog.h
    - manually add -lm -ldl -lrt to the end of the last g++ compile line in the build process. This builds the binary. I could never figure out how to add those flags inside the .pro file.

     
  • Andriy Golovnya

    Andriy Golovnya - 2014-06-22

    Looks great! My congratulations!

    Regarding adding libraries to a .pro file, it's easy. Here is a reference list http://qt-project.org/doc/qt-4.8/qmake-variable-reference.html for nearly all qmake variables. Those interesting for libraries are "QMAKE_LIBS+=m dl rt" or "QMAKE_LFLAGS+=-lm -ldl -lrt". Try this out to be sure.

    It seams like you are playing with some tegra device with ubuntu installed on it. Is it correct?
    We could integrate your changes in a main tree so people can compile it easily like:

    qmake CONFIG+=tegra && make

    But I need your support here for testing it. Are you Ok with this?

    Have a pleasant weekend!

     
  • William Smith

    William Smith - 2014-06-22

    Sure, I can test. Glad to help.

     
  • William Smith

    William Smith - 2014-06-24

    I've tested the different flag options: "QMAKE_LIBS+=m dl rt" and "QMAKE_LFLAGS+=-lm -ldl -lrt"

    With QMAKE_LIBS, I still needed to add -l in front of the library names.

    QMAKE_LIBS added the flags to the compiler command line, but it didn't add them at the end of the g++ command line. That was the only way I could get it to work - to add it at the end.

    I will ask around at work - there are some Qt experts.

     
  • William Smith

    William Smith - 2014-06-24

    I think adding the flags should not actually break other Linux/Unix builds, so a separate configuration for Linux4Tegra might not be needed.

     
  • Andriy Golovnya

    Andriy Golovnya - 2014-06-24

    Separate tegra build is needed for arch=compute_32, code=sm_32 at least. But you are totally right the library options should be added to the main linux flags list.

     
  • Andriy Golovnya

    Andriy Golovnya - 2014-06-28

    Hi there! I've managed to implement some of your proposals today.

    Do a clean checkout and try following: qmake CONFIG+=sm_32 && make

    You still have to comment QHttp out manually. I have to find out what is wrong there before I do any fixing.

    Best regards!

     
    • sunset

      sunset - 2015-01-06

      You still have to comment QHttp out manually. I have to
      find out what is wrong there before I do any fixing.

      Looks like qhttp is now separate:
      http://qt-project.org/forums/viewthread/24466

       

Log in to post a comment.