Compiling abinit on BG/Q

option, parallelism,...

Moderators: fgoudreault, mcote

Forum rules
Please have a look at ~abinit/doc/config/build-config.ac in the source package for detailed and up-to-date information about the configuration of Abinit 8 builds.
For a video explanation on how to build Abinit 7.x for Linux, please go to: http://www.youtube.com/watch?v=DppLQ-KQA68.
IMPORTANT: when an answer solves your problem, please check the little green V-like button on its upper-right corner to accept it.
Locked
xiangpisai
Posts: 19
Joined: Thu Mar 24, 2011 3:02 pm

Compiling abinit on BG/Q

Post by xiangpisai » Sat Feb 02, 2013 7:09 am

Hi everyone,
I am trying to compile abinit-7.0.4 on Bluegene/Q system. i use IBM XLC version 12.1 and IBM XLFORTRAN version 14.1. The autoconf options I have is:
./configure
--enable-mpi=yes
--enable-mpi-io=yes
CC=mpixlc
CXX=mpixlcxx
FC=mpixlf90
--with-dft-flavor="none"
--with-trio-flavor="none"
--enable-fc-wrapper=yes
CFLAGS="-O2 -q64 -qspill=5000 -qarch=qp -qtune=qp -qcache=auto -qstrict -qnosave -qlanglvl=stdc99"
FCFLAGS="-qnosave -q64 -qpic=large -qmaxmem=-1 -O2 -qspill=5000 -qarch=auto -qtune=auto -qcache=auto -qstrict -qsuppress=1520-022:1520-031:1500-036 -qzerosize"
CPPFLAGS="-DNDEBUG -D_ALL_SOURCE"
CPP="mpixlc -EC"
--with-linalg-flavor="none"
enable_64bit_flags="yes"
MPI_RUNNER=runjob
--host=powerpc-unknown-linux

In this configuration I will always meet a problem with code m_iso_c_binding.F90. It involves with config.h. Here I have tried several things:
1. If I enable fc-wrapper like above, I will get errors saying "(W) command option t contains an incorrect subargument".
2. If I disable fc-wrapper with --enable-fc-wrapper=no, I will meet with /* comment problem on file m_iso_c_binding.F90. That is, in config.h, all comments with /* COMMENT */ style will cause error. I tried to remove all the comments in config.h manually and that file will compile but there are more files that needs this manual comment removal and I just cannot do that for all headers.

Also I tried to read ibm XLFORTRAN reference manual and I quote the file

Avoiding preprocessing problems
Because Fortran and C differ in their treatment of some sequences of characters, be
careful when using /* or */. These might be interpreted as C comment delimiters,
possibly causing problems even if they occur inside Fortran comments. Also be
careful when using three-character sequences that begin with ?? (which might be
interpreted as C trigraphs).

Please refer to http://www-01.ibm.com/support/docview.wss?uid=swg27024803&aid=1 for more information. What I just quoted was at the bottom of page 31.
In my opinion the 2nd way---disabling fc-wrapper should be correct and there should be a way to disregard those comments by passing an option to xlf90 compiler but I just don't know how to do that.
Any help is greatly appreciated. Thanks in advance.
Best
Xiangpisai

User avatar
pouillon
Posts: 651
Joined: Wed Aug 19, 2009 10:08 am
Location: Spain
Contact:

Re: Compiling abinit on BG/Q

Post by pouillon » Thu Feb 07, 2013 6:59 pm

Look at the config file of your Fortran compiler. It might contain an incorrect cpp setup. On various IBM machines, I've had to change the default "-C" option of cpp - which means "preserve C comments" and does not make any sense in Fortran - into a "-P" - which removes C comments and other stuff from the preprocessed file. I'm always puzzled by IBM keeping this default to an absurd value. If you don't have the permissions to change this file, just ask your system administrator, so that others may benefit from this fix. Please have a look at ~abinit/README.xlf for more details.

Another solution is to use the --enable-fc-wrapper option in conjunction with CPP="/lib/cpp -P". It works in most cases.
Yann Pouillon
Simune Atomistics
Donostia-San Sebastián, Spain

xiangpisai
Posts: 19
Joined: Thu Mar 24, 2011 3:02 pm

Re: Compiling abinit on BG/Q

Post by xiangpisai » Thu Feb 07, 2013 8:07 pm

Thanks pouillon,
I have already solved all these problems and compiled it on BG/Q. Waiting for performance now. Let's see!
Thanks
Xiangpisai

Locked