RNAstructure Installation and Overview
General Build Information
Do I need to build the package?
RNAstructure is provided both as source code and as prebuilt executables. Prebuilt executables are currently available for 32-bit Linux, 64-bit Linux, Max OS-X (Leopard and higher), 32-bit Windows, and 64-bit Windows. If you are using one of these operating systems, then you probably do not need to build the package. The available executables will work fine.
In order to successfully use the data tables in the RNAstructure repository during calculations, an environment variable called DATAPATH must be set to the location of the data tables folder on the current machine.
For example, in BASH, this is accomplished with:
Building the RNAstructure JAVA GUI
The RNAstructure Graphical User Interface (GUI) is composed of two important components: the graphical front-end, written in Java and the native back-end, RNAstructure_GUI libary written in C++. The two are linked using the Java Native Interface (JNI). In addition, SWIG is used to generate C++ and Java "glue code" to provide necessary bindings on each side.
Due to this architecture, there are three phases to building the GUI, of which only two are usually required:
The first step involves running swig, which reads *.i files and parses C++ header files to generate *.cxx files that are later included in the compilation of the native RNAstructure_GUI libary. However, the RNAstructure distrubution already includes the pre-generated SWIG files, so it is NOT necessary to run SWIG or even to have it installed unless you plan to make changes to the public interface of the RNAstructure_GUI library (i.e. to the header files inside the java_interface\SWIG directory: RNAstructureBackendCalculator.h, DotPlotBackend.h, or StructureBackend.h)
Compilation of the C++ libary and the Java interface BOTH require installation of the Oracle Java SE JDK. (The latest version is recommended for security reasons, but the minimum version is 1.8). The Java JDK is required (instead of just the JRE) because it includes javac, the Java compiler, as well as several C++ JNI header files that are necessary for compiling the native library. Usually the location of javac as well as the JNI header files can be determined automatically (during the "Make" commands, below) however it might be necessary to modify some variables inside the file "compile-java.h", especially on Linux systems, where the installation location of Java can vary widely from one Linux distributionand/or package manager to another.
All steps involved in building the GUI are performed using a Makefile in the RNAstructure/java_interface directory. Importantly, this Makefile is distinct from the Makefile in the root RNAstructure directory, however it does include several of the same files (e.g. compiler.h). These java-specific commands can be run in a terminal/shell from within the RNAstructure/java_interface directory:
When the JAVA GUI is built correctly, two new files will exist in the RNAstructure/exe directory: a single large dynamic RNAstructure library (whose name depends on the operating system), and a JAVA JAR archive, called RNAstructure.jar. See Running the RNAstructure JAVA GUI for details on how to use these files.
Building the Command Line (Text) Interfaces
Configuring the Build on Unix/Linux/OS-X
The command line (text) interfaces for RNAstructure are built using the Makefile in the main directory (RNAstructure/). The definitions for compiler and flags are in RNAstructure/compiler.h. This file is provided with the defaults set for compiling on Linux using g++. To change the platform and/or compilers, this file should be manually edited. Example flags are provided for Linux, Mac, and Cygwin platforms. To change the operating system to a non-Linux system, simply remove the "#" symbol (which denotes comments) from the variable definitions under the target type. Also, add "#" in front of the Linux flags.
Note also that flags for building with OpenMP can be set (CXXOPENMPFLAGS). The default flags will work for Linux and Mac using g++ and g++/LLVM, respectively. An example flag set is also provided for Intel compilers, and this will need to used if Intel compilers are being used.
Building on Unix/Linux/OS-X
To build the package, use the command "make all" in RNAstructure/. The command line executables are built and placed in RNAstructure/exe/. You should probably then update your PATH variable to include this directory.
In adition, if you have a CUDA compiler, you can build partition-cuda by typing "make cuda" in the RNAstructure directory. This can then be run if you have a CUDA-capable graphics card.
An optional "make install" command will copy all the executables to the /usr/local/RNAstructure/ directory. This is helpful in a shared computing environment. This command can only be executed as root.
Dynalign, Fold, Multilign, and TurboFold can be built in SMP form, which allows them to delegate their workload across multiple processors at once in a shared memory environment.
By default, "make all" will build the serial programs and their SMP counteparts. To build only the serial programs, for example if the compiler does not have OpenMP support, "make serial" can be used with the Makefile in the main directory (RNAstructure/). To build only the SMP programs, use the "make SMP" target.
Multifind is built separately from the rest of the package. It depends on an installation of libsvm, which handles the support vector machine calculation. To build it, set the INCLUDESVM variable to point to the libsvm installation and uncomment the line "#MF = Multifind~" by removing the "#". Multifind will then be included with the list of standard RNAstructure programs and can be built with the command make Multifind or make Multifind-smp (for the parallel version).
Building on Windows
There are two options for compiling RNAstructure on Windows:
Visit The Mathews Lab RNAstructure Page for updates and latest information.