Caffe Ubuntu 16.04 compile patch
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 08f56a3..1150bc2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,9 @@ endif()
# ---[ Caffe project
project(Caffe C CXX)
+# ---[ Add by Ronny ]
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+
# ---[ Caffe version
set(CAFFE_TARGET_VERSION "1.0.0" CACHE STRING "Caffe logical version")
set(CAFFE_TARGET_SOVERSION "1.0.0" CACHE STRING "Caffe soname version")
diff --git a/examples/mnist/convert_mnist_data.cpp b/examples/mnist/convert_mnist_data.cpp
index 57ddef7..dfa2e24 100644
--- a/examples/mnist/convert_mnist_data.cpp
+++ b/examples/mnist/convert_mnist_data.cpp
@@ -112,7 +112,7 @@ void convert_dataset(const char* image_filename, const char* label_filename,
int main(int argc, char** argv) {
#ifndef GFLAGS_GFLAGS_H_
- namespace gflags = google;
+ // namespace gflags = google;
#endif
FLAGS_alsologtostderr = 1;
diff --git a/include/caffe/common.hpp b/include/caffe/common.hpp
index 4904d1d..22c9e2f 100644
--- a/include/caffe/common.hpp
+++ b/include/caffe/common.hpp
@@ -28,7 +28,7 @@
// TODO(Yangqing): Once gflags solves the problem in a more elegant way, let's
// remove the following hack.
#ifndef GFLAGS_GFLAGS_H_
-namespace gflags = google;
+//namespace gflags = google;
#endif // GFLAGS_GFLAGS_H_
// Disable the copy and assignment operator for a class.