Python plugin development

Discussion about user contributed plugins

Moderator: Moderator

User avatar
arj
Site Admin
Posts: 2316
Joined: Thu Dec 01, 2005 8:51 pm
Location: Denmark
Contact:

Postby arj » Sun Feb 24, 2008 12:44 am

Try going into:

/plugins/feature/python/libgui

and do a:

make guilistitem.o

Does that work?

What happens if you move the #include's at the top around?

And try the following line:

g++ -I/usr/local/include -I/usr/include/ -I. -pthread -pipe -O0 -g -Wall -W -Wno-sign-compare -Wold-style-cast -Wundef -Wshadow -Wno-long-long -
D_GNU_SOURCE -I/usr/include/cc++2 -I/usr/include/boost-1_34_1/ -I/usr/include/boost-1_34_0/ -I. -I../../ -I../../../ -I../../../..
/ -I../../../output/ -I../../audio/ -I../../../input/ -I../include/ -I../../tinyxml/ -fPIC -dPIC -shared -c guiwindow.cpp

Or

g++ -I/usr/local/include -I/usr/include/ -I. -pthread -pipe -O0 -I/usr/include/cc++2 -I/usr/include/boost-1_34_1/ -I/usr/include/boost-1_34_0/ -I. -I../../ -I../../../ -I../../../..
/ -I../../../output/ -I../../audio/ -I../../../input/ -I../include/ -I../../tinyxml/ -fPIC -dPIC -shared -c guiwindow.cpp

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Sun Feb 24, 2008 9:03 am

arj wrote:Try going into:

/plugins/feature/python/libgui

and do a:

make guilistitem.o

Does that work?

What happens if you move the #include's at the top around?

And try the following line:

g++ -I/usr/local/include -I/usr/include/ -I. -pthread -pipe -O0 -g -Wall -W -Wno-sign-compare -Wold-style-cast -Wundef -Wshadow -Wno-long-long -
D_GNU_SOURCE -I/usr/include/cc++2 -I/usr/include/boost-1_34_1/ -I/usr/include/boost-1_34_0/ -I. -I../../ -I../../../ -I../../../..
/ -I../../../output/ -I../../audio/ -I../../../input/ -I../include/ -I../../tinyxml/ -fPIC -dPIC -shared -c guiwindow.cpp

Or

g++ -I/usr/local/include -I/usr/include/ -I. -pthread -pipe -O0 -I/usr/include/cc++2 -I/usr/include/boost-1_34_1/ -I/usr/include/boost-1_34_0/ -I. -I../../ -I../../../ -I../../../..
/ -I../../../output/ -I../../audio/ -I../../../input/ -I../include/ -I../../tinyxml/ -fPIC -dPIC -shared -c guiwindow.cpp

Your last compiler line (see above) gives this:

Code: Select all

guiwindow.cpp:1: error: stray ‘#’ in program
In file included from guiwindow.cpp:2:
guiwindow.hpp:4: error: stray ‘#’ in program
In file included from guiwindow.hpp:5,
                 from guiwindow.cpp:2:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:65: error: stray ‘#’ in program
In file included from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:66,
                 from guiwindow.hpp:5,
                 from guiwindow.cpp:2:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/functexcept.h:41: error: stray ‘#’ in program
In file included from guiwindow.hpp:5,
                 from guiwindow.cpp:2:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:66: error: stray ‘#’ in program
In file included from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:67,
                 from guiwindow.hpp:5,
                 from guiwindow.cpp:2:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:64: error: stray ‘#’ in program
In file included from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:65,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:67,
                 from guiwindow.hpp:5,
                 from guiwindow.cpp:2:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/c++config.h:35: error: stray ‘#’ in program
In file included from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/c++config.h:36,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:65,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:67,
                 from guiwindow.hpp:5,
                 from guiwindow.cpp:2:
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/os_defines.h:39: error: stray ‘#’ in program
In file included from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/os_defines.h:40,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/c++config.h:36,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:65,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:67,
                 from guiwindow.hpp:5,
                 from guiwindow.cpp:2:
/usr/include/features.h:335: error: stray ‘#’ in program
In file included from /usr/include/features.h:336,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/os_defines.h:40,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/c++config.h:36,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:65,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:67,
                 from guiwindow.hpp:5,
                 from guiwindow.cpp:2:
/usr/include/sys/cdefs.h:360: error: stray ‘#’ in program
In file included from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/os_defines.h:40,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/c++config.h:36,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:65,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:67,
                 from guiwindow.hpp:5,
                 from guiwindow.cpp:2:
/usr/include/features.h:359: error: stray ‘#’ in program
In file included from /usr/include/features.h:360,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/os_defines.h:40,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/i386-redhat-linux/bits/c++config.h:36,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_algobase.h:65,
                 from /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../include/c++/4.1.2/vector:67,
                 from guiwindow.hpp:5,
                 from guiwindow.cpp:2:
.
.
.
.

The compiler line you've put on the first place compiles fine on ubuntu, but does absolutely nothing (doesn't come back either) with no system load at all. Only Ctrl-C can bring it back.

And yes - I've swaped around the include lines. See here my screen dump in vi with "set list" option. The only "odd" chars are some Tabs in the middle of the code. See here:
    Image


Thanks for your help.
Regards,
Andreas
Last edited by acmelabs on Sun Feb 24, 2008 8:30 pm, edited 1 time in total.

User avatar
arj
Site Admin
Posts: 2316
Joined: Thu Dec 01, 2005 8:51 pm
Location: Denmark
Contact:

Postby arj » Sun Feb 24, 2008 7:53 pm

I'm sorry, I simple don't understand what questions you're answering when. Please quote and answer each question one at a time.

but does absolutely nothing (doesn't come back either) with no system load at all. Only Ctrl-C can bring it back.


If it works on ubuntu but not on fedora then there must be something wrong with your fedora system. The compiler should never do that unless it is buggy (in which case it normally uses 100% cpu).

Why don't you just install Ubuntu in a virtual machine on your fedora machine or use their kernel source on a sane system if suspend is what you want. It's not reasonably that we should work around broken systems/compilers when other systems are working perfectly fine.

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Mon Feb 25, 2008 9:28 am

arj wrote:I'm sorry, I simple don't understand what questions you're answering when. Please quote and answer each question one at a time.
...

I'm sorry.

I'm sure you have better and by far more important things to do. I know that. Thanks for your help so far.
I will contact Fredde directly, because I think it's worth getting Python-Plugin running on FC, too. I think it should be possible to get MMS running on the big five flawlessly.

Regards,
Andreas

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Mon Feb 25, 2008 12:57 pm

Lol, it's weird.

Please add a new (empty) line before the first #include statement and report back.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Mon Feb 25, 2008 3:19 pm

lorenzodes wrote:Lol, it's weird.

Please add a new (empty) line before the first #include statement and report back.

Hi, hehe: well - it's in line two now ;-)

Code: Select all

make[1]: Entering directory `/usr/src/mms-1.1.0/plugins/feature/python/libgui'
g++ -I/usr/local/include -I/usr/include/ -I. -pthread -pipe -O3 -march=k8 -ffast-math -funroll-loops -fomit-frame-pointer -D_GNU_SOURCE -I/usr/i
nclude/cc++2 -I/usr/include/libxml2   -isystem/usr/include/boost-1_34_1/ -isystem/usr/include/boost-1_34_0/ -I. -I../../ -I../../../ -I../../../
../ -I../../../output/ -I../../audio/ -I../../../input/ -I../include/ -I../../tinyxml/ -fPIC -dPIC -shared -c guiwindow.cpp
guiwindow.cpp:2: error: stray ‘#’ in program
In file included from guiwindow.cpp:3:
guiwindow.hpp:4: error: stray ‘#’ in program
In file included from guiwindow.hpp:5,
                 from guiwindow.cpp:3:


Regrets,
Andreas

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Mon Feb 25, 2008 4:47 pm

acmelabs wrote:
lorenzodes wrote:Lol, it's weird.

Please add a new (empty) line before the first #include statement and report back.

Hi, hehe: well - it's in line two now ;-)


Well, looks like your build environment is broken... let me do a couple of test, I'll be back to you in 5 minutes.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Mon Feb 25, 2008 4:51 pm

lorenzodes wrote:
acmelabs wrote:
lorenzodes wrote:Lol, it's weird.

Please add a new (empty) line before the first #include statement and report back.

Hi, hehe: well - it's in line two now ;-)


Well, looks like your build environment is broken... let me do a couple of test, I'll be back to you in 5 minutes.

Strange, why do the rest compile fine?

Are you going to join #mms@freenode.net?

Regards,
Andreas

User avatar
arj
Site Admin
Posts: 2316
Joined: Thu Dec 01, 2005 8:51 pm
Location: Denmark
Contact:

Postby arj » Mon Feb 25, 2008 5:58 pm

acmelabs wrote:
arj wrote:I'm sorry, I simple don't understand what questions you're answering when. Please quote and answer each question one at a time.
...

I'm sorry.

I'm sure you have better and by far more important things to do. I know that. Thanks for your help so far.
I will contact Fredde directly, because I think it's worth getting Python-Plugin running on FC, too. I think it should be possible to get MMS running on the big five flawlessly.


It's not that I have better things to do, or maybe I do. But I just get so frustrated by these problems because I know I can't put them down no matter how hard I try. Secondly when the problem is as tricky as this one, I don't want to assume anything so that's why I asked you to be more precise in reporting back findings. Assuming something wrong will make it even harder to find and fix this problem.

Could you post the output of log by adding -E > log to the compile command. In my case it would make it look like this:

g++ -I/usr/local/include -I/usr/include/ -I. -pthread -pipe -O3 -march=nocona -ffast-math -funroll-loops -fomit-frame-pointer -D_GNU_SOURCE -isystem/home/arj/bzr/mms-1.1.0/libs -I. -I../../ -I../../../ -I../../../../ -I../../../output/ -I../../audio/ -I../../../input/ -I../include/ -I../../tinyxml/ -fPIC -dPIC -shared -c guiwindow.cpp -E > log

Also have you reported the missing -lz in their commoncpp2 package? If you're keen on getting FC supported we should at least report our findings upstream.

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Mon Feb 25, 2008 9:17 pm

SOLVED!

Thanks to Anders, MMS' python plugin can be compiled and used on Fedora Core!

Read here the whole story: http://irc.loswillios.de/2008-02-25.log
Search for 'CFLAGS'

Or read here for a quick howto on how to make pyhton-plugin work on Fedora Core:
  1. change last line of /usr/lib/pkgconfig/libccext2.pc to 'Libs: -lccext2 -lz'. The '-lz' switch is missing, so commoncpp2 doesn't use zlib by default.
  2. use a MMS bazaar revno >= 1462 or wait until RC4 will be released (or use patch mentioned in the irc-log above, it removes a broken compiler switch on FC (-dPIC) from the Makefiles)

Many thanks goes out to Anders!

Regards,
Andreas

PS: this is it what makes this project so successfull: Hard work!

Fredde
veteran
Posts: 288
Joined: Tue Dec 06, 2005 7:18 am
Location: Sweden

Postby Fredde » Mon Feb 25, 2008 10:48 pm

After the discussion on irc I started to investigate the makefiles in the python plugin. The dPIC option is totally unnecessary :oops:

I have removed it and will commit changes to mms tree.

User avatar
arj
Site Admin
Posts: 2316
Joined: Thu Dec 01, 2005 8:51 pm
Location: Denmark
Contact:

Postby arj » Mon Feb 25, 2008 10:57 pm

Don't worry about it Fredde. I committed a the Makefile changes to remove dPIC. I can't remember when or why it was removed for all the other plugins but that also happened at some point.

Fredde
veteran
Posts: 288
Joined: Tue Dec 06, 2005 7:18 am
Location: Sweden

Postby Fredde » Mon Feb 25, 2008 11:06 pm

I see, you already made the changes :D

One more thing, when creating the object files the -shared option isn't really needed, right? Only when creating the shared libraries (lib_feature_python.so, mmsv2.so, mmsv2gui.so)

...and the fPIC option isn't necessary when creating the shared libraries

User avatar
arj
Site Admin
Posts: 2316
Joined: Thu Dec 01, 2005 8:51 pm
Location: Denmark
Contact:

Postby arj » Tue Feb 26, 2008 12:14 am

I do believe it's correct the way it is today. shared is needed when building the o files according to gcc and I checked the fpic regarding linkage and it also appears to be needed. I recommend we keep it like it is and if someone has problems with it, we'll look into it.

Thanks

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Tue Feb 26, 2008 6:48 am

Fredde wrote:After the discussion on irc I started to investigate the makefiles in the python plugin. The dPIC option is totally unnecessary :oops:

I have removed it and will commit changes to mms tree.

Fredde, unnecessary or not, doesn't matter here at all. Adding -dPIC to the compiler options should never give me an stray '#' error. I've googled for this error, and found many such errer reports. And found also a lot of smart ass advices, like "don't compile an html document" or crap like that. Well - whatever, it's working and I'm almost happy (they'll shut down stage6 :-( ).

I bet, people totally unrelated to MMS will find this thread helpful!

Thanks,
Andreas


Return to “user plugins”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest