[sword-devel] problems compiling python binding (1.5.10) on OS X Leopard

Jon Brisbin jon at jbrisbin.com
Tue Dec 18 14:15:10 MST 2007


That did it!

Now I've copied the Sword.py module and _Sword.so into a working  
directory and am able to use the command-line python to manipulate it.

My next question is, how is this going to work in a self-contained  
project? I'm guessing it's finding the sword library at /usr/local/ 
sword/lib and this is not portable to other machines, right? If I drop  
the lucene and sword .dylibs into the same working directory, will  
that suffice for finding the library at runtime? Xcode should put that  
into my app package if I include it as a dependency, right?

Remember, I'm fairly new to this and having trouble finding good  
tutorials or online documentation on what I'm trying to do. Take it  
easy on me, okay? :)

Thanks!

Jon Brisbin
http://jbrisbin.com



On Dec 18, 2007, at 2:42 PM, Ben Morgan wrote:

> Hi,
>
> Try make pythonswig in the package directory before doing make  
> python_make. This will generate that file.
>
> -- 
> God Bless,
> Ben
> -------------------------------------------------------------------------------------------
> The Lord is not slow to fulfill his promise as some count slowness,
> but is patient toward you, not wishing that any should perish,
> but that all should reach repentance.
> 2 Peter 3:9 (ESV)
>
>
> On 12/19/07, Jon Brisbin <jon at jbrisbin.com> wrote:
> I've got 10.5.1 of Leopard (with Developer tools, obviously :) and I
> can compile clucene and sword just fine. I put it in /usr/local/sword
>
> Then I went into the bindings/swig/ directory, read the README,
> followed the steps therein and got a few errors:
>
> +-( ~/src/sword-1.5.10/bindings/swig/package ):> ./autogen.sh
> *** copying swig files
> *** Recreating aclocal.m4
> aclocal
> zlib.m4:4: warning: underquoted definition of AC_FIND_ZLIB
> zlib.m4:4:   run info '(automake)Extending aclocal'
> zlib.m4:4:   or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
> *** Recreating configure
> *** Recreating the Makefile.in files
>
> So I ran configure, which seemed to be mostly okay with the setup:
>
> +-( ~/src/sword-1.5.10/bindings/swig/package ):> ./configure
> checking for a BSD-compatible install... /usr/bin/install -c
> checking whether build environment is sane... yes
> checking for a thread-safe mkdir -p... ./install-sh -c -d
> checking for gawk... no
> checking for mawk... no
> checking for nawk... no
> checking for awk... awk
> checking whether make sets $(MAKE)... yes
> checking for gcc... gcc
> checking for C compiler default output file name... a.out
> checking whether the C compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C compiler... yes
> checking whether gcc accepts -g... yes
> checking for gcc option to accept ISO C89... none needed
> checking for style of include used by make... GNU
> checking dependency style of gcc... gcc3
> checking for g++... g++
> checking whether we are using the GNU C++ compiler... yes
> checking whether g++ accepts -g... yes
> checking dependency style of g++... gcc3
> checking for a BSD-compatible install... /usr/bin/install -c
> checking build system type... i686-apple-darwin9.1.0
> checking host system type... i686-apple-darwin9.1.0
> checking for a sed that does not truncate output... /usr/bin/sed
> checking for grep that handles long lines and -e... /usr/bin/grep
> checking for egrep... /usr/bin/grep -E
> checking for ld used by gcc... /usr/libexec/gcc/i686-apple-
> darwin9/4.0.1/ld
> checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld)
> is GNU ld... no
> checking for /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld option to
> reload object files... -r
> checking for BSD-compatible nm... /usr/bin/nm -p
> checking whether ln -s works... yes
> checking how to recognise dependent libraries... pass_all
> checking how to run the C preprocessor... gcc -E
> checking for ANSI C header files... yes
> checking for sys/types.h... yes
> checking for sys/stat.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for memory.h... yes
> checking for strings.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for unistd.h... yes
> checking dlfcn.h usability... yes
> checking dlfcn.h presence... yes
> checking for dlfcn.h... yes
> checking how to run the C++ preprocessor... g++ -E
> checking for g77... no
> checking for xlf... no
> checking for f77... no
> checking for frt... no
> checking for pgf77... no
> checking for cf77... no
> checking for fort77... no
> checking for fl32... no
> checking for af77... no
> checking for xlf90... no
> checking for f90... no
> checking for pgf90... no
> checking for pghpf... no
> checking for epcf90... no
> checking for gfortran... no
> checking for g95... no
> checking for xlf95... no
> checking for f95... no
> checking for fort... no
> checking for ifort... no
> checking for ifc... no
> checking for efc... no
> checking for pgf95... no
> checking for lf95... no
> checking for ftn... no
> checking whether we are using the GNU Fortran 77 compiler... no
> checking whether  accepts -g... no
> checking the maximum length of command line arguments... 196608
> checking command to parse /usr/bin/nm -p output from gcc object... rm:
> conftest.dSYM: is a directory
> rm: conftest.dSYM: is a directory
> rm: conftest.dSYM: is a directory
> rm: conftest.dSYM: is a directory
> ok
> checking for objdir... .libs
> checking for ar... ar
> checking for ranlib... ranlib
> checking for strip... strip
> rm: conftest.dSYM: is a directory
> rm: conftest.dSYM: is a directory
> checking if gcc supports -fno-rtti -fno-exceptions... rm:
> conftest.dSYM: is a directory
> no
> checking for gcc option to produce PIC... -fno-common
> checking if gcc PIC flag -fno-common works... rm: conftest.dSYM: is a
> directory
> yes
> checking if gcc static flag -static works... rm: conftest.dSYM: is a
> directory
> no
> checking if gcc supports -c -o file.o.. . rm: conftest.dSYM: is a
> directory
> yes
> checking whether the gcc linker (/usr/libexec/gcc/i686-apple-
> darwin9/4.0.1/ld) supports shared libraries... yes
> checking dynamic linker characteristics... darwin9.1.0 dyld
> checking how to hardcode library paths into programs... immediate
> checking whether stripping libraries is possible... yes
> checking if libtool supports shared libraries... yes
> checking whether to build shared libraries... yes
> checking whether to build static libraries... yes
> configure: creating libtool
> appending configuration tag "CXX" to libtool
> rm: conftest.dSYM: is a directory
> rm: conftest.dSYM: is a directory
> checking for ld used by g++... /usr/libexec/gcc/i686-apple-
> darwin9/4.0.1/ld
> checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld)
> is GNU ld... no
> checking whether the g++ linker (/usr/libexec/gcc/i686-apple-
> darwin9/4.0.1/ld) supports shared libraries... yes
> checking for g++ option to produce PIC... -fno-common
> checking if g++ PIC flag -fno-common works... rm: conftest.dSYM: is a
> directory
> yes
> checking if g++ static flag -static works... rm: conftest.dSYM: is a
> directory
> no
> checking if g++ supports -c -o file.o... rm: conftest.dSYM: is a
> directory
> yes
> checking whether the g++ linker (/usr/libexec/gcc/i686-apple-
> darwin9/4.0.1/ld) supports shared libraries... yes
> checking dynamic linker characteristics... darwin9.1.0 dyld
> checking how to hardcode library paths into programs... immediate
> appending configuration tag "F77" to libtool
> checking for swig... /usr/bin/swig
> checking for extra includes... no
> checking for extra libs... no
> checking for libz... -lz
> checking for Sword library files... /usr/local/sword/lib
> checking for Sword include files... /usr/local/sword/include/sword
> checking if you have Sword 1.5.7 or later... rm: conftest.dSYM: is a
> directory
> 1.5.10
> checking whether to enable maintainer-specific portions of
> Makefiles... no
> checking for perl... /usr/bin/perl
> checking for Perl5 header files... /System/Library/Perl/5.8.8/darwin-
> thread-multi-2level/CORE
> checking for Perl5 library... perl.dylib
> checking for NONE/bin/python... no
> checking for python... /usr/bin/python
> checking for Python prefix... /System/Library/Frameworks/
> Python.framework /Versions/2.5
> checking for Python exec-prefix... /System/Library/Frameworks/
> Python.framework/Versions/2.5
> checking for Python version... python2.5
> checking for Python header files... -I/System/Library/Frameworks/
> Python.framework/Versions/2.5/include/python2.5 -I/System/Library/
> Frameworks/Python.framework/Versions/2.5/lib/python2.5/config
> checking for Python library... /System/Library/Frameworks/
> Python.framework/Versions/2.5/lib/python2.5/config
> checking for php... /usr/bin/php
> checking for PHP4 header files... not found
> checking for Tcl configuration... found /usr/lib/tclConfig.sh
> checking for Tcl header files... -I/usr/include
> checking for Tcl library... -framework Tcl
> configure: creating ./config.status
> config.status: creating Makefile
> config.status: executing depfiles commands
>
>
> Then I ran "make python_make" and got this:
>
> +-( ~/src/sword-1.5.10/bindings/swig/package ):> make python_make
> mkdir -p python
> echo "writing python/setup.py"
> writing python/setup.py
> cd python && /usr/bin/python setup.py build_ext -I/usr/local/sword/
> include/sword -L/usr/local/sword/lib -lsword
> running build_ext
> building '_Sword' extension
> creating build
> creating build/temp.macosx-10.5-i386-2.5
> gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-
> madd -fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -
> DMACOSX -I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc - 
> pipe -
> DSWIG=1 -I/usr/local/sword/include/sword -I/System/Library/Frameworks/
> Python.framework/Versions/2.5/include/python2.5 -c Sword.cxx -o build/
> temp.macosx-10.5-i386-2.5/Sword.o
> i686-apple-darwin9-gcc-4.0.1: Sword.cxx: No such file or directory
> i686-apple-darwin9-gcc-4.0.1: no input files
> powerpc-apple-darwin9-gcc-4.0.1: Sword.cxx: No such file or directory
> powerpc-apple-darwin9-gcc-4.0.1: no input files
> lipo: can't figure out the architecture type of: /var/folders/D9/
> D9dZokG-EY0DTvB37eDKUk+++TI/-Tmp-//ccqeSETG.out
> error: command 'gcc' failed with exit status 1
> make: *** [python_make] Error 1
>
>
> Any ideas? It's really not there:
>
> +-( ~/src/sword-1.5.10/bindings/swig/package/python ):> find .
> .
> ./build
> ./build/temp.macosx-10.5-i386-2.5
> ./setup.py
>
>
> Thanks!
>
> Jon Brisbin
> http://jbrisbin.com
>
>
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.crosswire.org/pipermail/sword-devel/attachments/20071218/86f630ee/attachment-0001.html 


More information about the sword-devel mailing list