Plugin Development on Linux?

Plugin Development on Linux?

SimonJWakley
Contributor Contributor
5,198 Views
20 Replies
Message 1 of 21

Plugin Development on Linux?

SimonJWakley
Contributor
Contributor

 I have a Plugin working well on Windows with Maya but many of our customers have Maya on Linux so I wanted to compile it for them too.  They have various flavours of Linux, but mostly not on Mac / OSX.

 

I have dabbled with Linux in the past, but not heavily.  Using Qt designer with Visual Studio is a little clunky but quite workable.  Can anyone recommend an IDE or similar for working with the QT output and also building and debugging the Plugin - With whatever recommended Linux.  I can use code breakpoints in the plugin with Visual Studio, but can't get "re-compile and continue" to work but that is pretty minor.

 

I assume a plugin built for Linux would work on any of the various distributions available?

 

Thanks,

 

Simon

0 Likes
Accepted solutions (2)
5,199 Views
20 Replies
Replies (20)
Message 2 of 21

vijaya.prakash
Alumni
Alumni

In Linux, very popular debugger is GDB, you can build your own Maya plugin using makefile (please check the devkit samples). There are recomended linux operating system to develop Maya custom plugins .

 

Please check the following link for compiler information.

http://around-the-corner.typepad.com/adn/2015/04/maya-compiler-versions-update.html

 

If you want to build Qt related stuffs along with Python. We have PyQt in Maya. You can build your own PyQt. Please check the following link for building PyQt.

http://around-the-corner.typepad.com/adn/2015/05/building-sip-and-pyqt-for-maya-2016.html

0 Likes
Message 3 of 21

SimonJWakley
Contributor
Contributor

Thanks for the response.  I have installed Centos 6.7  I have downloaded Maya and once it is activated I will check out the examples.  I was really wondering if there was a good IDE for this development.  I heard Komodo is good?  Otherwise I guess I am destined for a Makefile and command line.

0 Likes
Message 4 of 21

vijaya.prakash
Alumni
Alumni
Accepted solution

Yes, Komodo IDE is a good choice to develop cross-platform projects. But, Autodesk is not recomending any IDE for linux. We recommend yout to use  Makefile and Command line.

0 Likes
Message 5 of 21

Anonymous
Not applicable

We use windows MSVS for coding and debugging our parts and then just migrate with minimal fixes (mostly known and packed to preprocessor defines and macros) to any Linux. We use Eclipse (Kepler) with simplest settings or not too sophisticated cmdline scripts - and "screaming" as general debug methodology under those OSes.

We are happy with it.

Everything else make us angry.

 

0 Likes
Message 6 of 21

SimonJWakley
Contributor
Contributor

Thanks.  I am working on using command line stuff.  Tried screaming but it hasn't helped much so far 🙂

I built most of the plugins but trying to build the qt stuff.  I used the command line "make -f Makefile.qt" and got

/include -I/usr/lib64/qt-3.3/include -o moc_helixQtCmd.o moc_helixQtCmd.cpp
moc_helixQtCmd.cpp:17:2: error: #error "This file was generated using the moc from 3.3.8b. It"
moc_helixQtCmd.cpp:18:2: error: #error "cannot be used with the include files from this version of Qt."
moc_helixQtCmd.cpp:19:2: error: #error "(The moc has changed too much.)"

I obviously have to re-create the moc_ files.  Any word on how to do this?  My Windows Plugin uses 4 .ui files so ..

With all these nested Makefiles, buildconfigs etc it gets a little hard to follow to the un initiated!  There is also a .qrc file.!

Simon

0 Likes
Message 7 of 21

Anonymous
Not applicable

Update.

Got it all compiling and linking on Linux with Maya 2016 Centos.

I am getting a error whcih on one machine seems fatal (plugin will not load), but on another seems to get past it.

 

// Error: line 1: Unable to dynamically load : /PluginName.so
/PluginName.so: undefined symbol: _ZNK12MFnAnimCurve15isUnitlessInputEP7MStatus //

 

I do call this function, but not right away, only after a button click.  Any idea why it would not be linkable?  Is it no longer asupported in 2016? It starts up and I get somewhere, but not fully working yet.

Simon

0 Likes
Message 8 of 21

vijaya.prakash
Alumni
Alumni

Hi Simon,

 

So, are you using CentOS 6.5 in both the cases? You said, in one machine the loading of plugin works fine and in another machine Maya 2016 is not loading your plugin. In plugin load failure machine, did you rebuild your sources? Make sure that your plugin is linked with "OpenMayaAnim" library ( -lOpenMayaAnim ).

 

Moreover, in Maya 2016 devkit we have "animImportExport" sample. Please build it on both machine and test it because it uses "OpnMayaAnim" library.

Setting LD_LIBRARY_PATH externally could be useful, but Maya does this internally, so no need to set it externally.

 

Thanks,

Vijaya Praaksh.

0 Likes
Message 9 of 21

SimonJWakley
Contributor
Contributor
It is compiling, but I can;t run Maya 2014 on Centos to test it 😞 Will have to sort the licensing out and will let you know.
0 Likes
Message 10 of 21

SimonJWakley
Contributor
Contributor

As a note, the use of the makefiles and makefile.qt with buildconfig and the .pro files all seems very complex.  I have figured out a single makefile that does everything for my plugin but pulling the .h file out of the qt .ui file, I do that through QtDesigner with a cut and paste.  It seems some developers relish the tricks you can run with nested makefiles, but it is confusing to us linux newbies who are used to Visual Studio 🙂

Now I am going to get my plugin working with Windows Maya 2016 and then try Linux 2016.

0 Likes
Message 11 of 21

vijaya.prakash
Alumni
Alumni

Hi,

 

Yes, nested Makefile is very much possible, in fact it is very convenient way to build huge projects. It's all about PHONY targets and dependencies. Please let me know if you need any help while writting Makefiles.

 

Thanks,

Vijaya Prakash..

0 Likes
Message 12 of 21

SimonJWakley
Contributor
Contributor

Thanks.  Adding that library fixed it.  I did not need to on another computer so it's a bit strnage plus the linker should throw an undefined shouldn't it?  Anyway that fixed that one.  Thank you.

Message 13 of 21

SimonJWakley
Contributor
Contributor

Hi,

Yes I need help on making a makefile.

I have one that works for me and if I copy the entire thing and the entire tree I can build a version for 2014 and 2016.  How would you recommend organizing it to have one set of sources and be able to buld a plugin for 2014 and one for 2016.

I can send you the existing makefile, it has nothing phony in it 🙂

Simon

0 Likes
Message 14 of 21

vijaya.prakash
Alumni
Alumni

Hi Simon,

 

I am happy to help you for writing Makefiles. Please send me your current Makefile. I will re-write it 🙂

 

Thanks,

Vijaya Prakash.

0 Likes
Message 15 of 21

Anonymous
Not applicable

@SimonJWakley wrote:

I assume a plugin built for Linux would work on any of the various distributions available?

 


Short Answer

 

If you build your plugin using the compiler and OS versions recommended by Autodesk for that version of Maya, then it will probably work on any distribution where that version of Maya can run.

 

Long Answer

 

Different distributions may use incompatible versions of the runtime libraries and compiler.

 

For the compiler, you're generally safe if you stay within the same major version number. For example, a plugin built with gcc 4.8.2 will probably work fine on a system where gcc 4.4.7 is the default compiler, and vice-versa. A plugin built with a (hypothetical) gcc 5.1.1 probably wouldn't work on any system where the default compiler is 4.x.x. In practice this is unlikely to be an issue, though, since we've been on the 4.x.x series of gcc since Noah was child, so you're unlikely to run into anything else.

 

For runtime libs (primarily libc/glibc and stdlibc++) your plugin will generally work with runtime libs with the same major version number, so long as the version number is higher. For example I recently ran into a problem where a Maya 2016 plugin that I built on CentOS 7.0 (glibc 2.17) wouldn't load on a CentOS 6.2 (glibc 2.12) system because the older glibc runtime lib was missing a symbol that the newer lib had. When I rebuilt the plugin on CentOS 6.2 it then worked fine on CentOS 7 as well.

0 Likes
Message 16 of 21

Anonymous
Not applicable

So to update on this.  I have both my 2014 and 2016 builds working for Linux Centos.  I have not yet managed to successfully deploy to another Linux machine, but I have a couple of options for that.  So basically it is working.  Next target is Win10 (which doesn't seem to work with my Win7 built plugin) and MAC.

0 Likes
Message 17 of 21

SimonJWakley
Contributor
Contributor
Hi,

I sent you the makefile. Did you get it

Simon
0 Likes
Message 18 of 21

vijaya.prakash
Alumni
Alumni

Hi Simon,

 

No, I didn't get your Makefile. Could you please attach and send it again?

 

Thanks,

Vijaya Prakash.

0 Likes
Message 19 of 21

Anonymous
Not applicable
Thanks,

Simon
0 Likes
Message 20 of 21

SimonJWakley
Contributor
Contributor

 

Continuing with Linux Plugin.  I have a client who has 2014, 2105 and 2016 on Linux.  I downloaded and compiled 2015, and sent him all three binaries.

 

2014.  Complains it was compiled against too new an Api, but it was compiled with 2014.  2016 Complains it was compiled against too old an API, I am downloading Ext 2, and will try that, but client tells me he has Maya 2016.5.  Not sure what the .5 is that Extension or Service Pack?  Can only download Ext1 SP6 or Ext 2

 

2015 Plugin loads and has some functionality, but a lot of the code is run from the idle loop, and that doesn't get called apparently.  I saw this once before on 2016, but it was on a different machine.

 

Anyone have any information abut the above?  Do plugins need compiling against the updates?  If so if there a table to indicate this?  Which update needs re-compiling for etc, I can't image it is needed for every single one.  I already have 2014, 215, 2016 Linux and 2014, 2016 WIndows....

 

Simon

 

 

0 Likes