Help on getting started in XCode and in APBS integration
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:
cd prototype/plugins/PB_S_AM/src
mkdir build
cd build
cmake -DENABLE_PBAM_SPHINX=on ../
make pbam_sph
cp pbam_sph.so ../../
- Editor --> Add target
- OS X --> Application --> Command Line Tool
- Add path to user-made header files to Build Settings --> Search Paths --> User Header Search Paths for all Targets
- Set Apple LLVM Language Dialects C Language Dialect GNU99 C++ Language Dialect GNU++11 C++ Standard Library libc++
- For Target pbsolvers Add source .cpp and .h Files to pbsolvers Project Under Build Phases --> Compile Sources : only need .cpp files
Need to change the Search Paths : User Header Search Paths to where your code is on the local machine!
Mac comes with built in blas and lapack.
- Finding the libraries: some paths that have worked on various Macs include:
/System/Library/Frameworks/Accelerate.framework/Frameworks/
Feel free to add them in as you find them!- There may be a Headers in the path above or a dylib that may also work.
- In Finder, open to the directory found above:
${PATH}
- Drag the
vecLib.framework
file into the pbsam XCode project. - Add path to gtest.framework to Build Settings --> Search Paths --> Framework Search Paths
- Add path to gtest.framework to Build Settings --> Search Paths --> Runpath Search Paths
- Add in the preprocessor definitions to both targets: Build Settings --> Apple LLVM 7.1 - Preprocessing -> __LAU=1 __XCODE=1
For gtest, it's a little more complicated...
-
Compile gtest.framework for version 1.7!!
-
The first step is to download the latest version of gtest
-
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
, andGCC_VERSION
-
With those changes the framework should compile
-
To find it, right click on the gtest.framework icon and select "Show in Finder"
-
Copy this to a directory of your choice
-
Add Target gtests
-
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
-
Files with Google Test format are called ClassUnitTest.h for each class. The Target Membership for these is to Test only.
-
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
-
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