Page 1 of 1

Building libxc (or disabling it) in AB 6.6.1, OS X

Posted: Thu Mar 03, 2011 6:22 am
by WoodDM
Howdy all!

For the last several 5.x and 6.x releases of ABINIT I've had trouble building libxc support under Mac OS 10.x (10.6.6 at the moment), so have used --disable-libxc. Since that's no longer an option, I'm trying to actually find out what was stopping libxc from building correctly during the 'make' phase of abinit.

So I have TWO real questions:

1) What am I doing wrong when configuring AB: e.g., by ./configure --enable-mpi --with-mpi-prefix=/opt/openmpi-1.5 --enable-64bit-flags
The configure *succeeds* but make crashes in libxc:

libtool: ignoring unknown tag F77
libtool: compile: /opt/openmpi-1.5/bin/mpif90 -m64 -ffree-form -m64 -g -ffree-line-length-none -O2 -mtune=native -march=native -mfpmath=sse -c libxc.f90 -o libxc_la-libxc.o
libxc.f90:30:

module xc_f90_ ## types_m
1
Error: Unclassifiable statement at (1)
libxc.f90:34.17:

integer, public, parameter :: xc_f90_kind = selected_real_kind(14)
1
Error: PUBLIC attribute at (1) is not allowed outside of the specification part of a module
libxc.f90:37.2:

type xc_f90_ ## pointer_t
1
Error: Unclassifiable statement at (1)
libxc.f90:38.11:

private
1
Error: PRIVATE statement at (1) is only allowed in the specification part of a module

2) Is it possible to work around this problem by building libxc EXTERNALLY, then linking to the libraries via flags in ~/.abinit/build/machinename.ac? (I tried this but the configure script for AB 6.6.1 doesn't like the resulting libraries and include files in /opt/etsf

=========Building libxc============
To my surprise, I was able to build and install the 'free-standing' libxc libraries in /opt/etsf by copying the libxc-1.0.tar.gz to /tmp, setting the following environment variables in bash
export FC="gfortran-mp-4.4 -m64"
export F77="gfortran-mp-4.4 -m64"
export F90="gfortran-mp-4.4 -m64"
export CC="gcc-mp-4.4 -m64"
export CXX="g++-mp-4.4 -m64"
export CPP="cpp-mp-4.4 -m64 -C -ansi"
export FCCPP="cpp-mp-4.4 -m64 -C -ansi"
export FCFLAGS="-O3"
export FFLAGS="-O3"

then:

./configure --enable-static
make

make install (as root) yields
libtool: install: /sw/bin/ginstall -c .libs/libxc.0.dylib /opt/etsf/lib/libxc.0.dylib
libtool: install: (cd /opt/etsf/lib && { ln -s -f libxc.0.dylib libxc.dylib || { rm -f libxc.dylib && ln -s libxc.0.dylib libxc.dylib; }; })
libtool: install: /sw/bin/ginstall -c .libs/libxc.lai /opt/etsf/lib/libxc.la
libtool: install: /sw/bin/ginstall -c .libs/libxc.a /opt/etsf/lib/libxc.a
libtool: install: chmod 644 /opt/etsf/lib/libxc.a
libtool: install: ranlib /opt/etsf/lib/libxc.a
ranlib: file: /opt/etsf/lib/libxc.a(libxc_la-libxc_funcs.o) has no symbols
ranlib: file: /opt/etsf/lib/libxc.a(libxc_la-libxc.o) has no symbols
=========End of building libxc============


======Configuring AB 6.6.1======
Upon enabling the lines in antbee.ac (machine name=antbee) in ~dmwood/.abinit/build

with_libxc_incs="-I/opt/etsf/include"
with_libxc_libs="-L/opt/etsf/lib -llibxc"

configure (invoked by simply ./configure in AB 6.6.1's top-level directory) gives:

configure: reading options from /Volumes/Backups/AntbeeHome/dmwood/.abinit/build/antbee.ac

but terminates with

configure: error: external libxc support does not work

[Note: If I configure libxc via
./configure --enable-static --enable-shared=false
I get libxc.a and libxc.la in /opt/etsf/lib but the same problem:
configure: error: external libxc support does not work]

In the config.log are the lines:

========BEGINNING of partial config.log listing ================
checking xc.h usability
/opt/openmpi-1.5/bin/mpicc -m64 -c -m64 -g -O2 -mtune=native -march=native -mfpmath=sse -I/opt/e
tsf/include conftest.c >&5
$? = 0
result: yes
checking xc.h presence
/opt/openmpi-1.5/bin/mpicc -E -I/opt/etsf/include conftest.c
$? = 0
result: yes
checking for xc.h
result: yes
checking xc_funcs.h usability
/opt/openmpi-1.5/bin/mpicc -m64 -c -m64 -g -O2 -mtune=native -march=native -mfpmath=sse -I/opt/e
tsf/include conftest.c >&5
$? = 0
result: yes
checking xc_funcs.h presence
/opt/openmpi-1.5/bin/mpicc -E -I/opt/etsf/include conftest.c
$? = 0
result: yes
checking for xc_funcs.h
result: yes
checking for Fortran module includes
result: unknown (cached)
error: external libxc support does not work
========END of partial config.log listing ================

So something is wrong with the includes in /opt/etsf/includes??
-rw-r--r-- 1 root admin 30874 Mar 2 21:36 libxc_funcs_m.mod
-rw-r--r-- 1 root admin 10673 Mar 2 21:36 xc.h
-rw-r--r-- 1 root admin 634 Mar 2 21:36 xc_config.h
-rw-r--r-- 1 root admin 78853 Mar 2 21:36 xc_f90_lib_m.mod
-rw-r--r-- 1 root admin 1237 Mar 2 21:36 xc_f90_types_m.mod
-rw-r--r-- 1 root admin 12516 Mar 2 21:36 xc_funcs.h

I'm over my head, so would be grateful for any suggestions.

DMW

Re: Building libxc (or disabling it) in AB 6.6.1, OS X

Posted: Thu Mar 03, 2011 8:53 am
by jbeuken
Hello,

to define the DFT libraries, we use ( from 6.6.x and above )

--with-dft-flavor="atompaw+bigdft+libxc+wannier90" ( the default )

then , to disable libxc

--with-dft-flavor="atompaw+bigdft+wannier90"

meanwhile, I succeed to compile abinit 6.6.1 with libxc on Mac OS X 10.5 / intel ,
this is my .ac :

Code: Select all

enable_64bit_flags="yes"
enable_mpi="yes"
enable_mpi_io="yes"
with_mpi_prefix="/opt/local/openmpi-gcc43_m64"
with_trio_flavor="netcdf+etsf_io+fox"
enable_gw_dpc="no"
enable_maintainer_checks="no"
enable_test_timeout="yes"
FC_LDFLAGS_EXTRA="-Wl,-search_paths_first"


( see for ex: http://www.abinit.org:8010/builders/big ... uilds/2082 )

regards

jmb