Wednesday, September 24, 2014

Re: compile vim against python

Hi Jesus,

From the output it seems that you have build Python with static
libraries.
I think you need to rebuild Python with shared libraries enabled.
You need to pass --enable-shared to the configure script.

From more info have a look a the python docs
https://docs.python.org/2.7/extending/embedding.html#compiling-and-linking-under-unix-like-systems

--
Konstantinos

On 23 Sep 2014, at 11:59, Jay Jesus Amorin wrote:

> I'm trying to build vim with python support, but I got this error
> during
> compile.
>
> gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -U_FORTIFY_SOURCE
> -D_FORTIFY_SOURCE=1 -o objects/memfile.o memfile.c
> gcc -c -I. -Iproto -DHAVE_CONFIG_H -g -O2 -U_FORTIFY_SOURCE
> -D_FORTIFY_SOURCE=1 version.c -o objects/version.o
> link.sh: $LINK_AS_NEEDED set to 'yes': invoking linker directly.
> gcc -L/usr/local/lib -Wl,--as-needed -o vim objects/buffer.o
> objects/blowfish.o objects/charset.o objects/diff.o objects/digraph.o
> objects/edit.o objects/eval.o objects/ex_cmds.o objects/ex_cmds2.o
> objects/ex_docmd.o objects/ex_eval.o objects/ex_getln.o
> objects/fileio.o
> objects/fold.o objects/getchar.o objects/hardcopy.o objects/hashtab.o
> objects/if_cscope.o objects/if_xcmdsrv.o objects/mark.o
> objects/memline.o
> objects/menu.o objects/message.o objects/misc1.o objects/misc2.o
> objects/move.o objects/mbyte.o objects/normal.o objects/ops.o
> objects/option.o objects/os_unix.o objects/pathdef.o
> objects/popupmnu.o
> objects/quickfix.o objects/regexp.o objects/screen.o objects/search.o
> objects/sha256.o objects/spell.o objects/syntax.o objects/tag.o
> objects/term.o objects/ui.o objects/undo.o objects/version.o
> objects/window.o objects/if_python.o objects/netbeans.o
> objects/main.o objects/memfile.o -lm -lncurses -lnsl -lselinux
> -L/usr/local/include/python2.7 -lpython2.7
> /usr/local/lib/libpython2.7.a(posixmodule.o): In function
> `posix_tmpnam':
> /usr/local/src/Python-2.7.8/./Modules/posixmodule.c:7575: warning: the
> use
> of `tmpnam_r' is dangerous, better use `mkstemp'
> /usr/local/lib/libpython2.7.a(posixmodule.o): In function
> `posix_tempnam':
> /usr/local/src/Python-2.7.8/./Modules/posixmodule.c:7522: warning: the
> use
> of `tempnam' is dangerous, better use `mkstemp'
> /usr/local/lib/libpython2.7.a(thread.o): In function
> `PyThread_start_new_thread':
> /usr/local/src/Python-2.7.8/Python/thread_pthread.h:184: undefined
> reference to `pthread_attr_setstacksize'
> /usr/local/src/Python-2.7.8/Python/thread_pthread.h:194: undefined
> reference to `pthread_create'
> /usr/local/src/Python-2.7.8/Python/thread_pthread.h:210: undefined
> reference to `pthread_detach'
> /usr/local/lib/libpython2.7.a(thread.o): In function
> `PyThread_allocate_lock':
> /usr/local/src/Python-2.7.8/Python/thread_pthread.h:269: undefined
> reference to `sem_init'
> /usr/local/lib/libpython2.7.a(thread.o): In function
> `PyThread_free_lock':
> /usr/local/src/Python-2.7.8/Python/thread_pthread.h:294: undefined
> reference to `sem_destroy'
> /usr/local/lib/libpython2.7.a(thread.o): In function
> `PyThread_acquire_lock':
> /usr/local/src/Python-2.7.8/Python/thread_pthread.h:324: undefined
> reference to `sem_wait'
> /usr/local/src/Python-2.7.8/Python/thread_pthread.h:326: undefined
> reference to `sem_trywait'
> /usr/local/lib/libpython2.7.a(thread.o): In function
> `PyThread_release_lock':
> /usr/local/src/Python-2.7.8/Python/thread_pthread.h:350: undefined
> reference to `sem_post'
> /usr/local/lib/libpython2.7.a(thread.o): In function
> `_pythread_pthread_set_stacksize':
> /usr/local/src/Python-2.7.8/Python/thread_pthread.h:497: undefined
> reference to `pthread_attr_setstacksize'
> /usr/local/lib/libpython2.7.a(posixmodule.o): In function
> `posix_openpty':
> posixmodule.c:(.text+0x2963): undefined reference to `openpty'
> /usr/local/lib/libpython2.7.a(posixmodule.o): In function
> `posix_forkpty':
> posixmodule.c:(.text+0x29cd): undefined reference to `forkpty'
> collect2: ld returned 1 exit status
> link.sh: Linking failed
> make: *** [vim] Error 1
> [jee@localhost /usr/local/src/vim74/src]$
>
>
> ./configure --enable-pythoninterp=yes --enable-gui=no
> --with-features=huge
> --with-python-config-dir=/usr/local/lib/python2.7/config
>
>
> Anything that I missed?
>
> Thanks,
>
>
> JDA
>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google
> Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to vim_use+unsubscribe@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: