Page 1 of 1

Compile abinit 7.6 under raspbian (raspberry pi)

Posted: Thu Mar 13, 2014 4:17 pm
by Magniff
Hello there)
Currently I am experiencing some difficulties with compiling abinit 7.6 under raspberry pi (yep, i do understand that this task is practically useless).
The problem is that RPi has an ARM11 like cpu, which based on deprecated armv6 arch (v7 arch supported just great, no problem with ARM CortexA9 and so on).

Code: Select all

./configure yields following:
Summary of important options:

  * C compiler      : gnu version 4.6
  * Fortran compiler: gnu version 4.6
  * architecture    :   ( bits)

  * debugging       : basic
  * optimizations   : standard

  * OpenMP enabled  : no (collapse: ignored)
  * MPI    enabled  : no
  * MPI-IO enabled  : no
  * GPU    enabled  : no (flavor: none)

  * TRIO   flavor = none
  * TIMER  flavor = abinit (libs: ignored)
  * LINALG flavor = netlib-fallback (libs: ignored)
  * ALGO   flavor = none (libs: ignored)
  * FFT    flavor = none (libs: ignored)
  * MATH   flavor = none (libs: ignored)
  * DFT    flavor = none


So, it seams that linalg libs from tarballs are not usable. Open-BLAS could not be compilled from src for v6 arch.
What would you advise?

Re: Compile abinit 7.6 under raspbian (raspberry pi)  [SOLVED]

Posted: Sun Mar 16, 2014 8:38 pm
by jbeuken
Hi,

LINALG flavor = netlib-fallback
...
So, it seams that linalg libs from tarballs are not usable.


why did you say that ?
the build system said that external linalg library is not available and therefore, it use the linalg library provided by abinit (= netlib and fallback)
PS : I have tested this, and it works...

but, on my raspberry under Debian 7, I have installed :

Code: Select all

apt-get install gfortran
apt-get install liblapack-dev


and I use this shell script to configure :

Code: Select all

#!/bin/bash
#
export CC=gcc
export CFLAGS="-O2"
export CXX=g++
export CXXFLAGS="-O2"
#
export F77=gofrtran
export FFLAGS="-O2 -g"
export FC=gfortran
export FCFLAGS="-O2 -g"
#
./configure \
     --with-trio-flavor=none \
     --with-dft-flavor=none \
     --with-linalg-flavor=netlib \
     --with-linalg-libs="-L/usr/lib -llapack -lblas"


but, due to a buggy version of gcc 4.6.3 under "Debian 4.6.3-14+rpi1" , you must also apply two patches on code :

1) in src/incs/abi_common.h

Code: Select all

--- abi_common.h   2014-03-16 19:24:55.051144814 +0000
+++ abi_common.h_new   2014-03-16 19:24:41.271794157 +0000
@@ -34,7 +34,7 @@
 /** #define DEBUG_MODE   **/
 
 /** define WHEREARG __FILE__,__LINE__**/
-#if defined(HAVE_FC_LONG_LINES) || defined(__INTEL_COMPILER)
+#if defined(HAVE_FC_LONG_LINES) || defined(__INTEL_COMPILER) || defined (FC_GNU)
 # define NEWLINE ;
 #else
 # define NEWLINE \newline


2) in src/42_libpaw/m_gaussfit.F90

Code: Select all

--- m_gaussfit.F90   2014-03-16 19:28:21.431421198 +0000
+++ m_gaussfit.F90_new   2014-03-16 19:28:00.682398977 +0000
@@ -2537,7 +2537,7 @@
 !!
 !! SOURCE
 
-subroutine gaussfit_apply_constrains(const,limit,nparam,param_in,param_out)
+subroutine gaussfit_apply_constrains(const1,limit,nparam,param_in,param_out)
 
 
 !This section has been created automatically by the script Abilint (TD).
@@ -2552,7 +2552,7 @@
  integer,parameter::positive=2
  integer,parameter::restricted=3
  integer,intent(in)::nparam
- integer,intent(in)::const(nparam)
+ integer,intent(in)::const1(nparam)
  real(dp),intent(in)::limit(nparam),param_in(nparam)
  real(dp),intent(out)::param_out(nparam)
  !
@@ -2563,9 +2563,9 @@
 !
  param_out=param_in
  do ii=1,nparam
-   if(const(ii)==positive) param_out(ii)=abs(param_in(ii))
+   if(const1(ii)==positive) param_out(ii)=abs(param_in(ii))
 ! 
-   if(const(ii)==restricted) then
+   if(const1(ii)==restricted) then
      if(param_in(ii)<limit(ii)) then
        param_out(ii)=limit(ii)
      end if


you can start the compilation with : make
now, you have time to drink 3 beers and eat two pizza :lol:

when, it finished, you can start some checks :

Code: Select all

root@pi:~/WorkSpace/abinit-7.6.2/tests# ./runtests.py fast
Regenerating database...
Saving database to file /root/WorkSpace/abinit-7.6.2/tests/test_suite.cpkl
Running ntests = 26, MPI_nprocs = 1, py_nthreads = 1...
[fast][t00] succeeded
...
[fast][t30] succeeded
Test suite completed in 655.73 s (average time for test = 55.46 s, stdev = 65.86 s)
failed: 0, succeeded: 11, passed: 0, skipped: 0, disabled: 0
[fast][t27-t28-t29] has run_etime 224.43 s
Suite   failed  passed  succeeded  skipped  disabled  run_etime  tot_etime
fast         0       0         11        0         0     610.08     649.32


I succeeded also with the same recipe with a UDOO ( quad raspbery version : http://shop.udoo.org/eu/product/udoo-quad.html )

regards...

Re: Compile abinit 7.6 under raspbian (raspberry pi)

Posted: Sat Mar 22, 2014 1:42 pm
by Magniff
Yep, it seams i took too much beer that day) Moreover, in attempt to use OpenBlas - alternative linalg lib, I actually found a bug. It fixed now.
https://github.com/xianyi/OpenBLAS/issues/355

So, thanx, and best wishes!
Magniff