Question: Trying to compile opencv on my Mac from source. 

I have following CMakeCache.txt:
<http://pastebin.com/KqPHjBx0>

I make `ccmake ..`, press `c`, then `g`.
Than I make `sudo make -j8`:
<http://pastebin.com/cJyr1cEd>

Than I make `sudo make install`:
<http://pastebin.com/W77syYBj>

And than I make `import cv` in python and get "Segmentation faul" with this stacktrace:
<http://pastebin.com/gegYAK1u>

I don't know what could be useful to help me, pls. ask, I'll get it.

Answer: 
From your logs, you seem to use MacPorts and python 2.6. 

`opencv` will compile fine on this framework:

```
sudo port install  opencv +python26

```

be sure to have `py26-numpy` installed to have support for basic functions such as `cv.fromarray` :

```
sudo port install py26-numpy

```

means that your problem has been solved by the MacPorts community. is it a problem of the latest source? the version you compile is the one (opencv 2.2.0) used by macports.

Your question is about compiling from source. Looking at the portfile linked to that you'll be able to locate your problem. to find the Portfile, do:

```
port file opencv

```

or directly

```
sudo port edit  opencv

```

this will list all configuration flags necessary for a working openCV.
The problem is simple, macports did rewrote cv.so in ~/usr/lib

if you installed OPENCV using 

```
sudo port install  opencv +python26

```

type

```
sudo port select --set python python26

```

if you installed OPENCV using

```
sudo port install  opencv +python27

```

type

```
sudo port select --set python python27

```

The "bug" is that python2.7 interpreter is trying to open python2.6 pre-compiled binary that gives seg fault 11 (or vice versa)

The nevereinding problem with opencv is that it does not have source code, just binaries that are stongly dependent on which compiler there were built on (which platform etc.)