Ubuntu 13.10 makes it very easy to cross-compile Quantum-Espresso for the arm CPUs. Install the following packages: gcc-arm-linux-gnueabihf, gcc-4.8-arm-linux-gnueabihf and gfortran-4.8-arm-linux-gnueabihf, then create the missing link:sudo ln -s /usr/bin/arm-linux-gnueabihf-gfortran-4.8 /usr/bin/arm-linux-gnueabihf-gfortran
Next, get the latest QE version from SVN, configure and compile with:./configure --with-internal-blas --with-internal-lapack --disable-shared --disable-parallel --host=arm-linux-gnueabihf
make pw
Since I don't have the proper hardware (arm7 CPU with FPU), I've tested it in the Android emulator. I've created a 4.4.2 AVD image and used adb to interact with the emulator:
adb shell# mkdir /data/user/espresso# exitadb push si-scf.in /data/user/espressoadb push Si-vbc.UPF /data/user/espressoadb push espresso/PW/src/pw.x /data/user/espressoadb shell# cd /data/user/espresso# ./pw.x <si-scf.in >si-scf.outAlternatively, install qemu-user-static package and run with QEMU on the host machine:
qemu-arm-static ./pw.x <si-scf.in >si-scf.outOn my workstation, in both cases, the calculation takes ~24 s.
I've successfully compiled and run PW on my Android phone. On this page you will find my gcc toolchain including gfortran, my customized make.sys, and the pw.x executable for ARM CPUs.
./configure --disable-shared --with-internal-blas --with-internal-lapack CC=arm-linux-androideabi-gcc FC=arm-linux-androideabi-gfortran F77=arm-linux-androideabi-gfortranthen edit the make.sys to use the internal FFTW v2.
ceresoli@milano:/scratch/ceresoli/ANDROID/silicon$ file pw.xpw.x: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not strippedceresoli@milano:/scratch/ceresoli/ANDROID/silicon$ qemu-arm ./pw.x <si-scf.in Program PWSCF v.4.3.1 starts on 16Jun2011 at 10:13:56 This program is part of the open-source Quantum ESPRESSO suite for quantum simulation of materials; please cite "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); URL http://www.quantum-espresso.org", in publications or presentations arising from this work. More details at http://www.quantum-espresso.org/wiki/index.php/Citing_Quantum-ESPRESSO...! total energy = -15.82060780 Ry... PWSCF : 1m51.46s CPU 1m52.78s WALL This run was terminated on: 10:15:49 16Jun2011 =------------------------------------------------------------------------------= JOB DONE.=------------------------------------------------------------------------------=The host machine is an Intel(R) Core(TM)2 Duo CPU E8400@3.00GHz running Ubuntu 10.04 64bit.
I've installed the Android SDK platform-tools and I've connected the device via USB.
ceresoli@milano:/scratch/ceresoli/ANDROID/android-sdk-linux_x86/platform-tools$ sudo ./adb shell$ su# cat /proc/cpuinfoProcessor : ARMv6-compatible processor rev 5 (v6l)BogoMIPS : 245.61Features : swp half thumb fastmult vfp edsp javaCPU implementer : 0x41CPU architecture: 6TEJCPU variant : 0x1CPU part : 0xb36CPU revision : 5Hardware : GT-S5830 BoardRevision : 0005Serial : 3432fe4a638700ec# cat /proc/meminfoMemTotal: 284444 kBMemFree: 5708 kBBuffers: 1420 kB# cd /data/misc/ceresoli# ls -l-rwxrwxr-x root root 3414 2011-06-15 22:38 chello-rwxrwxr-x root root 422145 2011-06-15 22:38 fhello-rwxrwxr-x root root 8658692 2011-06-15 22:38 pw.x-rwxrwxr-x root root 65267 2011-06-15 22:38 Si.pz-vbc.UPF-rwxrwxr-x root root 436 2011-06-16 11:29 si-scf.indrwxrwxrwx root root 2011-06-16 11:23 silicon.save# ./pw.x <si-scf.in Program PWSCF v.4.3.1 starts on 16Jun2011 at 11:30: 1 This program is part of the open-source Quantum ESPRESSO suite for quantum simulation of materials; please cite "P. Giannozzi et al., J. Phys.:Condens. Matter 21 395502 (2009); URL http://www.quantum-espresso.org", in publications or presentations arising from this work. More details at http://www.quantum-espresso.org/wiki/index.php/Citing_Quantum-ESPRESSO...! total energy = -15.82060780 Ry... PWSCF : 40.50s CPU 41.60s WALL This run was terminated on: 11:30:42 16Jun2011 =------------------------------------------------------------------------------= JOB DONE.=------------------------------------------------------------------------------=The phone is a Samsung Galaxy ACE. The calculation takes 40 s compared to 110 s on the emulator. However, on the Intel E8400 desktop, the job runs in less than 1 second!