Page 1 of 1

Segfault abinit-7.4.3, mac os, gcc/gfortran 4.6.4

Posted: Thu Oct 31, 2013 5:29 pm
by rpmuller
I'm getting errors during 'make check' and running a simple Si test case (tutorial 3.1) after building abinit v7.4.3 on MacOS using gcc/gfortran 4.6.4.

I've recompiled using -O0 and the problem still persists. I've looked through other posts in the forum, and most problems like this go away when you back down from -O2 to -O1, but I still get segfaults even at -O0.

----configure information----
Here's the summary after the configure step:

Code: Select all

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 (libs: auto-detected)
  * ALGO   flavor = none (libs: ignored)
  * FFT    flavor = none (libs: ignored)
  * MATH   flavor = none (libs: ignored)

  * DFT    flavor = none


Can anyone give me pointers on how to proceed?

Re: Segfault abinit-7.4.3, mac os, gcc/gfortran 4.6.4

Posted: Thu Oct 31, 2013 7:13 pm
by Alain_Jacques
Please be much more specific about your problem ...what kind of errors (segfault, OK but you are in the best position to provide an insight with gdb)? A classic issue under OSX is the configuration picking the OS buggy blas/lapck framework as the default ... check this with a otool -L on the abinit executable.

Kind regards,

Alain

Re: Segfault abinit-7.4.3, mac os, gcc/gfortran 4.6.4

Posted: Thu Oct 31, 2013 8:33 pm
by rpmuller
Alain, thanks very much for your reply.

Here's what otool -L generated:

Code: Select all

$ otool -L /usr/local/bin/abinit
/usr/local/bin/abinit:
        /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib (compatibility version 1.0.0, current version 1.0.0)
        /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib (compatibility version 1.0.0, current version 1.0.0)
        /opt/local/lib/gcc46/libgfortran.3.dylib (compatibility version 4.0.0, current version 4.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
        /opt/local/lib/gcc46/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
        /opt/local/lib/gcc46/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0)


Before trying this, I had attempted to rebuild abinit using compiled blas/lapack routines that I had compiled from source using the same compilers, using the --with-linalg-libs="-L/usr/local/lib -llapack -lblas". So it's strange that the code is pointing to the veclib accelerate libraries. Do you know the proper way to override this?

The code dies during the first SCF iteration. The printout immediately prior to the segfault suggests mentions the FFT, but one can't always go by this output, since the stderr output is not cached, whereas the stdout output is cached.

Code: Select all

ITER STEP NUMBER     1
 vtorho : nnsclo_now=  2, note that nnsclo,dbl_nnsclo,istep=  0 0  1
 Non-SCF iterations; kpt #     1  , k= ( -0.25000  0.50000  0.00000  ), band residuals:
 res:  2.20E-02  2.77E-02  2.68E-02  4.76E-02  1.55E-02
 ene: -1.34E-01 -2.21E-02  8.50E-02  1.23E-01  2.73E-01
 res:  1.85E-04  2.60E-04  1.81E-04  6.85E-05  1.80E-04
 ene: -1.45E-01 -3.88E-02  6.88E-02  1.15E-01  2.65E-01
 vtowfk : number of one-way 3D ffts skipped in vtowfk until now =1
Segmentation fault: 11


I'll work on getting gdb output. It's been a few years since I've used it.

Re: Segfault abinit-7.4.3, mac os, gcc/gfortran 4.6.4  [SOLVED]

Posted: Thu Oct 31, 2013 9:17 pm
by rpmuller
Got things working. Even after I specified the --with-linalg-libs stuff, I think it was still linking in the wrong libraries. I renamed my static blas/lapack libs to something with my initials at the end, recompiled, and it seems that everything is working. Thanks for your help!

Re: Segfault abinit-7.4.3, mac os, gcc/gfortran 4.6.4

Posted: Thu Oct 31, 2013 10:30 pm
by Alain_Jacques
Glad it worked. I circumvent this by using either MKL or OpenBLAS. As an example, my .ac file contains

Code: Select all

with_linalg_flavor="custom"
with_linalg_libs="-L/opt/OpenBLAS-0.25/lib -lopenblas"


Kind regards,

Alain