Sunday, December 2, 2012

MuPuPriNT Source + Cross-Platform Stuff (finally!)

As the title may have hinted, MuPuPriNT is now well on its way to being supported cross-platform!

After a very intense late-night coding session, I have just about completed a buildable version for Linux. Since I only have a 64-bit Ubuntu 12.10 machine for testing, I can't vouch for the application's compatibility with other Linux environments, especially if they aren't using the Unity desktop. However, it should still at least build.

Thing is, you need Qt installed fully to build anything, which is why I'll also simply release the application itself.

Same goes for Mac. I spent about four hours today getting the Mac version to compile. I now have a universal cross-platform Qt project file that ought to work on Windows (32 and 64-bit), Mac OS X 10.7+, and Linux 3.2.*+!

Not all that much has changed except some rather complicated preprocessor directives for OS-specific functions (for instance, getting the current username and folder paths is different for Windows from the methods for Unix and/or OS X).

Essentially, that means the MuPuPriNT source code is now full of stuff like #ifdef __unix and #ifdef __APPLE__, but it all works properly. Getting it to distinguish between WIN32 and _WIN64 is tricky considering _WIN64 is included in the WIN32 definition (why though?), but I got it eventually.

So, some links for you!

MuPuPriNT 2.1.3 Extended (stable beta) for Windows

MuPuPriNT source archive including 2.1.3 for Windows x86 and x86_64 and 2.1.2a for OS X and Linux

An app bundle for Mac is coming soon. I think it might be 64-bit only. Then again, it might be 32-bit only. I have no idea. It's not like Windows where the library architecture depends on the compiler you use. It's just "make." Ah well. It didn't say the executable was 32-bit.

Also, an application for Linux (specifically Unity) is coming soon as well. I know it works.

MuPuPriNT on Linux (just a test - it looks better now!)

MuPuPriNT on Mac in the office

There is one small issue with the Mac version - it's not stable. You will notice in the debug log (which is not entirely necessary I admit) that it occasionally says "warning: QPixmap::scaled is a null pixmap" and I have NO idea what that means or why it only happens on Mac. I haven't been able to find that in the source code anywhere so I assume it has to do with the Mac libraries specifically...

To build on Windows, use a Visual Studio tools command prompt, x86 or x64. That will determine what you end up building, NOT the project file itself! The project file just has a check to see if it's win32 or win64, but it won't make a difference if you use a compiler that's different from what you think the project file is going to build.

More instructions can be found in the individual readme files in the source archive itself and also here.

Yay future! :) This is a big step forward for me and NCPrime in general, since I've been talking about porting my apps for months (ever since I first made a rough alpha of GJSieve for Mac in Obj-C). Now, with Qt, not only is it possible, it's exactly the same functionality in any OS!

Once I get some things in the real world squared away, I'll work more on the stability of the Mac version and then possibly look into porting to other versions of Linux as well as some BSD-based stuff, perhaps...

No comments:

Post a Comment