You are here

Questions About Building Rosetta using the Rosetta Xcode Project (Mac)

4 posts / 0 new
Last post
Questions About Building Rosetta using the Rosetta Xcode Project (Mac)
#1

Hello,I am trying to build Rosetta using Rosetta Xcode Project.My Mac's system version is 10.12.4 and Xcode's is 8.3.3.I have read the link :https://www.rosettacommons.org/docs/latest/build_documentation/Build-Documentation#setting-up-rosetta-3_alternative-setup-for-individual-workstations_build-rosetta-using-the-rosetta-xcode-project-mac for building Rosetta. However,i am still confused about how to build Rosetta.

I'd like to get the specific process of adding and compiling Rosetta source code through Xcode.

 

I will very appreciate if anyone has idea about this question.

Category: 
Post Situation: 
Wed, 2017-09-20 04:58
MA

You haven't told us what your question is...

Wed, 2017-09-20 05:57
smlewis

I'm sorry I made you confused.My question is how to built Rosetta through Rosetta Xcode project.I don't know what shoud I do  to add Rosetta source code to Xcode project and then compile Rosetta successfully.

Wed, 2017-09-20 07:57
MA

I hope this will get you going:

Generating an Xcode project file

Xcode project files are used to group together the files, build targets and compilation settings and serve as the mechanism by which projects are opened and saved. The canonical build tool for Rosetta is SCons and Xcode can be configured to use SCons as an external build system. However, Xcode will not index code that it does not compile, which severely limits its utility. A python script that reads the src.settings files and updates the Xcode project file is used to make Xcode aware of files added by other developers. This script can be found in Rosetta/main/source/xcode/make_project.py. To update your Xcode project file, use the following command :

python make_project.py all

After this, you can double-click on rosetta/rosetta_source/xcode/Rosetta.xcodeproj or type:

open Rosetta/main/source/xcode/Rosetta.xcodeproj

Compiling rosetta_scripts & editing protocols

Note: I'm not entirely sure this is necessary, but I did it early on while setting up Xcode on my computer.

  1. In the upper left corner of Xcode, there is selection panel that reads something along the lines of "external: My Mac" ; change this to "rosetta_scripts: My Mac", and then press the play button (arrow) to compile the rosetta_scripts executable.
  2. The protocols in Xcode are not indexed as they are in your terminal view of Rosetta. Instead, they are indexed by their location in protocols.{number}.src.settings . In the lefthand tabbed menu, you can select Rosetta --> Sources --> protocols.{number} and then navigate to your .cc file of choice and start editing.

 

Adding a new application

By default, the Xcode project only contains and builds the libraries, however it is likely that you will want to build an application that is of interest to you. It's pretty easy to add a new application to Xcode, but it consists of a few steps that will be detailed below. 

  1. Make sure the navigator is visible by selecting the left-most tab in the view toolbar along the top-right of the main Xcode window.
  2. Select the Rosetta project in the navigator
  3. Select one of the existing executable targets in the left-hand pane of the editor section (there should be two navigator thingy's: one on the left and one in the editor window: when you click the triangle, it should show up). Executable targets have an icon that resembles a terminal as opposed to a library. [to see the targets you must have the Editor view selector in Standard (top right, left icon)
  4. Right click (or ctrl-click, or two finger tap or whatever you do to bring up a context menu) and select "Duplicate". You can also simply select the target and type "⌘D".
  5. Change the name of the target in the left-hand panel by double-clicking the text
  6. Change the value of "Product Name" in the Packaging section of the Build Settings tab.
  7. Click on the Build Phases tab and change the .cc file that is compiled in the "Compile Sources" section to the correct file for your application.
    1. Uncheck 'copy items', and select 'Create folder references' in the options dialog that appears
  8. Click the drop down bar in the top left of the window, just to the right of the Run and Stop buttons and select "Manage Schemes..."
  9. Rename the newly created scheme to something appropriate and uncheck the "Shared" checkbox on the right.
  10. Back in the left-panel, move your .cc file from under Rosetta to under Apps by drag-and-drop
  11. Hit ⌘R to Run! Compiling should commence.
Tue, 2017-10-10 13:31
weitzner