4.4 Possible Changes Needed After Updating MacOS or XCodeMost of the C compilers that are available online can be downloaded for free. To compile C or C++ and attach the GNU Debugger, press F6 or right click the file in tree view and click Compile and Debug. To compile C or C++, press F5 or right click the file in tree view and click Compile and Run. This Atom package allows you to compile and run C++ and C within the editor.A complete XCode project is located atNairn-mpm-fea/Common/Projects/NairnMPM.xcodeprojThis project is called NairnMPM, but it includes all MPM and FEA source code in two targets named NairnMPM and NairnFEA. The preferred method is to use XCode (but first you must install Xcode, install command line tools, and get a new compiler). Click on Settings, pull down to Compiler Settings, and pull down to Workspace.Most development of NairnMPM and NairnFEA is done in MacOS X and thus compiling on MacOS X is easy. Modify code to take advantage of AltiVec/SSE, automatically) and other sophisticated optimizations like OpenMP.4 Installation of Xcode and jGrasp Install Xcode.
These can be changed if needed by editing the project and target settings. These compiling instructions assume they are installed in the default locations for MacOS X or at:For the header files. To fix this problem edit both the project and target settings and under the "Architectures" section, set the "Architectures" option to match the architecture you used when installing xerces or recompile xerces if needed.Before you can compile and run the project, however, you will need an installed version of the xerces library and a copy of the xerces header files. Choose build and they will compile and be saved in XCode's derived data folder.If a linking error occurs, you might have conflicting architectures between the XCode settings and the xerces library you installed. Select the target to compile - either NairnMPM or NairnFEA Open Terminal app and navigate to the xerces source folder expanded from the downloaded file./configure CFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64"Where the provided arch (or architecture) is the desired option for your machine. First install XCode and command line tools. This libraries can be obtained by downloading theXerces source code from the Apache Software Foundation web site and then building and installing xerces with the following steps: Search for a program installed my macWhen working with nairn-mpm-fea on a new Mac, the xerces installation only needs to be done once. It requires sudo for you to provide your administrator password needed to authenticate installation and the default location (which is /usr/local). The final install command after make is done, installs both the library and the header files at the default locations listed above. When the configuration is done, use the following commands:These commands make the library (but not the unneeded xerces examples). To determine your chips, choose "About This Mac" from the Apple menu. The two supported solutions are to compile without OpenMP (and lose all advantages of multiprocessor execution) or to install and use the clang-mp compiler. Once installed, you then need to install command line tools.Unfortunately, the compilers provided in Apple's "Command Line Tools" do not support OpenMP used to make these code engines parallel. You can get Xcode from the Mac App Store or from the Apple Developer site. See comments in the makefile for all the latest options.All compiling on Mac requires that you install Xcode (even if you do not plan to use it for anything else). Once that is done, install command line tools by opening Terminal app and enter: xcode-select -install. After installing XCode on a recent MacOS, launch the app and agree to all options. You now have to manually install the tools before you can compile code. Alternatively, you can use command line compilation and specify settings for currently installed compilerWhenever you update your MacOS or Xcode, you may need to repeat some installation steps before you can return to compiling the code engines.The following sections have more details on installations needed for compiling the code engines.Apple used to install command line tools by default, but stopped doing that in MacOS Lion. It is be easy to convert any checkout to use the compiler you prefer by making a few changes in the XCode project build settings. Prior check outs are set up to use earlier versions of clang-mp or various version of GCC. Get C Compiler License By UsingMost tools should now be available. You may need to agree to XCode license by using Terminal app to enter: sudo xcodebuild -license You may need to be signed up as an Apple developer for this method. You can also get the command line tools from the Apple developer website and search for command line tools (being sure to get the correct tools for you current Xcode and MacOS versions). Emulator from mac to ipadHopefully these tricks will continue to work in the future.One issue in the XCode project is that it might not find your xerces library, even if it is in the standard location. For now, by using a few tricks it is still possible to get around their road blocks. To compile the code engines for parallel code, you will additionally need to install a compiler that works with OpenMP (none is provided in the command line tools).With each new system, Apple seems to creating road blocks to keep you from using you computer for interesting programming. After it opens, choose the "Add To Sidebar" menu command. In the Finder, use the "Go to Folder." menu command and enter " /usr/local". Here is a trick to get there: The problem is that you cannot navigate to the /usr/local/lib folder anymore (another new Apple "feature"). A potential solution is to delete the reference to the library and then add it back. Various versions of the checkout may have settings for one specific compiler, but you should be able to easily switch to your preferred settings using the details below: Alternatively, you can use the CC option to specify path to any compiler, such as:Make SYSTEM=mac CC=/opt/local/bin/clang-mp-4.0Compiling using a clang-mp compiler in Xcode requires some specific project build settings. For command line compiling, you may need to update the makefile to use you new compiler (see comments in makefile for details). See MacPorts if you want to remove an old version and replace with a newer one.To use clang-mp in XCode, you will need to add some project build settings. You can either switch to the desired version or change few XCode project settings. The checked-out XCode project may be setup for a different version of clang-mp. Use menu command Editor→Add Build Setting→Add User-Defined Setting and add setting for CC with value /opt/local/bin/clang-mp-7.
0 Comments
Leave a Reply. |
AuthorTara ArchivesCategories |