Dear Mat, dear Others,
Actually I had succesfully compiled CNS before on an Opteron (2GHz)but used gcc 3.3.3 compiler, which was pretty slow in comparision to Xeon 3,06Ghz: 9min/5min for 100ps MD with my molecular system. I also used very optimized code from the Xeon Compilation directly which was even slower: 10min. With my present Opteron Portland Group compilation I reach 5min like in the Xeon case. ( I don’t have seconds or such)
Here I will give you the neccessary modifications to files. I was only interesed to make things fast. Might be someone tries to make it nice, too?
- Step:
modify cns_solve_1.1//bin/getarch, make a copy first. This script will identify your machine for cns before compilation, or not. For the opteron I just added the line with my favorite architecture name:
echo “linux_opteron_pgcompiler”
before the exit and commented out the line:
#echo “unknown-${MACHINE}-${SYSTEM}”
Now the opteron is “detected” when no other architecture is detected. This is DIRTY
-
Step
Add a approprotate “supported” machine type subdirectory with the same architecture name as used above:
cd cns_solve_1.1
cp -r instlib/machine/supported/linux instlib/machine/supported/linux_opteron_pgcompiler
-
Step
Modify the compilation options in instlib/machine/supported/linux_opteron_pgcompiler/Makefile.header
Here the Portlandgroup Compiler setup:
###############################################################################
Machine dependent Makefile header for CNSsolve
Paul Adams 20-10-98
copyright Yale University
###############################################################################
fortran options
F77 = pgf77
F77STD = -w -i8 -O3 -Mcache_align -Mdalign -Munixlogical -fastsse -Mipa=fast
F77OPT = -i8 -O3 -Mcache_align -Mdalign -Munixlogical -fastsse -Mipa=fast
F77FLAGS = $(F77STD) $(F77OPT) $(EXT_F77FLAGS) $(F77BUG)
C options
CC = pgcc
CCFLAGS = -c -DCNS_ARCH_TYPE_$(CNS_ARCH_TYPE) $(EXT_CCFLAGS) -O3 -Mcache_align -Mdalign -fastsse -Mipa=fast
link options
LD = pgf77
LDFLAGS = $(EXT_LDFLAGS) -i8 -O3 -Mcache_align -Mdalign -Munixlogical -fastsse -Mipa=fast
utility programs
compile-utils:
@ cd $(CNS_INST)/utils;
make utils F77=“$(F77)” CC=“$(CC)”
F77FLAGS=“-O” CCFLAGS=“-O”
F77LINK=“” CCLINK=“-lm” LEXLIB=“fl”
#==============================================================================
Here the gnu compiler setup for people who really need it, at least it works:
###############################################################################
Machine dependent Makefile header for CNSsolve
Paul Adams 20-10-98
copyright Yale University
###############################################################################
fortran options
F77 = g77
F77STD = -c -D_REENTRANT -O3 -fno-globals -Wno-globals -O3 -malign-double -funroll-loops -frerun-loop-opt -ffast-math -m32 -msse2 -mfpmath=sse,387
#-w -Nn2000
F77OPT = -c -D_REENTRANT -O3 -fno-globals -Wno-globals -O3 -malign-double -funroll-loops -frerun-loop-opt-frerun-loop-opt-ffast-math -m32 -msse2 -mfpmath=sse,387
F77FLAGS = -c -D_REENTRANT -O3 -fno-globals -Wno-globals -O3 -malign-double -funroll-loops -frerun-loop-opt -ffast-math -m32 -msse2 -mfpmath=sse,387
C options
CC = gcc
CCFLAGS = -c -D_REENTRANT -O3 -fno-globals -Wno-globals -O3 -malign-double -funroll-loops -frerun-loop-opt -ffast-math -m32 -msse2 -mfpmath=sse,387
link options
LD = g77
LDFLAGS = $(EXT_LDFLAGS) -D_REENTRANT -O3 -fno-globals -Wno-globals -O3 -malign-double -funroll-loops -frerun-loop-opt -ffast-math -m32 -msse2 -mfpmath=sse,387
utility programs
compile-utils:
@ cd $(CNS_INST)/utils;
make utils F77=“$(F77)” CC=“$(CC)”
F77FLAGS=“-O” CCFLAGS=“-O”
F77LINK=“” CCLINK=“-lm” LEXLIB=“fl”
#==============================================================================
- Step:
If you compile with gcc skip this -m32 solves the problem I got with the portland compiler (so then this step can be skipted):
%ALLHP error encountered: out of INTEGER range
(see previous messages)
Edit cns_solve_1.1/source/dmemory.c and change line 7 from
#define INTEGER int
to
#define INTEGER long long int.
THIS IS DIRTY. I didn’t check yet if this big INT size is really needed but the program works. If you compile the same source later on a different architecture you might come into trubble. So better make a copy of the original file. It would be very nice to use some -Dx_64 precomilation flag for this, but sorry.
- Step
cd …/cns_solve_1.1
make install
Should work now. I wonder if an -i8 flag for the pgcc compiler would have solved the problem in Step 4. Might be PGI considers this for later versions?! Your compiler really is very fast it would be nice to compile code like this easily.
Kind regards,
Marcel Reese