charmm installation

I am trying to compile CHARMM version c34a1 PG compilers v7.0. The machine is a Operetron quadcore (64bit) CPU machine running Debian (kernel 2.6.18-5-amd64, x86_64). I tried following the instructions on the PG website about compiling CHARMM (version v30) on AMD-64bit, but am unsucessful, with both serial and the parallel versions.

I am interested in building the serial verison first; and I get the error in finding “ /librt.a”
/usr/bin/ld: cannot find -lrt
make: *** [/charmm/serial/c34a1/exec/gnu/charmm] Error 2

Any pointers ? Any other info is required, I will gladly provide.


Hi Prabhakar,

Do /usr/lib64/librt.a and /usr/lib64/ exist on your system? If not, please make sure it has. What is in your $PGI/linux86-64/7.0*/bin/localrc? Can you post it here?


Thank you for the reply. I appreciate it.

  1. /usr/lib64/librt.* exists on the system, as given by
    $ ls -l /usr/lib64/librt.*
    -rw-r–r-- 1 root root 91376 2007-05-15 08:19 /usr/lib64/librt.a
    lrwxrwxrwx 1 root root 15 2007-09-24 14:16 /usr/lib64/ -> /lib/

I just realised that I should have posted a more complete error info given by CHARMM. here is :

/usr/bin/ld: skipping incompatible /usr/lib/ when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/librt.a when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/bin/…/lib/ when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/bin/…/lib/librt.a when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/ when searching for -lrt
/usr/bin/ld: skipping incompatible /usr/lib/librt.a when searching for -lrt
/usr/bin/ld: cannot find -lrt
make: *** [/home/prabha/charmm/serial/c34a1/exec/gnu/charmm] Error 2

  1. PGI localrc :
    $ more $PGI/linux86-64/7.0/bin/localrc
    set LFC=-lgfortran;
    set LDSO=/lib64/;
    set GCCDIR=/usr/lib/gcc/x86_64-linux-gnu/4.1.2;
    set GCCINC=/usr/lib/gcc/x86_64-linux-gnu/4.1.2/include;
    set G77DIR=/usr/lib/gcc/x86_64-linux-gnu/4.1.2/;
    set OEM_INFO=64-bit target on x86-64 Linux;
    set LOCALRC=YES;
    set THROW=__THROW=;
    set EXTENSION=extension=;
    set LC=$if(-Bstatic,-lgcc -lgcc_eh -lc -lgcc -lgcc_eh -lc, -lgcc -lc -lgcc);

GLIBC version 2.3.6

GCC version 4.1.2

export PGI=/home/prabha/portland;

makelocalrc executed by prabha Fri Nov 9 12:38:04

Hi Prabhakar,

It’s strange that GCCDIR for 64-bit points to /usr/lib instead of /usr/lib64. Does /usr/lib points to /usr/lib64?

It looks like /usr/lib64/ does not point to the right and that /lib/ is rather 32-bit share object instead of 64-bit.

You may need to make sure that /usr/lib64/ points to the 64-bit If is a symlink, make sure it points to correct target.


Hi hyongyon,
Thank you, I appreciate the help.

  1. Well, /usr/lib64 points to /usr/lib; so that should cover that.
    $ ls -l /usr (gives for lib and lib32, and lib64) ,

drwxr-xr-x 149 root root 81920 2007-10-22 14:38 lib
lrwxrwxrwx 1 root root 24 2007-09-24 14:16 lib32 -> /emul/ia32-linux/usr/lib
lrwxrwxrwx 1 root root 3 2007-09-24 14:16 lib64 -> lib

  1. I do not know how to check if the is 64-bit rather than 32-bit; but I try
    $ ldd /usr/lib/ => /lib/ (0x00002ba9762ba000) => /lib/ (0x00002ba9764f8000)
    /lib64/ (0x0000555555554000)
    It is pointing to the 64-bit version of ld-linux! And
    $ls -l /lib64
    lrwxrwxrwx 1 root root 4 2007-09-24 14:16 /lib64 -> /lib

Is this suffecient to check if the correct 64-bit version is being used ? Any other checks?


Hi Prabhakar,

command: file should be sufficient to say if it is 32-bit or 64-bit.

Here is example fore 64-bit:

syst% file /usr/lib64/
/usr/lib64/ symbolic link to `/lib64/’

syst% file /lib64/
/lib64/ symbolic link to `’

syst% file /lib64/
/lib64/ ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), not stripped

And here is for 32-bit:

syst% file /lib/
/lib/ ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), not stripped


Hi Hongyon,
Thank you.
Looks like it the file is 64-bit version, but
$ file /usr/lib/
/usr/lib/ symbolic link to /lib/' $ file /lib/ /lib/ symbolic link to’
$ file /lib/
/lib/ ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.0, stripped

While yours was “not stripped”, mine is “stripped”; I do not know what the difference means and if it is significant ? (Is it related to underscoring of fortan functions when compiling ?)


Hi Prabhakar,

What is the compiler flags that you use to compile? Did you remove all -tp p6 occurrences from file build/UNX/Makefile_GNU? If -tp p6 is there, that means you compile 32-bit application. Perhaps, you compile some of the files with -tp p6 and the link with 64-bit libraries.

Thank you,

Thank you hongyon!

Great catch! I was compiling previously with “-tp p6”, the individual subroutines! Changing it to “-tp amd64”, allowed me to compile. Ran the “”, some programs Segment fault; All of them have

" VEHEAP> Expanding heap size by 6914048 words.
Segmentation fault"

Tried adding “-mcmodel=medium” flag to FC, but SegFaults in more input files. Wondering what the issue is! Would it be a concern when I want to compile the parallel version tommorrow?

ps: charmm installation with " ./ gnu large PGF77 X86_64 "

Thank you!

Hi Prabhakar,

The latest version of CHARMM we have here is v32b1. We won’t get to try latest version until next week at the earliest.

I assume X86_64 option at your build command line is the same as I8 in v32b1 version?

Which version of compilers are you using? It’s possible that there is a bug in compilers.

We will let you know as we have more information.

Thank you,

Hi Hongyon,
I am using PG 7.0/7.0-7 compilers.
My machine is Dual-Core Opteron, and gives
$uname -a
Linux sisboombah 2.6.18-5-amd64 #1 SMP Tue Oct 2 20:37:02 UTC 2007 x86_64 GNU/Linux

I digged around and found the c32b1 version. Changed the “-tp p6” to “-tp amd64” / “-tp amd64” and “pgf77” to “pgf90” in build/UNX/Makefile_gnu. The compilation was successful with “./ gnu large PGF77” ( “i8” does not work becase it complains that “-i8 not available for this platform”.

Running test suite has the same issues with “VEHEAP”. So Iam unsucessful in getting the older c32b1 working! Should I try a older PG compiler ?? May I ask which one are you using and which options do you pass to ??

Thank you.

Hi Prabhakar,

Please make sure you update all the changes as mention in Tips and Techniques page for 64-bit CHARMM.

Note: There is a typo in options for pgcc, so please don’t add $(I8DUM1) in pgcc option. There is no -i8 option for pgcc.


Please try unlimit stack size too.