Computer Science
Algorithm
Data Processing
Digital Life
Distributed System
Distributed System Infrastructure
Machine Learning
Install BLAS Library for MXNet (2015)
Operating System
Android
Linux
MacOS
Tizen
Windows
iOS
Programming Language
C++
Erlang
Go
Scala
Scheme
Type System
Software Engineering
Storage
UI
Flutter
Javascript
Virtualization
Life
Life in Guangzhou (2013)
Recent Works (2013)
东京之旅 (2014)
My 2017 Year in Review (2018)
My 2020 in Review (2021)
十三年前被隔离的经历 (2022)
A Travel to Montreal (2022)
My 2022 in Review (2023)
Travel Back to China (2024)
Projects
Bard
Blog
RSS Brain
Scala2grpc
Comment Everywhere (2013)
Fetch Popular Erlang Modules by Coffee Script (2013)
Psychology
耶鲁大学心理学导论 (2012)
Thoughts
Chinese
English

Install BLAS Library for MXNet

Posted on 08 Nov 2015, tagged deep learningprogrammingmxnetmac os x

MXNet is a deep learning library. I read its doc and some of its source code. It looks very good. So I’d like to install and try it. While I’m following the installing guide to install it on Mac OS X, it failed to compile with the error cblas.h not found. The message pointed out I may miss the BLAS library.

After some search, I find Mac OS X seems to come with its default BLAS library. But I cannot find its headers. And as an article said, the default BLAS library may not as fast as some third party ones. So I install OpenBLAS with homebrew:

brew install openblas

It is installed under /usr/local/opt/openblas, so we need to change these lines in the MXNet’s config.mk (it should be copied from make/osx.mk as the installing guide specified) :

# the additional link flags you want to add
ADD_LDFLAGS = '-L/usr/local/opt/openblas/lib'

# the additional compile flags you want to add
ADD_CFLAGS = '-I/usr/local/opt/openblas/include'

Then the compile should pass.