This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Can't configure iperf utility for arm?

I am following the instructions on the wiki page, but it does not configure correctly.

#./configure --host=arm-linux --prefix=$HOME/install CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++
configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for arm-linux-strip... no
checking for strip... strip
checking for C++ compiler default output file name... configure: error: C++ compiler cannot create executables
See `config.log' for more details.

 

Has anyone been able to get this tool to configure correctly?

 

 

  • When cross-compiling, you must provide all of these arguments together (as mentioned in the WARNING text above) build, host and target.

    See: http://www.gnu.org/software/libtool/manual/automake/Cross_002dCompilation.html

    Also, some of the tools may not have been created originally to be cross-compiled. So, in addition to CC and CXX, i would recommend you to define all common tool variables - LD, OBJDUMP etc.

    It may also help, if you started with autogen.sh/ autoreconf if available in the package (though you may be prompted for additional dependencies; depending upon the configuration of your build host).

    Best regards,
    Sanjeev

     

  • Hello Sanjeev,

     

    Thanks for the link, it helped a little, but I still must be missing some thing.  I tried this:

    # ./configure --build=i686-pc-linux-gnu --host=arm-none-linux-gnueabi CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ LDFLAGS=-L.

    and it now seems to configure (at least I am not getting the error that stops), and it almost builds; but it seems it is still looking for something that is missing:

     

    # make

    ....

     

    arm-none-linux-gnueabi-g++ -Wall -O2   -L. -o iperf -O2  -pthread  -DHAVE_CONFIG_H Client.o Extractor.o Launch.o List.o Listener.o Locale.o PerfSocket.o ReportCSV.o ReportDefault.o Reporter.o Server.o Settings.o SocketAddr.o gnu_getopt.o gnu_getopt_long.o main.o service.o sockets.o stdio.o tcp_window_size.o ../compat/libcompat.a
    ReportCSV.o: In function `CSV_peer':
    ReportCSV.c:(.text+0x58): undefined reference to `rpl_malloc'
    Reporter.o: In function `ReportServerUDP':
    Reporter.c:(.text+0xd60): undefined reference to `rpl_malloc'
    Reporter.o: In function `ReportSettings':
    Reporter.c:(.text+0x101c): undefined reference to `rpl_malloc'
    Reporter.o: In function `InitReport':
    Reporter.c:(.text+0x1528): undefined reference to `rpl_malloc'
    Reporter.c:(.text+0x1670): undefined reference to `rpl_malloc'
    Reporter.o:Reporter.c:(.text+0x174c): more undefined references to `rpl_malloc' follow
    collect2: ld returned 1 exit status
    make[2]: *** [iperf] Error 1
    make[2]: Leaving directory `/home/msj2105/tools/iperf-2.0.4/src'
    make[1]: *** [all-recursive] Error 1
    make[1]: Leaving directory `/home/msj2105/tools/iperf-2.0.4'
    make: *** [all] Error 2

     

    thanks for any help.

     

  • Assuming you are running using bash shell, can you try running this command, before running configure:

    $ export ac_cv_func_malloc_0_nonnull=yes

    If you are using  a different shell, adapt this command.

    Best regards,
    Sanjeev


     

  • Hi,

    I am trying to use iperf version 2.0.5 in my project which is based on Dm6467 & Linux kernel 2.6.18.

    to compile the code i used the following steps

    1. export CXX=arm-none-linux-gnueabi-g++
    2. export CC=arm-none-linux-gnueabi-gcc
    3. export CPP=arm-none-linux-gnueabi-cpp

    4. export ac_cv_func_malloc_0_nonnull=yes

    5. ./configure  --host=arm-linux --build=i686-linux --prefix=<home folder>/iperf-2.0.5/temp

    my compilation went well but when i run the generated iperf executable i am getting the following error

    "iperf: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory"

    if i download the above file and try to configure then i am getting the below error

    configure: error: in `<home folder>/iperf-2.0.5':
    configure: error: C++ compiler cannot create executables
    plz help me

    Thanks,

    Gaurav

  • I see 3 potential issues in the sequence above.

    1) CC=arm-none-linux-gnueabi; but --host=arm-linux

    2) ./configure is missing the "-target" definition.

    3) prefix should be relative to your target directory - not the cross-compile env

    Can you try the following:

    $ ./configure --build=i686-linux --host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi

    $ make

    $ make install DESTDIR=<location-in-your-host-machine>

    iperf will be installed in the DESTDIR. create a tarball and extract it in your target filesystem.

    Do ensure that you have a clean backup of the filesystem just in case something goes wrong.

  • Hi Sanjeev,

    i have used the steps as mentioned by you but i am still not able to successfully run the iperf tool.

    please find below the error i am seeing

    ~ # iperf
    iperf: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

    plz share your ideas on this.

    thanks,

    gaurav

  • So you have been able to cross-compile successfully.

    Can you check if "libstdc++.so.6" actually exist on your target file system?
    If yes, check this on your target platform:
    1) Value of LD_LIBRARY_PATH
    2) Contents of /etc/ld.so.conf

  • use a compile shell ,name such as:arm_build.sh

    the content is as follow:

    #!/bin/sh
        export ac_cv_func_malloc_0_nonnull=yes
        echo “ac_cv_func_malloc_0_nonnull=yes”>arm-linux.cache   
        echo "configure for arm"
        ./configure --build=i686-linux --host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi --cache-file=arm-linux.cache
        echo "make clean"   
        make clean
        echo "make"
        make
        echo "finish"

     

    chmod 777 arm_build.sh

    ./arm_build.sh

    this compile shell was tested and worked well.

    if you still have question,pls feel free to contact nsq20032002@yahoo.com.cn or nieshuqing@126.com

     

  • Hi sanjeev,

    i have used

                    #export ac_cv_func_malloc_0_nonnull=yes
                    # ./configure --build=i686-pc-linux-gnu --host=arm-none-linux-gnueabi CC=arm-none-linux-gnueabi-gcc CXX=arm-none-linux-gnueabi-g++ LDFLAGS=-L/nfsroot/lib

                   #make


                    am able to compile iperf 2.0.5 successfully but when i used

                    #iperf

                   i got the following line

                  The program 'iperf' is currently not installed.  You can install it by typing:

                   apt-get install iperf            
                  Then i used

                  #apt-get install iperf

                 but i got the following print

                     Reading package lists... Done
                     Building dependency tree       
                    Reading state information... Done
                   The following NEW packages will be installed:
                     iperf
                  0 upgraded, 1 newly installed, 0 to remove and 171 not upgraded.
                   Need to get 54.2kB of archives.
                 After this operation, 197kB of additional disk space will be used.
               Err http://in.archive.ubuntu.com/ubuntu/ lucid/universe iperf 2.0.4-5
               404  Not Found [IP: 91.189.92.181 80]
                 Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/universe/i/iperf/iperf_2.0.4-5_i386.deb  404  Not Found [IP: 91.189.92.181 80]
                E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

                I checked the lib folder in  my target file system in my nfs, there is no libstdc.0.6. how to resolve this and compile this successfully.

    Thanks in advance.

  • The cross compiled app will work on the "target" i.e. your EVM.

    It appears that you are now trying to execute the cross compiled binary on your host machine. Unless your target filesystem supports "apt-get".

    But then, when I see "http://in.archive.ubuntu.com/ubuntu/pool/universe/i/iperf/iperf_2.0.4-5_i386.deb" the presence of "i386" in the filename indicates that you are running the command "iperf" on your host (most probably Ubuntu machine).

  • Hi sanjeev,

    Thanks for u suggestion. I'll check this now

  • Hi sanjeev,

                   It works fine. thanks again