Differences

This shows you the differences between two versions of the page.

Link to this comparison view

dev:eclipse [2012/11/27 01:43]
tedfelix Update Ubuntu Issues for 12.10
dev:eclipse [2013/12/17 01:23] (current)
tedfelix [Ubuntu 12.04-13.04 Issues] Expand to 13.10
Line 31: Line 31:
   $ sh ./bootstrap.sh   $ sh ./bootstrap.sh
  
-Now we should be able to run configure.  Here's how I run it with Ubuntu 11.10 32-bit.  I need the "--with-qtlibdir" option because Ubuntu puts the Qt libraries in an architecture-specific location:+Now we should be able to run configure.  Here's how I run it with 32-bit (i386) versions of Ubuntu.  I need the "--with-qtlibdir" option because Ubuntu puts the Qt libraries in an architecture-specific location:
  
   $ ./configure --enable-debug --with-qtlibdir=/usr/lib/i386-linux-gnu   $ ./configure --enable-debug --with-qtlibdir=/usr/lib/i386-linux-gnu
  
-With Ubuntu 12.04 64-bit:+With 64-bit (amd64) versions of Ubuntu:
  
   $ ./configure --enable-debug --with-qtlibdir=/usr/lib/x86_64-linux-gnu   $ ./configure --enable-debug --with-qtlibdir=/usr/lib/x86_64-linux-gnu
Line 42: Line 42:
  
   $ make   $ make
 +
 +To make sure the build was successful, try running it:
 +
 +  $ ./rosegarden
 +
 +If you have a machine with multiple cores (who doesn't these days?) you probably want to add this to the end of your .bashrc file to tell make that it can run multiple jobs simulataneously:
 +
 +  export MAKEFLAGS="-j `nproc`"
 +  
 +This will take effect the next time you start a terminal.  It should speed up the build significantly.
 +
 +If you just need to build Rosegarden, you can stop here.  Otherwise, if you are interested in doing some development with Eclipse, read on....
  
 ===== Install Eclipse ===== ===== Install Eclipse =====
 The Eclipse IDE can be downloaded here: http://www.eclipse.org/ The Eclipse IDE can be downloaded here: http://www.eclipse.org/
  
-usually download the Linux C/C++ version which is usually called something like "Eclipse IDE for C/C++ Developers".  It's just a tarball you can expand and then look for the "eclipse" directory with the "eclipse" binary.  That's pretty much it.+I download the Linux C/C++ version which is usually called something like "Eclipse IDE for C/C++ Developers".  It's just a tarball you can expand and then look for the "eclipse" directory with the "eclipse" binary.  That's pretty much it.
  
-NOTE: If you upgrade your OS, it's a good idea to wipe out your Eclipse install and start fresh.  There are config files within the Eclipse install directory that can get out of sync and cause trouble with a new OS.+//NOTE: If you upgrade your OS, it's a good idea to wipe out your Eclipse install and start fresh.  There are config files within the Eclipse install directory that can get out of sync and cause trouble with a new OS.//
  
 ===== Set Up Rosegarden Source Under Eclipse ===== ===== Set Up Rosegarden Source Under Eclipse =====
-//Note: These instructions were developed using Eclipse 4.(Juno).//+//Note: These instructions were developed using Eclipse 4.(Kepler).//
  
 Since we set up the directory structure in a way that Eclipse likes, getting Eclipse to find the source and work with it is easy.  Launch Eclipse.  It will first ask for the location of your workspace.  Give it the rosegarden-workspace directory that we created earlier.  Since this is a new workspace, you'll get the Eclipse welcome screen.  On the far right is a button for the "Workbench".  Click it. Since we set up the directory structure in a way that Eclipse likes, getting Eclipse to find the source and work with it is easy.  Launch Eclipse.  It will first ask for the location of your workspace.  Give it the rosegarden-workspace directory that we created earlier.  Since this is a new workspace, you'll get the Eclipse welcome screen.  On the far right is a button for the "Workbench".  Click it.
Line 57: Line 69:
 Go to File > New > Makefile Project with Existing Code.  In the "Project Name" field type rosegarden-svn.  For the "Existing Code Location" provide the path to the rosegarden-svn directory.  In the Toolchain list, select "Linux GCC".  Click Finish.  You should now be able to build with Project > Build All (Ctrl+B). Go to File > New > Makefile Project with Existing Code.  In the "Project Name" field type rosegarden-svn.  For the "Existing Code Location" provide the path to the rosegarden-svn directory.  In the Toolchain list, select "Linux GCC".  Click Finish.  You should now be able to build with Project > Build All (Ctrl+B).
  
-To run the program, you'll need to set up a Run Configuration.  Go to Run > Run Configurations.  Select "C/C++ Application" and hit the New button.  Set the "Project:" field by hitting the "Browse...button and selecting rosegarden-svn.  Click Apply and then Run to test.  You should now be able to run with Run > Run (Ctrl+F11).  You should also be able to debug with F11 or Run > Debug.+To run the program, you'll need to set up a Run Configuration.  Go to Run > Run Configurations.  Select "C/C++ Application" and hit the New button.  Verify that the C/C++ Application field says "rosegarden", and the Project field says "rosegarden-svn".  Click Run to test.  You should now be able to run with Run > Run (Ctrl+F11).  You should also be able to debug with F11 or Run > Debug.
  
 If you get an error about "The selection cannot be launched, and there are no recent launches," you need to go back into the Run Configuration and hit the Run button in there to establish the first run.  That will then be used each time F11 or Ctrl-F11 are pressed. If you get an error about "The selection cannot be launched, and there are no recent launches," you need to go back into the Run Configuration and hit the Run button in there to establish the first run.  That will then be used each time F11 or Ctrl-F11 are pressed.
Line 69: Line 81:
   /usr/include/qt4/QtXml   /usr/include/qt4/QtXml
  
-When asked if you "wish to rebuild" the index, click "Yes".  Then click "Ok" to dismiss the properties dialog.  It will take some time for Eclipse to rebuild the index.  The "C/C++ Indexer" indicator at the bottom of the window will let you know how far along the process is.+Click Ok.  When asked if you "wish to rebuild" the index, click "Yes".  It will take some time for Eclipse to rebuild the index.  The "C/C++ Indexer" indicator at the bottom of the window will let you know how far along the process is.
  
 ===== Configuring Tabs ===== ===== Configuring Tabs =====
Line 81: Line 93:
  
 ===== Faster Builds ===== ===== Faster Builds =====
-If your machine has multiple cores and/or hyperthreading, you'll want to set up make for multiple jobs (make's -j option).  To do that within Eclipse, go to Window > Preferences > C/C++ > Build > Environment, add an environment variable MAKEFLAGS, and set it to -j4 (or whatever is best for your hardware).  This will tell make that it can run four simultaneous compiles.+If your machine has multiple cores and/or hyperthreading, you'll want to set up make for multiple jobs (make's -j option).  To do that within Eclipse, go to Window > Preferences > C/C++ > Build > Environment, add an environment variable MAKEFLAGS, and set it to "-j 4" (or whatever is best for your hardware, the nprocs command will tell you how many cores you've got).  This will tell make that it can run four simultaneous compiles.
  
 ===== Scalability Mode ===== ===== Scalability Mode =====
 With large source files, many of Eclipse's features are disabled by something called "scalability mode".  Since Rosegarden has some rather large source files, this can be a problem.  To adjust, go to Window > Preferences > C/C++ > Editor > Scalability.  Increase the "number of lines" field from 5000 to 10000.  If you end up seeing the scalability mode alert dialog, you can always increase this number even further. With large source files, many of Eclipse's features are disabled by something called "scalability mode".  Since Rosegarden has some rather large source files, this can be a problem.  To adjust, go to Window > Preferences > C/C++ > Editor > Scalability.  Increase the "number of lines" field from 5000 to 10000.  If you end up seeing the scalability mode alert dialog, you can always increase this number even further.
 +
 +===== Auto-Save Before Build =====
 +By default, Eclipse doesn't automatically save your files when you build.  If you would prefer that behavior, go to Window > Preferences > General > Workspace.  Set the "Save automatically before build" checkbox.  This avoids build errors if you forget to save a file that you've changed.
  
 ===== Upgrade Notes ===== ===== Upgrade Notes =====
-When upgrading to a new version of eclipse, it's a good idea to delete all the Eclipse config files in your workspace and project so the new version can start fresh.  You'll have to go through all the configuration again, but things should be a bit more stable.  Key things to delete (Indigo to Juno):+When upgrading to a new version of eclipse, it's a good idea to delete all the Eclipse config files in your workspace and project so the new version can start fresh.  You'll have to go through all the configuration again, but things should be a bit more stable.  Key things to delete for the Indigo to Juno upgrade:
  
   rosegarden-workspace/.metadata   rosegarden-workspace/.metadata
Line 94: Line 109:
   rosegarden-workspace/rosegarden-svn/.project   rosegarden-workspace/rosegarden-svn/.project
  
-===== Ubuntu 12.04-12.10 Issues =====+Juno to Kepler had the same files and directories to delete along with a new one: 
 + 
 +  rosegarden-workspace/rosegarden-svn/.settings 
 + 
 +===== Ubuntu 12.04-13.10 Issues =====
  
 ==== Unity Icon ==== ==== Unity Icon ====
Line 124: Line 143:
  
 ==== Unity Icon ==== ==== Unity Icon ====
-If you want Eclipse available as unity icon, you'll have to add a .desktop file to /usr/share/applications.  The easiest way is to use the GNOME desktop item editor:+ 
 +There appear to be two main ways to create Unity icon for an application.  The first uses GUI, and the second involves creating an eclipse.desktop file.  Apparently there is no native "Unity" way to add an icon to Unity. 
 + 
 +=== GUI === 
 +The GUI approach uses the GNOME desktop item editor:
  
   sudo apt-get install gnome-panel   sudo apt-get install gnome-panel
Line 131: Line 154:
 Give it the name "Eclipse".  Point it to the eclipse binary in the eclipse install directory.  And finally, use the icon that is in the eclipse install directory.  Click close, and Eclipse will now appear in the dash.  You can even drag and drop it onto the launcher if you wish. Give it the name "Eclipse".  Point it to the eclipse binary in the eclipse install directory.  And finally, use the icon that is in the eclipse install directory.  Click close, and Eclipse will now appear in the dash.  You can even drag and drop it onto the launcher if you wish.
  
 +=== eclipse.desktop ===
 +You can also just create an eclipse.desktop file in /usr/share/applications instead of installing all of the above GUI tools.  Here's mine:
 +
 +  [Desktop Entry]
 +  Type=Application
 +  Name=Eclipse CDT
 +  Comment=Eclipse IDE for C/C++
 +  Icon=<path-to-eclipse>/icon.xpm
 +  Exec=<path-to-eclipse>/eclipse
 +  Terminal=false
 +  Categories=Development
 +
 +You'll need to adjust the "<path-to-eclipse>" to point to where you expanded Eclipse.
 +
 +=== More Ways ===
 There are several other ways to add an application to the dash.  See this page for more: There are several other ways to add an application to the dash.  See this page for more:
  
 http://askubuntu.com/questions/67753/how-do-i-add-an-application-to-the-dash http://askubuntu.com/questions/67753/how-do-i-add-an-application-to-the-dash
 
 
dev/eclipse.1353976995.txt.gz · Last modified: 2012/11/27 01:43 by tedfelix
Recent changes RSS feed Creative Commons License Valid XHTML 1.0 Valid CSS Driven by DokuWiki