From: Susana Tomasio (susietomasio_at_gmail.com)
Date: Mon Mar 14 2011 - 11:52:49 CDT

Hi all,

I'm compiling the fortran bindings for the VMD molfile plugins from Axel
Kohlmeyer.

I've compiled the molfile plugins but I am having a linkage problem when
compliling the
fortran bindings. I am using a MacOSX Snow Leopard.
This is the error that I get when I type 'make":

g77 -c -O2 -Wall tester.f -o tester.o
gcc -c -I/Users/tomasio/plugins/include/ -I/Users/tomasio/plugins/MACOSXX86
-O2 -Wall f77_molfile.c -o f77_molfile.o
g77 -o tester -L/Users/tomasio/plugins/MACOSXX86/molfile
/opt/local/var/macports/software/tcl/8.5.9_0/opt/local/lib/
-L/opt/local/var/macports/software/netcdf/4.1.1_4+dap+netcdf4/opt/local/lib/
tester.o f77_molfile.o -lmolfile_plugin -lnetcdf -ltcl8.5-L/usr/lib/-lstdc++
-ldl
ld: library not found for -ltcl8.5-L/usr/lib/-lstdc++
collect2: ld returned 1 exit status
make: *** [tester] Error 1

And this is the edit section of my Makefile:

ARCH = MACOSX86-64
ARCHDIR = /Users/tomasio/plugins/MACOSXX86/molfile
FC = g77
#FC = g77
#-fno-second-underscore

CC = gcc
LD = $(FC)
OPT = -O2 -Wall
CPPFLAGS = -I/Users/tomasio/plugins/include/
-I/Users/tomasio/plugins/MACOSXX86 #
-D_F77_F2C_UNDERSCORE

CFLAGS = -c $(CPPFLAGS) $(OPT)
FFLAGS = -c $(OPT)
NETCDFLIB =
-L/opt/local/var/macports/software/netcdf/4.1.1_4+dap+netcdf4/opt/local/lib/
#/usr/lib64/netcdf-3

NETCDFLDFLAGS = -lnetcdf
TCLLIB = /opt/local/var/macports/software/tcl/8.5.9_0/opt/local/lib/
TCLLDFLAGS = -ltcl8.5
LDFLAGS = -L$(ARCHDIR) $(TCLLIB) $(NETCDFLIB)
LDLIBS = -lmolfile_plugin $(NETCDFLDFLAGS)
$(TCLLDFLAGS)-L/usr/lib/-lstdc++ -ldl

I tried with gfortran and got the same error.
I would be grateful if anyone could help me with this.

Thank you,

Susana