зеркало из https://github.com/microsoft/caffe.git
support OS X Yosemite / 10.10
- pick libstdc++ for OS X (regardless of version) - make gtest rely on its own tuple to not conflict with clang (thanks @pluskid!) - 10.10 has Accelerate while 10.9 has vecLib for BLAS (thanks @leonardt and @drdan14)
This commit is contained in:
Родитель
25e3748929
Коммит
ab839f5b2f
21
Makefile
21
Makefile
|
@ -234,15 +234,15 @@ endif
|
||||||
# libstdc++ instead of libc++ for CUDA compatibility on 10.9
|
# libstdc++ instead of libc++ for CUDA compatibility on 10.9
|
||||||
ifeq ($(OSX), 1)
|
ifeq ($(OSX), 1)
|
||||||
CXX := /usr/bin/clang++
|
CXX := /usr/bin/clang++
|
||||||
|
CXXFLAGS += -stdlib=libstdc++
|
||||||
|
LINKFLAGS += -stdlib=libstdc++
|
||||||
# clang throws this warning for cuda headers
|
# clang throws this warning for cuda headers
|
||||||
WARNINGS += -Wno-unneeded-internal-declaration
|
WARNINGS += -Wno-unneeded-internal-declaration
|
||||||
ifneq ($(findstring 10.9, $(shell sw_vers -productVersion)),)
|
# gtest needs to use its own tuple to not conflict with clang
|
||||||
CXXFLAGS += -stdlib=libstdc++
|
CXXFLAGS += -DGTEST_USE_OWN_TR1_TUPLE=1
|
||||||
LINKFLAGS += -stdlib=libstdc++
|
|
||||||
endif
|
|
||||||
# boost::thread is called boost_thread-mt to mark multithreading on OS X
|
# boost::thread is called boost_thread-mt to mark multithreading on OS X
|
||||||
LIBRARIES += boost_thread-mt
|
LIBRARIES += boost_thread-mt
|
||||||
NVCCFLAGS += -DOSX
|
NVCCFLAGS += -DOSX
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Custom compiler
|
# Custom compiler
|
||||||
|
@ -304,9 +304,16 @@ else
|
||||||
endif
|
endif
|
||||||
else ifeq ($(OSX), 1)
|
else ifeq ($(OSX), 1)
|
||||||
# OS X packages atlas as the vecLib framework
|
# OS X packages atlas as the vecLib framework
|
||||||
BLAS_INCLUDE ?= /System/Library/Frameworks/vecLib.framework/Versions/Current/Headers/
|
|
||||||
LIBRARIES += cblas
|
LIBRARIES += cblas
|
||||||
LDFLAGS += -framework vecLib
|
# 10.10 has accelerate while 10.9 has veclib
|
||||||
|
XCODE_CLT_VER := $(shell pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep -o 'version: 6')
|
||||||
|
ifneq (,$(findstring version: 6,$(XCODE_CLT_VER)))
|
||||||
|
BLAS_INCLUDE ?= /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/Accelerate.framework/Versions/Current/Frameworks/vecLib.framework/Headers/
|
||||||
|
LDFLAGS += -framework Accelerate
|
||||||
|
else
|
||||||
|
BLAS_INCLUDE ?= /System/Library/Frameworks/vecLib.framework/Versions/Current/Headers/
|
||||||
|
LDFLAGS += -framework vecLib
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
INCLUDE_DIRS += $(BLAS_INCLUDE)
|
INCLUDE_DIRS += $(BLAS_INCLUDE)
|
||||||
|
|
|
@ -5,7 +5,7 @@ title: Installation
|
||||||
# Installation
|
# Installation
|
||||||
|
|
||||||
Prior to installing, it is best to read through this guide and take note of the details for your platform.
|
Prior to installing, it is best to read through this guide and take note of the details for your platform.
|
||||||
We have installed Caffe on Ubuntu 14.04, Ubuntu 12.04, OS X 10.9, and OS X 10.8.
|
We have installed Caffe on Ubuntu 14.04, Ubuntu 12.04, OS X 10.10, 10.9, and 10.8.
|
||||||
|
|
||||||
- [Prerequisites](#prerequisites)
|
- [Prerequisites](#prerequisites)
|
||||||
- [Compilation](#compilation)
|
- [Compilation](#compilation)
|
||||||
|
@ -156,9 +156,9 @@ Building boost from source is needed to link against your local Python (exceptio
|
||||||
**Note** that the HDF5 dependency is provided by Anaconda Python in this case.
|
**Note** that the HDF5 dependency is provided by Anaconda Python in this case.
|
||||||
If you're not using Anaconda, include `hdf5` in the list above.
|
If you're not using Anaconda, include `hdf5` in the list above.
|
||||||
|
|
||||||
#### 10.9-specific Instructions
|
#### 10.10- and 10.9-specific Instructions
|
||||||
|
|
||||||
In OS X 10.9, clang++ is the default C++ compiler and uses `libc++` as the standard library.
|
In OS X 10.9+, clang++ is the default C++ compiler and uses `libc++` as the standard library.
|
||||||
However, NVIDIA CUDA (even version 6.0) currently links only with `libstdc++`.
|
However, NVIDIA CUDA (even version 6.0) currently links only with `libstdc++`.
|
||||||
This makes it necessary to change the compilation settings for each of the dependencies.
|
This makes it necessary to change the compilation settings for each of the dependencies.
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче