Compiling Spring RTS on OSX
• Mark Eschbach
First problem: Installing CMake! Hmm, they have prebuilt images. Not bad at ~26MBs. I apparently had a version already installed, with the binaries at /Applications/CMake.app/Contents/bin/cmake
. I should probably set my shell path for that.
So CMake ran with the error: unknown target CPU 'x86_64'
as the failure result. Looks like the default c++
program is failing. It’s linked to clang++
however I’m afraid it’s detecting the symlink name and changing the behaviors. I was hoping I was taking the wrong approach for OSX but nope. I found a tutorial published by the Spring group about compiling under OSX…but they want homebrew. Hmm…let’s see if I can find a way around that problem.
I got CMake to run with /Applications/CMake.app/Contents/bin/cmake -DCMAKE_CXX_COMPILER=clang++ -DAPPLE=1 -DCMAKE_OSX_ARCHITECTURES=x86-64 DCMAKE_SYSTEM_PROCESSOR=x86-64 .
! Time to simplify.
/Applications/CMake.app/Contents/bin/cmake -DCMAKE_CXX_COMPILER=clang++ .
- failed/Applications/CMake.app/Contents/bin/cmake -DCMAKE_CXX_COMPILER=clang++ -DAPPLE=1 -DCMAKE_SYSTEM_PROCESSOR=x86-64 .
- failed
Okay, re-running the original command fails. I must be crazy. The following worked: /Applications/CMake.app/Contents/bin/cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DAPPLE=1 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_PROCESSOR=x86_64 .
. Well, mostly worked. It’s no longer complaining about arch
flags. When running make
it noticed I hadn’t run git submodule init && git submodule update
, so I ran that and resulted in a cmake error :-/. Looking a litte closer at the output it may not be an arch
issue but a problem locating boost.
On to installing Boost! The instructions look fairly simple. Found out the hardway it doesn’t interpret `…back things could have happenepd if I let that run longer :-).
Interlude for holiday party
I installed Boost
to ~/tootls/boost-${version}
. I didn’t expect CMake to find it the first time. The question in Cmake deson’t find Boost might have the key with setting BOOST_ROOT
. Probably will not work, but worth a try. Failed as I had feared. I was wondering if I install boost with ~/.bash_profile…then realized I nuked it when I tried to delete teh directory named ~
. Probably nuked some session files related to heroku and others, kind of annoying.
Restoring configuration
First up is the RC file. I always forget which one is which. This StackOverflow question seems to resolve the question:
.bash_profile
is executed on login..bashrc
is executed for interactive subshells.
Simple enough. First up, fixing my PATH variables. First up is NodeJS because it follows my standard pattern. I install NodeJS to ~/tools
in the format of ~/tools/nodejs-v${NODE_VERSION}
. Generally results in s a stanza kind of like this:
export NODE_VERSION=6.6.0
export NODE_HOME=$HOME/tools/node-v${NODE_VERSION}
export NODE_PATH=$NODE_HOME/bin
Now that I have Boost installed, it follows a similar pattern. I tend to use Ruby often, so I definitely need this one. I use rbenv
due to administrative philosphies. Hmm, ~/.rbenv
was nuked already. Disappointing. Alrighty, onto getting the prompt restored.
Prompts
I work with multiple hosts and generally like to know where in the file system I am from the root. This is generally helfpul from my point of view as I tend to get lost significantly less often. The default of the host name, user name, and directory leaves something to be desired. I generally use the following prompt style:
PS1="[\h@\u]\w:> "
PS2="[\h@\u]\w:| "
This gives me context of where I am and what I’m doing. I know PS3
and PS4
exist, but I’ve never seen them in pratice.
Restoration of rbenv
Generally I just follow the instructions of rbenv’s project page. Pretty simple but I really feel like the system is nerfed without the build plugin. I’ve used it so much I’ve never imported a version of Ruby I built outside of it. I’m sure it’s possible though, just guessing.
The documentation recommends placing the path export in the .bash_profile
file…but I feel like it would fit better in the ~/.bashrc
file. If I’m wrong about this I haven’t found any particular reasoning. I always forget the check to ensure rbenv
is operating as expected, so it’s nice that it’s number 4 on thier install list.
Onto rbenv-build
. Simple installation instructions. I don’t think I’ve ever encountered an error with it. Once downloaded I can get my ruby versions back pretty simple through the rbenv install 2.3.1
like commands.
Right, my git
configuration has been blown away also. Right, I set these in my .bashrc
file. Probably a really bad place to set them, but I otherwise completely forget. user.name
and user.email
are the easy ones to configure. I always forget how to configure the GnuPGP stuff. Hmm, I may have lost the key because GnuPGP aren’t there. Yup, looks like GPG are stored in ~/.gpg
. Back to the GPG. Now to autosign….