Mathematica 9 does not read mathematica 8 ".mx" files



Having written a lot of code on M8, I recently switched to M9 and tried to run the code on M9, the code starts by loading an .mx file written by M8, but M9 wouldn't read the .mx file saying that it was written on another machine. This is a major incompatibility issue between M8 and M9. Fortunately, I kept my M8 installation, so for now, M9 is useless to me. Please a solution.


Posted 2012-12-10T10:54:14.977

Reputation: 101

@MikeHoneychurch Writing large amounts of data in wdx format is much slower than .mx format. – masterxilo – 2016-09-13T16:28:01.930

1@OleksandrR. You should post this as an answer, preferably with links to the relevant docs. – jVincent – 2012-12-10T11:27:25.533

@jVincent I don't think it really matters in this case since nothing more can be said on this question than is written in the documentation, ergo it will sooner or later be closed as TL (and I will vote as such as soon as the OP acknowledges the response). However, I've now given an answer as you suggest. – Oleksandr R. – 2012-12-10T11:52:02.150

1@OleksandrR. I believe the documentation is lacking in this regard in that .mx files are mentioned in several locations without mention of the non-compatibility with version changes. While it's true that there are also locations that do mention it, I believe that this question has value in directing users who for instance read the DumpSave documentation which states only machine dependence. – jVincent – 2012-12-10T12:13:19.113

3This question should remain open as a visible warning to new users. This is a bad mistake to make if proper back-ups were not kept. – Mr.Wizard – 2012-12-10T13:49:51.670

Just curious -- given that versions get updated and hardware gets updated from time to time, why do people use *.mx files? ...I guess I can see the usefulness for shorter term storage. – Mike Honeychurch – 2012-12-10T22:49:38.427



Unfortunately, there is no solution. Dump (.mx) files are explicitly documented as being non-portable between different versions, and even between different builds of the same version (e.g. 32- and 64-bit versions for a given platform, or those for two different platforms). As such, you must re-generate your .mx files for version 9 either from the original source or by reading them in on version 8 and then saving them in a different, portable format, such as WDX.

Oleksandr R.

Posted 2012-12-10T10:54:14.977

Reputation: 22 073

Or read them in in v8 again and Save them. This format is compatible. – Sjoerd C. de Vries – 2012-12-11T06:27:53.937

@Sjoerd yes, but this is not a serialized format. If one has saved large numerical arrays, for example (a likely use case for dump files), reading and writing them using expressions represented as strings in text files is likely to be very inefficient. One also loses representational details such as whether the array is packed. – Oleksandr R. – 2012-12-22T01:50:28.863

True, but conversion is a one-time operation. After carrying them over to v9 using Save, you can DumpSave them again. – Sjoerd C. de Vries – 2012-12-22T07:59:47.897