# System Modeler can't find g++ in Mac OS X Mavericks

I've just purchased SystemModeler (Mac OS X Mavericks) but can't verify the g++ compiler path. I assume it's in the Xcode package but nothing I've tried seems to work, for example,

Applications/xcode.app/Contents/Developer/usr/bin

Any ideas?

-
IIRC, it's actually not in XCode by default. You'll have to install "command line tools" for mac from XCode > Preferences > Downloads > Components > Command Line Tools > Install. If you upgrade to XCode 5, it should come with the command line tools. –  rm -rf Oct 28 '13 at 5:04
I have Xcode 5.0.1 but command line tools are missing from components. I tried /usr/bin/xcode-select --install but command line tools couldn't be found. –  nilglew Oct 29 '13 at 1:20
System Modeler instructions only state that Xcode must be installed so I thought that's where the compiler would be. After finding use/bin I see that the g++ executable is in that directory. However, System Modeler>Preferences>Global>Compiler fails to validate that path. –  nilglew Oct 29 '13 at 3:07
Tried your suggested command line tool install but Mavericks blocked it. "Valid only for Mountain Lion." –  nilglew Oct 29 '13 at 3:21

I was formally informed by WRI personnel that the system modeler is not (yet) compatible with 10.9

-
Information from @yehuda about another example of Apple fooling a vendor probably answers my question. (MS mostly fools users.) It was a case of bad timing on my part; should have waited a descent interval to get System Modeler after 10.9. Thanks everyone for the assistance; beyond some javascript I don't do code, which is why I use higher-end tools like Mathematica, but I enjoy reading the command line talk. You guys are awesome. –  nilglew Nov 2 '13 at 0:55
See my answer for a way to run SystemModeler on 10.9 –  jrhodin Mar 21 at 16:12

I just solved this problem, which is in fact resulted from the missing of gcc and apple developer tool. 1.gcc: refer to this page for the installation of gcc 4.8: gcc 4.7, 4.8 and 4.9

2.Apple Developer Tool: Just install it by executing this command in Terminal:

xcode-select --install


After install the developer tool, verify the g++ compiler in Preferences of SystemModeler under the compiler section. Good luck.

-
I can invoke the compiler from the command line ... "which g++" says /usr/bin, putting /usr/bin in the compiler section of the preferences results in "Compiler verification failed. Change the settings and try again." –  Reb.Cabin Mar 19 at 23:22

Locate the Compile script in the SystemModeler bundle, in a standard installation it should be located here /Applications/SystemModeler.app/Contents/MacOS/Compile.

To get there, right-click (or Ctrl+left click) on the SystemModeler bundle and select "Show Package Contents". Then you can browse into Contents/MacOS. Open the Compile file in a text editor and substitute the contents with this:

#!/bin/sh export export MACOSX_DEPLOYMENT_TARGET=10.8 make $2 -f$1.makefile > \$1.log 2>&1

Warning: Make sure that the new file does NOT use windows line endings, because then nothing will work.

-

xcode-select --install