Latest Macintosh Distributions - MdsWiki
Navigation
Personal tools

From MdsWiki

Jump to: navigation, search

MDSplus now supports the Macintosh platform. After installing a few prerequisite packages on your Macintosh operating system you should be able to install an MDSplus package downloaded from this page. Go back to downloads page.

Contents

Release Levels

There are currently 3 different release levels of MDSplus:

Release Level Description
Stable Updates occur less frequently.
New features added only after significant testing by sites running alpha versions.
Bug fixes applied as needed.
Alpha Updates occur whenever a change to an MDSplus source module.
Reflects the CVS head in the repository.

MDSplus Packaging

Currently there is one all encompassing MDSplus package which installs all the supported functions provided in the MDSplus software.

Prerequisites

Prior to installing MDSplus you will need to install a few additional packages required for MDSplus to operate. Even if you do not intend to use all of the MDSplus applications, some of the MDSplus internals may be linked to libraries in these prerequisite packages which would prevent them from loading if those packages were not installed. The following table lists the packages required and provides links to download sites where you can find them. Should these links become stale you can either search the web for these packages or post a note to the MDSplus mailing list and the developers will attempt to update the information on this page.

Name Location Directions
OpenMotif OpenMotif Downloads Download the dmg file from the 2nd link, and run the installer package from the disk image.
Note: the 10.5 package appears to work for 10.6.


Note on 10.8 you must set the system preference to allow applications from unknown vendors. Open system preferences and then open the 'security and privacy' panel. Allow applications from all sources is on the general tab.

XCode Command Line Tools Mac OS-X 10.6-Xcode 3.2.2
Mac OS-X 10.7+ Get Xcode 4.x from App Store
OS X 10.6 - download and install xcode 3.2.2
OS X 10.7+ nstall Xcode 4.x from the Mac App Store. Start Xcode and from File->Preferences downloads tab install the command line tools.


OS X 10.8 starting Xcode will prompt for you to install jre, which is also needed later.

FreeTDS FreeTDS Home Page Download the tarball from the 'stable release' link on the upper right.
Use finder to navigate to the downloaded file, and double click it to expand it to a folder.
With a terminal, cd to the expanded directory (~/Downloads/freetds-X.YY). Configure by typing ./configure.
Build by typing make. Install by typing sudo make install.
Note: you will have to provide your password for the sudo commmand.
Xquartz - OS-X 10.8 Xquartz installation on Mac OS-X 10.8 Mountain Lion, an X-11 server is not included. In order to run the X-Windows based MDSplus applications (traverser, dwscope, dwscope-remote) you will need to install XQuartz.
Java run time environment On OS-X 10.8 Mountain Lion, the first time a java application is run (jScope, jTraverser) the system will prompt to install the Java SE runtime environment. This is required to run these applications.

Xcode version 5 no longer ships with cvs. if you need cvs get it from: [1], You will have to download, and make. make install will not work (it is looking for /tmp/cvs/Debug) which does not exist. Copy the executable from /tmp/cvs/Build/src to /usr/local bin.

cp /tmp/cvs/Build/src/cvs /usr/local/bin

Performing the installation

Choose the type of installation you want to perform and select the pkg file from one of the three tables below. Click on the pkg to download it on your Macintosh and your browser should bring up the installer application to complete the installation. If your browser does not automatically activate the installer application you can either find the pkg file with the Finder and click on it or use a terminal window and type the following command to install it:

$ installer -pkg package-file-name -target /

Latest Stable Packages


Latest Alpha Packages

The last alpha installer built on OSX Mountain Lion can be found here: MDSplus-alpha-7-12-1.osx.pkg

Releases higher than MDSplus-alpha-7-12-1 are now being built on OSX Sierra and may not be downward compatible with earlier OSX versions.


Post Installation Configuration

Establish MDSplus Data Service for remote access to local MDSplus data

MDSplus provides a TCP based network interface which lets you serve your data to remote MDSplus users. To control access there is a file called /etc/mdsip.hosts which contains information which specifies the mapping of remote connection requests to local user accounts. Note this is an absolute path, and that the MDS installer does not create these files and that you should copy it from /usr/local/mdsplus/etc/mdsip.hosts. This file should contain lines of the format:

remote-user-connection-string | local-account

where the remote-user-connection-string for unencrypted mdsip would be something like remote-username@remote-hostname. This connection string can contain wildcards. For example, one could specify *@*.mydomain.org to match any user connecting from a host in the mydomain.org domain. Each asterisk in the connection string will match zero or more arbitrary characters. A percent character will match any single character. You can use either host names or ipv4 addresses. When a connection is first made, the connection string is checked for a match in the mdsip.hosts file starting from the top. Match checking stops when the first match has been found. There is also a special MAP_TO_LOCAL keyword that can be used instead of a specific local-account name. This will attempted to map the incoming connection to the same account name as the remote user account name. If you place an exclamation mark as the first character in a line, a match on the incoming connection string will result in the connection being denied. Lines beginning with # will be treated as comments and will be ignored.

--TIDBITS REGARDING /etc/mdsip.hosts ---- The usual 2 lines in/etc/mdsip.hosts are:

  • | MAP_TO_LOCAL
  • | nobody

Here is an example that confused us for a while, where '* | nobody' failed to allow a remote connection to the server. So make sure the permissions allow read (and write permissions to the shotid.sys file which contains the latest shot number if you want to increment the shot number). Apparently a line like

  • | mds_user

works fine, providing mds_user is a user on the server, and mds_user has read and write permissions to the data directory and files in it. The user 'nobody' is a special operating system user that evidently is not good enough for this?

Once you have configured the /etc/mdsip.hosts file you can turn on the MDSplus service by issuing the following command:

$ sudo launchctl load -w /usr/local/mdsplus/etc/mdsip.plist

Configuring the MDSplus environment variables

During the MDSplus installation procedure the /etc/profile and /etc/bash.login scripts were modified to invoke the either the /usr/local/mdsplus/setup.sh script or the /usr/local/mdsplus/setup.csh script. These scripts define environment variables used by MDSplus to tell applications where to find the MDSplus libraries, tdi script files and MDSplus data files (trees). To add your own tree path definitions you can create a file called /usr/local/mdsplus/local/envsyms containing tree path definitions. This file should contain lines such as:

tree-name_path [host[:port]::]tree-file-directory[;host[:port]::]tree-file-directory...]

For example if you want to put MDSplus trees called mytree in the directory /mdsplus/trees/mytree you would include a line such as:

mytree_path /mdsplus/trees/mytree

If you want to access a mytree tree stored on another system running an mdsip data server you might instead have a line such as:

mytree_path myotherserver::/mdsplus/trees/mytree

Once you have configured your environment variables using the /usr/local/mdsplus/local/envsyms file you can make these environment variables accessible from desktop Apps system-wide by issuing the following command:

$ sudo sh -c '/usr/local/mdsplus/bin/mdsplus_launchconfig >> /etc/launchd.conf'

If you don't want to make system-wide definitions, a user could issue the following command to establish his own App environment definitions:

$ /usr/local/mdsplus/bin/mdsplus_launchconfig >> ~/.launchd.conf

You may need to reboot for the launchd.conf changes to work

Note that which ever launchd configuration file you decide to create you will need to update that file every time changes are made to the envsyms configuration. The mdsplus_launchconfig script generates setenv commands for the launcher to use when invoking desktop applications. If you rerun the command appending to the launchd configuration file you might want to edit the resulting configuration file and remove duplicate or excess setenv commands.

Configuring Excelis IDL to access MDSplus

The IDL language is a commercial data analysis language, similar to Matlab, Otave and SciLab. In order to use MDSplus with it, first install and license the software.

Note: The MDSplus interface will not work with IDL when IDL is running in unlicensed 'demo' mode.

To use the MDSplus interface the environment variables defined in envsyms by the installation must be 'installed'.

Once you have configured your environment variables using the /usr/local/mdsplus/local/envsyms file you can make these environment variables accessible from desktop Apps system-wide by issuing the following command:

$ sudo sh -c '/usr/local/mdsplus/bin/mdsplus_launchconfig >> /etc/launchd.conf'

If you don't want to make system-wide definitions, a user could issue the following command to establish his own App environment definitions:

$ /usr/local/mdsplus/bin/mdsplus_launchconfig >> ~/.launchd.conf

You may need to reboot for the launchd.conf changes to work

Note that which ever launchd configuration file you decide to create you will need to update that file every time changes are made to the envsyms configuration. The mdsplus_launchconfig script generates setenv commands for the launcher to use when invoking desktop applications. If you rerun the command appending to the launchd configuration file you might want to edit the resulting configuration file and remove duplicate or excess setenv commands.


To test fire up idl and try the following commands:

IDL> print, MdsValue('42')
% Compiled module: MDSVALUE.
% Compiled module: MDSCHECKARG.
% Compiled module: MDSISCLIENT.
% Compiled module: MDSIDLIMAGE.
         42
IDL> print, mdsvalue('sin(0 : 10 : .1)')
     0.00000    0.0998334     0.198669     0.295520     0.389418     0.479426     0.564642     0.644218     0.717356     0.783327
    0.841471     0.891207     0.932039     0.963558     0.985450     0.997495     0.999574     0.991665     0.973848     0.946300
    0.909297     0.863209     0.808496     0.745705     0.675463     0.598472     0.515501     0.427380     0.334988     0.239249
    0.141120    0.0415805   -0.0583742    -0.157746    -0.255541    -0.350783    -0.442521    -0.529836    -0.611858    -0.687766
   -0.756802    -0.818277    -0.871576    -0.916166    -0.951602    -0.977530    -0.993691    -0.999923    -0.996165    -0.982453
   -0.958924    -0.925815    -0.883455    -0.832267    -0.772764    -0.705540    -0.631267    -0.550685    -0.464602    -0.373877
   -0.279415    -0.182163   -0.0830891    0.0168141     0.116549     0.215120     0.311541     0.404850     0.494114     0.578440
    0.656987     0.728969     0.793668     0.850437     0.898708     0.938000     0.967920     0.988168     0.998543     0.998941
    0.989358     0.969890     0.940731     0.902172     0.854599     0.798487     0.734397     0.662969     0.584917     0.501020
    0.412118     0.319098     0.222890     0.124454    0.0247749   -0.0751511    -0.174327    -0.271760    -0.366479    -0.457536
   -0.544021
IDL>

Configuring Matlab to access MDSplus

Matlab is a commercial data analysis language, similar to Excelis IDL , Otave and SciLab. In order to use MDSplus with it, first install and license the software.

There is a matlab command which will display the matlab software installation location. Start matlab and issue:

>> matlabroot

ans =

/Applications/MATLAB_R2010a.app

Open a terminal, cd to that location, then cd to toolbox/local, there are 2 files which must be modified in this directory. First classpath.txt:

$ cd /Applications/MATLAB_R2010a.app
$ cd toolbox/local/
$ sudo vi classpath.txt
Password:

add the following line to the top of the file:

/usr/local/mdsplus/java/classes/mdsobjects.jar

Then edit the file librarypath.txt

 $ sudo vi librarypath.txt
 Password:

and add the following line to the bottom of the file:

 /usr/local/mdsplus/lib/

To use the MDSplus matlab interface the environment variables defined in envsyms by the MDSplus installation procedure must be 'installed'.

Once you have configured your environment variables using the /usr/local/mdsplus/local/envsyms file you can make these environment variables accessible from desktop Apps system-wide by issuing the following command:

$ sudo sh -c '/usr/local/mdsplus/bin/mdsplus_launchconfig >> /etc/launchd.conf'

If you don't want to make system-wide definitions, a user could issue the following command to establish his own App environment definitions:

$ /usr/local/mdsplus/bin/mdsplus_launchconfig >> ~/.launchd.conf

You may need to reboot for the launchd.conf changes to work

Note that which ever launchd configuration file you decide to create you will need to update that file every time changes are made to the envsyms configuration. The mdsplus_launchconfig script generates setenv commands for the launcher to use when invoking desktop applications. If you rerun the command appending to the launchd configuration file you might want to edit the resulting configuration file and remove duplicate or excess setenv commands.


Matlab should now have access to the MDSplus java classes. Given a local tree called test with a numeric node 'status' and a text node 'txt'. First import the classes and open the tree:

>> import MDSplus.* 
>> t = Tree('test', -1)

t =
 
Tree(test, -1, NORMAL)
 

Then get the node 'status', retrieve its data and convert it to a native matlab array:

>> n = t.getNode('status')
  
n =
  
STATUS
  
>> mdsdata=n.getData()
  
mdsdata =
  
[1,2,3,4,5,6]
  
>> class(mdsdata)
 
ans =
 
MDSplus.Int32Array
 
>> matlabdata=NATIVEvalue(mdsdata)
 
matlabdata =
 
          1           2           3           4           5           6

Next retrieve the node called 'txt' and read its' data:

>> n = t.getNode('txt')
 
n =
 
TXT
 
>> mdsdata=n.getData()
 
mdsdata =
 
"This is some text"
 
>> class(mdsdata)

ans =

MDSplus.String

Finally construct some 2 dimensional data using the matlab magic square function, write it to the status node, read it back, and convert it to a native matlab array.

>> magic_sq = magic(5)

magic_sq =

   17    24     1     8    15
   23     5     7    14    16
    4     6    13    20    22
   10    12    19    21     3
   11    18    25     2     9

>> n = t.getNode('status')
 
n =
 
STATUS
 
>> n.putData(MDSarg(magic_sq))
>> mdsdata=n.getData()
 
mdsdata =
 
[[17D0,23D0,4D0,10D0,11D0], [24D0,5D0,6D0,12D0,18D0], [1D0,7D0,13D0,19D0,25D0],  [8D0,14D0,20D0,21D0,2D0], [15D0,16D0,22D0,3D0,9D0]]
 
>> class(mdsdata)

ans =

MDSplus.Float64Array

>> matlabdata=NATIVEvalue(mdsdata)

matlabdata =

   17    24     1     8    15
   23     5     7    14    16
    4     6    13    20    22
   10    12    19    21     3
   11    18    25     2     9

>>