This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Simple question about cross-compilation

Hi, I'm trying to cross-compile a program to run on arm versatile juno r2 development platform. 

The system where I'm compilling is:
Linux lfpm1993-virtual-machine 4.13.0-43-generic #48~16.04.1-Ubuntu SMP Thu May 17 12:56:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

The host where the application will be run is:
Linux localhost 4.9.51 #1 SMP PREEMPT Tue Feb 13 06:21:18 UTC 2018 aarch64

To compile I executed this command:
./configure --host=aarch64-linux-gnu --prefix=/data/data/papi --with-ffsll --with-walltimer=cycle --with-tls=__thread --with-virtualtimer=perfctr --with-perf-events --with-arch=aarch64 --with-CPU=arm

Followed up, by running:
sudo make
sudo make install

After the instalattion, the binary files were place here, /data/data/papi, as expected.

Typing ls shows:
bin include lib share

I then executed:
adb connect 146.193.56.204
adb push /data/data/papi /data/data/papi
adb shell
cd data/data/papi/bin/

Typing ls shows:
1|juno:/data/data/papi/bin # ls
papi_avail papi_decode papi_native_avail
papi_clockres papi_error_codes papi_version
papi_command_line papi_event_chooser papi_xml_event_info
papi_component_avail papi_mem_info
papi_cost papi_multiplex_cost

And this part is where I can't make it work, if I try to execute for example, papi_avail:
./papi_avail

This is the output message:
/system/bin/sh: ./papi_avail: No such file or directory

Trying with sh:
1|juno:/data/data/papi/bin # sh ./papi_avail
./papi_avail[2]: syntax error: '�1' unexpected
./papi_avail[1]: ELF��2@@H�@8: not found

So, my question is what i did wrong and how can I solve it?

Thanks, for your help:
Luís Martins






Parents
  • I will expand a little bit further the anwer.
    I asked PAPI support and Vince was kind enough to give me his input on this, I will copy/paste his reply:

    > It mostly just looks like "-lpthread" should be in the LFLAGS for the 
    > utils and it's not there for some reason.
    > 
    > I will see if I can figure out what's going on.
    
    It looks like it's not related to cross-compile, but rather you can make 
    this happen natively if you build statically and also have 
    --with-pthread-mutexes set (which is the default for ARM).
    
    Adding -lpthread to the end of (or after) $(PAPILIB) fixes this but have 
    no idea the proper way to get configure to do this for us.


Reply
  • I will expand a little bit further the anwer.
    I asked PAPI support and Vince was kind enough to give me his input on this, I will copy/paste his reply:

    > It mostly just looks like "-lpthread" should be in the LFLAGS for the 
    > utils and it's not there for some reason.
    > 
    > I will see if I can figure out what's going on.
    
    It looks like it's not related to cross-compile, but rather you can make 
    this happen natively if you build statically and also have 
    --with-pthread-mutexes set (which is the default for ARM).
    
    Adding -lpthread to the end of (or after) $(PAPILIB) fixes this but have 
    no idea the proper way to get configure to do this for us.


Children