15
$\begingroup$

This is the Kernel Configuration dialog from Evaluation → Kernel Configuration Options...

enter image description here

Under "Arguments to MLOpen" we can use several templates of the form `name`, which will be expanded by the front end to a certain value. For example, `mathkernel` will be expanded to the absolute path to the kernel executable of the current installation.

What are the templates that we can use and what do they expand to?

Additionally, what kind of escaping and quoting can be used in this box?

$\endgroup$
18
+350
$\begingroup$

By experimentation, the templates listed below seem to be supported in the Arguments to MLOpen and Launch command boxes. For each template, a sample expansion is shown as produced by Mathematica 11 under OS X on my machine.

Templates for Directories

  • `baseDirectory` expands to /Library/Mathematica
  • `homeDirectory` expands to /Users/sakra
  • `installDirectory` expands to /Applications/Mathematica.app/Contents
  • `jlinkDirectory` expands to /Applications/Mathematica.app/Contents/SystemFiles/Links/JLink
  • `userbaseDirectory` expands to /Users/sakra/Library/Mathematica
  • `userdocumentsDirectory` expands to /Users/sakra/Documents

Templates for Files

  • `executable` expands to wolfram
  • `java` expands to /Applications/Mathematica.app/Contents/SystemFiles/Java/MacOSX-x86-64/bin/java
  • `javaw` expands to /Applications/Mathematica.app/Contents/SystemFiles/Java/MacOSX-x86-64/bin/java
  • `jlinkjar` expands to /Applications/Mathematica.app/Contents/SystemFiles/Links/JLink/JLink.jar
  • `mathkernel` expands to /Applications/Mathematica.app/Contents/MacOS/WolframKernel
  • `mathssh` expands to /Applications/Mathematica.app/Contents/SystemFiles/Java/WolframSSH.jar
  • `wolframkernel` expands to /Applications/Mathematica.app/Contents/MacOS/WolframKernel
  • `wolframssh` expands to /Applications/Mathematica.app/Contents/SystemFiles/Java/WolframSSH.jar

Templates for Environment

  • `ipaddress` expands to 192.168.1.11
  • `machinename` expands to host.example.com
  • `username` expands to sakra

Templates for WSTP

The expansion of the following templates depends on the WSTP link actually created by the options entered in the Arguments to MLOpen box.

Templates for a TCPIP WSTP link

  • `linkname` expands to 54656@192.168.1.11,54657@192.168.1.11
  • `dataport` expands to 54656@192.168.1.11
  • `messageport` expands to 54657@192.168.1.11
  • `socketname` expands to 54656

Templates for a SharedMemory WSTP link

  • `linkname` expands to dr6hn_shm
  • `dataport` expands to dr6hn_shm
  • `messageport` expands to empty string
  • `socketname` expands to dr6hn_shm

Quoting

Under OS X and Linux both single quotes and double quotes can be used for quoting arguments in the expected way.

Under Windows the launch command is passed to cmd.exe in the following way:

C:\Windows\system32\cmd.exe /c "launch command"

That means that the quoting rules for cmd.exe /c apply, i.e. double quotes work as expected.

|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.