ROSE Compiler Framework/Virtual Machine Image

From Wikibooks, open books for an open world
Jump to: navigation, search

Overview[edit]

The goal of this page is to document

  • How users can download the virtual machine image (or virtual appliance) and use ROSE out of box.

We have two virtual machine images right now

  • V2: the newer VM using Ubuntu 14.04 (Trusty Tahr) and ROSE based on EDG 4.x frontend.
  • V1: the very old VM using Ubuntu 10.04 (Lucid Lynx) and ROSE based on EDG 3.x frontend (no longer maintained)

V2[edit]

Download[edit]

Download the virtual machine image created by using VMware Player:

  • http://www.rosecompiler.org/Ubuntu-ROSE-Demo-V2.tar.gz
  • Warning: it is a huge file of 6.7 GB (18.2GB if fully uncompressed). It may take ~1 hour to download depending on your High Speed Internet Connection.
  • Demonstration user account (sudo user in Ubuntu):
    • account: demo
    • password: password

Warning: LLNL users may not be able to download it due to limitations to max downloaded file size within LLNL. It may also be against LLNL's security policy to run a virtual machine without authorization. So this image should not be used inside LLNL.


On windows, you can install 7-zip (http://www.7-zip.org/) to untar the tar ball (.tar.gz file) into a folder.

  • It may take ~ 20 minutes on a desktop PC to fully uncompress it in two steps (.tar.gz to .tar, then .tar to the folder)
  • The final folder size is around 18.2 GB

Content[edit]

demo@ubuntu:~$ cat readme

This is a Ubuntu 14.04 virtual machine with installed ROSE-edg4.x. 

Directory List
* ~/rose-edg4x.git  : github.com rose edg4.x-based, checked out on Jan 24, 2015

* ~/buildtree  : build tree of rose, using the following configure command: 

../rose-edg4x.git/configure --prefix=/home/demo/opt/rose_inst --with-boost=/home/demo/opt/boost_1.45.0_inst --with-C_OPTIMIZE=-O0 --with-CXX_OPTIMIZE=-O0 --with-gomp_omp_runtime_library=/usr/lib/gcc/x86_64-linux-gnu/4.8/

* ~/opt/rose_inst : installation path of rose (--prefix value)

* ~/rose-project-template.git:  project templates using the installed rose as a library.

*~/tests: a simple c file, processed by identityTranslator and dotGeneratorWholeASTGraph. 
  type run.sh filex.dot to view a dot file of AST graph

bash env in .bashrc has the following variables by default
----------------------
export PATH=$PATH:/home/demo/opt/jdk1.8.0_25/bin:/home/demo/opt/zgrviewer-0.8.2
export LD_LIBRARY_PATH=/home/demo/opt/boost_1.45.0_inst/lib:/home/demo/opt/jdk1.8.0_25/jre/lib/amd64/server:$LD_LIBRARY_PATH
export JAVA_HOME=/home/demo/opt/jdk1.8.0_25/


To use rose translator , you need to type

source ~/set.rose

Installation Notes[edit]

At the time of writing, ROSE does not officially support Ubuntu 14.04 and its default gcc 4.8, mostly due to boost and other portability issues. Fortunately, the release process does generate gcc 4.8 EDG binaries.

There are a few tweaks used to successfully compile ROSE on Ubuntu 14.04

Prepare the prerequisite stuff for ROSE installation

  • sudo apt-get install gcc g++ gfortran
  • sudo apt-get install libtool flex bison automake
  • sudo apt-get install zlibc zlib1g zlib1g-dev libbz2-dev // mostly for boost iostreams library

Hack 1 to the system header path:

  • sudo ln -s /usr/include/x86_64-linux-gnu/sys /usr/include/sys
    • This is a hack since rose uses an absolute path to find some system headers. Ubuntu 14 has a different path. A better fix should be available.

Boost 1.45 has to be patched to work with gcc 4.8 so the required thread lib can be installed

Boost 1.45 Patch 1:

Error: /home/demo/development/install/gcc-4.4.7/boost-1.45.0/include/boost/thread/xtime.hpp:23: error: expected identifier before numeric constant

WORKAROUND: in file boost/thread/xtime.hpp WORKAROUND THAT DOES WORK FOR THREAD AND WAVE:

only undefine the C11 macro: (the following 3 lines are new, followed by the existing troublesome enum in the file)

#ifdef TIME_UTC
#undef TIME_UTC
#endif

enum xtime_clock_types
{
    TIME_UTC=1
};

Boost 1.45 Patch 2: force boost to recognize threading is actually supported by gcc 4.7 and after.

patch for boost/config/stdlib/libstdcpp3.hpp

33      33       
34      34      #ifdef __GLIBCXX__ // gcc 3.4 and greater: 
35      35      #  if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \ 
36                      || defined(_GLIBCXX__PTHREADS) 
        36              || defined(_GLIBCXX__PTHREADS) \ 
        37              || defined(_GLIBCXX_HAS_GTHREADS) 
37      38            // 
38      39            // If the std lib has thread support turned on, then turn it on in Boost 
39      40            // as well.  We do this because some gcc-3.4 std lib headers define _REENTANT 


Patch 3 to ROSE, bump up the gcc version allowed for boost filesystem

demo@ubuntu:~/rose-edg4x.git$ git diff
diff --git a/src/util/support/FileHelper.h b/src/util/support/FileHelper.h
index d2ca5b6..142e509 100644
--- a/src/util/support/FileHelper.h
+++ b/src/util/support/FileHelper.h
@@ -5,7 +5,8 @@
 // Non-windows support should used boost filesystem 2 if using GNU version less than 4.7.
 #ifndef _MSC_VER
 // #if ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 7))
-#if (defined(BACKEND_CXX_IS_INTEL_COMPILER) || ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 7)))
+// Liao, 1/24/2015. Not sure why GCC version is checked when we are taling about boost filesystem version. bumped up to 9 so gcc 4.8 can be supported  (<8 do
+#if (defined(BACKEND_CXX_IS_INTEL_COMPILER) || ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 9)))
   #define BOOST_FILESYSTEM_VERSION 2
 #endif
 #else
@@ -56,8 +57,8 @@ public:
 
 // DQ (3/8/2014): Adding use of BACKEND_CXX_IS_INTEL_COMPILER to support Intel compiler for backend use.
 #ifndef _MSC_VER
-// #if (defined(_MSC_VER) || ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 7)))
-#if (defined(BACKEND_CXX_IS_INTEL_COMPILER) || ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 7)))
+// #if (defined(_MSC_VER) || ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 9)))
+#if (defined(BACKEND_CXX_IS_INTEL_COMPILER) || ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 9)))
  // DQ (2/10/2014): I think this is the older BOOST_FILESYSTEM_VERSION 2 specific code.
     static string getFileName(const string& aPath) {
         path boostPath(aPath);
@@ -132,7 +133,7 @@ public:
 #ifndef _MSC_VER
 // DQ (3/8/2014): Adding use of BACKEND_CXX_IS_INTEL_COMPILER to support Intel compiler for backend use.
 // #if ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 7))
-#if (defined(BACKEND_CXX_IS_INTEL_COMPILER) || ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 7)))
+#if (defined(BACKEND_CXX_IS_INTEL_COMPILER) || ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 9)))
          // DQ (2/10/2014): I think this is the older BOOST_FILESYSTEM_VERSION 2 specific code.
             relativePath += *toPathIterator; //The first path element comes without the leading path delimiter
 #else
@@ -147,7 +148,7 @@ public:
             while (toPathIterator != boostToPath.end()) {
 #ifndef _MSC_VER
 // #if (defined(_MSC_VER) || ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 7)))
-#if (defined(BACKEND_CXX_IS_INTEL_COMPILER) || ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 7)))
+#if (defined(BACKEND_CXX_IS_INTEL_COMPILER) || ((BACKEND_CXX_COMPILER_MAJOR_VERSION_NUMBER == 4) && (BACKEND_CXX_COMPILER_MINOR_VERSION_NUMBER < 9)))
              // DQ (2/10/2014): I think this is the older BOOST_FILESYSTEM_VERSION 2 specific code.
                 relativePath += pathDelimiter + *toPathIterator;
 #else

V1[edit]

For the old VM using ROSE based on EDG 3.x, see ROSE_Compiler_Framework/Virtual_Machine_Image_V1