building a 64-bit archive library

I'm trying to build an archive library using the following script. It builds fine on 32-bit architectures, but when I try to build on a computer with 64-bit architecture I get this error message: /usr/bin/ld: warning: i386 architecture of input file `../lpdlib/lpdlib_byteswapio.a(system.o)' is incompatible with i386:x86-64 output

I'm extremely unfamiliar with library building commands and can't figure out how to specify the architecture of the input object files. Any clues?

Makefile:

FORT_COMP= pgf90
FORT_OPTS= -c -Mvect -Minfo -Munroll -Mnoframe -O2 -pc 64 -Mnofree -Mbyteswapio
ARCHIVE=ar rs
RANLIB =ls

LIB=lpdlib_byteswapio.a

SOURCE = cpart.f names.f polar.f random.f surfer.f system.f vform.f interpol.f polarst.f

$(LIB): $(SOURCE)
$(FORT_COMP) $(FORT_OPTS) $(?)
$(ARCHIVE) $(LIB) $(?:.f=.o)
$(RANLIB) $(LIB)
rm -f $(?:.f=.o)

The simpler answer is: `../lpdlib/lpdlib_byteswapio.a
was compiled 32 bit or with a compiler that does not emit code that is compatible with 64 bit linux.

You will have to recompile the library on the machine you are on.
Or recompile on the old machine using gcc with the -m64 option which produces 64 bit code.

I don't know what the 64 option does with your compiler.

You can compile fortran with the normal gcc distribution. I would compile it on the box you're using. Your compiler did not emit 64 bit ELF compatible object code. It looks like to me anyway.