Skip to content

Latest commit

 

History

History
97 lines (73 loc) · 3.96 KB

DEVEL.md

File metadata and controls

97 lines (73 loc) · 3.96 KB

These are some tips for developers of the PB-[S]AM codes

Help on getting started in XCode and in APBS integration

Building for Sphinx

This should be similar to the Geoflow build, the only difference is that you need to use the flag -DENABLE_PBAM_SPHINX=ON when you run cmake. Or you can ignore this and read the following steps:

  1. cd prototype/plugins/PB_S_AM/src
  2. mkdir build
  3. cd build
  4. cmake -DENABLE_PBAM_SPHINX=on ../
  5. make pbam_sph
  6. cp pbam_sph.so ../../

General XCode set-up:

Adding a new target

  1. Editor --> Add target
  2. OS X --> Application --> Command Line Tool

Steps

  1. Add path to user-made header files to Build Settings --> Search Paths --> User Header Search Paths for all Targets
  2. Set Apple LLVM Language Dialects C Language Dialect GNU99 C++ Language Dialect GNU++11 C++ Standard Library libc++
  3. For Target pbsolvers Add source .cpp and .h Files to pbsolvers Project Under Build Phases --> Compile Sources : only need .cpp files

For the simple schemes:

Need to change the Search Paths : User Header Search Paths to where your code is on the local machine!

Linear algebra Setup

Mac comes with built in blas and lapack.

  1. Finding the libraries: some paths that have worked on various Macs include:
  2. /System/Library/Frameworks/Accelerate.framework/Frameworks/ Feel free to add them in as you find them!
  3. There may be a Headers in the path above or a dylib that may also work.
  4. In Finder, open to the directory found above: ${PATH}
  5. Drag the vecLib.framework file into the pbsam XCode project.
  6. Add path to gtest.framework to Build Settings --> Search Paths --> Framework Search Paths
  7. Add path to gtest.framework to Build Settings --> Search Paths --> Runpath Search Paths
  8. Add in the preprocessor definitions to both targets: Build Settings --> Apple LLVM 7.1 - Preprocessing -> __LAU=1 __XCODE=1

GTest Setup

For gtest, it's a little more complicated...

  1. Compile gtest.framework for version 1.7!!

  2. The first step is to download the latest version of gtest

  3. Go to the XCode directory and I had to do the following hacks 1. Comment out the following lines in gtest-port.h: #include "gtest/internal/gtest-port-arch.h" #include "gtest/internal/custom/gtest-port.h" 2. Comment out the following options in xcode/Config/General.xconfig: SDKROOT, MACOS_DEPLOYMENT_TARGET, and GCC_VERSION

  4. With those changes the framework should compile

  5. To find it, right click on the gtest.framework icon and select "Show in Finder"

  6. Copy this to a directory of your choice

  7. Add Target gtests

  8. Link to gtest.framework Add path to gtest.framework to Target gtests --> Build Settings --> Search Paths --> Framework Search Paths Under Build Phases --> Link with Binary Libraries : add gtest.framwork Under Product --> Scheme --> Edit Scheme --> Run --> Environment Variables : Add DYLD_FRAMEWORK_PATH and path to gtest.framework

  9. Files with Google Test format are called ClassUnitTest.h for each class. The Target Membership for these is to Test only.

  10. The .cpp files of the main source must have Target Membership to Test and to pbsolvers. The .cpp files of the main source should also appear in Build Phases --> Compile Sources for Target gtests

Other XCode hints :

  • To see page width: XCode --> Preferences --> Text Editing --> Show : Page guide at column 80

  • To increase font size : XCode --> Preferences --> Fonts and Colors Duplicate one of the styles. Select all text in example box. Change font size.

  • To access Instruments : XCode --> Product --> Profile ; select profiling template For timings, select Counters make sure path to executable is correct -- XCode makes a Debug and Release version in separate folders Product --> Clean ; Product --> Build for --> Profiling ; Product --> Profile should display data in Instruments window