简体   繁体   English

为Android NDK交叉编译MPICH库

[英]Cross-compiling a MPICH library for Android NDK

My goal is to run MPICH on Android phones. 我的目标是在Android手机上运行MPICH。 I'm using Debian Jessie. 我正在使用Debian Jessie。 I thought that I'll achieve that following this tutorial: http://hex.ro/wp/projects/personal-cloud-computing/compiling-mpich2-for-android-and-running-on-two-phones/ but instead of creating toolchain with Buildroot I decided to create it from Android NDK, as on this site: http://www.threadstates.com/articles/2013/setting-up-an-android-cross-compiling-environment-with-the-ndk.html I tried to use MPICH library versions 2.1.4, 2.1.5, 3.0.4 and configure it using command: 我以为可以通过本教程来实现: http : //hex.ro/wp/projects/personal-cloud-computing/compiling-mpich2-for-android-and-running-on-two-phones/,但是使用Buildroot创建工具链的过程,我决定从Android NDK创建它,如以下网站所示: http : //www.threadstates.com/articles/2013/setting-up-an-android-cross-compiling-environment-with-the -ndk.html我尝试使用MPICH库版本2.1.4、2.1.5、3.0.4 ,并使用以下命令对其进行配置:

sudo CFLAGS=" -march=armv5 -mfpu=vfp -static "
 CC=/home/cerbia/android/bin/arm-linux-androideabi-gcc ./configure
 --prefix=/home/cerbia/old --host=arm-linux --with-pm=smpd --disable-f77 --disable-fc

but I still had this kind of error: 但是我仍然有这种错误:

configure: error: SMPD requires MD5 support, and configure could not find either md5_calc in md5.h or MD5 in openssl/md5.h 配置:错误:SMPD需要MD5支持,并且配置在md5.h中找不到md5_calc或在openssl / md5.h中找不到MD5

I found, that it is connected with openssl version and I tried to follow this instruction: 我发现它与openssl版本有关,因此我尝试遵循以下说明:

Download, compile, modify and install OpenSSL to the NDK directory. 下载,编译,修改OpenSSL并将其安装到NDK目录。 cd ~ wget www.openssl.org/source/openssl-1.0.0g.tar.gz tar xvzf cd〜wget www.openssl.org/source/openssl-1.0.0g.tar.gz tar xvzf

openssl-1.0.0g.tar.gz cd openssl-1.0.0g ./config no-asm shared --prefix=$ANDROID_ROOT/platforms/android-3/arch-arm/usr openssl-1.0.0g.tar.gz cd openssl-1.0.0g ./config no-asm shared --prefix = $ ANDROID_ROOT / platforms / android-3 / arch-arm / usr

edit Makefile: 编辑Makefile:
CC= arm-linux-gnueabi-gcc-4.6 CC = arm-linux-gnueabi-gcc-4.6

CFLAG= -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DOPENSSL_N -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -fPIC CFLAG = -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DOPENSSL_N -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -fPIC

DEPFLAG= -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_R C5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE DEPFLAG = -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MD2 -DOPENSSL_NO_R C5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_STORE

PEX_LIBS= PEX_LIBS =

EX_LIBS= -ldl EX_LIBS = -ldl

EXE_EXT= EXE_EXT =

ARFLAGS= ARFLAGS =

AR= arm-linux-gnueabi-ar $(ARFLAGS) r AR = arm-linux-gnueabi-ar $(ARFLAGS)r

RANLIB= arm-linux-gnueabi-ranlib RANLIB = arm-linux-gnueabi-ranlib

NM= arm-linux-gnueabi-nm NM = arm-linux-gnueabi-nm

PERL= /usr/bin/perl PERL = / usr / bin / perl

TAR= tar TAR =焦油

TARFLAGS= --no-recursion TARFLAGS =-无递归

MAKEDEPPROG= gcc MAKEDEPPROG = gcc

LIBDIR=lib LIBDIR = lib

Than instead of HIPL I tried to cross-compile MPICH in the analogous way as below 比起HIPL,我尝试通过以下类似方式交叉编译MPICH

Download and cross-compile HIPL. 下载并交叉编译HIPL。 cd ~ bzr co lp:hipl trunk cd trunk edit configure.ac and comment out all AM_CFLAGS autoreconf --install cd〜bzr co lp:hipl trunk cd trunk编辑configure.ac并注释掉所有AM_CFLAGS autoreconf --install

./configure --disable-gcc-warn --disable-firewall -host=arm-linux ./configure --disable-gcc-warn --disable-firewall -host = arm-linux

CC=arm-linux-gnueabi-gcc-4.6 CC = arm-linux-gnueabi-gcc-4.6

CPPFLAGS="-I$ANDROID_ROOT/platforms/android-3/arch-arm/usr/include" CPPFLAGS =“-I $ ANDROID_ROOT / platforms / android-3 / arch-arm / usr / include”

CFLAGS="-nostdlib" CFLAGS =“-nostdlib”

LDFLAGS="-Wl,-rpath-link=$ANDROID_ROOT/platforms/android-3/arch-arm/usr/lib,-L$ANDROID_ROOT/platforms/android-3/arch-arm/usr/lib" LDFLAGS =“-Wl,-rpath-link = $ ANDROID_ROOT / platforms / android-3 / arch-arm / usr / lib,-L $ ANDROID_ROOT / platforms / android-3 / arch-arm / usr / lib”

LIBS="-lc" make make all-am make[1]: Entering directory `/home/mkomu/projects/hipl-bzr/arm' CC lib/core/builder.lo In file LIBS =“-lc” make make all-am make [1]:输入目录`/ home / mkomu / projects / hipl-bzr / arm'CC lib / core / builder.lo在文件中

included from lib/core/debug.h:34:0, 包含在lib / core / debug.h:34:0中,

  from lib/core/crypto.h:43, from lib/core/builder.c:100: lib/core/protodefs.h:917:5: error: unknown type name 'in_port_t' 

lib/core/protodefs.h:929:5: error: unknown type name 'in_port_t' lib / core / protodefs.h:929:5:错误:未知类型名称'in_port_t'

lib/core/protodefs.h:1027:5: error: unknown type name 'in_port_t' lib / core / protodefs.h:1027:5:错误:未知类型名称'in_port_t'

lib/core/protodefs.h:1036:5: error: unknown type name 'in_port_t' lib / core / protodefs.h:1036:5:错误:未知类型名称'in_port_t'

lib/core/protodefs.h:1043:5: error: unknown type name 'in_port_t' lib / core / protodefs.h:1043:5:错误:未知类型名称'in_port_t'

lib/core/protodefs.h:1054:5: error: unknown type name 'in_port_t' lib / core / protodefs.h:1054:5:错误:未知类型名称'in_port_t'

lib/core/protodefs.h:1055:5: error: unknown type name 'in_port_t' ... lib / core / protodefs.h:1055:5:错误:未知类型名称'in_port_t'...

it comes from site: bugs.launchpad.net/hipl/+bug/715126 它来自网站:bugs.launchpad.net/hipl/+bug/715126

but I got the same errors as person there.. 但是我和那里的人有同样的错误。

make[8]: Wejście do katalogu `/home/cerbia/old/mpich2-1.3.2/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp' CC tcp_finalize.c In file included from tcp_finalize.c:7:0: tcp_impl.h:108:89: error: unknown type name 'in_port_t' make[8]: * [tcp_finalize.o] Błąd 1 make [8]:添加//home/cerbia/old/mpich2-1.3.2/src/mpid/ch3/channels/nemesis/nemesis/netmod/tcp'CC tcp_finalize.c在tcp_finalize.c包含的文件中: 7:0:tcp_impl.h:108:89:错误:未知的类型名称“ in_port_t” make [8]: * [tcp_finalize.o]Błąd1

Do you have any advices what I should try to make it working? 您对我应该如何使它正常工作有什么建议?

In Linux, in_port_t is typedefed as uint16_t in netinet/in.h . 在Linux中,在netinet/in.h in_port_t类型定义为uint16_t The only place this typedef is used is in the definition of sockaddr_in . 使用此typedef的唯一位置是sockaddr_in的定义。

The Android NDK does not define or use in_port_t , but instead uses unsigned short int . Android NDK不定义或使用in_port_t ,而是使用unsigned short int To compile code using the Android NDK, either typedef in_port_t or replace it with unsigned short int . 要使用Android NDK编译代码,请输入typedef in_port_t或将其替换为unsigned short int

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM