Fix building under MacOS X
fix build on linux
Merge branch 'fix_macosx_build'