PDA

View Full Version : X11 Apps on Intel based systems?



gpillans
11th March 2006, 04:13 PM
I have a question about X11 apps on the new intel based machines...

I'm thinking about buying a new Mac Mini sometime in the near future, but I wanted to know whether X11 apps will run well on them. I have MATLAB installed on my current G4 mini (which it runs pathetically slow on anyway).

So basically, will it run natively in an X11 environment designed for the Intel-based processors, or will it have to run through X11 which is then running through Rosetta (gahh - death on a stick!).

Thanks,
Geoff.

toholio
11th March 2006, 05:46 PM
Non native X11 apps run fine using the native X11.

I've been using that latest PPC Inkscape binary this way for the last week or so. It would surprise me if Matlab wouldn't run under rosetta.

gpillans
12th March 2006, 09:44 AM
That's not really my question.

My question was (may not have been obvious though), will X11 run natively or will X11 run through Rosetta?

Because if X11 is running through Rosetta, MATLAB will chug like a choo-choo-train.

luke_in_tas
12th March 2006, 02:56 PM
I'm not sure if I'm missing something here.

The Apple X11 application is part of OS X. Considering Apple have ported all of OS X to run on their new Intel-based machines, the Apple X11 application (for the Intel version of Tiger) will run natively on the new Intel hardware. Rosetta wouldn't be involved at all.

As for MATLAB, I don't have any personal experience with this app, but Linux/Unix applications don't really run "in X11". X11 is a windowing application that provides Linux/Unix applications with a means of displaying their graphical user interface. That is, X11 just draws the interface on the screen, while the underlying application itself runs natively on the operating system.

That being the case, as long as the application (MATLAB in this case) has been compiled for the Intel platform it wil run natively. I think this is the key thing you need to ensure—that the applications you want to run using X11 are Intel-native.

I'm not sure how successfully Rosetta would run a PPC-compiled version of an applications that runs on OS X using X11. Just get an Intel-compiled version and everything should be fine.

forgie
12th March 2006, 03:18 PM
X11 is oft referred to as an X11 server - it's the server that displays windows, your X11 app is the client sending it display data (this may seem counter-intuitive, but a client is about having control, not sending or receiving data).

I also wonder about this question - assuming that the Apple X11 server is universal, will PPC X11 apps actually work? I'm assuming that the X11 comms protocols are at fairly high level, meaning that the universality of the X11 client shouldn't have any effect on the X11 system as a whole - except for speed obviously.

"Just get an Intel-compiled version".... does that mean that there is no difference between an X11 binary compiled for x86 for Linux, Unix, BSD, OSX or Windows?

luke_in_tas
12th March 2006, 04:49 PM
Originally posted by forgie@Mar 12 2006, 04:18 PM
...

"Just get an Intel-compiled version".... does that mean that there is no difference between an X11 binary compiled for x86 for Linux, Unix, BSD, OSX or Windows?
I'm certainly not claiming any expertiese on this topic, but in asnwer to your question, my understanding is that the major determining factors on whether an X11-based application will run on a particular system is whether it has been disgned with the host operating system in mind, and whether it has been compiled for the processor architecture of the machine you want to run it on. So, there are two issues that need to be considered:
1. Processor architecture (e.g. x86 and PPC); and
2. Operating system.

A binary application compiled for an x86 system won't run on another processor architecture. For example, an X11-based app compiled for an Intel-based Mac won't run on a PPC-based Mac, because it hasn't been compiled for the PPC Mac's processor type.

The same may not be true in reverse though (on a Mac), because of Rosetta. Because Rosetta translates PPC intructions to x86 instructions, it is possible that PPC binaries of X11-based apps may run on Intel-based Macs. I don't have any experience with this, but toholio's post suggests this is the case. However, a PPC binary of an X11-based application won't run on an Intel-based Linux machine, because it hasn't been compiled for the Linux machine's processor type (and the Linux machine wouldn't have access to Rosetta).

So, making sure that the application is compiled for the right processor architecture is the first step. After that though, there is also a need to make sure that the application has been designed with the host operating system in mind.

Although the X11 calls in an application will be the same regardless of operating system (e.g. Linux, Unix, BSD, OS X), the application may depend on other libraries/functionality in the operating system to work. So, an X11-based application written for Intel-based Linux machine may or may not work on an Intel-based BSD or OS X machine. It all depends on whether the libraries required by the application are available in BSD or OS X. That is why there are various ports of X11-based applications for different operating systems that all run on x86 processors (e.g. ports of the same app for Linux, BSD, Solaris)

Many Linux/Unix apps will run fine on OS X once compiled for the processor the machine is using. If they don't work it is probably because they require libraries not installed on the machine. Often you can obtain these libraries and then everything will work fine. Sometimes though the libraries might not be available for OS X.

To make it easier to get X11-based applications to work on OS X, try getting an OS X port. Applications like Fink (http://fink.sourceforge.net/) and DarwinPorts (http://darwinports.opendarwin.org/) will install versions of apps designed for OS X, and will compile the source code for the processor your machine is using. If you can't find a specific OS X port, look for a BSD port of the application. Because OS X is BSD-based, most BSD applications should work fine on OS X.

In case I haven't made this very clear (which is likely :) ), have a look at this article on "Porting" from Wikipedia ('http://en.wikipedia.org/wiki/Software_port').

luke_in_tas
12th March 2006, 04:55 PM
For info on using Fink with Intel-based Macs see here: http://fink.sourceforge.net/news/index.php (article dated 2006-02-21).

For info on using DarwinPorts with Intel-based Macs see here: http://wiki.opendarwin.org/index.php/DarwinPorts:FAQ

antechinus55
12th March 2006, 05:35 PM
I don't know Matlab, so I don't know if its GPL or commercial software. If its commercial, the maker will need to recompile the source for intel machines, which, given the number already around, should be simple. They would then make available an upgrade of some sort. If its GPL registered software, (ie, copyright but freely distributed) it will come in both sorce and binary (compiled) forms. Binary is of course easier and quicker, but if source is available you download it, compile it yourself (it may take a while, in fact it may take quite a long while), which means that you make it run natively on your particular architecture (intel in this case). then away you go. Instructions for compiling software ALWAYS come with it if its source code, but basically in the shell (terminal), you run three commands (2 of them are make and make install, forget the other one). and find something else to do for a while. Its an interesting way to learn more about software.
So in summary, although straight out of the box this may be an issue, one way or another it wont be within hours/days or weeks of getting the machine, ie, a simple fix will be available.

sao

gpillans
12th March 2006, 06:37 PM
The Mac version of MATLAB is the same distribution as for Unix/Linux machines, so it will work on x86 based processors already.

Because it was a single distribution for both OS X (PPC processors) and other UNIX OSes (x86 processors) I thought that it was running 'through' X11 so to speak kind of like an emulator... but obviously not.

So in fact, Rosetta doesn't enter into the equation at all, as the Mac release is also the Unix/Linux release, and designed to run on both processor architectures.

jeremy
12th March 2006, 07:08 PM
If you have still have a PPC mac then you could always run it across the network displaying to your x86 mac. That's if you can't get it running with Rosetta or the performance of doing so isn't good enough. As for whether you can run it in Rosetta, this depends on whether you can run any standard unix apps with Rosetta (i.e. in the terminal). Alternatively, you could also run it across the network from a Linux machine if you have one.

tourist
12th March 2006, 07:22 PM
from the Bible Apple developers site on running x11 (http://developer.apple.com/opensource/tools/runningx11.html)


There are some things to know about X11 on Mac OS X before you start, and this article outlines the key issues you should be aware of. Many existing X11 applications from the UNIX world are available to use for free—if you know the "secret handshake." That is, you can often easily get the source code, but it's up to you to build and install the product. There are some binary distributions available as well, with applications pre-built for X11 on Mac OS X. This represents a new source of useful software that you don't want to overlook.

You will need a Intel compiled X11 binary to run natively, otherwise it will run the PPC X11 binary through Rosetta, if it ambles already it might blow chunks, but then again it might not...

But hassle the distributor (GPL or Commercial) for a Universal Binary,


from Mathworks.com


MATLAB 7.2 (R2006a)

System Requirements - Release 2006a
Macintosh

General Requirements

* CD-ROM or DVD drive (for installation)
* Some license types require a license server running FLEXnet 10.8.0.1, which is provided by the MathWorks installer
* TCP/IP is required on all platforms when using a license server

Platform Specific Requirements

Operating System Processors Disk Space RAM
32-bit MathWorks Products PowerPC G4 460 MB (MATLAB ONLY) 512 MB
Tiger PowerPC G5 1024 MB (recommended)
Mac OS X 10.4.2
Mac OS X 10.4
Panther
Mac OS X 10.3.9*
Mac OS X 10.3.8

* Requires a Apple Java patch. For more information, see solution 1-161VXT.

Compilers (for MEX Files)

* View an up-to-date list of supported compiler versions from vendors

Graphics

* 16-bit graphics or higher adaptor and display (24-bit recommended)
* X11 (X server) for Mac OS X

Other Recommended Items

* Postscript printer

To run in intel macs you will need a Universal binary to get any advantage.

p53
12th March 2006, 07:28 PM
FWIW the install/restore disc that came with my Intel iMac has X11 with a Universal binary.

tourist
12th March 2006, 07:31 PM
Originally posted by p53@Mar 12 2006, 07:28 PM
FWIW the install/restore disc that came with my Intel iMac has X11 with a Universal binary.
Its not X11 they need a Unversal Binary of, it is the application to run under it, X11 is just a windowing system, you still need a compiled application for your CPU, either ppc or Intel,

gpillans
13th March 2006, 10:36 AM
Originally posted by tourist@Mar 12 2006, 07:31 PM
Its not X11 they need a Unversal Binary of, it is the application to run under it, X11 is just a windowing system, you still need a compiled application for your CPU, either ppc or Intel,
So even though the same distribution will run under Linux (and so on) on an x86 processor, it wont run on OS X on an x86 processor? (it was released before x86 macs were just to clarify)

tourist
13th March 2006, 11:17 AM
Originally posted by gpillans@Mar 13 2006, 10:36 AM
So even though the same distribution will run under Linux (and so on) on an x86 processor, it wont run on OS X on an x86 processor? (it was released before x86 macs were just to clarify)



Fellow MATLAB Users:

Anybody have any idea when TMW will come out with a version of MATLAB
for Intel-based Macs? Also, anybody had any experience yet with
MATLAB 7.x on the current Intel-Mac?

I bought my last Mac laptop (a TiBook) when TMW announced that they
were doing software for Mac OS X. Since then, we've seen the
interface steadily improve, now its great. I really appreciate TMW's
efforts on this. I hope that another change at Apple won't cause them
too many headaches. Anyhow, my TiBook is getting a little long in the
tooth--it would be great to have an excuse to get a new one!

Best regards....

BMW

Barry M. Wise
Eigenvector Research, Inc.



Hi Barry,

While some versions of MATLAB could be run emulated on an Intel iMac or
MacBook Pro via Rosetta, they would fail to start the Java JVM (and
hence the MATLAB Desktop), because MATLAB is a native launcher of the
JVM, and also loads JNI libraries.

See < http://developer.apple.com/qa/qa2005/qa1295.html > for details.

MATLAB could potentially run without the desktop and display X11 figures
if you were to start from an xterm with the &#39;-nojvm&#39; flag. Because
MATLAB would be running emulated, Bench results should be expected to be
lower than a (hypothetical) native Intel MATLAB for Mac OS X, and
potentially lower than current top-of-the-line PowerMac G5&#39;s.

The MathWorks has not yet formally tested or qualified the current
release of MATLAB on the new Intel Macs. The platform qualification
process typically requires a month or so after new hardware has started
shipping.

The result of that testing is likely to be that we don&#39;t recommend using
current versions of MATLAB on Intel Macs, if you start MATLAB from the
dock icon or desktop icon, or if you depend on any features which
require the use of the Java JVM, for the reasons described above. (So
if you don&#39;t hear anything more formal about qualifying current versions
of MATLAB for Intel Macs for a while, this is why).

Brian Arnold
Mac Developer
The MathWorks, Inc.

I think that mean No&#33; :)

gpillans
13th March 2006, 02:31 PM
AHA&#33; So not only would it not work very well, it would not work at all&#33; :(

Thanks for your answers, and thanks tourist for finding that article.

Well until they decide to release a new version with Mac-Intel support, my mind will not be made up about buying a nice shiny new core-duo mac mini. :unsure: