Monday, May 08, 2006

/usr/bin/ld: -L: directory name missing

When compiling xleap under certain version of developer tools, you might encounter such error message:

    gcc -o xaLeap basics.o sysdepend.o stringExtra.o varArray.o getline.o avl.o pdb_format.o pdb_read.o pdb_sprntf.o pdb_sscanf.o pdb_write.o vector.o zMatrix.o sort.o bag.o hash.o dictionary.o database.o nVector.o ring.o matrix.o fortran.o displayer.o assoc.o atom.o byteArray.o collection.o container.o internal.o list.o loop.o molecule.o oDouble.o oInteger.o oString.o objekt.o parmSet.o residue.o unit.o unitio.o tripos.o graphUtil.o select.o amber.o build.o elements.o library.o chirality.o minimizer.o model.o parmLib.o pdbFile.o tools.o variables.o parser.o help.o helptext.o octree.o commands.o mathop.o block.o restraint.o hybrid.o xTank.o xAction.o x3d.o xBasics.o xaLeapc.o xaUnitEditor.o xaTable.o xaAtomTable.o XrawRegistr.o xaCommand.o xaTools.o xaAtomParmTable.o xaBondParmTable.o xaAngleParmTable.o xaParmEditor.o xaTorsionParmTable.o xaImproperParmTable.o xaHBondParmTable.o ../ Xraw/libXaw.a ../Wc/libWcLeap.a ../Xpm/libXpm.a ../Xmu/libXmu.a -L /usr/X11R6/lib -lXt -lXext -lSM -lICE -lX11 -lm -lpthread

    /usr/bin/ld: -L: directory name missing
This is due to somehow more strict behavior in certain versions of ld (the ld on my iMac Core Duo and an user reported that an iMac G5 also has that.). The manual solution is to modify your config.h file before issuing make command: to eliminate the space character between -L and /usr/X11R6/lib. This should solve the problem. A better way to do it is to apply the bugfix.3 patch at AMBER 9 bugfixes page.
% cd amber9/src
% curl http://amber.scripps.edu/bugfixes/9.0/bugfix.3 -o /tmp/bugfix.3
% patch -p0 -N -r patch_rejects < /tmp/bugfix.3