Page 1 of 1

Abinit 7.10.2 in Homebrew (OS-X) : libxc and netcdf issues

Posted: Sat Jan 24, 2015 1:20 pm
by davydden
Dear all,

I would like to add Abinit to Homebrew (a package manager similar to MacPorts).
The current attempt is in this pull request: https://github.com/Homebrew/homebrew-science/pull/1757
The file is human readable so if there are any suggestions/advices regarding the way Abinit is built, please, let me know.

The configure for which no fast test fail is:

Code: Select all

./configure
CC=/usr/local/bin/mpicc
CXX=/usr/local/bin/mpicxx
F77=/usr/local/bin/mpif77
FC=/usr/local/bin/mpif90
--prefix=/usr/local/Cellar/abinit/7.10.2
--enable-mpi=yes
--with-mpi-prefix=/usr/local/opt/open-mpi
--enable-optim=safe
--enable-openmp=no
--enable-gw-dpc
--with-linalg-flavor=custom
--with-linalg-libs=-L/usr/local/opt/veclibfort/lib -lveclibfort
--with-math-flavor=gsl
--with-math-incs=-I/usr/local/opt/gsl/include
--with-math-libs=-L/usr/local/opt/gsl/lib -lgsl
--with-fft-flavor=fftw3
--with-fft-incs=-I/usr/local/opt/fftw/include
--with-fft-libs=-L/usr/local/opt/fftw/lib -lfftw3 -lfftw3f -lfftw3_mpi -lfftw3f_mpi


While configuring / compiling / running tests, I faced two issues :

1) Abinit does not want to pick up Libxc 2.2.0. Configure complains that 2.0 is requested. Is it done deliberately, or shall it also be ok to use 2.2.0?

2) If I build with NetCDF 4.3.2 by adding

Code: Select all

--with-trio-flavor=netcdf
--with-netcdf-incs=-I/usr/local/opt/netcdf/include
--with-netcdf-libs=-L/usr/local/opt/netcdf/lib -lnetcdff -lnetcdf

to the configure script above, all fast tests fail because the number of lines is different, i.e.

Code: Select all

 returned exit_code: 14

[fast][t00][np=1]: fldiff.pl fatal error:
The diff analysis cannot be done: the number of lines to be analysed differ.
File /Users/davydden/Downloads/abinit-7.10.2/tests/fast/Refs/t00.out: 110 lines, 35 ignored
File /Users/davydden/Downloads/abinit-7.10.2/tests/Test_suite/fast_t00/t00.out: 109 lines, 35 ignored
[fast][t00][np=1]Test was not expected to fail but subrocesses returned 14
#0  0x1115bf4f2
#1  0x10ccc3663
#2  0x10c786035
#3  0x10bea4a8a
#4  0x10cd06e4e


when I compare the two, the "blessed" output has "chkinp: Checking input parameters for consistency." whereas
current output does not have this. It seems to have everything to do with NetCDF...

p.s. Here is the result of otool for the case without netcdf

Code: Select all

otool -L /usr/local/Cellar/abinit/7.10.2/bin/abinit
/usr/local/Cellar/abinit/7.10.2/bin/abinit:
   /usr/local/lib/libfftw3.3.dylib (compatibility version 8.0.0, current version 8.4.0)
   /usr/local/lib/libfftw3f.3.dylib (compatibility version 8.0.0, current version 8.4.0)
   /usr/local/lib/libfftw3_mpi.3.dylib (compatibility version 8.0.0, current version 8.4.0)
   /usr/local/lib/libfftw3f_mpi.3.dylib (compatibility version 8.0.0, current version 8.4.0)
   /usr/local/lib/libgsl.0.dylib (compatibility version 18.0.0, current version 18.0.0)
   /usr/local/lib/libvecLibFort.dylib (compatibility version 0.0.0, current version 0.0.0)
   /usr/local/lib/libmpi_usempif08.0.dylib (compatibility version 7.0.0, current version 7.0.0)
   /usr/local/lib/libmpi_mpifh.2.dylib (compatibility version 8.0.0, current version 8.0.0)
   /usr/local/lib/libmpi.1.dylib (compatibility version 8.0.0, current version 8.0.0)
   /usr/local/lib/gcc/4.9/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 1213.0.0)
   /usr/local/lib/gcc/4.9/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
   /usr/local/lib/gcc/4.9/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0)

so at least it did not link against osx blas/lapack :-)

Re: Abinit 7.10.2 in Homebrew (OS-X) : libxc and netcdf issu

Posted: Mon Jan 26, 2015 10:25 am
by Jordan
I cannot help much because I am not a user of homebrew (nor OSX) but for your libxc problem, you should indeed use 2.2 (I use 2.2.1) and set the variable as

Code: Select all

with_dft_flavor="libxc"
with_libxc_incs="-I/SOMETHING/libxc-2.2.1/include"
with_libxc_libs="-L/SOMETHING/libxc-2.2.1/lib -lxcf90 -lxc"

At least on Linux system this how the new libxc can be linked with abinit

For NetCDF, the test should all pass. The missing line is printed using standard fortran IO (write statement) and does not involve any NetCDF function.
Are you sure the result are the same ? Have you checked the fast00.stdout files ? and compared them ?

Cheers

Jordan

Re: Abinit 7.10.2 in Homebrew (OS-X) : libxc and netcdf issu

Posted: Mon Jan 26, 2015 3:16 pm
by davydden
Hi Jordan.

Jordan wrote:I cannot help much because I am not a user of homebrew (nor OSX) but for your libxc problem, you should indeed use 2.2 (I use 2.2.1) and set the variable as

Code: Select all

with_dft_flavor="libxc"
with_libxc_incs="-I/SOMETHING/libxc-2.2.1/include"
with_libxc_libs="-L/SOMETHING/libxc-2.2.1/lib -lxcf90 -lxc"

At least on Linux system this how the new libxc can be linked with abinit


That's exactly how I use it,
yet there is configure failure:

Code: Select all

checking for the requested DFT support... libxc
checking whether to select a fallback for libxc... no
checking xc.h usability... yes
checking xc.h presence... yes
checking for xc.h... yes
checking xc_funcs.h usability... yes
checking xc_funcs.h presence... yes
checking for xc_funcs.h... yes
checking for Fortran module includes... none required
checking whether LibXC has Fortran support... yes
checking whether this is LibXC version 2.0... no
configure: error: external libxc support does not work

The libxc is `2.2.0`. I can also see it in "xc_version.h" in its include folder:

Code: Select all

#define XC_VERSION "2.2.0"
#define XC_MAJOR_VERSION 2
#define XC_MINOR_VERSION 2

Shall work, as far as I can see...

Jordan wrote:For NetCDF, the test should all pass. The missing line is printed using standard fortran IO (write statement) and does not involve any NetCDF function.
Are you sure the result are the same ? Have you checked the fast00.stdout files ? and compared them ?


I had another look at the output file and it is indeed NetCDF related:

Code: Select all

--- !ERROR
message: |
    Netcdf Error while closing the OUT.nc file: NetCDF: Not a valid ID
src_file: outvars.F90
src_line: 359
...


p.s. I was trying to upload an .stdout file but neither .txt nor .zip are allowed for upload.

Re: Abinit 7.10.2 in Homebrew (OS-X) : libxc and netcdf issu  [SOLVED]

Posted: Mon Jan 26, 2015 5:19 pm
by pouillon
Abinit 7.10.2 still depends on LibXC 2.0. LibXC 2.2 will be used with Abinit 8.0.

You may get some issues with NetCDF if you build with GCC 4.8 on Mac, but I haven't understood yet what exaclty is occurring (I don't have any Mac around to test). It could be a good idea to discuss directly with the developers of NetCDF and report back here if they provide you with a solution.

Re: Abinit 7.10.2 in Homebrew (OS-X) : libxc and netcdf issu

Posted: Mon Jan 26, 2015 5:51 pm
by davydden
I see... Thanks for making it clear.
I actually build with clang + gfortran 4.9.
I guess for a moment i will just avoid building with NetCDF as I do not need really need.

Re: Abinit 7.10.2 in Homebrew (OS-X) : libxc and netcdf issu

Posted: Mon Jan 26, 2015 6:53 pm
by davydden
Just a small follow-up question: is it possible to move `tests` folder from the build directory and run them via the same python script externally (given that abinit is in PATH)?

Perhaps one could consider this option for future releases?

Re: Abinit 7.10.2 in Homebrew (OS-X) : libxc and netcdf issu

Posted: Mon Jan 26, 2015 7:45 pm
by jbeuken
Hi,

only for information :

there is hope to succeed to compile netcdf with gcc48 : MacPorts does ! :lol:
I use MacPorts on our MacOS X bot on our test farm :

Code: Select all

port list | grep netcdf
netcdf                         @4.3.2          science/netcdf
netcdf-cxx                     @4.2            science/netcdf-cxx
netcdf-cxx4                    @4.2.1          science/netcdf-cxx4
netcdf-fortran                 @4.2            science/netcdf-fortran


we can see on the MacPorts website than there are some patch files…

https://trac.macports.org/browser/trunk/dports/science/netcdf-fortran/Portfile
https://trac.macports.org/browser/trunk ... tran/files


my 5¢

jmb

Re: Abinit 7.10.2 in Homebrew (OS-X) : libxc and netcdf issu

Posted: Tue Jan 27, 2015 10:35 am
by davydden
Another related question:

On installation there is `abinit-tests` in `share` folder. However, it does not seem that the python scripts are runnable:

Code: Select all

$ python runtests.py fast
Traceback (most recent call last):
  File "runtests.py", line 32, in <module>
    import tests
ImportError: No module named tests

Re: Abinit 7.10.2 in Homebrew (OS-X) : libxc and netcdf issu

Posted: Mon Mar 09, 2015 2:33 am
by torrent
Hi,

Thanks for having initiated this homebrew formula for ABINIT...

I have just submitted a few additions to your formula in homebrew-science (waiting for acceptance):
1- use of scalapack
2- simple patch to make libXC 2.2 useable
3- patch to corect the netCDF bug (occurs only when netCDF is activated and ETSF_IO is not); I have committed the changes upstream.

I also have added a user's guide in ABINIT package and on the wiki; it includes homebrew installation (also macports and manual install).

Marc

Re: Abinit 7.10.2 in Homebrew (OS-X) : libxc and netcdf issu

Posted: Fri Mar 13, 2015 1:56 pm
by davydden
Hi Marc,

Thanks for contributing an update to the formula.
Hope it will be merged soon.

Kind regards,
Denis.