librelist archives

« back to archive

"hello world" cython project fails

"hello world" cython project fails

From:
Gour-Gadadhara Dasa
Date:
2011-06-09 @ 16:30
could not decode message

Re: [bento] "hello world" cython project fails

From:
David Cournapeau
Date:
2011-06-10 @ 02:05
On Fri, Jun 10, 2011 at 1:30 AM, Gour-Gadadhara Dasa <gour@atmarama.net> wrote:

>
> [gour@atmarama cython] bentomaker configure
>  File "/usr/home/gour/prj/cython/bento.info", line 1
> Name: Hello world app

Name is supposed to be a single word, not multiple words. To be
honest, that's the first time I see a multiple words name, but the
related PEP does not say it is required to have a single word.

In any case, modify Name field to a single word for now.

Then, bento does not detect yet when an extension uses cython, so you
have to do it manually for now:

# in the bento.info
HookFile: bscript

# bscript file
from bento.commands import hooks

@hooks.post_configure()
def post_configure(context):
    context.yaku_configure_ctx.use_tools(["cython"])

Re: [bento] "hello world" cython project fails

From:
Gour-Gadadhara Dasa
Date:
2011-06-10 @ 08:14
On Fri, 10 Jun 2011 11:05:44 +0900
David Cournapeau <cournape@gmail.com> wrote:

> Name is supposed to be a single word, not multiple words. To be
> honest, that's the first time I see a multiple words name, but the
> related PEP does not say it is required to have a single word.

Heh, here we have a saying: "Even a blind hen sometimes finds a grain of corn."
:-)

> In any case, modify Name field to a single word for now.

OK. I knew it must be simple, but still I did report 'cause I heard
about Bento in Cython community so it might be that I'm not the only one
trying to convert Cython 'project' to Bento.

> Then, bento does not detect yet when an extension uses cython, so you
> have to do it manually for now:

OK.

> # in the bento.info
> HookFile: bscript
> 
> # bscript file
> from bento.commands import hooks
> 
> @hooks.post_configure()
> def post_configure(context):
>     context.yaku_configure_ctx.use_tools(["cython"])

I did it and here is the result:

[gour@atmarama cython] BENTOMAKER_DEBUG=1 bentomaker configure
Looking for gcc (c compiler) ... yes
Checking whether gcc can build objects... yes
Checking whether gcc can build programs... yes
Checking whether gcc can build static libraries... yes
Checking whether gcc can link static libraries to exe... yes
Checking whether gcc can build shared libraries...   File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bentomakerlib/bentomaker.py",
line 463, in noexc_main
    ret = main(argv)
  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bentomakerlib/bentomaker.py",
line 229, in main
    return _wrapped_main(popts, run_node, top_node, build_node)
  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bentomakerlib/bentomaker.py",
line 269, in _wrapped_main
    return _main(popts, run_node, top_node, build_node)
  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bentomakerlib/bentomaker.py",
line 341, in _main
    run_cmd(cmd_name, cmd_opts, run_node, top:w
_node, build_node)
  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bentomakerlib/bentomaker.py",
line 410, in run_cmd
    run_cmd_in_context(cmd_klass, cmd_name, cmd_opts, ctx_klass, run_node,
top_node, pkg)
  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bentomakerlib/bentomaker.py",
line 447, in run_cmd_in_context
    cmd_func(ctx)
  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bento/commands/configure.py",
line 170, in run
    ctx.setup()
  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bento/commands/context.py",
line 83, in setup
    yaku_ctx.use_tools(["ctasks", "pyext"])
  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bento/private/_yaku/yaku/context.py",
line 94, in use_tools
    self.setup_tools()
  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bento/private/_yaku/yaku/context.py",
line 100, in setup_tools
    builder.configure()
  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bento/private/_yaku/yaku/tools/ctasks.py",
line 354, in configure
    raise ValueError()
bentomaker: Error: bentomaker crashed (uncaught exception <type 
'exceptions.ValueError'>: ).
Please report this on bento issue tracker:
    http://github.com/cournape/bento/issues


As you can figure out from the above, I use bentomaker created as 
single-dist file.

Sincerely,
Gour

-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

Re: [bento] "hello world" cython project fails

From:
David Cournapeau
Date:
2011-06-10 @ 08:21
On Fri, Jun 10, 2011 at 5:14 PM, Gour-Gadadhara Dasa <gour@atmarama.net> wrote:

>> Then, bento does not detect yet when an extension uses cython, so you
>> have to do it manually for now:
>
> OK.
>
>> # in the bento.info
>> HookFile: bscript
>>
>> # bscript file
>> from bento.commands import hooks
>>
>> @hooks.post_configure()
>> def post_configure(context):
>>     context.yaku_configure_ctx.use_tools(["cython"])
>
> I did it and here is the result:
>
> [gour@atmarama cython] BENTOMAKER_DEBUG=1 bentomaker configure
> Looking for gcc (c compiler) ... yes
> Checking whether gcc can build objects... yes
> Checking whether gcc can build programs... yes
> Checking whether gcc can build static libraries... yes
> Checking whether gcc can link static libraries to exe... yes
> Checking whether gcc can build shared libraries...   File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bentomakerlib/bentomaker.py",
line 463, in noexc_main
>    ret = main(argv)
>  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bentomakerlib/bentomaker.py",
line 229, in main
>    return _wrapped_main(popts, run_node, top_node, build_node)
>  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bentomakerlib/bentomaker.py",
line 269, in _wrapped_main
>    return _main(popts, run_node, top_node, build_node)
>  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bentomakerlib/bentomaker.py",
line 341, in _main
>    run_cmd(cmd_name, cmd_opts, run_node, top:w
> _node, build_node)
>  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bentomakerlib/bentomaker.py",
line 410, in run_cmd
>    run_cmd_in_context(cmd_klass, cmd_name, cmd_opts, ctx_klass, 
run_node, top_node, pkg)
>  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bentomakerlib/bentomaker.py",
line 447, in run_cmd_in_context
>    cmd_func(ctx)
>  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bento/commands/configure.py",
line 170, in run
>    ctx.setup()
>  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bento/commands/context.py",
line 83, in setup
>    yaku_ctx.use_tools(["ctasks", "pyext"])
>  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bento/private/_yaku/yaku/context.py",
line 94, in use_tools
>    self.setup_tools()
>  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bento/private/_yaku/yaku/context.py",
line 100, in setup_tools
>    builder.configure()
>  File 
"/home/gour/bin/.bentomaker-0.1-3c123323f3c3db6e43d06954e80a5c8a/bento/private/_yaku/yaku/tools/ctasks.py",
line 354, in configure
>    raise ValueError()
> bentomaker: Error: bentomaker crashed (uncaught exception <type 
'exceptions.ValueError'>: ).
> Please report this on bento issue tracker:
>    http://github.com/cournape/bento/issues

There is an error in the configuration: please paste the config.log
file (in build/ by default)

cheers,

David

Re: [bento] "hello world" cython project fails

From:
Gour-Gadadhara Dasa
Date:
2011-06-10 @ 08:26
On Fri, 10 Jun 2011 17:21:11 +0900
David Cournapeau <cournape@gmail.com> wrote:

> There is an error in the configuration: please paste the config.log
> file (in build/ by default)

===============================================================================
Checking whether gcc can build objects
  |
  |int foo() {return 0;}
---> Succeeded !
Command sequence was:
gcc -Wall -Ibuild/.conf-foo-5166232335887390111 -c -o 
/usr/home/gour/prj/cython/build/.conf-foo-5166232335887390111/foob473ef6027bcb96ec0e18de08248f48c.c.o
foob473ef6027bcb96ec0e18de08248f48c.c

foob473ef6027bcb96ec0e18de08248f48c.c:2:22: warning: no newline at end of file


===============================================================================
Checking whether gcc can build programs
  |
  |int main() {return 0;}
---> Succeeded !
Command sequence was:
gcc -Wall -Ibuild/.conf-foo-3922306587589364807 -c -o 
/usr/home/gour/prj/cython/build/.conf-foo-3922306587589364807/fooe10573e4f0d2b442ed54708a1d770b8d.c.o
fooe10573e4f0d2b442ed54708a1d770b8d.c

fooe10573e4f0d2b442ed54708a1d770b8d.c:2:23: warning: no newline at end of file

gcc -o /usr/home/gour/prj/cython/build/.conf-foo-3922306587589364807/foo 
fooe10573e4f0d2b442ed54708a1d770b8d.c.o -L.

===============================================================================
Checking whether gcc can build static libraries
  |
  |int foo() {return 0;}
---> Succeeded !
Command sequence was:
gcc -Wall -Ibuild/.conf-foo-5166232335887390111 -c -o 
/usr/home/gour/prj/cython/build/.conf-foo-5166232335887390111/foob473ef6027bcb96ec0e18de08248f48c.c.o
foob473ef6027bcb96ec0e18de08248f48c.c

foob473ef6027bcb96ec0e18de08248f48c.c:2:22: warning: no newline at end of file

ar rcs 
/usr/home/gour/prj/cython/build/.conf-foo-5166232335887390111/libfoo.a 
foob473ef6027bcb96ec0e18de08248f48c.c.o

===============================================================================
Checking whether gcc can link static libraries to exe
  |
  |int foo() { return 0;}
---> Succeeded !
Command sequence was:
gcc -Wall -Ibuild/.conf-exelib-5431423555552885669 -c -o 
/usr/home/gour/prj/cython/build/.conf-exelib-5431423555552885669/foo42b4cc65e244cd148524d0788ebe79d8.c.o
foo42b4cc65e244cd148524d0788ebe79d8.c

foo42b4cc65e244cd148524d0788ebe79d8.c:2:23: warning: no newline at end of file

ar rcs 
/usr/home/gour/prj/cython/build/.conf-exelib-5431423555552885669/libfoo.a 
foo42b4cc65e244cd148524d0788ebe79d8.c.o

  |
  |int foo(); int main() { return foo();}
---> Succeeded !
Command sequence was:
gcc -Wall -Ibuild/.conf-exelib-5431423555552885669 -c -o 
/usr/home/gour/prj/cython/build/.conf-exelib-5431423555552885669/exed9f34a2f78ca001ad4b64f7bdf62e9b7.c.o
exed9f34a2f78ca001ad4b64f7bdf62e9b7.c

exed9f34a2f78ca001ad4b64f7bdf62e9b7.c:2:39: warning: no newline at end of file

gcc -o 
/usr/home/gour/prj/cython/build/.conf-exelib-5431423555552885669/exe 
exed9f34a2f78ca001ad4b64f7bdf62e9b7.c.o -L. -lfoo

===============================================================================
Checking whether gcc can build shared libraries
  |
  |#ifdef _MSC_VER
  |#define __YAKU_DLL_MARK __declspec(dllexport)
  |#else
  |#define __YAKU_DLL_MARK
  |#endif
  |
  |__YAKU_DLL_MARK int foo()
  |{
  |    return 0;
  |}
---> Failure !
~~~~~~~~~~~~~~
cmd gcc -shared -L. -o 
/usr/home/gour/prj/cython/build/.conf-foo--5765622568496125669/libfoo.so 
foo7f0cf2e8ba6d9d02bc496bd0a589f447.c.o failed: 

/usr/bin/ld: foo7f0cf2e8ba6d9d02bc496bd0a589f447.c.o: relocation 
R_X86_64_32 against `a local symbol' can not be used when making a shared 
object; recompile with -fPIC
foo7f0cf2e8ba6d9d02bc496bd0a589f447.c.o: could not read symbols: Bad value
~~~~~~~~~~~~~~
Command sequence was:
gcc -Wall -Ibuild/.conf-foo--5765622568496125669 -c -o 
/usr/home/gour/prj/cython/build/.conf-foo--5765622568496125669/foo7f0cf2e8ba6d9d02bc496bd0a589f447.c.o
foo7f0cf2e8ba6d9d02bc496bd0a589f447.c
gcc -shared -L. -o 
/usr/home/gour/prj/cython/build/.conf-foo--5765622568496125669/libfoo.so 
foo7f0cf2e8ba6d9d02bc496bd0a589f447.c.o



Sincerely,
Gour


-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

Re: [bento] "hello world" cython project fails

From:
David Cournapeau
Date:
2011-06-10 @ 09:15
On Fri, Jun 10, 2011 at 5:26 PM, Gour-Gadadhara Dasa <gour@atmarama.net> wrote:

> ===============================================================================
> Checking whether gcc can build shared libraries
>  |
>  |#ifdef _MSC_VER
>  |#define __YAKU_DLL_MARK __declspec(dllexport)
>  |#else
>  |#define __YAKU_DLL_MARK
>  |#endif
>  |
>  |__YAKU_DLL_MARK int foo()
>  |{
>  |    return 0;
>  |}
> ---> Failure !
> ~~~~~~~~~~~~~~
> cmd gcc -shared -L. -o 
/usr/home/gour/prj/cython/build/.conf-foo--5765622568496125669/libfoo.so 
foo7f0cf2e8ba6d9d02bc496bd0a589f447.c.o failed:
>
> /usr/bin/ld: foo7f0cf2e8ba6d9d02bc496bd0a589f447.c.o: relocation 
R_X86_64_32 against `a local symbol' can not be used when making a shared 
object; recompile with -fPIC
> foo7f0cf2e8ba6d9d02bc496bd0a589f447.c.o: could not read symbols: Bad value
> ~~~~~~~~~~~~~~
> Command sequence was:
> gcc -Wall -Ibuild/.conf-foo--5765622568496125669 -c -o 
/usr/home/gour/prj/cython/build/.conf-foo--5765622568496125669/foo7f0cf2e8ba6d9d02bc496bd0a589f447.c.o
foo7f0cf2e8ba6d9d02bc496bd0a589f447.c
> gcc -shared -L. -o 
/usr/home/gour/prj/cython/build/.conf-foo--5765622568496125669/libfoo.so 
foo7f0cf2e8ba6d9d02bc496bd0a589f447.c.o

Can you confirm you are on a 64 bits linux machine ? What is the
output of: python -c "import distutils.sysconfig as s; print
s.get_config_var('CCSHARED')" ?

cheers,

David

Re: [bento] "hello world" cython project fails

From:
Gour-Gadadhara Dasa
Date:
2011-06-10 @ 09:40
On Fri, 10 Jun 2011 18:15:52 +0900
David Cournapeau <cournape@gmail.com> wrote:

> Can you confirm you are on a 64 bits linux machine ? 

No, 64bit FreeBSD. :_)


> What is the output of: python -c "import distutils.sysconfig as s; print
> s.get_config_var('CCSHARED')" ?

-fPIC


Sincerely,
Gour

-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

Re: [bento] "hello world" cython project fails

From:
David Cournapeau
Date:
2011-06-10 @ 10:31
On Fri, Jun 10, 2011 at 6:40 PM, Gour-Gadadhara Dasa <gour@atmarama.net> wrote:
> On Fri, 10 Jun 2011 18:15:52 +0900
> David Cournapeau <cournape@gmail.com> wrote:
>
>> Can you confirm you are on a 64 bits linux machine ?
>
> No, 64bit FreeBSD. :_)

Ok. Could you also put the output of build/default.env.py  ?

The problem is that for some reason, bento does not use the -fPIC
flag, which is mandatory on 64 bits. It works on linux, so I am
wondering what's different on FreeBSD.

cheers,

David

Re: [bento] "hello world" cython project fails

From:
Gour-Gadadhara Dasa
Date:
2011-06-10 @ 11:06
On Fri, 10 Jun 2011 19:31:28 +0900
David Cournapeau <cournape@gmail.com> wrote:

> Ok. Could you also put the output of build/default.env.py  ?

BLDDIR = 'build'
CC = ['gcc']
CC_OBJECT_FMT = '%s.o'
CC_SRC_F = []
CC_TGT_F = ['-c', '-o']
CFLAGS = ['-Wall']
CPPPATH = []
CPPPATH_FMT = '-I%s'
DEFINES = []
DEFINES_FMT = '-D%s'
ENV = {'SSH_ASKPASS': '/usr/local/bin/gnome-ssh-askpass2', 'LC_NUMERIC': 
'hr_HR.UTF-8', 'WINDOWID': '67108884', 'GLADE_PIXMAP_PATH': ':', 
'LC_CTYPE': 'en_US.UTF-8', 'LOGNAME': 'gour', 'USER': 'gour', 'HOME': 
'/home/gour', 'LC_PAPER': 'hr_HR.UTF-8', 'PATH': 
'/home/gour/bin:/home/gour/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/gour/bin',
'ZSH': '/home/gour/.oh-my-zsh', 'DISPLAY': ':0.0', 
'GNOME_KEYRING_CONTROL': '/var/tmp/keyring-EHa4Xn', 'SSH_AGENT_PID': 
'4966', 'LANG': 'en_US.UTF-8', 'TERM': 'screen', 'SHELL': 
'/usr/local/bin/zsh', 'COLORFGBG': '0;default;15', 'XDG_SESSION_COOKIE': 
'7af549d5acf9461bf20aca5500000134-1307687163.237933-1654811388', 
'SESSION_MANAGER': 'local/atmarama.noip.me:/tmp/.ICE-unix/5023', 
'LC_MEASUREMENT': 'hr_HR.UTF-8', 'BLOCKSIZE': 'K', 'WINDOWPATH': '9', 
'EDITOR': 'vim', 'TERMINFO': '/usr/local/share/misc/terminfo.db', 
'GLADE_CATALOG_PATH': ':', 'GREP_COLOR': '1;32', 'GPG_AGENT_INFO': 
'/tmp/gpg-Aiv6Ee/S.gpg-agent:5017:1', 'LC_MONETARY': 'hr_HR.UTF-8', 
'USERNAME': 'gour', 'GLADE_MODULE_PATH': ':', 'LC_ADDRESS': 'hr_HR.UTF-8',
'SSH_AUTH_SOCK': '/tmp/ssh-0FWuRji5nlvV/agent.4938', 'TMUX': 
'/tmp/tmux-1001/default,37761,0', 'GDMSESSION': 'xfce', 'LSCOLORS': 
'Gxfxcxdxbxegedabagacad', 'ENV': '/home/gour/.shrc', 'GNOME_KEYRING_PID': 
'4921', 'LC_COLLATE': 'hr_HR.UTF-8', 'ZSH_THEME': 'robbyrussell', 
'DBUS_SESSION_BUS_ADDRESS': 
'unix:path=/var/tmp/dbus-ixum44a23V,guid=7a190e9f5f6e0b48353cc97a00000056',
'_': '/home/gour/bin/bentomaker', 'XAUTHORITY': 
'/var/run/gdm/auth-for-gour-NDjd1m/database', 'LC_IDENTIFICATION': 
'hr_HR.UTF-8', 'DESKTOP_SESSION': 'xfce', 'GREP_OPTIONS': '--color=auto', 
'XDG_CONFIG_DIRS': '/usr/local/etc/xdg:/usr/local/etc/xdg', 'LC_MESSAGES':
'en_US.UTF-8', 'PAGER': 'less', 'OLDPWD': '/home/gour/prj', 
'LC_TELEPHONE': 'hr_HR.UTF-8', 'LIBGLADE_MODULE_PATH': 
':/usr/local/lib/libglade/2.0', 'SHLVL': '2', 'PWD': 
'/home/gour/prj/cython', 'GTK_PATH': ':/usr/local/lib/gtk-2.0', 
'COLORTERM': 'rxvt-xpm', 'LC_NAME': 'hr_HR.UTF-8', 'XDG_MENU_PREFIX': 
'xfce-', 'LC_TIME': 'en_US.UTF-8', 'GDM_KEYBOARD_LAYOUT': 'hr', 
'XDG_DATA_DIRS': '/share:/usr/share:/usr/local/share:/usr/local/share'}
FRAMEWORKS = []
LIBDIR = []
LIBDIR_FMT = '-L%s'
LIBS = []
LIB_FMT = '-l%s'
LINK = ['gcc']
LINKFLAGS = []
LINK_SRC_F = []
LINK_TGT_F = ['-o']
MODLINK = ['gcc', '-bundle', '-undefined', 'dynamic_lookup']
MODLINKFLAGS = []
MODLINK_SRC_F = []
MODLINK_TGT_F = ['-o']
PROGRAM_FMT = '%s'
SHAREDLIB_FMT = 'lib%s.so'
SHLINK = ['gcc', '-shared']
SHLINKFLAGS = []
SHLINK_SRC_F = []
SHLINK_TGT_F = ['-o']
STATICLIB_FMT = 'lib%s.a'
STLINK = ['ar']
STLINKFLAGS = ['rcs']
STLINK_SRC_F = []
STLINK_TGT_F = []
VERBOSE = False
cc_type = 'gcc'

> The problem is that for some reason, bento does not use the -fPIC
> flag, which is mandatory on 64 bits. It works on linux, so I am
> wondering what's different on FreeBSD.

I'm quite new on FreeBSD and still learing about its diosyncrasies...


Sincerely,
Gour

-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

Re: [bento] "hello world" cython project fails

From:
Gour-Gadadhara Dasa
Date:
2011-06-11 @ 08:44
On Fri, 10 Jun 2011 19:31:28 +0900
David Cournapeau <cournape@gmail.com> wrote:

> The problem is that for some reason, bento does not use the -fPIC
> flag, which is mandatory on 64 bits. It works on linux, so I am
> wondering what's different on FreeBSD.

Just to mention that building the extension with distutils works:

[gour@atmarama cython] python setup.py build_ext --inplace
running build_ext
cythoning hello.pyx to hello.c
building 'hello' extension
creating build/temp.freebsd-9.0-CURRENT-amd64-2.7
cc -fno-strict-aliasing -O2 -pipe -D__wchar_t=wchar_t 
-DTHREAD_STACK_SIZE=0x20000 -fno-strict-aliasing -DNDEBUG -O2 -pipe 
-D__wchar_t=wchar_t -DTHREAD_STACK_SIZE=0x20000 -fno-strict-aliasing -fPIC
-I/usr/local/include/python2.7 -c hello.c -o 
build/temp.freebsd-9.0-CURRENT-amd64-2.7/hello.o
cc -shared -pthread build/temp.freebsd-9.0-CURRENT-amd64-2.7/hello.o -o 
/usr/home/gour/prj/cython/hello.so


Sincerely,
Gour

-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

Re: [bento] "hello world" cython project fails

From:
David Cournapeau
Date:
2011-06-16 @ 23:15
On Sat, Jun 11, 2011 at 5:44 PM, Gour-Gadadhara Dasa <gour@atmarama.net> wrote:

> Just to mention that building the extension with distutils works:

Ok, could you try the last version of bento ? There was a bug in yaku
which I fixed,

cheers,

David

Re: [bento] "hello world" cython project fails

From:
Gour-Gadadhara Dasa
Date:
2011-06-17 @ 04:53
On Fri, 17 Jun 2011 08:15:18 +0900
David Cournapeau <cournape@gmail.com> wrote:

> Ok, could you try the last version of bento ? There was a bug in yaku
> which I fixed,

[gour@atmarama cython] BENTOMAKER_DEBUG=1 bentomaker configure
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 467, in noexc_main
    ret = main(argv)
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 233, in main
    return _wrapped_main(popts, run_node, top_node, build_node)
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 258, in _wrapped_main
    mods = set_main(top_node, build_node)
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 200, in set_main
    modules.append(create_hook_module(hook_node.abspath()))
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bento/commands/hooks.py",
line 133, in create_hook_module
    exec(compile(code, main_file, 'exec'), module.__dict__)
  File "/usr/home/gour/prj/cython/bscript", line 4, in <module>
    @hooks.post_configure()
bentomaker: Error: bentomaker crashed (uncaught exception <type 
'exceptions.TypeError'>: decorator() takes exactly 1 argument (0 given)).
Please report this on bento issue tracker:
    http://github.com/cournape/bento/issues

Here is my bscript:

# bscript file
from bento.commands import hooks

@hooks.post_configure()
def post_configure(context):
    context.yaku_configure_ctx.use_tools(["cython"])



Sincerely,
Gour


-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

Re: [bento] "hello world" cython project fails

From:
David Cournapeau
Date:
2011-06-17 @ 05:22
On Fri, Jun 17, 2011 at 1:53 PM, Gour-Gadadhara Dasa <gour@atmarama.net> wrote:
> On Fri, 17 Jun 2011 08:15:18 +0900
> David Cournapeau <cournape@gmail.com> wrote:
>
>> Ok, could you try the last version of bento ? There was a bug in yaku
>> which I fixed,

Ah, yes, sorry, I forgot that I changed the calling API of hooks in
recent bento. The bscript file should now look as follows:

@hooks.post_configure
def post_configure...

cheers,

David

Re: [bento] "hello world" cython project fails

From:
Gour-Gadadhara Dasa
Date:
2011-06-17 @ 06:40
On Fri, 17 Jun 2011 14:22:15 +0900
David Cournapeau <cournape@gmail.com> wrote:

> Ah, yes, sorry, I forgot that I changed the calling API of hooks in
> recent bento. The bscript file should now look as follows:
> 
> @hooks.post_configure
> def post_configure...

I have tried with thee following bscript (according to: 


https://github.com/cournape/Bento/blob/c40e8020af7ff43b26f4fd47e86c21286ef130e4/examples/hooks/customization/bscript):

and I get the following:

[gour@atmarama cython] BENTOMAKER_DEBUG=1 bentomaker configure
Looking for gcc (c compiler) ... yes
Checking whether gcc can build objects... yes
Checking whether gcc can build programs... yes
Checking whether gcc can build static libraries... yes
Checking whether gcc can link static libraries to exe... yes
Checking whether gcc can build shared libraries... yes
Checking whether gcc can link shared libraries to exe... yes
Detecting distutils CC exec ... cc
Detecting CC type... gcc
Detecting distutils CXX exec ... c++
Detecting CC type... gcc
Checking whether default can build python object code... yes
Checking whether default can build python extension... yes
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 467, in noexc_main
    ret = main(argv)
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 233, in main
    return _wrapped_main(popts, run_node, top_node, build_node)
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 273, in _wrapped_main
    return _main(popts, run_node, top_node, build_node)
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 345, in _main
    run_cmd(cmd_name, cmd_opts, run_node, top_node, build_node)
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 414, in run_cmd
    run_cmd_in_context(cmd_klass, cmd_name, cmd_opts, ctx_klass, run_node,
top_node, pkg)
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 455, in run_cmd_in_context
    _run_hooks(get_post_hooks(cmd_name))
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 440, in _run_hooks
    hook(ctx)
  File "/usr/home/gour/prj/cython/bscript", line 7, in post_configure
    cfg = ctx.yaku_configure_ctx
bentomaker: Error: bentomaker crashed (uncaught exception <type 
'exceptions.AttributeError'>: 'ConfigureYakuContext' object has no 
attribute 'yaku_configure_ctx').
Please report this on bento issue tracker:
    http://github.com/cournape/bento/issues


What do I miss in the syntax?


Sincerely,
Gour


-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

Re: [bento] "hello world" cython project fails

From:
David Cournapeau
Date:
2011-06-17 @ 06:53
On Fri, Jun 17, 2011 at 3:40 PM, Gour-Gadadhara Dasa <gour@atmarama.net> wrote:
> On Fri, 17 Jun 2011 14:22:15 +0900
> David Cournapeau <cournape@gmail.com> wrote:
>
>> Ah, yes, sorry, I forgot that I changed the calling API of hooks in
>> recent bento. The bscript file should now look as follows:
>>
>> @hooks.post_configure
>> def post_configure...
>
> I have tried with thee following bscript (according to:

Sorry for all this trouble, it just happened that I have changed a few
things the last few days. Please update to the last revision of master
(which as of now is 46b09e60eb8de0ead3ceac888a3bb29e38372f97) and then
use the example you mentioned (but as in the same last revision).

I don't have my FreeBSD vm in handy, but I checked that the example
works on my (linux) machine as least,

cheers,

David

Re: [bento] "hello world" cython project fails

From:
Gour-Gadadhara Dasa
Date:
2011-06-17 @ 08:21
On Fri, 17 Jun 2011 15:53:46 +0900
David Cournapeau <cournape@gmail.com> wrote:

> Sorry for all this trouble, it just happened that I have changed a few
> things the last few days. Please update to the last revision of master
> (which as of now is 46b09e60eb8de0ead3ceac888a3bb29e38372f97) and then
> use the example you mentioned (but as in the same last revision).

OK, I've found that example should look like:

# bscript file
from bento.commands import hooks

@hooks.post_configure

def post_configure(ctx):
    cfg = ctx.yaku_context
    cfg.use_tools(["cython"])

However, trying with it gives:

[gour@atmarama cython] BENTOMAKER_DEBUG=1 bentomaker configure 
Looking for gcc (c compiler) ... yes
Checking whether gcc can build objects... yes
Checking whether gcc can build programs... yes
Checking whether gcc can build static libraries... yes
Checking whether gcc can link static libraries to exe... yes
Checking whether gcc can build shared libraries... yes
Checking whether gcc can link shared libraries to exe... yes
Detecting distutils CC exec ... cc
Detecting CC type... gcc
Detecting distutils CXX exec ... c++
Detecting CC type... gcc
Checking whether default can build python object code... yes
Checking whether default can build python extension... yes
Looking for cython... yes
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 467, in noexc_main
    ret = main(argv)
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 233, in main
    return _wrapped_main(popts, run_node, top_node, build_node)
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 273, in _wrapped_main
    return _main(popts, run_node, top_node, build_node)
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 345, in _main
    run_cmd(cmd_name, cmd_opts, run_node, top_node, build_node)
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 414, in run_cmd
    run_cmd_in_context(cmd_klass, cmd_name, cmd_opts, ctx_klass, run_node,
top_node, pkg)
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 455, in run_cmd_in_context
    _run_hooks(get_post_hooks(cmd_name))
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bentomakerlib/bentomaker.py",
line 440, in _run_hooks
    hook(ctx)
  File "/usr/home/gour/prj/cython/bscript", line 8, in post_configure
    cfg.use_tools(["cython"])
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bento/private/_yaku/yaku/context.py",
line 94, in use_tools
    self.setup_tools()
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bento/private/_yaku/yaku/context.py",
line 100, in setup_tools
    builder.configure()
  File 
"/home/gour/bin/.bentomaker-0.1-625a7d6d91d22567aaf796b830b19660/bento/private/_yaku/yaku/tools/cython.py",
line 53, in configure
    ctx.env["ENV"]["PYTHONPATH"] = os.environ["PYTHONPATH"]
  File "/usr/local/lib/python2.7/UserDict.py", line 23, in __getitem__
    raise KeyError(key)
bentomaker: Error: bentomaker crashed (uncaught exception <type 
'exceptions.KeyError'>: 'PYTHONPATH').
Please report this on bento issue tracker:
    http://github.com/cournape/bento/issues


Any hint?


Sincerely,
Gour


-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

Re: [bento] "hello world" cython project fails

From:
David Cournapeau
Date:
2011-06-17 @ 08:51
On Fri, Jun 17, 2011 at 5:21 PM, Gour-Gadadhara Dasa <gour@atmarama.net> wrote:

> bentomaker: Error: bentomaker crashed (uncaught exception <type 
'exceptions.KeyError'>: 'PYTHONPATH').

Damn, this one is stupid. As a workaround, you can define PYTHONPATH
in your shell. I will have to look into more details tonight on why I
need PYTHONPATH in the first place there,

cheers,

David

Re: [bento] "hello world" cython project fails

From:
Gour-Gadadhara Dasa
Date:
2011-06-17 @ 09:18
On Fri, 17 Jun 2011 17:51:43 +0900
David Cournapeau <cournape@gmail.com> wrote:

> Damn, this one is stupid. As a workaround, you can define PYTHONPATH
> in your shell.

Yeah, but only as workaround. ;)

> I will have to look into more details tonight on why I need PYTHONPATH in the
> first place there,

OK.

Excuse me for so much trouble with 'hello world' project.


Sincerely,
Gour


-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810

Re: [bento] "hello world" cython project fails

From:
David Cournapeau
Date:
2011-06-17 @ 09:29
On Fri, Jun 17, 2011 at 6:18 PM, Gour-Gadadhara Dasa <gour@atmarama.net> wrote:
> On Fri, 17 Jun 2011 17:51:43 +0900
> David Cournapeau <cournape@gmail.com> wrote:
>
>> Damn, this one is stupid. As a workaround, you can define PYTHONPATH
>> in your shell.
>
> Yeah, but only as workaround. ;)

Yes, this is obviously not the right fix (I just happen to have always
define this on any machine I use, so never encountered the bug).

Is is finally working, then ?

>
> Excuse me for so much trouble with 'hello world' project.

No problem, it should not have taken so many steps to work in the first place,

David

Re: [bento] "hello world" cython project fails

From:
Gour-Gadadhara Dasa
Date:
2011-06-17 @ 09:45
On Fri, 17 Jun 2011 18:29:30 +0900
David Cournapeau <cournape@gmail.com> wrote:

> Is is finally working, then ?

Yes, by defininig env var in shell.

btw, do you prefer reporting problems here or at Github?


Sincerely,
Gour

-- 
“In the material world, conceptions of good and bad are
all mental speculations…” (Sri Caitanya Mahaprabhu)

http://atmarama.net | Hlapicina (Croatia) | GPG: 52B5C810