Skip to content

Instantly share code, notes, and snippets.

@tcgeophysics
Last active January 1, 2016 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tcgeophysics/8156717 to your computer and use it in GitHub Desktop.
Save tcgeophysics/8156717 to your computer and use it in GitHub Desktop.
Tentative homebrew formula to install bob a free signal-processing and machine learning toolbox. http://www.idiap.ch/software/bob/docs/releases/last/sphinx/html/index.html Compilation instructions: http://www.idiap.ch/software/bob/docs/releases/last/sphinx/html/Compilation.html Dependencies: http://www.idiap.ch/software/bob/docs/releases/last/sp…
# the VTK formula. It uses the output from `python-config`.
which_python = "python" + `python -c 'import sys;print(sys.version[:3])'`.strip
python_prefix = `python-config --prefix`.strip
# Python is actually a library. The libpythonX.Y.dylib points to this lib, too.
if File.exist? "#{python_prefix}/Python"
# Python was compiled with --framework:
args << "-DPYTHON_LIBRARY='#{python_prefix}/Python'"
args << "-DPYTHON_INCLUDE_DIR='#{python_prefix}/Headers'"
else
python_lib = "#{python_prefix}/lib/lib#{which_python}"
if File.exists? "#{python_lib}.a"
args << "-DPYTHON_LIBRARY='#{python_lib}.a'"
else
args << "-DPYTHON_LIBRARY='#{python_lib}.dylib'"
end
args << "-DPYTHON_INCLUDE_DIR='#{python_prefix}/include/#{which_python}'"
end
args << "-DPYTHON_PACKAGES_PATH='#{lib}/#{which_python}/site-packages'"
system "cmake", "..", *args
system "make"
system "make test"
system "make install"
end
end
def test
python do
ohai "This tests only a simple import and prints the version number. Use --verbose to see progress."
system "python", "-c", "import bob; print bob.version"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment