Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis15/INSTALL.md
ViewVC logotype

Diff of /branches/vis15/INSTALL.md

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

branches/vis15/INSTALL revision 5588, Thu Sep 10 17:22:17 2020 UTC branches/vis15/INSTALL.md revision 5589, Thu Sep 10 17:31:14 2020 UTC
# Line 1  Line 1 
1  Build instructions for the Diderot compiler  # Build instructions for the Diderot compiler
2    
3  ===============  These instructions are organized into two parts.  First is a quick
4  PREREQUISITES  guide to installing the Diderot system (including the prerequisite
5  ===============  software).  Following the quick overview are detailed instructions
6    for acquiring and installing the prerequisite software.
7    
8  You must have TEEM installed, which you can get from  ## QUICK GUIDE
9    
10    http://teem.sourceforge.net/download/index.html  ### Prerequisite software
11    
12  You also must have SML/NJ (version 110.79 or later) installed, which you can  #### Software tools
 get from  
13    
14    http://smlnj.org/dist/working/index.html  To build *Teem*, you will need to have *cmake* installed.  Instructions
15    for getting *cmake* are [below](#cmake-details).
16    
17  Diderot is currently supported on Linux and Mac OS X.  It requires a system that is  The Diderot runtime system is written in **C++11** and the code generator
18  capable of running 64-bit executables.  Note that SML/NJ is a 32-bit program, so  also produces **C++** code, so you will need to have a modern **C++** compiler
19  on Linux systems you must also have the 32-bit compatibility libraries installed  installed (*e.g.*, either version 4.8.1 or later of **g++**, or
20  (the exact libraries/packages required will depend on your distribution).  version 3.3 or later of **clang++**).
21    
22  ===============  #### Teem
 SOURCE CHECKOUT  
 ===============  
23    
24  You can checkout the stable version of the Diderot source tree with:  You must have **Teem** installed, which you can get from
25    
26    svn co https://svn.smlnj-gforge.cs.uchicago.edu/svn/diderot/trunk diderot  >
27    >  <http://teem.sourceforge.net/download/index.html>
28    >
29    
30  An anonymous checkout is available via user name "anonsvn" and  Make sure that your **Teem** installation is revision **r6294** or later.
31  password "anonsvn".  At times, there may also be unstable or  More details about installing **Teem** can be found [below](#teem-details).
 experimental development branches.  You can explore these using the  
 web interface at  
32    
33    https://smlnj-gforge.cs.uchicago.edu/scm/viewvc.php/?root=diderot  #### Standard ML of New Jersey
34    
35  ===============  You also must have **Standard ML of New Jersey** (SML/NJ) installed,
36  CONFIGURATION  which you can get from
 ===============  
37    
38  Run autoheader:  >
39    >  <http://smlnj.org/dist/working/index.html>
40    >
41    
42    % autoheader -Iconfig  Make sure that you get version 110.98 or later.  More details about
43    installing **SML/NJ** can be found [below](#smlnj-details).
44    
45  Run autoconf:  #### MLton
46    
47    % autoconf -Iconfig  It is also possible to build **Diderot** using the **MLton**
48    Standard ML compiler, which you can get from
49    
50  Configure the makefiles etc.  >
51    >  <http:/mlton.org>
52    >
53    
54    % ./configure --with-teem=/path/to/teem  ### Getting the Diderot source
55    
56  where "/path/to/teem" is the full path of the directory  You can checkout the stable version of the Diderot source tree from
57  containing the "lib" and "include" directories containing  <github.com> with the command:
 "libteem.{a,so,dylib}" and "teem/*.h", respectively.  
58    
59  You can also specify the location of the doxygen executable at  ````bash
60  configuration time using the option    % git clone https://github.com/Diderot-Language/diderot.git
61    ````
62    
63          --with-doxygen=/path/to/doxygen  or you can browse the source code
64    
65  Doxygen (http://doxygen.org) is used to generate documentation  >
66  for the runtime system.  If you have the Doxygen application  >  <https://github.com/Diderot-Language/diderot>
67  installed on the Mac, you should specify  >
68    
69          --with-doxygen=/Applications/Doxygen.app/Contents/Resources/doxygen  ### Configuration
70    
71  (assuming that the Doxygen application is installed in the Applications  Once you have downloaded the **Diderot** source code, go to the root of
72  folder).  the source tree and configure the build for your machine.
73    
74  ===============  ````bash
75  INSTALLATION      ./configure
76  ===============  ````
77    
78  From the root of the Diderot tree, run  The `configure` script will try to find your **Teem** installation and
79    the **sml** command.  You may need to specify these locations as follows.
80    
81    % make local-install  The `configuration` script looks for **Teem** in either `/usr/local` or
82    `/usr/local/teem`.  If **Teem** is installed elsewhere, use the command
83    
84  This command will build the Diderot compiler (bin/diderotc) and  ````bash
85  runtime support.  Assuming that $ROOT is the root of the Diderot tree;      ./configure --with-teem=/path/to/teem
86  the above make command will create the following files and directories:  ````
87    
88          $ROOT/bin/diderotc      -- the diderotc compiler script  where `/path/to/teem` is the full path of the directory containing the
89          $ROOT/bin/.heap         -- contains the diderotc heap image (used by  **Teem** `lib` and `include` directories.
                                    the diderotc script)  
         $ROOT/lib               -- various versions of the Diderot runtime system  
                                    compiled as ".o" files  
         $ROOT/include/Diderot   -- the Diderot header files, which are needed to  
                                    compile the output of the diderotc compiler.  
90    
91  It is also possible to install the system outside the Diderot tree.  To do so,  If the **sml** command is in your `PATH`, then you are set.  Otherwise,
92  use the "--prefix" option to the configure command.  For example:  you can specify its location to `configure` using the command
93    
94    % configure --with-teem=/path/to/teem --prefix=/usr/local/Diderot  ````bash
95    % make install      SMLNJ_CMD=/usr/local/smlnj/bin/sml ./configure
96    ````
97    
98  will install the Diderot compiler, libraries, and headers in /usr/local/Diderot.  assuming that `/usr/local/smlnj` is the installation directory for
99    **SML/NJ**.
100    
101    ### Building and installing the Diderot system
102    
103    From the root of the Diderot source tree, run the command
104    
105    ````bash
106        make local-install
107    ````
108    
109    This command will build the Diderot compiler (`diderotc`) and runtime
110    support.  Assuming that `$ROOT` is the root of the Diderot tree, the
111    compiler will be located at `$ROOT/bin/diderotc`.
112    
113    ## DETAILS
114    
115    ### CMake <a name="cmake-details"></a>
116    
117    [CMake](https://cmake.org) is required to build **Teem**.
118    These utilities can be obtained via `apt-get` on Ubuntu/Debian
119    Linux, or via [Homebrew `brew`](http://brew.sh) or
120    [Mac Ports `port`](https://www.macports.org) on **macOS**.
121    
122    To get CMake:
123    * **Linux**: CMake can be installed for Ubuntu/Debian using
124      the command `sudo apt-get install cmake`.
125    * **macOS**: CMake can be installed from [Homebrew](http://brew.sh)
126      using the command `brew install cmake` or from
127      [Mac Ports](https://www.macports.org) using the command
128      `sudo port install cmake`.
129    * Alternatively, the [CMake download](https://cmake.org/download/)
130      page includes "Binary distributions" that have the executable
131      `cmake` you will need, as well as source-code distributions.
132    
133    ### Teem <a name="teem-details"></a>
134    
135    The Diderot run-time depends on [**Teem**](http://teem.sourceforge.net).
136    **Teem** is overdue for a release, but in the mean time you should
137    build it from source with **CMake**, because **Diderot** requires
138    the current source (revision **r6294** or later).
139    
140    It is best to build a **Teem** for Diderot that has *none* of the
141    optional libraries (PNG, zlib, etc) enabled. Experience has shown
142    that additional library dependencies from **Teem** will complicate
143    the linking that the Diderot compiler must do to create executables.
144    
145    Create a directory for **Teem**; assume that `$TEEMDIR` specifies the path to
146    that directory.  Then run the following shell commands:
147    
148    ````bash
149        cd $TEEMDIR
150        svn co https://svn.code.sf.net/p/teem/code/teem/trunk teem-src
151    ````
152    
153    The next step is to create a build directory and to configure the build
154    using **CMake**.  This step requires specifying a bunch of flags to
155    disable dependency on various libraries.
156    
157    **COMMENT: for macOS, I do not think that turing off shared libraries
158    is required.  Also, it is not clear that one need to disable PNG, etc.
159    on macOS (at least when using shared libraries). -- JHR**
160    
161    ````bash
162        mkdir teem-build
163        cd teem-build
164        TEEMBUILD=`pwd`
165        cmake -Wno-dev \
166          -D BUILD_EXPERIMENTAL_APPS=OFF -D BUILD_EXPERIMENTAL_LIBS=OFF \
167          -D BUILD_SHARED_LIBS=OFF -D BUILD_TESTING=OFF \
168          -D CMAKE_BUILD_TYPE=Release \
169          -D Teem_BZIP2=OFF -D Teem_FFTW3=OFF -D Teem_LEVMAR=OFF -D Teem_PTHREAD=OFF \
170          -D Teem_PNG=OFF -D Teem_ZLIB=OFF \
171          -D CMAKE_INSTALL_PREFIX:PATH=$TEEMDIR \
172          ../teem-src
173    ````
174    
175    Lastly, you can build and install **Teem**.
176    
177    ````bash
178        make
179        make install
180    ````
181    
182    At this point you will have a `$TEEMDIR/bin`, `$TEEMDIR/lib`, and
183    `$TEEMDIR/include` directories that contain the various parts of
184    **Teem**.
185    
186    To make sure your build works, try:
187    
188    ````bash
189        $TEEMDIR/bin/unu --version
190    ````
191    
192    Note that we do **not** recommend adding this `teem-ddro/bin` to your path;
193    it's not very useful.
194    
195    ### SML/NJ <a name="smlnj-details"></a>
196    
197    #### Installing on Linux
198    
199    On Ubuntu or Debian Linux, `apt-get` may work to install a sufficiently recent
200    version.  `apt-cache policy smlnj` reports what version you can get;
201    if that's at or above version 110.82, you can:
202    
203    ````bash
204        sudo apt-get install smlnj
205        sudo apt-get install ml-lpt
206    ````
207    
208    The second `apt-get` to get `ml-lpt` is required because without it, the later compilation
209    of the Diderot compiler (with the `sml` from `apt-get`) will stop with an error message
210    like `driver/sources.cm:16.3-16.18 Error: anchor $ml-lpt-lib.cm not defined`.
211    
212    #### Installing on macOS
213    
214    On **macOS** systems, the easiest way to install **SML/NJ** is by
215    downloading the signed installer package from <smlnj.org>.  Running the
216    installer will place the system in `/usr/local/smlnj` and the path to the
217    **sml** command will be `/usr/local/smlnj/bin/sml`.
218    
219    As an alternative you can install SML/NJ from [Homebrew](https://brew.sh)
220    using the following commands:
221    
222    It is also possible to get SML/NJ from [Homebrew](https://brew.sh) for macOS.
223    Assuming that `brew info smlnj` mentions version 110.82 or higher, then
224    
225    ````bash
226        brew install smlnj
227    ````
228    
229    (possibly followed by `brew link smlnj`) should work.
230    
231    #### Installing from source ####
232    
233    It is also possible to install **SML/NJ** using the installation script
234    provided as part of the source downloads.
235    
236    First, create a directory to hold the downloaded files and the results
237    of the installation; assume that `$SMLDIR` denotes the path to that
238    directory.  Then run the following command to download and unbundle
239    the `config` directory:
240    
241    ```` bash
242        curl -O http://smlnj.org/dist/working/110.98/config.tgz
243        tar -xzf config.tgz
244    ````
245    
246    Then you can build the system using the command
247    
248    ```` bash
249        config/install.sh
250    ````
251    
252    This command will download the necessary source and precompiled files from
253    <smlnj.org> and build the **SML/NJ** runtime, compiler, and libraries.
254    The path to the **sml** command will be `$SMLDIR/bin/sml`.

Legend:
Removed from v.5588  
changed lines
  Added in v.5589

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0