×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Regular Contributor
    Join Date
    Apr 2010
    Location
    Fortaleza, Brazil
    Posts
    118

    Problems compiling / building a PyS60 module

    Hi all!

    Does anyone know how can I build / compile a Python module for Symbian / S60?

    I tried to build the camera module, but I'm having problems. Here's what I'm using:

    - Symbian 3 SDK 0.9
    - Open C/C++ Plug-in
    - Python 2.5.4
    - Windows XP SP3

    Following the directions in README_BUILD_INSTRUCTIONS.txt, I did this:
    Code:
    subst t: c:\Nokia\devices\Nokia_Symbian3_SDK_v0.9
    rem installed PyS60 source in t:\pys60_src
    rem cd t:\pys60_src
    path=C:\Python25;%PATH%
    set EPOCROOT=\
    setup.py configure
    setup.py build --device ext\amaretto\camera\group
    The last line above produces this error:
    Code:
    T:\pys60_src>setup.py build --device ext\amaretto\camera\group
    Entering "T:\pys60_src\ext\amaretto\camera\group"
    Running "abld -keepgoing reallyclean armv5"
    -  abld -keepgoing reallyclean armv5
     ** This project does not support platform, build or  program "ARMV5"
    
    Entering "T:\pys60_src\ext\amaretto\camera\group"
    Running "bldmake clean"
    -  bldmake clean
    Entering "T:\pys60_src\ext\amaretto\camera\group"
    Running "bldmake bldfiles"
    -  bldmake bldfiles
    Entering "T:\pys60_src\ext\amaretto\camera\group"
    Running "abld build armv5 urel"
    -  abld build armv5 urel
     ** This project does not support platform, build or  program "ARMV5"
    Any idea of how to solve this? Does this mean I can't use Symbian 3 SDK? Should I download & install S60 SDK 5.0?

  2. #2
    Regular Contributor
    Join Date
    Apr 2010
    Location
    Fortaleza, Brazil
    Posts
    118

    Re: Problems compiling / building a PyS60 module

    Updates:

    The same problem happens with S60 SDK 5.0... but if I configure it with "setup.py configure -s 32gcce", it compiles!

    BTW, what's the difference between the possible options, and why is 50armv5 the default?
    Code:
    T:\pys60_src>setup.py configure -help
    Usage: setup.py [options]
    
    Options:
    [...]
      --compiler-flags=COMPILER_FLAGS
                            Compiler flags to be used while building the python
                            interpreter core [default: ]
    [...]
      -s SDK, --sdk=SDK     Specify the version of sdk to use, choose any version
                            from 30gcce,50armv5,32gcce,30armv5,32[default:
                            50armv5]
    Another thing I noticed is that I have to build the whole package (setup.py build) to get some things configured (like the t:\epoc32\include\python25 directory). But I'm receiving many warnings like these:
    Code:
     -- perl -S makmake.pl  -D \pys60_src\EXT\AMARETTO\GRAPHICS\GROUP\_GRAPHICS GCCE
     **
     ** MMPFILE "\pys60_src\EXT\AMARETTO\GRAPHICS\GROUP\_GRAPHICS.MMP"
     ** WARNING: Frozen .def file \pys60_src\EXT\AMARETTO\GRAPHICS\eabi\kf__graphics.def not found - project not frozen
    ** WARNING: Frozen .def file \pys60_src\EXT\AMARETTO\SOCKET\eabi\kf_e32socket.def not found - project not frozen
    
    [...]
    
     -- make -s  -r -f "\EPOC32\BUILD\pys60_src\newcore\symbian\group\E32SOCKET\GCCE\E32SOCKET.GCCE" LIBRARY
     -- WARNING: Not attempting to create any import libraries.
     -- When exports are frozen in "\pys60_src\EXT\AMARETTO\SOCKET\eabi\kf_e32socket.def", regenerate Makefile.
    I wonder if the .def files above (bold by me, of course) are actually the def files below, which exist:

    • T:\pys60_src\ext\amaretto\socket\group\eabi\251_e32socket.def
    • T:\pys60_src\ext\amaretto\graphics\group\eabi\_graphics.def


    Probably because of the problem above, at the end I'm getting this error:
    Code:
    \EPOC32\BUILD\pys60_src\newcore\symbian\group\PYTHON25\GCCE\urel\pythonrun.o: In function `Py_InitializeEx':
    pythonrun.c:(.text+0x80): undefined reference to `set_fmode'
    make[1]: *** [\epoc32\release\gcce\urel\python25.dll] Error 1
    make: *** [TARGETPYTHON25] Error 2
      make -r  -f "\EPOC32\BUILD\pys60_src\newcore\symbian\group\GCCE.make" FINAL CFG=UREL VERBOSE=-s
    Any ideas how can I get past this now?
    Last edited by AltoRetrato; 2010-10-21 at 02:59.

  3. #3
    Regular Contributor
    Join Date
    Apr 2010
    Location
    Fortaleza, Brazil
    Posts
    118

    Re: Problems compiling / building a PyS60 module

    I got it to compile, but only after changing the _camera.mpp (my additions are highlighted):
    Code:
    #if defined(ARMCC)
    deffile eabi\_camera
    #elif defined(GCCE)
    deffile eabi\_camera
    #elif defined(WINSCW)
    deffile bwins\_camera
    #endif
    
    EPOCALLOWDLLDATA
    The last statement (EPOCALLOWDLLDATA) is to solve the error below:
    elf2e32 : Error: E1028: ELF File \EPOC32\BUILD\pys60src\ext\amaretto\camera\group\_CAMERA\GCCE\urel\kf__camera.pyd contains uninitialized writable data.

    But I'm still not sure if I had to do this in the first place, or if the resulting files will be compatible with the current distribution.

    Any comments?

  4. #4
    Regular Contributor
    Join Date
    Apr 2010
    Location
    Fortaleza, Brazil
    Posts
    118

    Re: Problems compiling / building a PyS60 module

    Dear diary,

    It's lonely the life of a PyS60 hacker around the Forum Nokia. You get no love at all... and hackers have feelings, too - but, of course, you know that.

    You also know that I've been trying to build that camera module thingy, without much success. Well, I advanced a bit more: I finally got it compiled, with:
    Code:
    cd ext\amaretto\camera\group
    bldmake bldfiles
    abld build gcce urel
    abld freeze gcce
    abld build gcce urel
    Then I created a "camera2" folder in the module repository with the required files (copied from the camera folder, then renamed and edited), and I added my newly compiled file:
    Code:
    C:
    mkdir  "C:\Program Files\PythonForS60\module-repo\dev-modules\camera2"
    copy T:\epoc32\release\gcce\urel\kf__camera.pyd "C:\Program Files\PythonForS60\module-repo\dev-modules\camera2\kf__camera2.pyd"
    Finally, I created a small test program, packed it with ensymble and tried it on my device. The result? The error below, just as the newly compiled file is imported:
    Code:
    Traceback (most recent call last):
      File "launcher.py", line 43, in <module>
        execfile('default.py', default_namespace)
      File "default.py", line 11, in <module>
        import camera2
      File "c:\resource\python25\python25.zip\site.py", line 86, in platsec_import    
        return _original_import(name, globals, locals, fromlist, level)  
      File "i:camera_tests_174851\camera2.py", line 21, in <module>  
      File "c:\resource\python25\python25.zip\site.py", line 104, in platsec_import    
        return imp.load_dynamic(name, module   '.pyd')
    SystemError: dynamic module not initialized properly
    OK, now I have this SystemError watchamacalit... if it's not one thing, it's another! But I'm worried that this might be caused by a binary incompatibility, meaning I would have to build not just the module, but the whole Python distro!

    Dear diary, I think I will post my findings on Forum Nokia anyway, just in case another suffering developer looking for the same answers might find, if not a solution, another kindred spirit and, with that, feel a bit less lonely in this huge Symbian development world.

    XOXO

  5. #5
    Registered User
    Join Date
    Jun 2010
    Posts
    49

    Re: Problems compiling / building a PyS60 module

    Hi, AltoRetrato,
    I followed with interest your log.
    Could you please send me a ZIP of the source code?
    I experienced a "SystemError: dynamic module not initialized properly" with my own PyS60 2.0 module and if I remember correctly the solution was to uninstall all other .pyd of my extension (if installed as SIS uninstall them).
    Cheers.

  6. #6
    Regular Contributor
    Join Date
    Apr 2010
    Location
    Fortaleza, Brazil
    Posts
    118

    Re: Problems compiling / building a PyS60 module

    Hi rcu!

    Thanks for replying. Martin Wibbels graciously lent me a hand and I found out my problem: I haven't changed all required .cpp and .py references to "camera" into "camera2". After doing that the new module is working fine!

    Now I can finally start trying to make the camera2 module record video in high res!

  7. #7
    Regular Contributor
    Join Date
    Apr 2010
    Location
    Fortaleza, Brazil
    Posts
    118

    Re: Problems compiling / building a PyS60 module

    That was faster than I imagined (but not quite what I expected)...

    I added a couple of functions to the camera2 module:
    Code:
      video_formats()
      frame_sizes()
      frame_rates()
    and got a list of the available video formats:
    Code:
      YUV420p
      YUV422
    resolutions:
    Code:
      640x480
      352x288
      320x240
      176x144
    and frame rates:
    Code:
      15.0
    The code works (yay!) since I captured a short clip at 640 x 480... but unfortunately, it seems I still can't capture at 1280 x 720, 25fps... which means I still have work to do.

  8. #8
    Regular Contributor
    Join Date
    Apr 2010
    Location
    Fortaleza, Brazil
    Posts
    118

    Re: Problems compiling / building a PyS60 module

    I managed to build the module with the Symbian^3 SDK 0.9 too, but the max. res. is still 640 x 480...

  9. #9
    Regular Contributor
    Join Date
    Apr 2010
    Location
    Fortaleza, Brazil
    Posts
    118

    Re: Problems compiling / building a PyS60 module

    So close! I got HD video, finally: 1280 x 780 by using H.264 baseline profile 3.1 - but the video is captured at only 15fps (even if I try setting the video frame rate to 25.0 fps)...

    EDIT: done! I even captured HD video @ 30fps! I hope to make the source code and binaries available in less than two weeks, if anyone is interested.
    Last edited by AltoRetrato; 2010-11-05 at 21:55.

  10. #10
    Registered User
    Join Date
    Nov 2007
    Posts
    15

    Re: Problems compiling / building a PyS60 module

    Quote Originally Posted by AltoRetrato View Post
    So close! I got HD video, finally: 1280 x 780 by using H.264 baseline profile 3.1 - but the video is captured at only 15fps (even if I try setting the video frame rate to 25.0 fps)...

    EDIT: done! I even captured HD video @ 30fps! I hope to make the source code and binaries available in less than two weeks, if anyone is interested.
    That will be great, thanks for your excellent work!

    Stoval

  11. #11
    Registered User
    Join Date
    Nov 2007
    Posts
    15

    Re: Problems compiling / building a PyS60 module

    Quote Originally Posted by AltoRetrato View Post
    So close! I got HD video, finally: 1280 x 780 by using H.264 baseline profile 3.1 - but the video is captured at only 15fps (even if I try setting the video frame rate to 25.0 fps)...

    EDIT: done! I even captured HD video @ 30fps! I hope to make the source code and binaries available in less than two weeks, if anyone is interested.
    By the way, I did the test. N8 worked ok with 1280 x 780 @25fps

  12. #12
    Registered User
    Join Date
    Nov 2010
    Posts
    1

    Re: Problems compiling / building a PyS60 module

    Hi, I have just begun working on an N8 and have just discovered the limitations of the built-in camera module. I found your posts and was wondering if you had made the camera2 module available to the public yet? I can't wait to actually be able to make use of my HD camera! Thanks.

  13. #13
    Regular Contributor
    Join Date
    Apr 2010
    Location
    Fortaleza, Brazil
    Posts
    118

    Re: Problems compiling / building a PyS60 module

    Please visit the camera2 thread.

Similar Threads

  1. Replies: 4
    Last Post: 2009-06-10, 19:18
  2. help compiling a Python C module
    By mad77 in forum Symbian
    Replies: 7
    Last Post: 2008-03-17, 06:52
  3. Compiling pyS60 on linux
    By bacademy in forum Symbian
    Replies: 0
    Last Post: 2007-04-14, 14:27
  4. Compiling Pys60 for other platforms
    By cassioli in forum Symbian
    Replies: 7
    Last Post: 2007-03-04, 16:58
  5. Compiling additional module
    By cassioli in forum Symbian
    Replies: 6
    Last Post: 2007-02-15, 10:23

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •