Mathematica: Difference between revisions

From ArchWiki
m (Added troubleshooting of errors due to incompatibilities with system libraries. Seems to be a common problem now.)
m (update sagemath link)
 
(34 intermediate revisions by 13 users not shown)
Line 1: Line 1:
[[Category:Mathematics and science]]
[[Category:Numerical analysis]]
[[it:Mathematica]]
[[ja:Mathematica]]
[[ja:Mathematica]]
[[zh-hans:Mathematica]]
[[zh-hans:Mathematica]]
{{Related articles start}}
{{Related articles start}}
{{Related|Scientific Applications}}
{{Related|List of applications/Science}}
{{Related|Sage-mathematics}}
{{Related|SageMath}}
{{Related|Matlab}}
{{Related|Matlab}}
{{Related articles end}}
{{Related articles end}}


[http://www.wolfram.com/mathematica/ Mathematica] is a commercial program used in scientific, engineering and mathematical fields. Here we explain how to install it.
[[Wikipedia:Wolfram Mathematica|Mathematica]] is a commercial program used in scientific, engineering and mathematical fields. Here we explain how to install it.


== Installation ==
== Installation ==


Since Mathematica is a non-free application and upgrades may incur costs, this section lists instructions for different available versions.  
Since Mathematica is a non-free application and upgrades may incur costs, this section lists instructions for different available versions.


=== Mathematica 6 ===
=== Mathematica 6 ===
Line 24: Line 23:
  # mount /media/iso
  # mount /media/iso


==== Running the Installer ====
==== Running the installer ====


You can start the installer by navigating to:
/Unix/Installer
Run ''MathInstaller'' with:
Run ''MathInstaller'' with:
  sh ./MathInstaller
 
  # cd Unix/Installer
# sh ./MathInstaller
 
{{Note|If you do not place the "sh" in front, then you will get an error about a bad interpreter.}}
{{Note|If you do not place the "sh" in front, then you will get an error about a bad interpreter.}}


Line 40: Line 40:
Mathematica 7 is much easier to install.
Mathematica 7 is much easier to install.


  tar xf Mathematica-7.0.1.tar.gz
  # tar xf Mathematica-7.0.1.tar.gz
  cd Unix/Installer
  # cd Unix/Installer
  ./MathInstaller
  # ./MathInstaller


Follow instructions.
Follow instructions.
Line 60: Line 60:
=== Mathematica 11 ===
=== Mathematica 11 ===


[[Install]] {{AUR|mathematica}}. Obtain {{ic|Mathematica_11.XX.YY_LINUX.sh}} from Wolfram Research, along with an activation key. Successful install may throw non-critical errors: xdg-icon-resource, mkdir, xdg-desktop-menu.
[[Install]] {{AUR|mathematica}}. Obtain {{ic|Mathematica_11.XX.YY_LINUX.sh}} from Wolfram Research, along with an activation key, and save it to the package build directory. Successful install may throw non-critical errors: xdg-icon-resource, mkdir, xdg-desktop-menu. For more details see the [https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mathematica mathematica PKGBUILD file].


Mathematica 11 automatically creates a document folder 'Wolfram Mathematica' in [https://reference.wolfram.com/language/ref/$UserDocumentsDirectory.html $UserDocumentsDirectory], which is set by Mathematica according to [[XDG user directories]].
Mathematica 11 automatically creates a document folder 'Wolfram Mathematica' in [https://reference.wolfram.com/language/ref/$UserDocumentsDirectory.html $UserDocumentsDirectory], which is set by Mathematica according to [[XDG user directories]].


== Troubleshooting ==  
=== Mathematica 12 ===
 
# [[Install]] the packages {{Pkg|avahi}} and {{Pkg|inetutils}}.
# [[Start/enable]] the service {{ic|avahi-daemon.service}}.
# Check that {{ic|hostnamectl}} contains either a static or transient hostname.
# [https://account.wolfram.com/products/downloads/mathematica Download] the install script from Wolfram. The filename will be {{ic|Mathematica_12.XX.YY_LINUX.sh}}.
# Make {{ic|Mathematica_12.XX.YY_LINUX.sh }} [[executable]].
# Run the install script as root. When ran as user, the installer will ask for another installation directory.
 
# ./Mathematica_12.XX.YY_LINUX.sh
 
=== Mathematica 13 ===
 
The installation steps are the same as Mathematica 12.
 
== Troubleshooting ==


=== Missing symbols ===
=== Missing symbols ===


If you have font rendering problems where certain symbols do not show up (i.e. {{ic|/}} appears as a square), try uninstalling {{Pkg|font-mathematica}}.
If you have font rendering problems where certain symbols do not show up (i.e. {{ic|/}} appears as a square), try [https://mathematica.stackexchange.com/questions/1158/invisible-conjugate-glyph-in-the-linux-frontend this] solution. It also states the issue is fixed with Mathematica version 9.
 
Also, try [http://mathematica.stackexchange.com/questions/1158/invisible-conjugate-glyph-in-the-linux-frontend this] solution. It also states the issue is fixed with Mathematica version 9.


Try having applications use anti-aliasing.  
Try having applications use anti-aliasing.  
For KDE: ''System Settings > Application Appearance > Fonts > Use anti-aliasing (Enabled)''
For KDE: ''System Settings > Application Appearance > Fonts > Use anti-aliasing (Enabled)''


=== HiDPI / Retina Screens ===
=== HiDPI / Retina screens ===


If you have a [[HiDPI]] screen, such as an Apple Retina display, and the main text in Mathematica looks small when you open it, this can be fixed:
If you have a [[HiDPI]] screen, such as an Apple Retina display, and the main text in Mathematica looks small when you open it, this can be fixed:


* Go to ''Edit Preferences''
* Go to ''Edit > Preferences''
* From the ''Advanced'' tab, click ''Open Option Inspector''
* From the ''Advanced'' tab, click ''Open Option Inspector''
* In the tree on the right, go to ''Formatting Options Font Options Font Properties''
* In the tree on the right, go to ''Formatting Options > Font Options > Font Properties''
* Change the value for ''"ScreenResolution"'' to double its current setting, e.g. 72 144. You can also use <code>xdpyinfo | grep resolution</code> to get a more precise number (which will need to be doubled).
* Change the value for ''"ScreenResolution"'' to double its current setting, e.g. 72 to 144. You can also use {{ic|xdpyinfo {{!}} grep resolution}} to get a more precise number (which will need to be doubled).


=== Conflicts with system libraries ===
=== Conflicts with system libraries ===


The Mathematica package includes a number of it's own libraries, located in <INSTALL_DIR>/SystemFiles/Libraries/Linux-x86-64. They may lead to some compatibility issues and fallback to the system versions of some of these libraries may be necessary.
The Mathematica package includes a number of its own libraries, located in {{ic|<INSTALL_DIR>/SystemFiles/Libraries/Linux-x86-64}}. They may lead to some compatibility issues and fallback to the system versions of some of these libraries may be necessary.


==== Symbol lookup error: /usr/lib/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var ====
==== Symbol lookup error: /usr/lib/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var ====
Line 101: Line 114:
  # cd <INSTALL_DIR>/SystemFiles/Libraries/Linux-x86-64
  # cd <INSTALL_DIR>/SystemFiles/Libraries/Linux-x86-64
  # mv libz.so.1 libz.so.1.old
  # mv libz.so.1 libz.so.1.old
==== Symbol lookup error: /usr/lib/libfreetype.so.6: undefined symbol: hb_ot_tags_from_script_and_language ====
Force Mathematica to use the system version of the harfbuzz library.
# cd <INSTALL_DIR>/SystemFiles/Libraries/Linux-x86-64
# mv libharfbuzz.so.0 libharfbuzz.so.0.old


== See also ==
== See also ==


* [http://www.wolfram.com/mathematica/ Official site]
* [https://www.wolfram.com/mathematica/ Official site]
* [http://www.wolfram.com/support/ Official Support]
* [https://www.wolfram.com/support/ Official support]

Latest revision as of 08:53, 23 December 2023

Mathematica is a commercial program used in scientific, engineering and mathematical fields. Here we explain how to install it.

Installation

Since Mathematica is a non-free application and upgrades may incur costs, this section lists instructions for different available versions.

Mathematica 6

Mounting iso

One way to mount the Mathematica .iso is to create a /media/iso mount directory and add the following line to the fstab:

/location/of/mathematica.iso /media/iso iso9660 exec,ro,user,noauto,loop=/dev/loop0   0 0

Now you can mount it with:

# mount /media/iso

Running the installer

Run MathInstaller with:

# cd Unix/Installer
# sh ./MathInstaller
Note: If you do not place the "sh" in front, then you will get an error about a bad interpreter.

Fonts

Add the directories containing Type1 and BDF fonts to your FontPath.

Mathematica 7

Mathematica 7 is much easier to install.

# tar xf Mathematica-7.0.1.tar.gz
# cd Unix/Installer
# ./MathInstaller

Follow instructions.

For KDE users, the Mathematica icon may appear in the Lost & Found category. To solve this, execute the following as root:

# ln -s /etc/xdg/menus/applications-merged /etc/xdg/menus/kde-applications-merged

Mathematica 8

An issue with Mathematica 8 is a reproducible crash when performing WolframAlpha[] functions. By default, Mathematica is configured to detect the system's proxy settings when configuring how to connect to the internet to fetch data. A "bug" exists that will eventually crash Mathematica when the calling library is used. A workaround is to avoid this library call altogether by configuring Mathematica to "directly connect" to the internet. (Edit > Preferences > Internet Connectivity > Proxy Settings). This bug has been reported to Wolfram.

Mathematica 10

Install mathematicaAUR (need historical version). The Mathematica_10.XX.YY_LINUX.sh installation script is required; you will need to download this separately from Wolfram.com, your university, etc. You will also need an activation key.

Mathematica 11

Install mathematicaAUR. Obtain Mathematica_11.XX.YY_LINUX.sh from Wolfram Research, along with an activation key, and save it to the package build directory. Successful install may throw non-critical errors: xdg-icon-resource, mkdir, xdg-desktop-menu. For more details see the mathematica PKGBUILD file.

Mathematica 11 automatically creates a document folder 'Wolfram Mathematica' in $UserDocumentsDirectory, which is set by Mathematica according to XDG user directories.

Mathematica 12

  1. Install the packages avahi and inetutils.
  2. Start/enable the service avahi-daemon.service.
  3. Check that hostnamectl contains either a static or transient hostname.
  4. Download the install script from Wolfram. The filename will be Mathematica_12.XX.YY_LINUX.sh.
  5. Make Mathematica_12.XX.YY_LINUX.sh executable.
  6. Run the install script as root. When ran as user, the installer will ask for another installation directory.
# ./Mathematica_12.XX.YY_LINUX.sh

Mathematica 13

The installation steps are the same as Mathematica 12.

Troubleshooting

Missing symbols

If you have font rendering problems where certain symbols do not show up (i.e. / appears as a square), try this solution. It also states the issue is fixed with Mathematica version 9.

Try having applications use anti-aliasing. For KDE: System Settings > Application Appearance > Fonts > Use anti-aliasing (Enabled)

HiDPI / Retina screens

If you have a HiDPI screen, such as an Apple Retina display, and the main text in Mathematica looks small when you open it, this can be fixed:

  • Go to Edit > Preferences
  • From the Advanced tab, click Open Option Inspector
  • In the tree on the right, go to Formatting Options > Font Options > Font Properties
  • Change the value for "ScreenResolution" to double its current setting, e.g. 72 to 144. You can also use xdpyinfo | grep resolution to get a more precise number (which will need to be doubled).

Conflicts with system libraries

The Mathematica package includes a number of its own libraries, located in <INSTALL_DIR>/SystemFiles/Libraries/Linux-x86-64. They may lead to some compatibility issues and fallback to the system versions of some of these libraries may be necessary.

Symbol lookup error: /usr/lib/libfontconfig.so.1: undefined symbol: FT_Done_MM_Var

Force Mathematica to use the system version of the freetype library.

# cd <INSTALL_DIR>/SystemFiles/Libraries/Linux-x86-64
# mv libfreetype.so.6 libfreetype.so.6.old

Mathematica/11.3/SystemFiles/Libraries/Linux-x86-64/libz.so.1: version `ZLIB_1.2.9' not found (required by /usr/lib/libpng16.so.16)

Force Mathematica to use the system version of the zlib library.

# cd <INSTALL_DIR>/SystemFiles/Libraries/Linux-x86-64
# mv libz.so.1 libz.so.1.old

Symbol lookup error: /usr/lib/libfreetype.so.6: undefined symbol: hb_ot_tags_from_script_and_language

Force Mathematica to use the system version of the harfbuzz library.

# cd <INSTALL_DIR>/SystemFiles/Libraries/Linux-x86-64
# mv libharfbuzz.so.0 libharfbuzz.so.0.old

See also