Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 349d510f03
Fetching contributors…

Cannot retrieve contributors at this time

313 lines (223 sloc) 11.139 kb
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Installing SMART on OS X</title>
<meta name="author" content="SMART Platforms">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="/assets/themes/twitter-2.0/css/pygments.css" rel="stylesheet">
<link href="/assets/themes/twitter-2.0/css/bootstrap.min.css" rel="stylesheet">
<link href="/assets/themes/twitter-2.0/css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="/assets/themes/twitter-2.0/css/style.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div class="content">
<section id="jekyll-page">
<div class="row">
<div class="span4">
<a href="/">
<img id='smart_top_logo' src="/images/smart.png"/>
</a>
<div id="left_nav">
<ul class="nav nav-list">
<li class="nav-header">Tutorials</li>
<li><a href="/howto/build_a_smart_app">Build a SMART App</a></li>
<li><a href="/howto/build_a_rest_app">Build a SMART REST App</a></li>
<li><a href="/howto/background_and_helper_apps">Background + Helper Apps</a></li>
<li><a href="/howto/build_smart_frame_ui_apps">Frame UI Apps</a></li>
<li><a href="/howto/got_statins">Got Statins? App</a></li>
<li><a href="/howto/rx_reminder">RxReminder App</a></li>
<li class="nav-header">Using SMART Data</li>
<li><a href="/howto/intro_to_rdf">Intro to RDF and SPARQL</a></li>
<li><a href="/howto/sparql_examples">SPARQL Examples for SMART</a></li>
<li><a href="/howto/intro_to_jsonld">Intro to the JSON-LD API</a></li>
<li><a href="/howto/filters">Query Filtering and Pagination</a></li>
<li><a href="/howto/deferred">$.Deferred for Parallel Queries</a></li>
<li><a href="/howto/smart_data">SMART Data: Best Practices</a></li>
<li class="nav-header">Reference</li>
<li><a href="/reference/data_model">Data Model</a></li>
<li><a href="/reference/rest_api">REST API</a></li>
<li><a href="/reference/filters">Query Filters</a></li>
<li><a href="/reference/app_manifest">App Manifest</a></li>
<li class="nav-header">Client Libraries</li>
<li><a href="/libraries/javascript">Javascript (SMART Connect)</a></li>
<li><a href="/libraries/python">Python</a></li>
<li><a href="/libraries/java">Java</a></li>
<li><a href="/libraries/dotnet">.NET</a></li>
<li><a href="/libraries/container_javascript">Container-side Javascript</a></li>
<li class="nav-header">SMART Update Guides</li>
<li><a href="/updates/smart_0.4/app">0.4 Apps</a></li>
<li><a href="/updates/smart_0.5/container">0.4 Containers</a></li>
<li><a href="/updates/smart_0.5/">0.5 Apps + Containers</a></li>
<li class="nav-header">Reference EMR Installation</li>
<li><a href="/install/linux">Ubuntu Linux</a></li>
<li><a href="/install/os_x">OS X</a></li>
<li class="nav-header">Presentations</li>
<li><a href="http://www.slideshare.net/jmandel/2010-0826smartarchitecture">Architecture (2010-08)</a></li>
<li><a href="http://www.slideshare.net/jmandel/2010-08-26-smart-governance">Governance (2010-08)</a></li>
<li><a href="http://media.smartplatforms.org/smart-screencast.mp4">Demo</a></li>
<li class="nav-header">Downloads</li>
<li><a href="/downloads/">Download Source + VM</a></li>
</ul>
</div>
</div>
<div class="span8" id="jekyll-page-content">
<div class="page-header">
<h1>Installing SMART on OS X <small></small></h1>
</div>
<div class='simple_small_box'>Help us improve! You can correct errors or add to this page by clicking
<a class='githublink' href=''>here</a> to edit this page on Github.
</div>
<p>This walks you through installing an <em>insecure SMART testing environment</em> on
Mac OS X. We will be installing everything needed for SMART into the directory
<code>/Library/SMART</code>, all the instructions assume that you are running a Terminal
open from this location. Of course you can use your own location, just remember
to return to your <code>SMART</code> directory. Tested on OS X Lion and Mountain Lion.</p>
<h1>Install Homebrew</h1>
<p>We use <a href="http://mxcl.github.com/homebrew/">Homebrew</a> as package manager to install a few Linux tools. Since this
needs some extra command line tools to compile code, you first have to do
<em>one</em> of the following:</p>
<ul>
<li><p>Install <a href="http://itunes.apple.com/ch/app/xcode/id497799835?l=en&mt=12">Xcode</a> from the App Store (it's free, if large), then open
<code>Xcode &gt; Preferences &gt; Downloads &gt; Components</code> and install the <code>Command Line
Tools</code></p></li>
<li><p>Download only the <a href="https://developer.apple.com/downloads/index.action">Command Line Tools</a> (search for the correct version) from
the Apple Developer Center (you will need a free developer account for this)</p></li>
</ul>
<p><a href="http://mxcl.github.com/homebrew/">Homebrew</a> is a superb replacement for the old managers Fink and MacPorts and
you will love it! Here's a one-line installer for it:</p>
<pre><code>$ /usr/bin/ruby -e &quot;$(/usr/bin/curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)&quot;
</code></pre>
<p>If you had Homebrew installed before, make sure to update it:</p>
<pre><code>$ brew update
</code></pre>
<h1>Install Python Tools</h1>
<h2><code>lxml</code> - an pythonic xml library</h2>
<p>Download <a href="http://pypi.python.org/pypi/lxml/2.3.4#downloads">lxml</a> version 2.3.4 or later (via source tarball), double-click to
unarchive, then build and install:</p>
<pre><code>$ cd lxml-2.3.4
$ python setup.py build --static-deps
$ sudo python setup.py install
</code></pre>
<h2><code>psycopg2</code> - an advanced PostgreSQL driver for Python</h2>
<p>Download the <a href="http://initd.org/psycopg/">latest stable release</a>, unarchive, build and install:</p>
<pre><code>$ cd psycopg2-2.4.5
$ python setup.py build
$ sudo python setup.py install
</code></pre>
<h2>RDF packages</h2>
<pre><code>$ sudo easy_install -U &quot;rdflib&gt;=3.0.0&quot; rdfextras
</code></pre>
<h1>Install Django</h1>
<h2>Django</h2>
<p>You have to use <a href="https://www.djangoproject.com/download/">Django 1.3</a> for now. Download, unarchive and install:</p>
<pre><code>$ cd Django-1.3.1
$ sudo python setup.py install
</code></pre>
<h1>PostgreSQL</h1>
<p>It's easiest to use the <a href="http://www.postgresql.org/download/macosx/">Mac installer</a> because it also sets up
the <code>postgres</code> user which is needed.</p>
<ul>
<li><p>Download the latest installer (I used 9.1.4) and run it. You can keep most
default settings:</p>
<ul>
<li>Install into <code>/Library/PostgreSQL/9.1</code></li>
<li>Port <code>5432</code></li>
<li>Remember your password!</li>
<li>Locale <code>en_US.UTF-8</code> (any <code>.UTF-8</code> will do)</li>
</ul></li>
<li><p>Create a PostgreSQL user for your SMART service. We will be using <em>smart</em>,
use your own password:</p>
<pre><code>$ sudo su - postgres
$ createuser --superuser smart
$ psql postgres
$ postgres=# \password smart
$ postgres=# \q
</code></pre></li>
</ul>
<p><em>Caveat</em>: When using Postgres &lt; 9.1 see the <a href="https://github.com/chb/smart_server">instructions</a> on how to change
the Postgres config to use md5 passwords. Also, if you haven't configured
postgres to use UTF-8, you seemingly need to use <code>pg_createcluster</code> which does
not ship on the Mac. You're on your own.</p>
<h1>Tomcat and openrdf-sesame</h1>
<ul>
<li><p>Install Tomcat</p>
<p>$ brew install tomcat</p></li>
<li><p>Configure Tomcat: The environment variable <em>$CATALINA_HOME</em> needs to point
to the tomcat base directory. So in your Bash <code>.profile</code> add:</p>
<p>$ export CATALINA_HOME=/usr/local/Cellar/tomcat/7.0.28/libexec</p></li>
</ul>
<p>If you don't use Bash adjust accordingly. Reload your profile file with:</p>
<pre><code> $ source ~/.profile
</code></pre>
<ul>
<li><p>Install openrdf-sesame</p>
<pre><code>$ curl -O http://downloads.sourceforge.net/project/sesame/Sesame%202/2.6.5/openrdf-sesame-2.6.5-sdk.tar.gz
$ tar -xzvf openrdf-sesame-2.6.5-sdk.tar.gz
$ mkdir $CATALINA_HOME/.aduna
$ cp -r openrdf-sesame-2.6.5/war/* $CATALINA_HOME/webapps/
</code></pre></li>
<li><p>Launch Tomcat and check its availability</p>
<pre><code>$ CATALINA_HOME/bin/startup.sh
</code></pre></li>
</ul>
<p>You should now be able to access <code>http://localhost:8080/openrdf-workbench/</code>.</p>
<h1>Automated SMART install</h1>
<p>We're now ready to get the latest and greatest from SMART.</p>
<ul>
<li><p>Download the SMART manager</p>
<pre><code>$ curl -O https://raw.github.com/chb/smart_server/master/load_tools/smart_manager.py
</code></pre></li>
<li><p>Run the manager. This will install the current <code>master</code> branch of all SMART
repositories that we need. If you want the bleeding edge <code>dev</code> version, add a
<code>-d</code> switch to the following command</p>
<pre><code>$ python smart_manager.py -a
</code></pre></li>
</ul>
<p>This will fetch all needed repositories, run an installer that asks you for some
configurations, generate patient sample data and in the end run the server.</p>
<h1>Running SMART</h1>
<p>If you've just run the automated install, you only need to start Tomcat via
<code>$CATALINA_HOME/bin/startup.sh</code>, in the future:</p>
<h2>To start SMART (and Tomcat):</h2>
<pre><code>$ CATALINA_HOME/bin/startup.sh
$ python smart_manager.py -v -w
</code></pre>
<h2>To stop SMART (and Tomcat):</h2>
<pre><code>$ python smart_manager.py -k
$ CATALINA_HOME/bin/shutdown.sh
</code></pre>
<p>Nobody is stopping you from putting these two commands in a start- and/or stop
script, of course. :)</p>
</div>
</div>
</section>
</div>
<footer>
<div>
<a href='http://smartplatforms.org'>SMART Platforms</a> &copy; 2012
</div>
</footer>
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/assets/themes/twitter-2.0/js/jquery.min.js"><\/script>')</script>
<script src="/assets/themes/twitter-2.0/js/bootstrap_aks.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-33617191-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script src="/assets/app.js?v=0.1"></script>
<script>Toc.init($("#jekyll-page-content"), $("#toc"));</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.