0

I am trying to compile Tesseract so I can run it on IBMi 7.3 (AS400, iSeries, System/i) which has a Power PC architecture. I haven't done any C compiling with makefiles for decades so I found and am following these instruction (with thanks) and am compiling Leptonica (1.80) as a prerequisite. After some problem solving I have managed to do ./configure which seemed to work okay. Then I tried make which didn't but I read somewhere to try gmake which does quite a lot but it produces errors:

CC       webpanimiostub.lo                                                
CC       writefile.lo                                                     
CC       zlibmem.lo                                                       
CC       zlibmemstub.lo                                                   
CCLD     liblept.la                                                       
ar: 0707-126 adaptmap.o is not valid with the current object file mode.     
        Use the -X option to specify the desired object mode.               
ar: 0707-126 affine.o is not valid with the current object file mode.       
        Use the -X option to specify the desired object mode.               
ar: 0707-126 affinecompose.o is not valid with the current object file mode.

So I'm wondering if I should worry about those messages (there are well over 100 of them)?

After all those it says:

ar: 0707-126 zlibmemstub.o is not valid with the current object file mode.
        Use the -X option to specify the desired object mode.             
gmake[2]: *** [Makefile:545: liblept.la] Error 179               
gmake[2]: Leaving directory '/home/mydir/leptonica-1.80.0/src'
gmake[1]: *** [Makefile:522: all-recursive] Error 1              
gmake[1]: Leaving directory '/home/mydir/leptonica-1.80.0'    
gmake: *** [Makefile:406: all] Error 2                           

Lines 544 and 545 of src/Makefile say:

liblept.la: $(liblept_la_OBJECTS) $(liblept_la_DEPENDENCIES) $(EXTRA_liblept_la_DEPENDENCIES) 
    $(AM_V_CCLD)$(liblept_la_LINK) -rpath $(libdir) $(liblept_la_OBJECTS) $(liblept_la_LIBADD) $(LIBS)

I have trawled the net in vain to find any clues so any help much appreciated, Mark.

M. A. Wheadon
  • 101
  • 1
  • 8
  • This is kind of a shot in the dark - I work on Linux on Power rather than IBM i - but looking at https://github.com/openssl/openssl/issues/5659#issuecomment-375022992 , https://stackoverflow.com/questions/14196575/compiling-pcre-8-32-on-aix-6-1-64-bit for AIX, it looks like you might need to specify `OBJECT_MODE=64` and `AR="ar -X64"`... – dja Oct 02 '20 at 06:48
  • @dja That did indeed allow the compilation to complete, so thank you very much. If you want to add the answer I'll tick it off. Tesseract compile says it can't find a version >1.71 even though I have PKG_CONFIG_PATH=/usr/local/lib/pkgconfig and in there lept.pc says it is version 1.80.0. I guess that is the next thing to sort out. – M. A. Wheadon Oct 21 '20 at 15:32

1 Answers1

1

Looking at https://github.com/openssl/openssl/issues/5659#issuecomment-375022992 and Compiling pcre 8.32 on AIX 6.1 64 bit for AIX, it looks like you might need to specify OBJECT_MODE=64 and AR="ar -X64".

dja
  • 1,453
  • 14
  • 20
  • 1
    This `ar -X64` problem is rather common when compiling on AIX in 64-bit. Sometimes exporting `AR='ar -X64'` and/or adding this into `configure` is enough, other times you have to edit `Makefile`s before `make`. – Zsigmond Lőrinczy Nov 02 '20 at 05:29