Alpha system with Linux OS: which compiler recommended?

Questions regarding the compilation of VASP on various platforms: hardware, compilers and libraries, etc.


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
lahaye
Jr. Member
Jr. Member
Posts: 98
Joined: Fri Apr 14, 2006 5:08 am
Location: Suwon - Korea

Alpha system with Linux OS: which compiler recommended?

#1 Post by lahaye » Tue Sep 26, 2006 10:31 am

Hi all,

I recently got an Alpha system and installed Linux on it.
Problem is now which (free) compiler is available for this system,
so that I can compile VASP.

The vasp.4.6/makefile.linux_alpha uses 'fort' as the Fortran compiler;
which compiler is this? Commercial?

I also have a Titianium CPU system with Linux and installed
the free Intel Fortran compiler there.

Does anyone have a good suggestion for this Alpha system?

Thank you,
Rob.
Last edited by lahaye on Tue Sep 26, 2006 10:31 am, edited 1 time in total.

job
Jr. Member
Jr. Member
Posts: 55
Joined: Tue Aug 16, 2005 7:44 am

Alpha system with Linux OS: which compiler recommended?

#2 Post by job » Wed Sep 27, 2006 11:56 am


I recently got an Alpha system and installed Linux on it.
Problem is now which (free) compiler is available for this system,
so that I can compile VASP.


If the Linux distribution comes with gcc 4.1 or newer, you can use 'gfortran' to compile vasp. If you have an older gcc, you can download and install a newer version (don't overwrite the system compiler, though) from http://gcc.gnu.org. Or you can download g95 which seems to have Linux-alpha binaries: http://ftp.g95.org/v0.9/g95-alpha-32-linux.tgz .


The vasp.4.6/makefile.linux_alpha uses 'fort' as the Fortran compiler;
which compiler is this? Commercial?


I guess this is the (commercial) Linux-Alpha compiler that Compaq made at some point. Good luck finding it anywhere.


I also have a Titianium CPU system


I guess you mean Itanium?


and installed
the free Intel Fortran compiler there.


Er. Please read the license. It's anything but free.


Does anyone have a good suggestion for this Alpha system?


Yes. Play around with it a little, and keep it in the corner to impress your friends with. Don't bother using it for real work. Alpha was back in its heyday perhaps the finest RISC processor ever, but the reality is that today it's dead, and the corpse is starting to smell.
<span class='smallblacktext'>[ Edited Wed Sep 27 2006, 02:04PM ]</span>
Last edited by job on Wed Sep 27, 2006 11:56 am, edited 1 time in total.

lahaye
Jr. Member
Jr. Member
Posts: 98
Joined: Fri Apr 14, 2006 5:08 am
Location: Suwon - Korea

Alpha system with Linux OS: which compiler recommended?

#3 Post by lahaye » Thu Sep 28, 2006 7:40 am

Thanks very much for your reply.

On my alpha system, I have a recent CentOS for alpha (clone of RedHat
Enterprise Linux 4). This comes with:

GNU Fortran 95 (GCC 4.0.2 20051130 (Red Hat 4.0.2-14.EL4))

I bet then that this version is no good?
Is there a critical improvement from 4.0 to 4.1?
If so, I must struggle to install 4.1 from the sources myself :(.

Thanks,
Rob.
Last edited by lahaye on Thu Sep 28, 2006 7:40 am, edited 1 time in total.

job
Jr. Member
Jr. Member
Posts: 55
Joined: Tue Aug 16, 2005 7:44 am

Alpha system with Linux OS: which compiler recommended?

#4 Post by job » Thu Sep 28, 2006 11:41 am

CentOS 4.4 has gfortran 4.1.0, which IIRC is able to compile VASP. But then again, it seems the newest CentOS for Alpha is 4.2, so you're out of luck anyway.

Basically, gfortran 4.0 is an alpha release; more often than not it segfaults when trying to compile any nontrivial code, including VASP.

You might want to try the G95 binary I linked to above, it might be easier to install than compiling gcc from source. The G95 frontend is fairly mature, although it generally seems to produce slower code than gfortran.
Last edited by job on Thu Sep 28, 2006 11:41 am, edited 1 time in total.

lahaye
Jr. Member
Jr. Member
Posts: 98
Joined: Fri Apr 14, 2006 5:08 am
Location: Suwon - Korea

Alpha system with Linux OS: which compiler recommended?

#5 Post by lahaye » Fri Sep 29, 2006 1:04 am

I did not install precompiled G95, as it is based on GCC-4.0.

Instead I compiled GCC 4.1.2 (prerelease) from the GNU
sources and surprisingly this was very easy.

This is what I use:

Code: Select all

$ gfortran --version
GNU Fortran 95 (GCC) 4.1.2 20060928 (prerelease)
Copyright (C) 2006 Free Software Foundation, Inc.
In vasp.4.lib I copied the makefile.linux to Makefile and only
modified following variables:

Code: Select all

CPP     = /opt/bin/gcc -E -P -C $*.F >$*.f
FC=/opt/bin/gfortran
CFLAGS = -O
FFLAGS = -O0
FREE   =
See http://surfion.snu.ac.kr/~lahaye/vasp/Makefile for the whole Makefile.

When I type make, I get error messages like this:

Code: Select all

/opt/bin/gcc -E -P -C preclib.F >preclib.f 
/opt/bin/gfortran -O0   -c preclib.f
cc -O -c timing_.c
cc -O -c derrf_.c
cc -O -c dclock_.c
/opt/bin/gcc -E -P -C diolib.F >diolib.f 
/opt/bin/gfortran -O0   -c diolib.f
 In file diolib.f:48

      IF (DUMMY.OR.((IUNIT.EQ.6).AND.(.NOT.ALLOW6)).OR.(IUNIT.EQ.5) &   
                                                                  1
Error: Syntax error in IF-expression at (1)

etc.etc.
See http://surfion.snu.ac.kr/~lahaye/vasp/make.output for complete list of errors in the make output.

It appears that these errors only occur at continuation lines, but when
I remove the continuation by glueing the lines together, I get a similar
error message at that line.

Any idea what is the problem here?
Do I need a more sophisticated Makefile?

Thanks,
Rob.
Last edited by lahaye on Fri Sep 29, 2006 1:04 am, edited 1 time in total.

lahaye
Jr. Member
Jr. Member
Posts: 98
Joined: Fri Apr 14, 2006 5:08 am
Location: Suwon - Korea

Alpha system with Linux OS: which compiler recommended?

#6 Post by lahaye » Fri Sep 29, 2006 11:57 am

In reply to my own message above:

There seems to be something fishy with the ampersand
characters, which are used at the end of the line and at
the 6th position of the next line, to indicate continuation.

It's the ampersand at the end of the line on which gfortran
is bailing out. When I remove those (but leave the ones at
the 6th position in place), then the errors disappear.

Does that make sense? Or even better: does that ring a
bell with someone?

Is there a flag I can pass to the gfortran command
to solve this problem?

I'll keep investigating, as I really want to compile VASP
with gfortran.

By the way: I myself am a C/C++ coder and hence
I know very little about Fortran and its variations.

Thank you!

Rob.
Last edited by lahaye on Fri Sep 29, 2006 11:57 am, edited 1 time in total.

job
Jr. Member
Jr. Member
Posts: 55
Joined: Tue Aug 16, 2005 7:44 am

Alpha system with Linux OS: which compiler recommended?

#7 Post by job » Fri Sep 29, 2006 12:00 pm

gfortran follows the usual convention of assuming that an .f/.F extension is fixed form, and .f90/.F90 is free form source.

Unfortunately, vasp uses .f/.F for everything, including free form, and instead uses an appropriate compiler switch to specify that the input is free form source. In vasp.4.lib/Makefile there is the FREE variable that is used for this purpose. So obviously when you have defined FREE to be empty, the compilation will fail.

The compiler switch that you're looking for is -ffree-form .
<span class='smallblacktext'>[ Edited Fri Sep 29 2006, 02:02PM ]</span>
Last edited by job on Fri Sep 29, 2006 12:00 pm, edited 1 time in total.

lahaye
Jr. Member
Jr. Member
Posts: 98
Joined: Fri Apr 14, 2006 5:08 am
Location: Suwon - Korea

Alpha system with Linux OS: which compiler recommended?

#8 Post by lahaye » Fri Sep 29, 2006 3:34 pm

Bingo! Thank you!

FREE is, by default, set to "-FR" in the makefile.linux_alpha.
I cleared the FREE variable, because gfortran does not have
a -FR flag, and I had no idea what its meaning was.

Thanks to your help, I have now set FREE to "-ffree-form",
and vasp.4.lib compiles like a charm. Fantastic!

Next week I'll continue with vasp.4.6 directory.

Thanks for your very useful and quick help.

Best regards,
Rob.
Last edited by lahaye on Fri Sep 29, 2006 3:34 pm, edited 1 time in total.

lahaye
Jr. Member
Jr. Member
Posts: 98
Joined: Fri Apr 14, 2006 5:08 am
Location: Suwon - Korea

Alpha system with Linux OS: which compiler recommended?

#9 Post by lahaye » Sat Sep 30, 2006 8:02 am

So I can get everything done in vasp.4.lib.

However, in the directory vasp.4.6, I get a segmentation
fault of the compiler. See

http://surfion.snu.ac.kr/~lahaye/vasp/
for the Makefile, the output of the make command and
the diff between makefile.linux_alpha and my Makefile.

Something seems to be wrong at line 550 of xml.f.

My Fortran knowledge is too limited to understand this,
so I forwarded this 'bug' to the gfortran mailing list.
However, they replied that the xml.f file is too bulky to
consider as a bug report; a more simplified example is
necessary. But I don't know how to extract the part that
causes the bug.

I wonder if it is possible to get answers from this list to
solve this problem. One difficult task is to "translate" the
compiler flags in the makefile.linux_alpha into the
corresponding gfortran compiler flags.

If I finally succeed with this, I will happily provide a
makefile.alphalinux_gfortran to this project :).

Thank you so much for all the help.

Regards,
Rob.
Last edited by lahaye on Sat Sep 30, 2006 8:02 am, edited 1 time in total.

admin
Administrator
Administrator
Posts: 2921
Joined: Tue Aug 03, 2004 8:18 am
License Nr.: 458

Alpha system with Linux OS: which compiler recommended?

#10 Post by admin » Tue Oct 03, 2006 8:10 am

the subroutine in which the the segmentation fault occurs according to your logfile (STOP_XML) closes the vasprun.xml file at the end of a run, it is just 12 lines long and very simple. So the error really must be related to some compiler bug. Maybe it helps to initialize stackposition as integer variable explicitely in xml.F (line 498 in xml.F, vasp release 4.6)
Last edited by admin on Tue Oct 03, 2006 8:10 am, edited 1 time in total.

lahaye
Jr. Member
Jr. Member
Posts: 98
Joined: Fri Apr 14, 2006 5:08 am
Location: Suwon - Korea

Alpha system with Linux OS: which compiler recommended?

#11 Post by lahaye » Tue Oct 03, 2006 3:35 pm

It's indeed a bug in the gfortran compiler, for which a
fix is committed for next release 'as we speak'.

I applied the fix in my GCC repository and all goes well then.

Except that I get a segmentation fault when running
vasp. I have not such a problem when using the same
input files with vasp compiled against the Intel compiler
(on a different computer).

So I wonder if I have to add more flags to the compilation.
At the moment I use:

Code: Select all

FFLAGS = -ffree-form -ffixed-line-length-none \
              -ffree-line-length-none
But I'm not sure that's correct and/or whether I have to
add other 'compatibility' flags.
Help at this point is very much appreciated.

Would it help if I provide here the debugger's backtrace
for the occurring segmentation fault?

Thanks,
Rob.
Last edited by lahaye on Tue Oct 03, 2006 3:35 pm, edited 1 time in total.

Post Reply