Software:BuildingFromSources - MdsWiki
Navigation
Personal tools

From MdsWiki

Jump to: navigation, search

Contents

Building from sources


General Recommendations

If you will be running the MDSplus test suite, it is best to use a local file system to build / test MDSplus. On a local file system, the MDSplus file locking occurs quickly. However, on a NFS file system, there is additional overhead associated with locking files, which can make some tests run very slowly.

Mac OS X Prerequisites

Prior to building MDSplus you will need to install a few additional packages required for the building process to work correctly. 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
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.
OS X 10.14 Start Xcode. Choose Preferences from the Xcode menu. Choose the Components tab. Check and Install.

Xcode SDK headers Package Located here: /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg Simply, open a terminal and type the following as super-user:
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
LibXML library Located here: /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg Simply, open a terminal and type the following:
brew install libxml2
You will need to have Home Brew installed in your system, see https://brew.sh
From your terminal type:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
pkg-config Tool See here for more details about this tool: https://www.freedesktop.org/wiki/Software/pkg-config/ Simply, open a terminal and type the following:
brew install pkg-config
packagesbuild (part of the Packages Tool) See here for more details about this tool:
http://s.sudre.free.fr/Software/Packages/about.html
Simply, download Packages from one of these sites:
https://www.macupdate.com/app/mac/34613/packages
http://s.sudre.free.fr/Software/Packages/about.html
After that, packagesbuild will be installed here: /usr/local/bin/packagesbuild
gfortran Fortran compiler: http://gcc.gnu.org/wiki/GFortran Simply, open a terminal and type the following:
brew install gcc
OpenMotif OpenMotif Downloads
Home Brew
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.
For OS X older than Mojave: Download the dmg file from the 2nd link, and run the installer package from the disk image.
Note: for OS X Mojave and later, simply, open a terminal and type the following:
brew install openmotif
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 https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html
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


Specialized Tool Prerequisites

If the configuration files need to be modified, i.e configure.ac and/or Makefile.in or Makefile.inc.in, the following two tools need to be available to use.

Name Location Directions
autoconf Tool https://www.gnu.org/software/autoconf/ Simply, open a terminal and type the following:
brew install autoconf
This tool is only necessary if you need to modify the configure.ac script.
automake Tool https://www.gnu.org/software/automake/ Simply, open a terminal and type the following:
brew install automake
This tool is only necessary if you need to modify the Makefile.am script.

Making the configure script and the Makefile scripts

What follows explains when to use the autoconf tool and the automake tool to generate the necessary files that will be used later during the building of the application.

The source code package contains two files that controls how the build will proceed. These are the configure.ac and the Makefile.am.

Those two files will generate the configure file and the Makefile.in (and Makefile.inc.in) files:

  1. Use autoconf (you can run the MDSplus script bootstrap as well) to make configure from configure.ac:
    simply from the OS terminal and from the location of the configure.ac file, type:
    autoconf
  2. Use automake to make Makefile.in from Makefile.am:
    simply from the OS terminal and from the location of the Makefile.am file, type:
    automake

Now, we can then run (from yourn MDSplus directory):

./configure

If you need to run configure more than once, and you would like to run it using the same parameters used in the previous execution of configure, you can use the command:
make reconfigure

Building MDSplus using the build.sh script

The build.sh script and be found here: <your home dir>/mdsplus/deploy/build.sh

To build MDSplus using this script, use the following command from your mdsplus directory (which should be on a local file system):

./deploy/build.sh --os=macosx --test --release

(Be sure that you first run "make clean" so that all the old Makefiles are removed from the directories.) The above command will create a test build version of MDSplus that will be located under:

<your home dir>/mdsplus/build/macosx/test/

Building MDSplus using configure and make

The MDSplus source code is maintained on github. If you are interested in building MDSplus from the sources we recommend downloading a tarball, or a zip file from there.

  1. choose 'stable' or 'alpha' - ""note alpha is the active development branch and may contain untested code.""
  2. choose 'zip' or 'tar.gz'
  3. download the sources (choose one of):
    wget https://github.com/MDSplus/mdsplus/archive/alpha.zip
    wget https://github.com/MDSplus/mdsplus/archive/alpha.tar.gz
    wget https://github.com/MDSplus/mdsplus/archive/stable.zip
    wget https://github.com/MDSplus/mdsplus/archive/stable.tar.gz
  4. expand the zip or tar
  5. cd to the directory
  6. ./configure
  7. make

The MDSplus repository can also be cloned from github using:

git clone https://github.com/MDSplus/mdsplus.git

Note: Building from the head of the git repository may lead to unpredictable results. It should be safer to select a release version using the appropriate release tags.

Building MDSplus using Docker

On linux systems that support docker you have the ability to build from MDSplus sources for all the supported platforms except for MacOSX. Once you have the sources you can execute the following command to build a installer for the operating system of your choice:

$ mkdir ~/build
$ cd ~/build
$ ~/mdsplus-src-dir/deploy/build.sh --os=os-name --release

where os-name would be something like fc25 or ubuntu16 etc. The available choices can be found by doing

$ ls ~/mdsplus-src-dir/deploy/os/*.opts

This build.sh script will pull the necessary docker image from dockerhub.com to build MDSplus for that platform. The build results should be in subdirectories of the build directory and will include a full buildroot used for constructing installers and the new package installers. You do not need anything else installed on your system beside docker using this method as all the libraries, compilers etc are provided in the docker images which are used to build MDSplus.

This docker build mechanism is how the standard releases of MDSplus are created and published to mdsplus.org repositories. Each night the alpha and stable branches of MDSplus are automatically fetched by a Jenkins job and examined for updates. These jobs then trigger build jobs which use Docker to test and build MDSplus for a large variety of platforms.