anonymous user

Forums   Register   Login   Forgot your login/password?   Search

Compiling Sphinx in IBM AIX 6.1 and later environments

Common forum | 1 | 2 | 3 | 4 | 5 | ... | 450 | 451 | 452 | 453 | next »» | Create new thread

sunderwood

Name: Steve Underwood
Posts: 3

2012-07-31 15:09:29 | reply!


Hi All:

I'm trying to get Sphinx 2.0.4 compiled on an AIX 6.1 platform that has a GNU C/C++
compiler installed on it:

$ uname -a
AIX thief 1 6 00C00D844C00

$ gcc -v
Using built-in specs.
Target: powerpc-ibm-aix6.1.0.0
Configured with: ../gcc-4.4.5/configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld
--enable-languages=c,c++,fortran --prefix=/opt/freeware --enable-threads
--enable-version-specific-runtime-libs --disable-nls --enable-decimal-float=dpd
--host=powerpc-ibm-aix6.1.0.0
Thread model: aix
gcc version 4.4.5 (GCC)

The "configure" script is being invoked with the following options:

--prefix=/usr1/vtk-2.0.0 --sysconfdir=/usr1/vtk-2.0.0/etc/sphinx
--localstatedir=/usr1/vtk-2.0.0/var/sphinx --without-mysql --enable-id64

at the same time the CFLAGS/CXXFLAGS environment variables are each set to a value of
"-maix64" (informs the GNU compiler AIX 64-bit object is to be produced).

The first issue encountered was with the constant variable definition of "PAGE_SIZE" in
the "CSphArena" class found within the "sphinx.cpp" module. Near as I can tell, this
constant variable definition conflicts with a AIX manifest constant definition found in
AIX's "/usr/include/sys/limits.h" header file. To circumvent this issue, I changed all
instances of the constant variable within the "sphinx.cpp" module named "PAGE_SIZE" to be
"SPHINX_PAGE_SIZE" instead.

That change allowed the compile to progress to the following error message that has me
scratching my head which is no big surprise as I'm not by any stretch of the imagination
a C++ developer. The error message being generated by the compiler is:

g++ -DHAVE_CONFIG_H -I. -I../config -DSYSCONFDIR="\"/usr1/vtk-2.0.0/etc/sphinx\""
-DDATADIR="\"/usr1/vtk-2.0.0/var/sphinx/data\"" -I/usr/local/include -pthread -maix64
-D_FILE_OFFSET_BITS=64 -DNDEBUG -MT sphinxsort.o -MD -MP -MF .deps/sphinxsort.Tpo -c -o
sphinxsort.o sphinxsort.cpp
mv -f .deps/sphinxsort.Tpo .deps/sphinxsort.Po
g++ -DHAVE_CONFIG_H -I. -I../config -DSYSCONFDIR="\"/usr1/vtk-2.0.0/etc/sphinx\""
-DDATADIR="\"/usr1/vtk-2.0.0/var/sphinx/data\"" -I/usr/local/include -pthread -maix64
-D_FILE_OFFSET_BITS=64 -DNDEBUG -MT sphinxexpr.o -MD -MP -MF .deps/sphinxexpr.Tpo -c -o
sphinxexpr.o sphinxexpr.cpp
In file included from sphinxexpr.cpp:18:
sphinxudf.h:53: error: expected ';' before '.' token
sphinxexpr.cpp: In constructor 'UdfCall_t::UdfCall_t()':
sphinxexpr.cpp:106: error: 'struct SPH_UDF_INIT' has no member named 't_union'
make[2]: *** [sphinxexpr.o] Error 1
make[2]: Leaving directory `/usr1/vtk-2.0.0/src/build/sphinx-2.0.5-release/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr1/vtk-2.0.0/src/build/sphinx-2.0.5-release/src'
make: *** [all-recursive] Error 1

Would you folks have any insight into what might be causing this error? I don't see any
problem with the SPH_UDF_INIT struct typedef found around line 53 in the "sphinxudf.h"
module but the again, as I've already admitted, I'm far from being a qualified resource
when it comes to the syntax of C++. Does the above error mean anything to you folks? Or
can you point me to some online Sphinx resource more geared to AIX builds?

Thanks for any insight you might be able to offer.

sunderwood

Name: Steve Underwood
Posts: 3

to: sunderwood, 2012-08-02 20:12:55 | reply!


Well ... some breadcrumbs for those who choose to compile in an AIX world ...

1. As mentioned in the original post, the PAGE_SIZE constant variable defined in the
"sphinx.cpp" module conflicts with a manifest constant of the same name in AIX's
"/usr/include/sys/limits.h" header file. This problem was avoided by renaming all
occurences of the PAGE_SIZE constant variable in "sphinx.cpp" to something else (e.g.
SPHINX_PAGE_SIZE);

2. The "func_data" void pointer variable in the "sphinxudf.h" module conflicts with a
manifest constant of the same name on AIX's "/usr/include/sys/timer.h" header file. This
issue was preventing the "sphinxexpr.cpp" module from compiling and was addressed by
including "-D_LINUX_SOURCE_COMPAT" as one of the values assigned to the CFLAGS and
CXXFLAGS environment variables before invoking the build of Sphinx. The
"_LINUX_SOURCE_COMPAT" flag causes the AIX "timer.h" header file not to define
"func_data" as a manifest constant;

3. The "WCOREDUMP" preprocessor macro referenced in the "searchd.cpp" module is not
supported in AIX and was preventing Sphinx "searchd" program from linking due to an
undefined reference. This issue was resolved by injecting the following preprocessor
directives:

                #ifndef WCOREDUMP
                #define WCOREDUMP(x) 0
                #endif

into the "searchd.cpp" module just before the preprocessor directives dealing with the
MSG_NOSIGNAL manifest constant; and

4. I had to ensure AIX's native "ar" tool was used instead of the GNU version of "ar"
lest the assembly of the "libsphinx.a" static archive library be plagued with a multitude
of warnings similar to:

            # BFD: sphinx.o: Unrecognized storage class 111 for .text symbol `._Z7sphLog2m'

With the above four issues addressed, I was able to get Sphinx release 2.0.5 at least
compiled on an AIX 6.1 platform using the GNU 4.4.5 C/C++ compiler. Now to move on and
see if it actually works.

Happy trails :-)

anu_philip01

Name: anu jacob
Posts: 4

to: sunderwood, 2013-03-17 10:23:48 | reply!


hi ,
Please could you please tell me where I can download the Sphinx Search Engine for AIX.
Also could you please provide your comments on the product

thanks in advance.

waiting for your reply

anu

sunderwood

Name: Steve Underwood
Posts: 3

to: anu_philip01, 2013-04-18 15:12:24 | reply!


Hi Anu:

Apologies for my tardiness in replying.

At the time I was working on getting Sphinx compiled, I did not find any site that was
offering up Sphinx in an "already-compiled-for-AIX" package; hence my own effort in
getting it to compile on AIX and the breadcrumbs I left for those wishing to follow in my
path. So unless circumstances have changed, I suspect your options for getting Sphinx
onto AIX are to compile it yourself from source or to engage (i.e. pay) the Sphinx
programmers to port it to AIX for you.

As for the product itself, our developers seem pleased with its performance but beyond
that, I cannot offer any more insight. My role was solely to get Sphinx ported to our AIX
environment so that developers could test it there.

Best regards,
Steve

Common forum | 1 | 2 | 3 | 4 | 5 | ... | 450 | 451 | 452 | 453 | next »» | Create new thread