2012-03-22

Are humans fundamentally vegetarians or non-vegetarians?

I believe humans are non-vegetarians from an evolutionary perspective.

The animal kingdom is split into predators and prey and there is one characteristic shared by all members of each group, regardless of species. That is the position of the eyes.

All prey have eyes at the side of their head, to get a wider view of their surroundings when grazing and looking out for predators. Whereas all predators have eyes at the front of the head to focus better on their prey during a chase. This applies everywhere - mammals, fish(sharks), birds(eagles), reptiles and so on.

Guess which group humans belong to?

2012-03-06

Building re2c on Mac/OSX/XCode

Having recently got a Macbook Pro, I installed Xcode and tried to port zenlang over to it. The lemon parser was a piece of cake, but re2c... not so much. This is using XCode 4.3 on OSX 10.7.

Having downloaded and extracted the source tarball, I tried running ./configure and got the error "C++ compiler cannot create executables".
The config.log file showed that the test file created by ./configure wasn't getting linked, it could not find crt1.10.6.

So the next step was to find this library (using find /Applications/Xcode.app -name "crt1.10.6*") add it to the environment before running ./configure, as follows:

env LDFLAGS="-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.SDK/usr/lib" ./configure

Now configure goes through successfully, but make doesn't. It is unable to find the standard include files, so I had to re-run configure with the include paths, again, discovered using find.


env CPPFLAGS="-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.SDK/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.SDK/usr/c++/4.2.1"  LDFLAGS="-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.SDK/usr/lib" ./configure

Note that we are also adding the include directory for the C++ header files (iostream, iomanip, etc) as well.

Now make should run successfully and create the re2c binary.

A couple of blogs I found suggested using macports, but I was quite sure that autotools won't let me down :)