[mpich-discuss] How to configure MPICH build to create linux x86 cross-compiler for ARM?

Kenneth Raffenetti raffenet at mcs.anl.gov
Fri Jun 2 10:37:02 CDT 2017


After installing the 'crossbuild-essential-armel' package, configure 
finds the right compilers without the need to specify them, so this 
should also work:

./configure --build=x86_64-linux-gnu --host=arm-linux-gnueabi 
--disable-fortran

file examples/cpi
examples/cpi: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), 
dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 3.2.0, 
BuildID[sha1]=b24df425c14a6754bc97dce22580827d3d65dbfb, not stripped

mpicc -show 
 
 
 
                  arm-linux-gnueabi-gcc -I/sandbox/mpich/i/include 
-L/sandbox/mpich/i/lib -Wl,-rpath -Wl,/sandbox/mpich/i/lib 
-Wl,--enable-new-dtags -lmpi

Ken

On 06/02/2017 10:15 AM, Kenneth Raffenetti wrote:
> Hi Alex,
> 
> One thing to understand is that MPICH does not actually build compiler 
> tools, so the --target option is not used. mpicc and friends are only 
> wrapper scripts. Here is how I was able to configure/build MPICH on my 
> laptop (Ubuntu 16.10) to cross-compile binaries arm-linux-gnueabi. 
> Fortran is disabled since it requires additional steps.
> 
> ./configure --build=x86_64-linux-gnu --host=arm-linux-gnueabi 
> CC=/usr/bin/arm-linux-gnueabi-gcc-6 CXX=/usr/bin/arm-linux-gnueabi-g++-6 
> --disable-fortran
> 
> Ken
> 
> On 06/01/2017 10:22 AM, Alexander Rast wrote:
>> I assume you mean from the build intended for the ARM targets. In any 
>> case here they are.
>>
>> On Thu, Jun 1, 2017 at 4:04 PM, Kenneth Raffenetti 
>> <raffenet at mcs.anl.gov <mailto:raffenet at mcs.anl.gov>> wrote:
>>
>>     Hi Alex,
>>
>>     I don't have experience with this type of build, but I can try to
>>     replicate it on a system here internally. Can you provide a couple
>>     of artifacts first?
>>
>>     1. the config.log file from the top-level build directory
>>     2. the output of 'mpicc -show' from the installed build
>>
>>     Thanks,
>>     Ken
>>
>>     On 06/01/2017 10:00 AM, Alexander Rast wrote:
>>
>>         All,
>>
>>         I'm trying to build MPICH so that I can cross-compile MPI
>>         applications on my x86_64-linux system to run on an arm-linux
>>         machine. I want to emphasise that this is different from
>>         building a native ARM MPICH install that runs on ARM itself; the
>>         intent is that an x86-linux 'root' process compiles ARM MPI
>>         application binaries and distributes them to the ARM cores. I
>>         have a separate build for compiling the MPI binaries that lie on
>>         the root x86 system. I tried running configure with
>>         --build=x86_64-linux-gnu --host=x86_64-linux-gnu
>>         --target=arm-linux-gnueabi, but that didn't give me what I need.
>>         If, meanwhile, I try to run mpicc off the native x86 build (the
>>         MPICH installation used for running MPI applications on the root
>>         x86 system) it complains that the target type specified in the
>>         makefile (CFLAGS = -march=armv8-a -mtune=cortex-a53) isn't
>>         supported. It's not clear how one creates this sort of 'hybrid'
>>         build, running on one platform, compiling MPI applications for
>>         another.
>>
>>
>>         _______________________________________________
>>         discuss mailing list discuss at mpich.org <mailto:discuss at mpich.org>
>>         To manage subscription options or unsubscribe:
>>         https://lists.mpich.org/mailman/listinfo/discuss
>>         <https://lists.mpich.org/mailman/listinfo/discuss>
>>
>>
> _______________________________________________
> discuss mailing list     discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
_______________________________________________
discuss mailing list     discuss at mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss


More information about the discuss mailing list