aboutsummaryrefslogtreecommitdiff
path: root/science/gamess
diff options
context:
space:
mode:
Diffstat (limited to 'science/gamess')
-rw-r--r--science/gamess/Makefile133
-rw-r--r--science/gamess/distinfo3
-rw-r--r--science/gamess/files/Makefile.tools11
-rw-r--r--science/gamess/files/Makefile.top11
-rw-r--r--science/gamess/files/patch-comp293
-rw-r--r--science/gamess/files/patch-compall31
-rw-r--r--science/gamess/files/patch-compddi94
-rw-r--r--science/gamess/files/patch-lked59
-rw-r--r--science/gamess/files/patch-rungms133
-rw-r--r--science/gamess/pkg-descr16
-rw-r--r--science/gamess/pkg-plist56
11 files changed, 840 insertions, 0 deletions
diff --git a/science/gamess/Makefile b/science/gamess/Makefile
new file mode 100644
index 000000000000..da34c1775024
--- /dev/null
+++ b/science/gamess/Makefile
@@ -0,0 +1,133 @@
+# New ports collection makefile for: gamess
+# Date created: 2007-3-13
+# Whom: NAKATA Maho <maho@FreeBSD.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= gamess
+PORTVERSION= ${SNAPDATE}.4
+CATEGORIES= science
+MASTER_SITES= #http://www.msg.ameslab.gov/GAMESS/GAMESS.html
+DISTNAME= gamess-current
+DIST_SUBDIR= ${PORTNAME}.${PORTVERSION}
+
+MAINTAINER= maho@FreeBSD.org
+COMMENT= A freely obtainable ab-initio molecular orbital calculation program
+
+USE_GMAKE= yes
+WRKSRC= ${WRKDIR}/gamess
+SNAPDATE= 20060907
+
+WANT_FORTRAN= yes
+BUILD_DEPENDS+= gfortran42:${PORTSDIR}/lang/gcc42
+FC= gfortran42
+F77= gfortran42
+
+RESTRICTED= NOT DISTRIBUTED FREELY. BUT YOU CAN OBTAIN SOURCE CODE FREELY.
+NO_CDROM= ${RESTRICTED}
+
+.if !exists(${DISTDIR}/${DISTFILES})
+IGNORE=You must manually get the source distribution from master site. http://www.msg.ameslab.gov/GAMESS/dist.menu.html. Please selsect "Source code distribution", and check on "running on Intel compatible PC running Linux". You must have license, and freely obtainable.
+.endif
+
+.include <bsd.port.pre.mk>
+
+.if exists(${LOCALBASE}/lib/libatlas_r.so) && !defined(WITH_BLAS)
+WITH_ATLAS= yes
+.endif
+.if defined(WITH_ATLAS)
+LIB_DEPENDS+= atlas.2:${PORTSDIR}/math/atlas
+BLAS= -lf77blas -latlas
+.else
+LIB_DEPENDS+= blas.2:${PORTSDIR}/math/blas
+BLAS= -lblas
+.endif
+
+.if defined(WITH_OPTIMIZED_FLAGS)
+.if ${ARCH} == "amd64"
+CFLAGS+= -pipe -O3 -ffast-math -funroll-all-loops -fpeel-loops -ftracer -funswitch-loops -funit-at-a-time
+FFLAGS+= -pipe -O3 -ffast-math -funroll-all-loops -fpeel-loops -ftracer -funswitch-loops -funit-at-a-time
+.elif ${ARCH} == "i386"
+CFLAGS+= -pipe -O3 -ffast-math -finline-functions -fomit-frame-pointer -funroll-loops -fexpensive-optimizations -malign-double -mcpu=i686 -march=i686 -mfancy-math-387
+FFLAGS+= -pipe -O3 -ffast-math -finline-functions -fomit-frame-pointer -funroll-loops -fexpensive-optimizations -malign-double -mcpu=i686 -march=i686 -mfancy-math-387
+.endif
+.endif
+
+#WITH_IFC= yes #currently building with ifc is broken
+.if defined(WITH_IFC)
+FC= ${LOCALBASE}/intel_fc_80/bin/ifort
+F77= ${LOCALBASE}/intel_fc_80/bin/ifort
+CC= ${LOCALBASE}/intel_cc_80/bin/icc
+FFLAGS= -axP -xW -ipo -O3 -Vaxlib
+CFLAGS= -axP -xW -ipo -O3 -Vaxlib
+LIBSVM= -lsvml
+LIBG2C= -lg2c
+.else
+LIBG2C=
+LIBSVM=
+.endif
+
+.if defined(WITH_IFC)
+FORTRAN= ifort
+.else
+FORTRAN= gfortran
+.endif
+
+pre-build:
+.if ${ARCH} == "amd64"
+ @${REINPLACE_CMD} -e 's+%%ARCH%%+freebsd-amd64+g' ${WRKSRC}/comp
+ @${REINPLACE_CMD} -e 's+%%ARCH%%+freebsd-amd64+g' ${WRKSRC}/compall
+ @${REINPLACE_CMD} -e 's+%%ARCH%%+freebsd-amd64+g' ${WRKSRC}/ddi/compddi
+ @${REINPLACE_CMD} -e 's+%%ARCH%%+freebsd-amd64+g' ${WRKSRC}/lked
+.elif ${ARCH} == "i386"
+ @${REINPLACE_CMD} -e 's+%%ARCH%%+freebsd-i386+g' ${WRKSRC}/comp
+ @${REINPLACE_CMD} -e 's+%%ARCH%%+freebsd-i386+g' ${WRKSRC}/compall
+ @${REINPLACE_CMD} -e 's+%%ARCH%%+freebsd-i386+g' ${WRKSRC}/ddi/compddi
+ @${REINPLACE_CMD} -e 's+%%ARCH%%+freebsd-i386+g' ${WRKSRC}/lked
+.endif
+ @${REINPLACE_CMD} -e 's+%%FC%%+${FC}+g ; \
+ s+%%PREFIX%%+${PREFIX}+g ; \
+ s+%%LIBSVM%%+${LIBSVM}+g ; \
+ s+%%LIBG2C%%+${LIBG2C}+g ; \
+ s+%%BLAS%%+${BLAS}+g ; \
+ s+%%PTHREAD_LIBS%%+${PTHREAD_LIBS}+g' \
+ ${WRKSRC}/lked
+ @${REINPLACE_CMD} -e 's+%%FC%%+${FC}+g ; \
+ s+%%PREFIX%%+${PREFIX}+g ; \
+ s+%%FFLAGS%%+${FFLAGS}+g ; \
+ s+%%FORTRAN%%+${FORTRAN}+g' \
+ ${WRKSRC}/comp
+ @${REINPLACE_CMD} -e 's+%%CC%%+${CC}+g' \
+ ${WRKSRC}/compall
+ @${REINPLACE_CMD} -e 's+%%PREFIX%%+${PREFIX}+g' \
+ ${WRKSRC}/rungms
+ @${REINPLACE_CMD} -e 's+%%PTHREAD_CFLAGS%%+${PTHREAD_CFLAGS}+g ; \
+ s+%%PTHREAD_LIBS%%+${PTHREAD_LIBS}+g ; \
+ s+%%UNDERSCORES%%+${UNDERSCORES}+g ; \
+ s+%%FORTRAN%%+${FORTRAN}+g ; \
+ s+%%CC%%+${CC}+g' \
+ ${WRKSRC}/ddi/compddi
+
+ ${CP} ${FILESDIR}/Makefile.top ${WRKSRC}/Makefile
+ ${CP} ${FILESDIR}/Makefile.tools ${WRKSRC}/tools/Makefile
+ @${REINPLACE_CMD} -e 's+%%FC%%+${FC}+g ; \
+ s+%%FFLAGS%%+${FFLAGS}+g' \
+ ${WRKSRC}/tools/Makefile
+do-build:
+ (cd ${WRKSRC}; ${GMAKE})
+
+do-install:
+ ${MKDIR} ${PREFIX}/bin/gms
+ ${MKDIR} ${PREFIX}/share/gamess
+ ${MKDIR} ${PREFIX}/share/doc/gamess
+ ${MKDIR} ${PREFIX}/share/examples/gamess
+ ${INSTALL_SCRIPT} ${WRKDIR}/gamess/rungms ${PREFIX}/bin/gamess
+ ${CHMOD} 555 ${PREFIX}/bin/gamess
+ ${INSTALL_PROGRAM} ${WRKDIR}/gamess/gamess.00.x ${PREFIX}/bin/gms
+ ${INSTALL_PROGRAM} ${WRKDIR}/gamess/ddi/ddikick.x ${PREFIX}/bin/gms
+ ${INSTALL_DATA} ${WRKDIR}/gamess/*.DOC ${PREFIX}/share/doc/gamess/
+ ${INSTALL_DATA} ${WRKDIR}/gamess/tests/*.inp ${PREFIX}/share/examples/gamess/
+ ${INSTALL_DATA} ${WRKDIR}/gamess/ericfmt.dat ${PREFIX}/share/gamess/
+
+.include <bsd.port.post.mk>
diff --git a/science/gamess/distinfo b/science/gamess/distinfo
new file mode 100644
index 000000000000..fb7529cf7820
--- /dev/null
+++ b/science/gamess/distinfo
@@ -0,0 +1,3 @@
+MD5 (gamess.20060907.4/gamess-current.tar.gz) = 1f31f0c02dd8f87cdeec37e9ebfd9d48
+SHA256 (gamess.20060907.4/gamess-current.tar.gz) = 8361f50e18ce5301e42375f820d8c41297ca1639fe02441c0a376b19d5e61ea9
+SIZE (gamess.20060907.4/gamess-current.tar.gz) = 7864905
diff --git a/science/gamess/files/Makefile.tools b/science/gamess/files/Makefile.tools
new file mode 100644
index 000000000000..6943a7b77a53
--- /dev/null
+++ b/science/gamess/files/Makefile.tools
@@ -0,0 +1,11 @@
+all: actvte.f actvte.x
+
+actvte.x: actvte.f
+ %%FC%% %%FFLAGS%% -o actvte.x actvte.f
+
+actvte.f: actvte.code
+ sed 's/*UNX/ /g' < actvte.code > actvte.f
+
+clean:
+ rm actvte.x actvte.f
+
diff --git a/science/gamess/files/Makefile.top b/science/gamess/files/Makefile.top
new file mode 100644
index 000000000000..edf2d8d88424
--- /dev/null
+++ b/science/gamess/files/Makefile.top
@@ -0,0 +1,11 @@
+# Makefile for gamess
+all: gamess_exe
+
+gamess_exe:
+ (cd tools ; make )
+ (cd ddi ; ./compddi )
+ ./compall
+ csh lked
+
+clean:
+ rm -rf object/*.o *.o *.f
diff --git a/science/gamess/files/patch-comp b/science/gamess/files/patch-comp
new file mode 100644
index 000000000000..dcc1071907c3
--- /dev/null
+++ b/science/gamess/files/patch-comp
@@ -0,0 +1,293 @@
+--- comp.orig Tue Nov 7 00:17:54 2006
++++ comp Fri Mar 9 10:44:49 2007
+@@ -8,11 +8,11 @@
+ # 1. Choose your machine, the legal values for TARGET are
+ # amd64,axp64,compaq-sc,cray-pvp,cray-t3e,cray-x1,cray-xd1,cray-xt3,
+ # fuji-pp32,fuji-pp64,hpux32,hpux64,ibm32,ibm64,ibm64-sp,ibm-bg,
+-# linux-ia64,linux-pc,mac32,macG5,necsx,sgi32,sgi64,sun32,sun64
++# linux-ia64,linux-pc,mac32,macG5,necsx,sgi32,sgi64,sun32,sun64,freebsd-amd64,freebsd-i386
+ # 2. Choose your GAMESS directory tree.
+ #
+-set TARGET=ibm64
+-chdir /u1/mike/gamess
++set TARGET=%%ARCH%%
++#chdir /u1/mike/gamess
+ #
+ # ---- and now the script begins...
+ #
+@@ -31,6 +31,9 @@
+ #
+ set OK=false
+ if ($TARGET == amd64) set OK=true
++if ($TARGET == freebsd-amd64) set OK=true
++if ($TARGET == freebsd-i386) set OK=true
++if ($TARGET == sun64) set OK=true
+ if ($TARGET == axp64) set OK=true
+ if ($TARGET == compaq-sc) set OK=true
+ if ($TARGET == cray-pvp) set OK=true
+@@ -115,6 +118,8 @@
+ endif
+ if ($TARGET == mac32) set BLAS3=true
+ if ($TARGET == macG5) set BLAS3=true
++if ($TARGET == freebsd-i386) set BLAS3=true
++if ($TARGET == freebsd-amd64) set BLAS3=true
+ if ($TARGET == sgi32) set BLAS3=true
+ if ($TARGET == sgi64) set BLAS3=true
+ if (($TARGET == sun32) && (-e /opt/SUNWspro/lib/libsunperf.so)) set BLAS3=true
+@@ -493,6 +498,19 @@
+ if ($MODULE == iolib) setenv MACHIN '*UNX'
+ if ($MODULE == unport) setenv MACHIN '*F2C'
+ endif
++if ($TARGET == freebsd-amd64) then
++ setenv MACHIN '*I64'
++ if ($MODULE == ddi) setenv MACHIN '*SOC'
++ if ($MODULE == iolib) setenv MACHIN '*UNX'
++ if ($MODULE == unport) setenv MACHIN '*AMD'
++endif
++if ($TARGET == freebsd-i386) then
++ setenv MACHIN '*I32'
++ if ($MODULE == ddi) setenv MACHIN '*SOC'
++ if ($MODULE == iolib) setenv MACHIN '*UNX'
++ if ($MODULE == unport) setenv MACHIN '*F2C'
++endif
++
+ if (($TARGET == mac32) || ($TARGET == macG5)) then
+ setenv MACHIN '*I32'
+ if ($MODULE == ddi) setenv MACHIN '*SOC'
+@@ -1630,6 +1648,236 @@
+ #-- f77 -c $OPT -stackvar $MODULE.f
+ #-- unset echo
+ #--endif
++
++#
++# FreeBSD (i386)
++#
++if ($TARGET == freebsd-i386) then
++#
++# The target of freebsd-i386 requires that you select a FORTRAN compiler.
++# There are five choices,
++# g77,
++# the default, because it is on our PCs at Iowa State!
++# lacks support for unit numbers over 99, or REAL*16
++# gfortran,
++# the gnu FORTRAN being included in recent Linux distributions
++# this allows unit numbers over 99, but not REAL*16
++# Intel's commercial ifort,
++# this is usually a bit faster, and supports both unit
++# numbers above 99 and REAL*16 (i.e. runs all of GAMESS)
++# Portland's commercial pgf77,
++# lacks support for REAL*16
++# the obsolete combination of f2c/gcc.
++# lacks support for unit numbers over 99, or REAL*16
++#
++# Note that the source code is the same for any of the possibilities, so
++# something missing means only that you can't run that particular thing:
++# Use of RUNTYP=TDHFX requires file numbers over 99.
++# Use of quadruple precision (MODEQR) in relativity requires REAL*16.
++#
++# The only thing you need to change is the next line.
++# Note: you must make the analogous choice in compddi and lked, as well.
++#
++ set FORTRAN=%%FORTRAN%% # choose from g77, gfortran, ifort, pgf77, f2c
++#
++ switch ($FORTRAN)
++#
++# 1. Using g77 compiler. compiler version query: rpm -q gcc-g77
++# If your RedHat is older than 6.0, see the f2c/gcc clause below.
++#
++# The meaning of g77's flags are
++# -O0, -O1, -O2, -O3 are the optimization levels, -O means -O1
++# -Wno-globals -fno-globals together suppress argument type checking.
++# -fautomatic defeats use of static storage
++# -malign-double uses 64 bit data alignment
++# Tests on a representative GAMESS test suite (executing energy, gradient
++# hessian code, as well as various SCF, MCSCF, MP2 runs, show that each
++# of the more aggressive optimizations -ffast-math, -march=i586, and -O3
++# gave speedups of less than 1% each. (-march=i686 slows a Celeron type
++# Pentium II fractionally). None of these optimizations are used below.
++#
++ case g77:
++ set OPT = '-O2'
++ if ($MODULE == ormas1) set OPT='-O2 -fno-move-all-movables' # RH9, g77 3.3
++ if ($MODULE == zheev) set OPT='-O0' # defensive compiling
++#
++# g77 does not support FORTRAN logical units above 99, or 128 bit math.
++#
++ if (($MODULE == qeigen) || ($MODULE == int2c)) then
++ mv $MODULE.f $MODULE.junk
++ sed -e "s/Q-/D-/g" \
++ -e "s/Q+00/D+00/g" \
++ -e "s/REAL\*16/DOUBLE PRECISION/" $MODULE.junk > $MODULE.f
++ rm -f $MODULE.junk
++ endif
++ if (($MODULE == iolib) || ($MODULE == inputa)) then
++ mv $MODULE.f $MODULE.junk
++ sed -e "s/MXUNIT=299/MXUNIT=99/g" $MODULE.junk > $MODULE.f
++ rm -f $MODULE.junk
++ endif
++ set echo
++ %%FC%% -c $OPT -malign-double -fautomatic \
++ -Wno-globals -fno-globals $MODULE.f
++ unset echo
++ breaksw
++#
++# 2. Using gfortran compiler. Tested with gfortran 4.1.1 on FC5.
++# gfortran was included with Fedora Core distributions starting around FC4.
++# compiler version query: rpm -q gcc-gfortran
++#
++# This is a 32 bit version, i.e. not using -fdefault-integer-8!
++# Unlike g77, gfortran allows for unit numbers above 100.
++# Like g77, gfortran does not support quadruple precision.
++#
++# -Ox optimization level is from the gcc back end, x can be 0,1,2,3
++# -std=legacy suppresses warnings about use of f77 constructs.
++#
++ case gfortran:
++ set OPT='-O2'
++ if ($MODULE == zheev) set OPT='-O0' # defensive compiling
++ if (($MODULE == qeigen) || ($MODULE == int2c)) then
++ mv $MODULE.f $MODULE.junk
++ sed -e "s/Q-/D-/g" \
++ -e "s/Q+00/D+00/g" \
++ -e "s/REAL\*16/DOUBLE PRECISION/" $MODULE.junk > $MODULE.f
++ rm -f $MODULE.junk
++ endif
++ set echo
++ %%FC%% -c $OPT -std=legacy $MODULE.f
++ unset echo
++ breaksw
++#
++# 3. Intel Fortran Compiler for Linux
++# Please see the 64 bit Linux target for more details as to where
++# to get this compiler, and its cost, and for an explanation of
++# the command line arguments.
++#
++# Note that this is more agressive (-O3 compared to -O2) than the
++# other two places in this file where ifort is used. If some
++# version gives you problems, drop this back to -O2.
++#
++# Dmitri likes to use "-O3 -xN -ssp -unroll8 -ip -pad -opt_report",
++# but that may cause certain ifort versions to fail on some files.
++#
++ case ifort:
++ set OPT = '-O3'
++ if ($MODULE == delocl) set OPT='-O0' # from Cheol
++ if ($MODULE == zheev) set OPT='-O0'
++ set echo
++ %%FC%% -c -i4 $OPT -auto -assume byterecl -w95 -cm $MODULE.f
++ unset echo
++ breaksw
++#
++# 4. Portland Group compiler.
++# This is a synthesis of recommendations from Fred Arnold and Brian
++# Salter-Duke. -fast means -O2 -Munroll -Mnoframe, the latter option
++# seems to be the source of several incorrect results. It is said that
++# "-Munroll" and "-tp p6" gives no significant improvement in run times.
++# The -Mlfs flag is supposed to cure the 2 GB file size limit.
++# exam19 may hang when using this compiler. -Mlfs at link-time
++# enables large file support. Your login script must set
++# up the use of this compiler, along the lines of
++# setenv PATH $PATH\:/usr/pgi/linux86/bin
++# setenv PGI /usr/pgi
++#
++ case pgf77:
++ if (($MODULE == qfmm) || ($MODULE == solib) || ($MODULE == zheev)) then
++ mv $MODULE.f $MODULE.junk
++ sed -e s/DREAL/DBLE/g $MODULE.junk > $MODULE.f
++ rm -f $MODULE.junk
++ endif
++ if (($MODULE == qeigen) || ($MODULE == int2c)) then
++ mv $MODULE.f $MODULE.junk
++ sed -e "s/Q-/D-/g" \
++ -e "s/Q+00/D+00/g" \
++ -e "s/REAL\*16/DOUBLE PRECISION/" $MODULE.junk > $MODULE.f
++ rm -f $MODULE.junk
++ endif
++ set OPT = '-O2'
++ if ($MODULE == zheev) set OPT = '-O2 -Kieee'
++ if ($MODULE == bassto) set OPT = '-O0' # Takako
++ set echo
++ pgf77 -c $OPT -Msecond_underscore $MODULE.f
++ unset echo
++ breaksw
++#
++# 5. RedHat 4.x and 5.x's FORTRAN compiler was f2c/gcc.
++# This is a totally obsolete option, actually.
++#
++ case f2c:
++ if (($MODULE == qfmm) || ($MODULE == solib) || ($MODULE == zheev)) then
++ mv $MODULE.f $MODULE.junk
++ sed -e s/DREAL/DBLE/g $MODULE.junk > $MODULE.f
++ rm -f $MODULE.junk
++ endif
++ if (($MODULE == qeigen) || ($MODULE == int2c)) then
++ mv $MODULE.f $MODULE.junk
++ sed -e "s/Q-/D-/g" \
++ -e "s/Q+00/D+00/g" \
++ -e "s/REAL\*16/DOUBLE PRECISION/" $MODULE.junk > $MODULE.f
++ rm -f $MODULE.junk
++ endif
++ if (($MODULE == iolib) || ($MODULE == inputa)) then
++ mv $MODULE.f $MODULE.junk
++ sed -e "s/MXUNIT=299/MXUNIT=99/g" $MODULE.junk > $MODULE.f
++ rm -f $MODULE.junk
++ endif
++ set OPT = '-O3 -malign-double'
++ set echo
++ f2c -w66 -a -Nn1604 -Nx800 $MODULE.f
++ gcc -c $OPT $MODULE.c
++ rm -f $MODULE.c
++ unset echo
++ breaksw
++#
++ default:
++ echo Please spell your ia32 compiler correctly.
++ exit 4
++ breaksw
++ endsw
++# ... end of FreeBSD on 32 bit PC compiler choices.
++endif
++if ($TARGET == freebsd-amd64) then
++#
++# The only thing you need to change is the next line.
++# Note: you must make the analogous choice in compddi and lked, as well.
++#
++ set FORTRAN=%%FORTRAN%% # choose from gfortran, ifort
++#
++ switch ($FORTRAN)
++
++ case gfortran:
++ set OPT='-O2'
++ if ($MODULE == zheev) set OPT='-O0' # defensive compiling
++ if (($MODULE == qeigen) || ($MODULE == int2c)) then
++ mv $MODULE.f $MODULE.junk
++ sed -e "s/Q-/D-/g" \
++ -e "s/Q+00/D+00/g" \
++ -e "s/REAL\*16/DOUBLE PRECISION/" $MODULE.junk > $MODULE.f
++ rm -f $MODULE.junk
++ endif
++ set echo
++ %%FC%% -fdefault-integer-8 $OPT -std=legacy $MODULE.f
++ unset echo
++ breaksw
++
++ case ifort:
++ set OPT = '-O2'
++ if ($MODULE == delocl) set OPT='-O0'
++ if ($MODULE == zheev) set OPT='-O0'
++ set echo
++ %%FC%% -c -i8 $OPT -auto -assume byterecl -w95 -cm $MODULE.f
++ unset echo
++ breaksw
++#
++ default:
++ echo "Please spell your AMD64's FORTRAN compiler name correctly."
++ exit 4
++ breaksw
++ endsw
++# ... end of FreeBSD on 64 bit AMD processors.
++endif
++
+ #
+ # Store the generated object code, clean up, and quit
+ #
diff --git a/science/gamess/files/patch-compall b/science/gamess/files/patch-compall
new file mode 100644
index 000000000000..1b9212db8834
--- /dev/null
+++ b/science/gamess/files/patch-compall
@@ -0,0 +1,31 @@
+--- compall.orig Mon Nov 20 08:02:49 2006
++++ compall Thu Mar 8 17:19:25 2007
+@@ -9,11 +9,11 @@
+ # 1. Choose your machine, the legal values for TARGET are
+ # amd64,axp64,compaq-sc,cray-pvp,cray-t3e,cray-x1,cray-xd1,cray-xt3,
+ # fuji-pp32,fuji-pp64,hpux32,hpux64,ibm32,ibm64,ibm64-sp,ibm-bg,
+-# linux-ia64,linux-pc,mac32,macG5,necsx,sgi32,sgi64,sun32,sun64
++# linux-ia64,linux-pc,mac32,macG5,necsx,sgi32,sgi64,sun32,sun64,freebsd-i386,freebsd-amd64
+ # 2. Choose your GAMESS directory tree.
+ #
+-set TARGET=ibm64
+-chdir /u1/mike/gamess
++set TARGET=%%ARCH%%
++#chdir /u1/mike/gamess
+ #
+ # ----- and now the script begins...
+ #
+@@ -67,9 +67,13 @@
+ if ($TARGET == ibm-bg) set CCOMP='/opt/ibmcmp/vac/7.0/bin/blrts_xlc'
+ if ($TARGET == linux-ia64) set CCOMP=gcc
+ if ($TARGET == necsx) set CCOMP=c++
++if ($TARGET == freebsd-amd64) set CCOMP=%%CC%%
++if ($TARGET == freebsd-i386) set CCOMP=%%CC%%
+ #
+ unset extraflags
+ if ($TARGET == amd64) set extraflags='-DLINUX64 -m64'
++if ($TARGET == freebsd-amd64) set extraflags='-DLINUX64 -m64'
++if ($TARGET == freebsd-i386) set extraflags='-DLINUX32'
+ if ($TARGET == axp64) set extraflags='-DCOMPAQ'
+ if ($TARGET == compaq-sc) set extraflags='-DCOMPAQ'
+ if ($TARGET == cray-pvp) set extraflags='-DCRAY'
diff --git a/science/gamess/files/patch-compddi b/science/gamess/files/patch-compddi
new file mode 100644
index 000000000000..8b94e90ed62a
--- /dev/null
+++ b/science/gamess/files/patch-compddi
@@ -0,0 +1,94 @@
+--- ddi/compddi.orig Wed Aug 30 22:34:15 2006
++++ ddi/compddi Fri Mar 9 10:28:28 2007
+@@ -12,9 +12,9 @@
+ # 1. Choose your machine, the legal values for TARGET are
+ # amd64,axp64,compaq-sc,cray-pvp,cray-t3e,cray-x1,cray-xd1,cray-xt3,
+ # fuji-pp32,fuji-pp64,hpux32,hpux64,ibm32,ibm64,ibm64-sp,ibm-bg,
+-# linux-ia64,linux-pc,mac32,macG5,necsx,sgi32,sgi64,sun32,sun64
++# linux-ia64,linux-pc,mac32,macG5,necsx,sgi32,sgi64,sun32,sun64,freebsd-i386,freebsd-amd64
+ #
+- set TARGET = ibm64
++ set TARGET = %%ARCH%%
+
+ # 2. Choose DDI communication layer, the only legal values are
+ # sockets,mixed,mpi,shmem,lapi
+@@ -575,7 +575,77 @@
+ set RANLIB_FLAGS = ' '
+
+ endif
++# --------------------------------------- #
++# FreeBSD for x86 PCs #
++# --------------------------------------- #
+
++ if($TARGET == freebsd-i386) then
++
++ set FORTRAN=%%FORTRAN%% # choose from g77, gfortran, ifort, pgf77, f2c
++
++ set CC = %%CC%%
++ set CFLAGS = "-DLINUX -O3 -fstrict-aliasing -I./include"
++
++ switch ($FORTRAN)
++ case g77:
++ case pgf77:
++ case f2c:
++ set NumUS=2
++ breaksw
++ case gfortran:
++ set CFLAGS = "$CFLAGS -Dgetarg_=_gfortran_getarg_i4"
++ set CFLAGS = "$CFLAGS -Diargc_=_gfortran_iargc"
++ set NumUS=1
++ breaksw
++ case ifort:
++ set NumUS=1
++ breaksw
++ default:
++ echo Please spell your ia32 compiler correctly.
++ exit 4
++ endsw
++
++ set CLIBS = "%%PTHREAD_LIBS%%"
++ set F77_OPTS = "-DINT_SIZE=int -D_UNDERSCORES=$NumUS"
++ set AR_FLAGS = 'cr'
++ set RANLIB_FLAGS = ' '
++
++ endif
++
++# ------------- #
++# FreeBSD amd64 #
++# ------------- #
++ if($TARGET == freebsd-amd64) then
++
++ set CC = %%CC%%
++ set CFLAGS = "-DLINUX -m64 -O3 -fstrict-aliasing -I./include"
++
++ set FORTRAN=%%FORTRAN%%
++ switch ($FORTRAN)
++ case g77:
++ case pgf77:
++ case f2c:
++ set NumUS=2
++ breaksw
++ case gfortran:
++ set CFLAGS = "$CFLAGS -Dgetarg_=_gfortran_getarg_i4"
++ set CFLAGS = "$CFLAGS -Diargc_=_gfortran_iargc"
++ set NumUS=1
++ breaksw
++ case ifort:
++ set NumUS=1
++ breaksw
++ default:
++ echo Please spell your x86_64 compiler correctly.
++ exit 4
++ endsw
++
++ set CLIBS = "%%PTHREAD_LIB%%"
++ set F77_OPTS = "-DINT_SIZE=int -D_UNDERSCORES=$NumUS"
++ set AR_FLAGS = 'cr'
++ set RANLIB_FLAGS = ' '
++
++ endif
+
+ # ------------------------- #
+ # Mac OS X (10.2 or 10.3) #
+
+
diff --git a/science/gamess/files/patch-lked b/science/gamess/files/patch-lked
new file mode 100644
index 000000000000..d20fe27f579c
--- /dev/null
+++ b/science/gamess/files/patch-lked
@@ -0,0 +1,59 @@
+--- lked.orig Mon Nov 20 08:02:58 2006
++++ lked Thu Mar 8 17:24:22 2007
+@@ -11,11 +11,11 @@
+ # 1. Choose your machine, the legal values for TARGET are
+ # amd64,axp64,compaq-sc,cray-pvp,cray-t3e,cray-x1,cray-xd1,cray-xt3,
+ # fuji-pp32,fuji-pp64,hpux32,hpux64,ibm32,ibm64,ibm64-sp,ibm-bg,
+-# linux-ia64,linux-pc,mac32,macG5,necsx,sgi32,sgi64,sun32,sun64
++# linux-ia64,linux-pc,mac32,macG5,necsx,sgi32,sgi64,sun32,sun64,freebsd-i386,freebsd-amd64
+ # 2. Choose your GAMESS directory tree.
+ #
+-set TARGET=ibm64
+-chdir /u1/mike/gamess
++set TARGET=%%ARCH%%
++#chdir /u1/mike/gamess
+ #
+ # ---- and now the script begins...
+ #
+@@ -442,6 +442,23 @@
+ # MacIntosh, clauses for using g77 or xlf.
+ # If Atlas was downloaded, it may be a little faster than Apple's.
+ #
++if ($TARGET == freebsd-i386) then
++ set LDR=%%FC%%
++ set LDOPTS=''
++ set LIBRARIES=''
++ set BLAS="-L%%PREFIX%%/lib %%BLAS%% %%LIBSVM%% %%LIBG2C%%"
++ set VECTOR=' '
++ set QUICHE='zunix.o'
++endif
++if ($TARGET == freebsd-amd64) then
++ set LDR=%%FC%%
++ set LDOPTS=''
++ set LIBRARIES=''
++ set BLAS="-L%%PREFIX%%/lib %%BLAS%%"
++ set VECTOR=' '
++ set QUICHE='zunix.o'
++endif
++
+ if ($TARGET == mac32) then
+ set LDR='g77'
+ set LDOPTS='-Wl,-multiply_defined -Wl,suppress' # add '-Wl,-M' for load map
+@@ -549,6 +566,8 @@
+ case hpux64:
+ case ibm32:
+ case ibm64:
++ case freebsd-amd64:
++ case freebsd-i386:
+ case linux-ia64:
+ case linux-pc:
+ case mac32:
+@@ -556,7 +575,7 @@
+ case sgi32:
+ case sun32:
+ case sun64:
+- set MSG_LIBRARIES='../ddi/libddi.a -lpthread'
++ set MSG_LIBRARIES='../ddi/libddi.a %%PTHREAD_LIBS%%'
+ # Solaris 2.6 needs -lposix4 instead of -lrt
+ if (($TARGET == sun32) || ($TARGET == sun64) || \
+ ($TARGET == fuji-pp32) || ($TARGET == fuji-pp64)) then
diff --git a/science/gamess/files/patch-rungms b/science/gamess/files/patch-rungms
new file mode 100644
index 000000000000..7579dd4d6469
--- /dev/null
+++ b/science/gamess/files/patch-rungms
@@ -0,0 +1,133 @@
+--- rungms.orig Mon Nov 20 08:09:11 2006
++++ rungms Thu Mar 8 17:28:51 2007
+@@ -1,4 +1,4 @@
+-#!/bin/csh
++#!/bin/csh -f
+ #
+ # 27 Mar 06 - MWS
+ #
+@@ -54,7 +54,14 @@
+ # of using LoadLeveler via a "llgms" front end in ~/gamess/misc.
+ #
+ set TARGET=sockets
+-set SCR=/scr/$USER
++set SCR=.
++if ($#argv == 0 ) then
++ echo "Usage: gamess <input file>"
++ exit
++endif
++set SCR=.
++set GMSPATH=/usr/local/bin/gms
++
+ #
+ set JOB=$1 # name of the input file xxx.inp, give only the xxx part
+ set VERNO=$2 # revision number of the executable created by 'lked' step
+@@ -66,30 +73,40 @@
+ #
+ # ---- the top third of the script is input and other file assignments ----
+ #
+-echo ----- GAMESS execution script -----
++#echo ----- GAMESS execution script -----
+ set master=`hostname`
+-echo This job is running on host $master
+-echo under operating system `uname` at `date`
+-echo "Available scratch disk space (Kbyte units) at beginning of the job is"
+-df -k $SCR
++#echo This job is running on host $master
++#echo under operating system `uname` at `date`
++#echo "Available scratch disk space (Kbyte units) at beginning of the job is"
++#df -k $SCR
++
++set JOBORG=$JOB
++set JOB=$JOB:r # strip off possible .inp
++
++if (-e $JOBORG) then
++ cp $JOBORG $SCR/$JOB.F05
++else
++ echo "Input file $JOBORG does not exist. Please fix and resubmit."
++ exit 4
++endif
+
+ # Grab a copy of the input file.
+ # In the case of EXAMnn jobs, this file might be in the "tests" subdirectory.
+-if ($JOB:r.inp == $JOB) set JOB=$JOB:r # strip off possible .inp
+-if (-e $JOB.inp) then
+- set echo
+- cp $JOB.inp $SCR/$JOB.F05
+- unset echo
+-else
+- if (-e tests/$JOB.inp) then
+- set echo
+- cp tests/$JOB.inp $SCR/$JOB.F05
+- unset echo
+- else
+- echo "Input file $JOB.inp does not exist. Please fix and resubmit."
+- exit 4
+- endif
+-endif
++#if ($JOB:r.inp == $JOB) set JOB=$JOB:r # strip off possible .inp
++#if (-e $JOB.inp) then
++# set echo
++# cp $JOB.inp $SCR/$JOB.F05
++# unset echo
++#else
++# if (-e tests/$JOB.inp) then
++# set echo
++# cp tests/$JOB.inp $SCR/$JOB.F05
++# unset echo
++# else
++# echo "Input file $JOB.inp does not exist. Please fix and resubmit."
++# exit 4
++# endif
++#endif
+
+ # file assignments.
+ #
+@@ -112,16 +129,16 @@
+ # d. see NEO plug-in code's documentation regarding the NUCBAS file.
+ # Note that you must edit a+b, but will probably skip c+d.
+ #
+-set echo
++# set echo
+ # ASCII input files (see explanation above)
+-setenv ERICFMT ~mike/gamess/ericfmt.dat
+-setenv MCPPATH ~mike/gamess/mcpdata
++setenv ERICFMT %%PREFIX%%/share/gamess/ericfmt.dat
++setenv MCPPATH %%PREFIX%%/share/gamess/mcpdata
+ setenv EXTBAS /dev/null
+ setenv NUCBAS /dev/null
+ #
+-setenv IRCDATA ~$USER/scr/$JOB.irc
++setenv IRCDATA $SCR/$JOB.irc
+ setenv INPUT $SCR/$JOB.F05
+-setenv PUNCH ~$USER/scr/$JOB.dat
++setenv PUNCH $SCR/$JOB.dat
+ setenv AOINTS $SCR/$JOB.F08
+ setenv MOINTS $SCR/$JOB.F09
+ setenv DICTNRY $SCR/$JOB.F10
+@@ -151,8 +168,8 @@
+ setenv SOINTY $SCR/$JOB.F32
+ setenv SOINTZ $SCR/$JOB.F33
+ setenv SORESC $SCR/$JOB.F34
+-setenv SIMEN ~$USER/scr/$JOB.simen
+-setenv SIMCOR ~$USER/scr/$JOB.simcor
++setenv SIMEN $SCR/$JOB.simen
++setenv SIMCOR $SCR/$JOB.simcor
+ setenv GCILIST $SCR/$JOB.F37
+ setenv HESSIAN $SCR/$JOB.F38
+ setenv SOCCDAT $SCR/$JOB.F40
+@@ -302,10 +319,10 @@
+
+ setenv GMSJOBNAME $JOB # this values is used only by the VB2000 add-on code
+
+-if ((-e $PUNCH) || (-e $IRCDATA)) then
+- echo Please rename/erase $PUNCH and/or $IRCDATA, and resubmit
+- exit 4
+-endif
++#if ((-e $PUNCH) || (-e $IRCDATA)) then
++# echo Please rename/erase $PUNCH and/or $IRCDATA, and resubmit
++# exit 4
++#endif
+
+ # ---- the middle third of the script is to execute GAMESS ----
+ #
diff --git a/science/gamess/pkg-descr b/science/gamess/pkg-descr
new file mode 100644
index 000000000000..de5d8b11984a
--- /dev/null
+++ b/science/gamess/pkg-descr
@@ -0,0 +1,16 @@
+GAMESS is freely available ab-initio molecular orbital
+calculation program calculates energy, molecular structure,
+vibrational frequencies from the basic principle of quantum mechanics.
+
+A site license for GAMESS is available at no cost to both academic
+and industrial users. Please refer
+http://wwwmsg.fi.ameslab.gov/GAMESS/dist.menu.html
+for details.
+
+We also included simple launcher called `gamess'
+for your convenience. You don't set any environment variable
+to run gamess. Just type
+% gamess <somefile.inp>
+is enough.
+
+WWW: http://wwwmsg.fi.ameslab.gov/GAMESS/
diff --git a/science/gamess/pkg-plist b/science/gamess/pkg-plist
new file mode 100644
index 000000000000..71a5e48bea63
--- /dev/null
+++ b/science/gamess/pkg-plist
@@ -0,0 +1,56 @@
+bin/gamess
+bin/gms/ddikick.x
+bin/gms/gamess.00.x
+share/doc/gamess/INPUT.DOC
+share/doc/gamess/INTRO.DOC
+share/doc/gamess/IRON.DOC
+share/doc/gamess/PROG.DOC
+share/doc/gamess/REFS.DOC
+share/doc/gamess/TESTS.DOC
+share/gamess/ericfmt.dat
+share/examples/gamess/exam01.inp
+share/examples/gamess/exam02.inp
+share/examples/gamess/exam03.inp
+share/examples/gamess/exam04.inp
+share/examples/gamess/exam05.inp
+share/examples/gamess/exam06.inp
+share/examples/gamess/exam07.inp
+share/examples/gamess/exam08.inp
+share/examples/gamess/exam09.inp
+share/examples/gamess/exam10.inp
+share/examples/gamess/exam11.inp
+share/examples/gamess/exam12.inp
+share/examples/gamess/exam13.inp
+share/examples/gamess/exam14.inp
+share/examples/gamess/exam15.inp
+share/examples/gamess/exam16.inp
+share/examples/gamess/exam17.inp
+share/examples/gamess/exam18.inp
+share/examples/gamess/exam19.inp
+share/examples/gamess/exam20.inp
+share/examples/gamess/exam21.inp
+share/examples/gamess/exam22.inp
+share/examples/gamess/exam23.inp
+share/examples/gamess/exam24.inp
+share/examples/gamess/exam25.inp
+share/examples/gamess/exam26.inp
+share/examples/gamess/exam27.inp
+share/examples/gamess/exam28.inp
+share/examples/gamess/exam29.inp
+share/examples/gamess/exam30.inp
+share/examples/gamess/exam31.inp
+share/examples/gamess/exam32.inp
+share/examples/gamess/exam33.inp
+share/examples/gamess/exam34.inp
+share/examples/gamess/exam35.inp
+share/examples/gamess/exam36.inp
+share/examples/gamess/exam37.inp
+share/examples/gamess/exam38.inp
+share/examples/gamess/exam39.inp
+share/examples/gamess/exam40.inp
+share/examples/gamess/exam41.inp
+@dirrm bin/gms
+@dirrm share/doc/gamess
+@dirrm share/gamess
+@dirrm share/examples/gamess
+