-## Process this file with automake to produce Makefile.in
-#
-# Don't edit - this file is generated automatically from Makefile.am
-#
+# Note: this file is generated automatically from Makefile.am
+
AUTOMAKE_OPTIONS = foreign
-#
-# The real work is done in our subdirs - automake iterates through these
-#
-SUBDIRS = src top html tutor man
+SUBDIRS = include src share admin scripts man
#
# Most files in the config subdir is included automatically when
(cd ${top_builddir}/src/kernel && $(MAKE) install-mdrun)
links:
- (cd /usr/local/bin && $(LN_S) ${bindir}/* .)
+ (cd /usr/local/bin && ln -sf ${bindir}/* .)
#
# Apart from normal things like .o, things matching this are removed
# (The second one removes files beginning with a #)
+
CLEANFILES = *~ \\\#*
+
DISTCLEANFILES = libtool config.cache config.log
fi
-if test "${prefix}" = "NONE"; then
- cat >> confdefs.h <<EOF
-#define GMXLIBDIR "${ac_default_prefix}/top"
+echo "1: ${datadir}"
+echo '2: ${datadir}'
+cat >> confdefs.h <<EOF
+#define GMXLIBDIR "${datadir}/top"
EOF
-else
- cat >> confdefs.h <<EOF
-#define GMXLIBDIR "${prefix}/top"
-EOF
-fi
# Check if there are any optimizations and options for this arch and cpu
echo $ac_n "checking whether $CC accepts -malign-double""... $ac_c" 1>&6
-echo "configure:7250: checking whether $CC accepts -malign-double" >&5
+echo "configure:7246: checking whether $CC accepts -malign-double" >&5
if eval "test \"`echo '$''{'ac_align_double'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking whether $CC accepts -mcpu=$cputype""... $ac_c" 1>&6
-echo "configure:7307: checking whether $CC accepts -mcpu=$cputype" >&5
+echo "configure:7303: checking whether $CC accepts -mcpu=$cputype" >&5
if eval "test \"`echo '$''{'ac_m_cpu_60x'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking whether $CC accepts -mcpu=750""... $ac_c" 1>&6
-echo "configure:7334: checking whether $CC accepts -mcpu=750" >&5
+echo "configure:7330: checking whether $CC accepts -mcpu=750" >&5
if eval "test \"`echo '$''{'ac_m_cpu_750'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking whether $CC accepts -mcpu=powerpc""... $ac_c" 1>&6
-echo "configure:7362: checking whether $CC accepts -mcpu=powerpc" >&5
+echo "configure:7358: checking whether $CC accepts -mcpu=powerpc" >&5
if eval "test \"`echo '$''{'ac_m_cpu_powerpc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking whether $CC accepts -mpowerpc""... $ac_c" 1>&6
-echo "configure:7390: checking whether $CC accepts -mpowerpc" >&5
+echo "configure:7386: checking whether $CC accepts -mpowerpc" >&5
if eval "test \"`echo '$''{'ac_m_powerpc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking whether $CC accepts ${CFLAGS}""... $ac_c" 1>&6
-echo "configure:7452: checking whether $CC accepts ${CFLAGS}" >&5
+echo "configure:7448: checking whether $CC accepts ${CFLAGS}" >&5
if eval "test \"`echo '$''{'ac_guessed_cflags'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo $ac_n "checking whether $F77 accepts ${FFLAGS}""... $ac_c" 1>&6
-echo "configure:7501: checking whether $F77 accepts ${FFLAGS}" >&5
+echo "configure:7497: checking whether $F77 accepts ${FFLAGS}" >&5
if eval "test \"`echo '$''{'ac_guessed_fflags'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
+
trap '' 1 2 15
cat > confcache <<\EOF
# This file is a shell script that caches the results of configure
src/kernel/Makefile
src/tools/Makefile
src/ngmx/Makefile
- src/include/Makefile
- src/include/types/Makefile
- src/contrib/Makefile
- src/contrib/scripts/Makefile
- tutor/Makefile
- tutor/gmxdemo/Makefile
- tutor/nmr1/Makefile
- tutor/nmr2/Makefile
- tutor/water/Makefile
- tutor/speptide/Makefile
- tutor/template/Makefile
- tutor/template/Template.mak
- top/Makefile
- html/Makefile
- html/gif/Makefile
- html/online/Makefile
- man/Makefile src/include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+ src/contrib/Makefile
+ include/Makefile
+ include/types/Makefile
+ scripts/Makefile
+ admin/Makefile
+ share/Makefile
+ share/tutor/Makefile
+ share/tutor/gmxdemo/Makefile
+ share/tutor/nmr1/Makefile
+ share/tutor/nmr2/Makefile
+ share/tutor/water/Makefile
+ share/tutor/speptide/Makefile
+ share/template/Makefile
+ share/template/Template.mak
+ share/top/Makefile
+ share/html/Makefile
+ share/html/images/Makefile
+ share/html/online/Makefile
+ man/Makefile
+ man/man1/Makefile include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
EOF
cat >> $CONFIG_STATUS <<EOF
s%@MDLIB_COND_OBJ@%$MDLIB_COND_OBJ%g
s=XXX_SUFFIX_XXX=$SUFFIX=g
s%@SUFFIX@%$SUFFIX%g
+s%@SHARED_VERSION_INFO@%$SHARED_VERSION_INFO%g
CEOF
EOF
src/kernel/Makefile
src/tools/Makefile
src/ngmx/Makefile
- src/include/Makefile
- src/include/types/Makefile
- src/contrib/Makefile
- src/contrib/scripts/Makefile
- tutor/Makefile
- tutor/gmxdemo/Makefile
- tutor/nmr1/Makefile
- tutor/nmr2/Makefile
- tutor/water/Makefile
- tutor/speptide/Makefile
- tutor/template/Makefile
- tutor/template/Template.mak
- top/Makefile
- html/Makefile
- html/gif/Makefile
- html/online/Makefile
- man/Makefile"}
+ src/contrib/Makefile
+ include/Makefile
+ include/types/Makefile
+ scripts/Makefile
+ admin/Makefile
+ share/Makefile
+ share/tutor/Makefile
+ share/tutor/gmxdemo/Makefile
+ share/tutor/nmr1/Makefile
+ share/tutor/nmr2/Makefile
+ share/tutor/water/Makefile
+ share/tutor/speptide/Makefile
+ share/template/Makefile
+ share/template/Template.mak
+ share/top/Makefile
+ share/html/Makefile
+ share/html/images/Makefile
+ share/html/online/Makefile
+ man/Makefile
+ man/man1/Makefile"}
EOF
cat >> $CONFIG_STATUS <<\EOF
for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
if test "${CONFIG_HEADERS+set}" != set; then
EOF
cat >> $CONFIG_STATUS <<EOF
- CONFIG_HEADERS="src/include/config.h"
+ CONFIG_HEADERS="include/config.h"
EOF
cat >> $CONFIG_STATUS <<\EOF
fi
EOF
cat >> $CONFIG_STATUS <<\EOF
-test -z "$CONFIG_HEADERS" || echo timestamp > src/include/stamp-h
+test -z "$CONFIG_HEADERS" || echo timestamp > include/stamp-h
exit 0
EOF
dnl It does *not* correspond to the release number.
SHARED_VERSION_INFO="1:0:0"
AC_PREFIX_DEFAULT(/usr/local/gromacs)
-AM_CONFIG_HEADER(src/include/config.h)
+AM_CONFIG_HEADER(include/config.h)
#######################################################################
# User options
if test "$enable_vectorized_recip" = "yes"; then
AC_DEFINE(VECTORIZE_RECIP,,[Vectorize the reciprocal calculation])
fi
+
+AC_DEFINE_UNQUOTED(GMXLIBDIR,"${datadir}/top",[Default topology file location])
-if test "${prefix}" = "NONE"; then
- AC_DEFINE_UNQUOTED(GMXLIBDIR,"${ac_default_prefix}/top",[Default topology file location])
-else
- AC_DEFINE_UNQUOTED(GMXLIBDIR,"${prefix}/top",[Default topology file location])
-fi
# Check if there are any optimizations and options for this arch and cpu
ACX_COMPILER_MAXOPT
AC_SUBST(bindir)
AC_SUBST(libdir)
+AC_SUBST(SHARED_VERSION_INFO)
AC_OUTPUT([Makefile
src/Makefile
src/kernel/Makefile
src/tools/Makefile
src/ngmx/Makefile
- src/include/Makefile
- src/include/types/Makefile
- src/contrib/Makefile
- src/contrib/scripts/Makefile
- tutor/Makefile
- tutor/gmxdemo/Makefile
- tutor/nmr1/Makefile
- tutor/nmr2/Makefile
- tutor/water/Makefile
- tutor/speptide/Makefile
- tutor/template/Makefile
- tutor/template/Template.mak
- top/Makefile
- html/Makefile
- html/gif/Makefile
- html/online/Makefile
- man/Makefile])
+ src/contrib/Makefile
+ include/Makefile
+ include/types/Makefile
+ scripts/Makefile
+ admin/Makefile
+ share/Makefile
+ share/tutor/Makefile
+ share/tutor/gmxdemo/Makefile
+ share/tutor/nmr1/Makefile
+ share/tutor/nmr2/Makefile
+ share/tutor/water/Makefile
+ share/tutor/speptide/Makefile
+ share/template/Makefile
+ share/template/Template.mak
+ share/top/Makefile
+ share/html/Makefile
+ share/html/images/Makefile
+ share/html/online/Makefile
+ man/Makefile
+ man/man1/Makefile])
echo ""
echo "GROMACS is ready to compile. Summary of main options:"
-/* src/include/config.h.in. Generated automatically from configure.in by autoheader. */
+/* include/config.h.in. Generated automatically from configure.in by autoheader. */
/* Define to empty if the keyword does not work. */
#undef const
/* Default topology file location */
#undef GMXLIBDIR
-/* Default topology file location */
-#undef GMXLIBDIR
-
#
# Don't edit - this file is generated automatically from Makefile.am
#
-includetypesdir = ${prefix}/include/types
+includetypesdir = ${includedir}/types
includetypes_HEADERS = \
atoms.h edsams.h forcerec.h ifunc.h \
# Don't edit - this file is generated automatically from Makefile.am
#
-man_MANS = g_dih.1 g_msd.1 g_tcaf.1 nmrun.1 \
- do_dssp.1 g_dipoles.1 g_nmeig.1 g_traj.1 \
- pdb2gmx.1 editconf.1 g_disre.1 g_nmens.1 \
- g_velacc.1 protonate.1 eneconv.1 g_dist.1 \
- g_order.1 genbox.1 tpbconv.1 g_anaeig.1 \
- g_dyndom.1 g_potential.1 genconf.1 trjcat.1 \
- g_analyze.1 g_enemat.1 g_rama.1 genion.1 \
- trjconv.1 g_angle.1 g_energy.1 g_rdf.1 \
- genpr.1 trjorder.1 g_bond.1 g_gyrate.1 \
- g_rms.1 gmxcheck.1 wheel.1 g_bundle.1 \
- g_h2order.1 g_rmsdist.1 gmxdump.1 x2top.1 \
- g_chi.1 g_hbond.1 g_rmsf.1 grompp.1 \
- xpm2ps.1 g_cluster.1 g_helix.1 g_rotacf.1 \
- highway.1 xrama.1 g_confrms.1 g_lie.1 \
- g_saltbr.1 make_ndx.1 g_covar.1 g_mdmat.1 \
- g_sas.1 mdrun.1 g_density.1 g_mindist.1 \
- g_sgangle.1 mk_angndx.1 g_morph.1 g_sorient.1 \
- ngmx.1 g_dielectric.1
+SUBDIRS = man1
-EXTRA_DIST = ${man_MANS}
\ No newline at end of file
+CLEANFILES = *~ \\\#*
\ No newline at end of file
--- /dev/null
+## Process this file with automake to produce Makefile.in
+#
+# Don't edit - this file is generated automatically from Makefile.am
+#
+
+man_MANS = g_dih.1 g_msd.1 g_tcaf.1 nmrun.1 \
+ do_dssp.1 g_dipoles.1 g_nmeig.1 g_traj.1 \
+ pdb2gmx.1 editconf.1 g_disre.1 g_nmens.1 \
+ g_velacc.1 protonate.1 eneconv.1 g_dist.1 \
+ g_order.1 genbox.1 tpbconv.1 g_anaeig.1 \
+ g_dyndom.1 g_potential.1 genconf.1 trjcat.1 \
+ g_analyze.1 g_enemat.1 g_rama.1 genion.1 \
+ trjconv.1 g_angle.1 g_energy.1 g_rdf.1 \
+ genpr.1 trjorder.1 g_bond.1 g_gyrate.1 \
+ g_rms.1 gmxcheck.1 wheel.1 g_bundle.1 \
+ g_h2order.1 g_rmsdist.1 gmxdump.1 x2top.1 \
+ g_chi.1 g_hbond.1 g_rmsf.1 grompp.1 \
+ xpm2ps.1 g_cluster.1 g_helix.1 g_rotacf.1 \
+ highway.1 xrama.1 g_confrms.1 g_lie.1 \
+ g_saltbr.1 make_ndx.1 g_covar.1 g_mdmat.1 \
+ g_sas.1 mdrun.1 g_density.1 g_mindist.1 \
+ g_sgangle.1 mk_angndx.1 g_morph.1 g_sorient.1 \
+ ngmx.1 g_dielectric.1
+
+EXTRA_DIST = ${man_MANS}
\ No newline at end of file
# Don't edit - this file is generated automatically from Makefile.am
#
-# These scripts aren't installed, but should go in the distribution
-
-EXTRA_DIST = grompplog2top make_gromos_nb.pl make_gromos_rtp.py \
- mkhtml mkonline make_gromos_bon.pl \
- mkcompl mknroff make_gromos_rtp.pl \
- mktex GMXRC NOGMX
-
-
+EXTRA_DIST = grompplog2top make_gromos_nb.pl make_gromos_rtp.py \
+ make_gromos_bon.pl make_gromos_rtp.pl
#
# Don't edit - this file is generated automatically from Makefile.am
#
-SUBDIRS = . gif online
+SUBDIRS = . images online
-htmldir = ${prefix}/html
+htmldir = ${datadir}/html
html_DATA = online.html
+++ /dev/null
-Makefile.in
<TD>
<TH ALIGN=CENTER>Cooling to zero
<TR>
-<TD ALIGN=CENTER><IMG SRC="gif/annealup.gif">
+<TD ALIGN=CENTER><IMG SRC="images/annealup.gif">
<TD>
-<TD ALIGN=CENTER><IMG SRC="gif/annealdn.gif">
+<TD ALIGN=CENTER><IMG SRC="images/annealdn.gif">
</TABLE>
<P>
#
# Don't edit - this file is generated automatically from Makefile.am
#
-gifdir = ${prefix}/html/gif
+imagedir = ${datadir}/html/images
-gif_DATA = \
+image_DATA = \
annealdn.gif features.gif \
flow_leftrightup.gif flow_vrule.gif \
annealup.gif flow_down.gif \
flow_vline.gif topologies.gif \
plotje.gif xvgr.gif
-EXTRA_DIST = ${gif_DATA}
+EXTRA_DIST = ${image_DATA}
CLEANFILES = *~ \\\#*
+
+
+
+
+
+
+
+
+
<table WIDTH="800" NOSAVE NOBORDER >
<tr NOSAVE>
<td WIDTH="120" HEIGHT="140" NOSAVE><a href="http://www.gromacs.org/"><img SRC="
-gif/gmxlogo_small.jpg" BORDER=0 height=133 width=116></a></td>
+images/gmxlogo_small.jpg" BORDER=0 height=133 width=116></a></td>
<td ALIGN=LEFT VALIGN=TOP WIDTH=480 NOSAVE>
<br><br>
#
# Don't edit - this file is generated automatically from Makefile.am
#
-onlinedir = ${prefix}/html/online
+onlinedir = ${datadir}/html/online
online_DATA = \
dat.html g_disre.html g_sorient.html ndx.html \
# Don't edit - this file is generated automatically from Makefile.am
#
-templatedir = ${prefix}/share/template
+templatedir = ${datadir}/template
# we don't build this, it's meant for the user to play with.
# Since a Makefile is used for the installation, we call the
CLEANFILES = *~ \\\#* *.ene *.hat *.tr? *.xtc *.edr *.ene *.xvg core *.log mdout.mdp *.tp? mon.out confout.gro deshuf.ndx output.* *.gz *.ps *.dat *.g87 *~ \\\#*
+
+
+
#
# Don't edit - this file is generated automatically from Makefile.am
#
-topoldir = ${prefix}/top
+topoldir = ${datadir}/top
topol_DATA = \
FF.dat ffgmx.itp ffgmxnb.itp ffgmxbon.itp \
# Don't edit - this file is generated automatically from Makefile.am
#
-SUBDIRS = nmr1 nmr2 speptide water gmxdemo template
+SUBDIRS = nmr1 nmr2 speptide water gmxdemo
-tutordir = ${prefix}/share/tutor
+tutordir = ${datadir}/tutor
tutor_SCRIPTS = cleanit
# Don't edit - this file is generated automatically from Makefile.am
#
-gmxdemodir = ${prefix}/share/tutor/gmxdemo
+gmxdemodir = ${datadir}/tutor/gmxdemo
gmxdemo_DATA = cpeptide.pdb
gmxdemo_SCRIPTS = demo
# Don't edit - this file is generated automatically from Makefile.am
#
-nmr1dir = ${prefix}/share/tutor/nmr1
+nmr1dir = ${datadir}/tutor/nmr1
nmr1_DATA = conf.gro grompp.mdp pep.pdb topol.top
# Don't edit - this file is generated automatically from Makefile.am
#
-nmr2dir = ${prefix}/share/tutor/nmr2
+nmr2dir = ${datadir}/tutor/nmr2
nmr2_DATA = conf.gro genconf.gcp grompp.mdp pep.pdb topol.top
# Don't edit - this file is generated automatically from Makefile.am
#
-speptidedir = ${prefix}/share/tutor/speptide
+speptidedir = ${datadir}/tutor/speptide
speptide_DATA = em.mdp full.mdp pr.mdp speptide.pdb
# Don't edit - this file is generated automatically from Makefile.am
#
-waterdir = ${prefix}/share/tutor/water
+waterdir = ${datadir}/tutor/water
water_DATA = oxygen.ndx spc216.gro spc216.pdb water.mdp water.top
# Don't edit - this file is generated automatically from Makefile.am
#
-include $(srcdir)/Makefile.inc
-
-SUBDIRS = include gmxlib mdlib kernel tools ngmx contrib
+SUBDIRS = gmxlib mdlib kernel tools ngmx contrib
# don't do anything for the local directory
-EXTRA_DIST = Makefile.inc
mdrun:
(cd ${top_builddir}/src/gmxlib && $(MAKE))
+++ /dev/null
-## Process this file with automake to produce Makefile.in
-#
-# Don't edit - this file is generated automatically from Makefile.am
-#
-
-#################
-# We need a second compile command producing executables
-# that can be run on the local host to make the innerloops.
-# In most cases this is identical to the normal one, but not
-# for cross-compilation. We also need it on parallel machines
-# where the MPI executables cannot be run outside a batch queue.
-
-BUILD_COMPILE = $(BUILD_CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-
-#################
-# This might be bad - but I don't know any other way to enable
-# us to type make <progname> in subdirs right now
-#AM_CPPFLAGS = -DHAVE_CONFIG_H
-
-
#
# Don't edit - this file is generated automatically from Makefile.am
#
-SUBDIRS = scripts
-
-include $(srcdir)/../Makefile.inc
# This is necessary for VPATH to work,
# but it can probably be done in a nicer way...
-INCLUDES = @INCLUDES@ -I$(top_srcdir)/src/include
+INCLUDES = @INCLUDES@ -I$(top_srcdir)/include
LDFLAGS = @LDFLAGS@ -L${top_builddir}/src/gmxlib -L${top_builddir}/src/mdlib
LDADD = ../gmxlib/libgmxXXX_SUFFIX_XXX.la ../mdlib/libmdXXX_SUFFIX_XXX.la
-EXTRA_DIST = README programs.txt gromacs-3.0.spec
+EXTRA_DIST = README
# NB: The programs in contrib do not get double/mpi suffixes automatically,
# to make it easier for new developers to understand this file. If you want
# clean things explicitly, since the target names might have changed
CLEANFILES = ${bin_PROGRAMS} ${EXTRA_PROGRAMS} \
*_mpi *_d *~ \\\#*
+
+
+
+
+
+
+
+
+
+
# Note that Makefile is generated automatically from Makefile.in,
# which is automatically generated from Makefile.am
-include $(srcdir)/../Makefile.inc
+
#
# This is necessary for VPATH builds (and thus distcheck) to work,
# but it can probably be included in a nicer way...
-INCLUDES = @INCLUDES@ -I$(top_srcdir)/src/include
+INCLUDES = @INCLUDES@ -I$(top_srcdir)/include
# produce the gmx library
#
#
libgmxXXX_SUFFIX_XXX_la_LIBADD = @GMXLIB_COND_OBJ@
-
libgmxXXX_SUFFIX_XXX_la_DEPENDENCIES = @GMXLIB_COND_OBJ@
+libgmxXXX_SUFFIX_XXX_la_LDFLAGS = -version-info @SHARED_VERSION_INFO@
+
+
# The inner loops
innerf.f: mkinl
mkinl_recip.c mkinl_interactions.c metacode.c \
mkinl.h mkinl_fortrandata.h
+BUILD_COMPILE = $(BUILD_CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+
metacode.o: metacode.c
$(BUILD_COMPILE) -c $(srcdir)/metacode.c
mkinl.o: mkinl.c
# clean things explicitly, since the target names might have changed
CLEANFILES = ${lib_LTLIBRARIES} *_d.la *_mpi.la *~ \\\#* innerc.c innerf.f mkinl
+
+
+
+
+
static char *SRCID_futil_c = "$Id$";
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include "sysstuff.h"
#include "string2.h"
#include "futil.h"
#include "network.h"
#include "fatal.h"
#include "smalloc.h"
+#include "statutil.h"
typedef struct t_pstack {
FILE *fp;
return ff;
}
-char *low_libfn(char *file,bool bFatal)
+
+
+bool search_subdirs(char *parent, char *libdir)
+{
+ char *ptr;
+ bool found;
+
+ /* Search a few common subdirectory names for the gromacs library dir */
+ sprintf(libdir,"%s/share/top/FF.dat",parent);
+ found=fexist(libdir);
+ if(!found) {
+ sprintf(libdir,"%s/share/gromacs/top/FF.dat",parent);
+ found=fexist(libdir);
+ }
+ if(!found) {
+ sprintf(libdir,"%s/share/gromacs-%s/top/FF.dat",parent,VERSION);
+ found=fexist(libdir);
+ }
+ if(!found) {
+ sprintf(libdir,"%s/share/gromacs/gromacs-%s/top/FF.dat",parent,VERSION);
+ found=fexist(libdir);
+ }
+
+ /* Remove the FF.dat part from libdir if we found something */
+ if(found) {
+ ptr=rindex(libdir,'/'); /* slash always present, no check necessary */
+ *ptr='\0';
+ }
+ return found;
+}
+
+bool get_libdir(char *libdir)
+{
+ char bin_name[512];
+ char buf[512];
+ char full_path[512];
+ char test_file[512];
+ char *system_path;
+ char *dir,*ptr;
+ bool found=FALSE;
+ int i;
+
+ /* First - detect binary name */
+ strcpy(bin_name,Program());
+
+ /* Only do the smart search part if we got a real name */
+ if(bin_name && strcmp(bin_name,"GROMACS")) {
+
+ if (!index(bin_name,'/')) {
+ /* No "/" in name means it must be in the path - search it! */
+ system_path=getenv("PATH");
+ found=FALSE;
+ while(!found && (dir=strsep(&system_path,":"))!=NULL) {
+ sprintf(full_path,"%s/%s",dir,bin_name);
+ found=fexist(full_path);
+ }
+ if(!found)
+ return FALSE;
+ } else if (bin_name[0]!='/') {
+ /* name is relative the current dir */
+ getcwd(buf,sizeof(buf)-1);
+ strcpy(full_path,buf);
+ strcat(full_path,bin_name+1);
+ }
+
+ /* Now we should have a full path and name in full_bin_name,
+ * but it might be a link, or a link to a link to a link...
+ */
+ while( (i=readlink(full_path,buf,sizeof(buf)-1)) > 0 ) {
+ buf[i]='\0';
+ /* If it doesn't start with "/" it is relative */
+ if(buf[0]!='/') {
+ strcpy(rindex(full_path,'/')+1,buf);
+ } else
+ strcpy(full_path,buf);
+ }
+
+ /* Remove the executable name - it always contains at least one slash */
+ *(rindex(full_path,'/')+1)='\0';
+
+ /* Now we have the full path to the gromacs executable.
+ * Use it to find the library dir.
+ */
+ found=FALSE;
+ while(!found && ( (ptr=rindex(full_path,'/')) != NULL ) ) {
+ *ptr='\0';
+ found=search_subdirs(full_path,libdir);
+ }
+ }
+ /* End of smart searching. If we didn't find it in our parent tree,
+ * or if the program name wasn't set, at least try some standard
+ * locations before giving up, in case we are running from e.g.
+ * a users home directory:
+ */
+ if(!found)
+ found=search_subdirs("/usr/local",libdir);
+ if(!found)
+ found=search_subdirs("/usr",libdir);
+ if(!found)
+ found=search_subdirs("/opt",libdir);
+
+ return found;
+}
+
+
+char *low_libfn(char *file, bool bFatal)
{
char *ret=NULL;
char *lib;
static char buf[1024];
static char libdir[1024];
static int bFirst=1;
-
+ static bool env_is_set;
+
if(bFirst) {
- if((lib=getenv("GMXLIB")) != NULL)
+ lib=getenv("GMXLIB");
+ if(lib!=NULL) {
+ env_is_set=TRUE;
strcpy(libdir,lib);
- else
- strcpy(libdir,GMXLIBDIR);
+ } else {
+ env_is_set=FALSE;
+ if(get_libdir(libdir))
+ strcpy(libdir,GMXLIBDIR);
+ }
bFirst=0;
}
sprintf(buf,"%s/%s",libdir,file);
ret=buf;
if (bFatal && !fexist(ret))
- fatal_error(0,"Library file %s not found in current dir nor in libdir %s",
- ret,libdir);
+ fatal_error(0,"Library file %s not found in current dir nor in libdir %s\n"
+ "%s\n",ret,libdir,
+ env_is_set ? "" : "(You can override libdir with the GMXLIB environment variable.)");
}
return ret;
}
+
+
+
FILE *low_libopen(char *file,bool bFatal)
{
FILE *ff;
fprintf(out,"<table WIDTH=\"800\" NOBORDER >\n<TR>\n");
fprintf(out,"<td WIDTH=\"120\" HEIGHT=\"133\">\n"
"<a href=\"http://www.gromacs.org/\">"
- "<img SRC=\"../gif/gmxlogo_small.jpg\""
+ "<img SRC=\"../images/gmxlogo_small.jpg\""
"BORDER=0 height=133 width=116></a></td>");
fprintf(out,"<td ALIGN=LEFT VALIGN=TOP WIDTH=480>"
"<br><br><h2>GROMACS Online Reference:<br>%s</h2>",program);
# Don't edit - this file is generated automatically from Makefile.am
#
-include $(srcdir)/../Makefile.inc
-
# This is necessary for VPATH to work,
# but it can probably be done in a nicer way...
-INCLUDES = @INCLUDES@ -I$(top_srcdir)/src/include
+INCLUDES = @INCLUDES@ -I$(top_srcdir)/include
LDFLAGS = @LDFLAGS@ -L${top_builddir}/src/gmxlib -L${top_builddir}/src/mdlib
LDADD = ../gmxlib/libgmxXXX_SUFFIX_XXX.la ../mdlib/libmdXXX_SUFFIX_XXX.la
# Don't edit - this file is generated automatically from Makefile.am
#
-include $(srcdir)/../Makefile.inc
-
# This is necessary for VPATH to work,
# but it can probably be done in a nicer way...
-INCLUDES = @INCLUDES@ -I$(top_srcdir)/src/include
+INCLUDES = @INCLUDES@ -I$(top_srcdir)/include
# Dependencies and extra objects should come before the target definition
libmdXXX_SUFFIX_XXX_la_LIBADD = @MDLIB_COND_OBJ@
# Don't edit - this file is generated automatically from Makefile.am
#
-include $(srcdir)/../Makefile.inc
-
# This is necessary for VPATH to work,
# but it can probably be done in a nicer way...
-INCLUDES = @INCLUDES@ -I$(top_srcdir)/src/include
+INCLUDES = @INCLUDES@ -I$(top_srcdir)/include
LDFLAGS = @LDFLAGS@ -L${top_builddir}/src/gmxlib -L${top_builddir}/src/mdlib
LDADD = ../gmxlib/libgmxXXX_SUFFIX_XXX.la ../mdlib/libmdXXX_SUFFIX_XXX.la
#
# Don't edit - this file is generated automatically from Makefile.am
#
-include $(srcdir)/../Makefile.inc
# This is necessary for VPATH to work,
# but it can probably be done in a nicer way...
-INCLUDES = @INCLUDES@ -I$(top_srcdir)/src/include
+INCLUDES = @INCLUDES@ -I$(top_srcdir)/include
LDFLAGS = @LDFLAGS@ -L${top_builddir}/src/gmxlib -L${top_builddir}/src/mdlib
LDADD = ../gmxlib/libgmxXXX_SUFFIX_XXX.la ../mdlib/libmdXXX_SUFFIX_XXX.la