Is Eigen provided with XCode?

Solution 1:

Try to do something like

pkgutil --file-info /usr/include/eigen3/your.file

That will return where the file comes from...

For instance (I do not have eigen3 in /usr/include):

$ pkgutil --file-info /usr/include/cups/ppd.h
volume: /
path: /usr/include/cups/ppd.h
pkgid: com.apple.pkg.DevSDKLeo

Let me add, Macports would not install anything in /usr/include (unless there is a bug OR You told it do so by doing a custom install). I do not use Homebrew so I cannot comment on where it keeps the files it installs.

In any case, I have Lion, XCode 4.3.2 with the Command Line tools installed, and do not have eigen3 in /usr/include

Solution 2:

For the record Homebrew should have installed the eigen3 header into /usr/local/include/eigen3/. According to HomeBrew FAQ the default install location is:

/usr/local

Unless further customization was performed, it does not seem like eigen3 in your case was installed by a default configuration of HomeBrew nor MacPorts as noted by user1256923.

After looking at a Mac with Lion and no Xcode installed there is currently no include directory at the /usr/include path. So you should be safe to remove it and rebuild.

Additionally, Xcode 4.3.2 is self contained as observed by Install the Command Line C Compilers in OS X Lion

Which means that Apple is installing things Xcode needs within the Xcode application package so in this case its safe to say that eigen3 is not needed by Xcode. For example gcc and everything else Xcode needs is located within its package at the following path:

/Applications/Xcode.app/Contents/Developer/usr/

In order to get compiling tools back for things other than Xcode's back into '/usr' you will need to install the Xcode Command Line tools in order to make any changes in the /usr directory.

As noted by The MacObserver here is how to install the Command Line Tools:

After launching Xcode, go to Preferences and select the Downloads pane, then Components. There, in the list of candidate items, one will be the Command line tools. Click “Install.”

Xcode's Command Line Tools