LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   warning: unknown architecture of input file *** incompatible with i386 output (https://www.linuxquestions.org/questions/linux-newbie-8/warning-unknown-architecture-of-input-file-%2A%2A%2A-incompatible-with-i386-output-528958/)

johnpaulodonnell 02-14-2007 07:35 AM

warning: unknown architecture of input file *** incompatible with i386 output
 
Hi.

Trying to compile a seismic format conversion program ms2sac on a 32-bit machine running Mandrake 9.2. The compiler is the cc compiler. Getting the following error messages:

[jp@seismic ms2sac]$ make
(cd ../qlib2; make)
make[1]: Entering directory `/home/jp/ms2sac/qlib2'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/jp/ms2sac/qlib2'
cc -g -I../qlib2 -DDEFAULT_COORD_FILE=\"/usr/contrib/data/bdsn/bdsn.coord\" -o ms2sac ms2sac.o read_mseed_data.o get_stn_evt_info.o init_sac_header.o write_sac.o ../qlib2/libqlib2.a -lm
/usr/bin/ld: warning: unknown architecture of input file `../qlib2/libqlib2.a(qlib2_version.o)' is incompatible with i386 output
/usr/bin/ld: warning: unknown architecture of input file `../qlib2/libqlib2.a(ms_utils.o)' is incompatible with i386 output
/usr/bin/ld: warning: unknown architecture of input file `../qlib2/libqlib2.a(ms_unpack.o)' is incompatible with i386 output
/usr/bin/ld: warning: unknown architecture of input file `../qlib2/libqlib2.a(qtime.o)' is incompatible with i386 output
/usr/bin/ld: warning: unknown architecture of input file `../qlib2/libqlib2.a(sdr_utils.o)' is incompatible with i386 output
/usr/bin/ld: warning: unknown architecture of input file `../qlib2/libqlib2.a(unpack.o)' is incompatible with i386 output
/usr/bin/ld: warning: unknown architecture of input file `../qlib2/libqlib2.a(qutils.o)' is incompatible with i386 output
/usr/bin/ld: warning: unknown architecture of input file `../qlib2/libqlib2.a(drm_utils.o)' is incompatible with i386 output
/usr/bin/ld: warning: unknown architecture of input file `../qlib2/libqlib2.a(qda_utils.o)' is incompatible with i386 output
/usr/bin/ld: BFD 2.14.90.0.5 20030722 internal error, aborting at elf32-i386.c line 2242 in elf_i386_relocate_section

/usr/bin/ld: Please report this bug.

collect2: ld returned 1 exit status
make: *** [ms2sac] Error 1


So this is some kind of 64-bit / 32-bit clash? The relevant part of the Makefile is:

########################################################################
TARGET = ms2sac

SRCS = $(TARGET).c read_mseed_data.c get_stn_evt_info.c \
init_sac_header.c write_sac.c

OBJS = $(SRCS:%.c=%.o)

COORD_FILE = \"/usr/contrib/data/bdsn/stat.db.coord\"
IQLIB2 = -I../qlib2
QLIB2 = ../qlib2/libqlib2.a
LIBS = $(QLIB2) -lm

.PRECIOUS: $(QLIB2)

BINDIR = /usr/local/bin
MANDIR = /usr/local/man
MANEXT = 1

CC = cc
COPT = -g
CFLAGS = $(COPT) $(IQLIB2) -DDEFAULT_COORD_FILE=$(COORD_FILE)

########################################################################


The ms2sac program needs qlib2 stuff...which does compile ok - see above. Any help with sorting this out would be much appreciated...I don't really know much at all about different architecture issues.

Thanks.

colucix 02-14-2007 08:23 AM

It seems libqlib2.a has been compiled previously for another OS (like SUN or any other). Indeed, the following lines tell that qlib2 has not been compiled from your system, because the binaries were already there!
Code:

make[1]: Entering directory `/home/jp/ms2sac/qlib2'
make[1]: Nothing to be done for `all'.

You can try to go into directory qlib2 and issue a
Code:

make clean
command. This will hopefully remove any previously compiled qlib2 object file. Then try to do
Code:

make
inside qlib2. After this you can return to the ms2sac dir and proceed with compiling.

johnpaulodonnell 02-14-2007 08:37 AM

It seems libqlib2.a has been compiled previously for another OS (like SUN or any other). Indeed, the following lines tell that qlib2 has not been compiled from your system, because the binaries were already there!
Code:

make[1]: Entering directory `/home/jp/ms2sac/qlib2' make[1]: Nothing to be done for `all'.

Unfortunatley that isn't the problem! When I first downloaded the qlib2 package there were binaries included but they would not execute...most likely for the reason you say. So I deleted them and ran make in the qlib2 directory - then went on to the ms2sac directory. That's why the Nothing to be done for 'all' is there at the top.

There was a ms2sac binary as well but of course this didn't execute either...

Thanks anyway!

colucix 02-14-2007 09:58 AM

Quote:

Originally Posted by johnpaulodonnell
So I deleted them and ran make in the qlib2 directory - then went on to the ms2sac directory.

Do you mean you have manually deleted them? I'd suggest to download the qlib2 source again and do a safe "make clean", instead. Don't give up... I am pretty sure there is a workaround for this compilation issue! :)

johnpaulodonnell 02-14-2007 10:41 AM

Tried that but getting same errors! One other thing...at the end of the makefile there's a list of the object files and their dependencies:

Code:

                              .......................................................
                              .......................................................
########################################################################
# DO NOT DELETE THIS LINE -- make depend depends on it.

init_sac_header.o: /usr/include/stdio.h /usr/include/sys/feature_tests.h
init_sac_header.o: /usr/include/sys/va_list.h ../qlib2/qlib2.h
init_sac_header.o: /usr/include/sys/param.h /usr/include/sys/types.h
init_sac_header.o: /usr/include/sys/isa_defs.h /usr/include/sys/machtypes.h
init_sac_header.o: /usr/include/sys/int_types.h /usr/include/sys/select.h
init_sac_header.o: /usr/include/sys/time.h /usr/include/sys/time.h
init_sac_header.o: /usr/include/sys/unistd.h ../qlib2/drm_seismo.h procs.h
init_sac_header.o: sachead.h
ms2sac.o: /usr/include/stdio.h /usr/include/sys/feature_tests.h
ms2sac.o: /usr/include/sys/va_list.h version.h ../qlib2/qlib2.h
ms2sac.o: /usr/include/sys/param.h /usr/include/sys/types.h
ms2sac.o: /usr/include/sys/isa_defs.h /usr/include/sys/machtypes.h
ms2sac.o: /usr/include/sys/int_types.h /usr/include/sys/select.h
ms2sac.o: /usr/include/sys/time.h /usr/include/sys/time.h
ms2sac.o: /usr/include/sys/unistd.h ../qlib2/drm_seismo.h procs.h sachead.h
                          ...........      ETC ETC    ...........

Sorry for the big ream! A lot of these .h files do not exist on my system (Suse10.1) and I've checked Mandrake 9.2 as well and they're not there....eg /usr/include/sys/feature_tests.h

Code:

make: *** No rule to make target `/usr/include/sys/feature_tests.h', needed by `ms2sac.o'.  Stop.
I googled this and it seems that these redundant(?) entries can just be deleted from the makefile. Once I do this I run make to get the original errors...I do not think that the removal of these entries has any bearing on it - although I could well be wrong!

So all in all I'm still stuck!

colucix 02-14-2007 04:44 PM

Indeed, some of the header files are not from Linux... they are usually installed on SUN Solaris! If this incompatibility is for header files only, you can get them from a SUN machine (if available) and hopefully they will be recognized from the compiler. It is likely at this point that the software has been developed for a SUN OS. However I see no apparent reason for the qlib2 you have (successfully?) compiled on your system to be addicted as "incompatible for i386".

Edit: just another hint: check if in the Makefile of qlib2 there is a flag regarding the endianity, since SUN OS are generally installed on BIG ENDIAN architectures, while Linux is generally on LITTLE ENDIAN machines.


All times are GMT -5. The time now is 01:25 PM.