{"action":"created","issue":{"url":"https://api.github.com/repos/naibaf7/caffe/issues/13","labels_url":"https://api.github.com/repos/naibaf7/caffe/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/naibaf7/caffe/issues/13/comments","events_url":"https://api.github.com/repos/naibaf7/caffe/issues/13/events","html_url":"https://github.com/naibaf7/caffe/issues/13","id":114470095,"number":13,"title":"Can not compile","user":{"login":"letalvoj","id":5262321,"avatar_url":"https://avatars.githubusercontent.com/u/5262321?v=3","gravatar_id":"","url":"https://api.github.com/users/letalvoj","html_url":"https://github.com/letalvoj","followers_url":"https://api.github.com/users/letalvoj/followers","following_url":"https://api.github.com/users/letalvoj/following{/other_user}","gists_url":"https://api.github.com/users/letalvoj/gists{/gist_id}","starred_url":"https://api.github.com/users/letalvoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letalvoj/subscriptions","organizations_url":"https://api.github.com/users/letalvoj/orgs","repos_url":"https://api.github.com/users/letalvoj/repos","events_url":"https://api.github.com/users/letalvoj/events{/privacy}","received_events_url":"https://api.github.com/users/letalvoj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-01T13:36:55Z","updated_at":"2015-11-02T14:28:02Z","closed_at":null,"body":"Hi,\r\n\r\nI tried to compile this code but it does not seem to work. Is there any commit from which I can start and compile the stuff, or is the code unusable yet?\r\n\r\nWhile trying to compile the code I got mostly easy to fix casting errors:\r\n\r\n``` diff\r\ndiff --git a/src/caffe/layers/base_conv_layer.cpp b/src/caffe/layers/base_conv_layer.cpp\r\nindex 5252fd2..223732e 100644\r\n--- a/src/caffe/layers/base_conv_layer.cpp\r\n+++ b/src/caffe/layers/base_conv_layer.cpp\r\n@@ -26,7 +26,7 @@ void BaseConvolutionLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,\r\n   num_spatial_axes_ = num_axes - first_spatial_axis;\r\n   CHECK_GE(num_spatial_axes_, 0);\r\n   vector<int_tp> bottom_dim_blob_shape(1, num_spatial_axes_ + 1);\r\n-  vector<int_tp> spatial_dim_blob_shape(1, std::max(num_spatial_axes_, 1L));\r\n+  vector<int_tp> spatial_dim_blob_shape(1, std::max(num_spatial_axes_, static_cast<int_tp>(1L)));\r\n   // Setup filter kernel dimensions (kernel_shape_).\r\n   kernel_shape_.Reshape(spatial_dim_blob_shape);\r\n   int_tp* kernel_shape_data = kernel_shape_.mutable_cpu_data();\r\ndiff --git a/src/caffe/layers/eltwise_layer.cpp b/src/caffe/layers/eltwise_layer.cpp\r\nindex c76f80c..7b53eb7 100644\r\n--- a/src/caffe/layers/eltwise_layer.cpp\r\n+++ b/src/caffe/layers/eltwise_layer.cpp\r\n@@ -66,7 +66,7 @@ void EltwiseLayer<Dtype>::Forward_cpu(\r\n   case EltwiseParameter_EltwiseOp_MAX:\r\n     // Initialize\r\n     mask = max_idx_.mutable_cpu_data();\r\n-    caffe_set(count, -1L, mask);\r\n+    caffe_set(count, -1LL, mask);\r\n     caffe_set(count, Dtype(-FLT_MAX), top_data);\r\n     // bottom 0 & 1\r\n     bottom_data_a = bottom[0]->cpu_data();\r\ndiff --git a/src/caffe/layers/pooling_layer.cpp b/src/caffe/layers/pooling_layer.cpp\r\nindex 6de258c..5bbf009 100644\r\n--- a/src/caffe/layers/pooling_layer.cpp\r\n+++ b/src/caffe/layers/pooling_layer.cpp\r\n@@ -33,7 +33,7 @@ void PoolingLayer<Dtype>::LayerSetUp(const vector<Blob<Dtype>*>& bottom,\r\n   CHECK_GE(num_spatial_axes_, 0);\r\n \r\n   vector<int_tp> bottom_dim_blob_shape(1, num_spatial_axes_ + 1);\r\n-  vector<int_tp> spatial_dim_blob_shape(1, std::max(num_spatial_axes_, 1L));\r\n+  vector<int_tp> spatial_dim_blob_shape(1, std::max(num_spatial_axes_, static_cast<int_tp>(1L)));\r\n \r\n   kernel_shape_.Reshape(spatial_dim_blob_shape);\r\n   int_tp* kernel_shape_data = kernel_shape_.mutable_cpu_data();\r\n@@ -259,7 +259,7 @@ void PoolingLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,\r\n       caffe_set(top_count, Dtype(-1), top_mask);\r\n     } else {\r\n       mask = max_idx_.mutable_cpu_data();\r\n-      caffe_set(top_count, -1L, mask);\r\n+      caffe_set(top_count, -1LL, mask);\r\n     }\r\n     caffe_set(top_count, Dtype(-FLT_MAX), top_data);\r\n     // The main loop\r\n@@ -271,8 +271,8 @@ void PoolingLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,\r\n             int_tp wstart = pw * stride_w_ - pad_w_;\r\n             int_tp hend = min(hstart + kernel_h_, height_);\r\n             int_tp wend = min(wstart + kernel_w_, width_);\r\n-            hstart = max(hstart, 0L);\r\n-            wstart = max(wstart, 0L);\r\n+            hstart = max(hstart, static_cast<int_tp>(0L));\r\n+            wstart = max(wstart, static_cast<int_tp>(0L));\r\n             const int_tp pool_index = ph * pooled_width_ + pw;\r\n             for (int_tp h = hstart; h < hend; ++h) {\r\n               for (int_tp w = wstart; w < wend; ++w) {\r\n@@ -314,8 +314,8 @@ void PoolingLayer<Dtype>::Forward_cpu(const vector<Blob<Dtype>*>& bottom,\r\n             int_tp hend = min(hstart + kernel_h_, height_ + pad_h_);\r\n             int_tp wend = min(wstart + kernel_w_, width_ + pad_w_);\r\n             int_tp pool_size = (hend - hstart) * (wend - wstart);\r\n-            hstart = max(hstart, 0L);\r\n-            wstart = max(wstart, 0L);\r\n+            hstart = max(hstart, static_cast<int_tp>(0L));\r\n+            wstart = max(wstart, static_cast<int_tp>(0L));\r\n             hend = min(hend, height_);\r\n             wend = min(wend, width_);\r\n             for (int_tp h = hstart; h < hend; ++h) {\r\n@@ -406,8 +406,8 @@ void PoolingLayer<Dtype>::Backward_cpu(const vector<Blob<Dtype>*>& top,\r\n             int_tp hend = min(hstart + kernel_h_, height_ + pad_h_);\r\n             int_tp wend = min(wstart + kernel_w_, width_ + pad_w_);\r\n             int_tp pool_size = (hend - hstart) * (wend - wstart);\r\n-            hstart = max(hstart, 0L);\r\n-            wstart = max(wstart, 0L);\r\n+            hstart = max(hstart, static_cast<int_tp>(0L));\r\n+            wstart = max(wstart, static_cast<int_tp>(0L));\r\n             hend = min(hend, height_);\r\n             wend = min(wend, width_);\r\n             for (int_tp h = hstart; h < hend; ++h) {\r\ndiff --git a/src/caffe/layers/window_data_layer.cpp b/src/caffe/layers/window_data_layer.cpp\r\nindex d5a777b..613677e 100644\r\n--- a/src/caffe/layers/window_data_layer.cpp\r\n+++ b/src/caffe/layers/window_data_layer.cpp\r\n@@ -332,10 +332,10 @@ void WindowDataLayer<Dtype>::load_batch(Batch<Dtype>* batch) {\r\n         // the extent beyond the image\r\n         int_tp unclipped_height = y2-y1+1;\r\n         int_tp unclipped_width = x2-x1+1;\r\n-        int_tp pad_x1 = std::max(0L, -x1);\r\n-        int_tp pad_y1 = std::max(0L, -y1);\r\n-        int_tp pad_x2 = std::max(0L, x2 - cv_img.cols + 1);\r\n-        int_tp pad_y2 = std::max(0L, y2 - cv_img.rows + 1);\r\n+        int_tp pad_x1 = std::max(static_cast<int_tp>(0L), -x1);\r\n+        int_tp pad_y1 = std::max(static_cast<int_tp>(0L), -y1);\r\n+        int_tp pad_x2 = std::max(static_cast<int_tp>(0L), x2 - cv_img.cols + 1);\r\n+        int_tp pad_y2 = std::max(static_cast<int_tp>(0L), y2 - cv_img.rows + 1);\r\n         // clip bounds\r\n         x1 = x1 + pad_x1;\r\n         x2 = x2 - pad_x2;\r\ndiff --git a/src/caffe/util/hdf5.cpp b/src/caffe/util/hdf5.cpp\r\nindex ab56474..ce1b5d7 100644\r\n--- a/src/caffe/util/hdf5.cpp\r\n+++ b/src/caffe/util/hdf5.cpp\r\n@@ -125,7 +125,7 @@ void hdf5_save_nd_dataset<double>(\r\n \r\n string hdf5_load_string(hid_t loc_id, const string& dataset_name) {\r\n   // Get size of dataset\r\n-  uint_tp size;\r\n+  size_t size;\r\n   H5T_class_t class_;\r\n   herr_t status = \\\r\n     H5LTget_dataset_info(loc_id, dataset_name.c_str(), NULL, &class_, &size);\r\n```\r\n\r\nbut then I got this one:\r\n``` make\r\nsrc/caffe/util/math_functions.cpp:146:3: error: call to 'cblas_saxpby' is ambiguous\r\n  cblas_saxpby(N, alpha, X, 1, beta, Y, 1);\r\n  ^~~~~~~~~~~~\r\n/usr/local/include/cblas.h:324:6: note: candidate function\r\nvoid cblas_saxpby(OPENBLAS_CONST blasint n, OPENBLAS_CONST float alpha, OPENBLAS_CONST float *x, OPENBLAS_CONST blasint incx,OPENBLAS_CONST float beta, float *y, OPENBLAS_CONST blasint incy);\r\n     ^\r\n./include/caffe/util/mkl_alternate.hpp:83:13: note: candidate function\r\ninline void cblas_saxpby(const int_tp N, const float alpha, const float* X,\r\n            ^\r\nsrc/caffe/util/math_functions.cpp:152:3: error: call to 'cblas_daxpby' is ambiguous\r\n  cblas_daxpby(N, alpha, X, 1, beta, Y, 1);\r\n  ^~~~~~~~~~~~\r\n/usr/local/include/cblas.h:326:6: note: candidate function\r\nvoid cblas_daxpby(OPENBLAS_CONST blasint n, OPENBLAS_CONST double alpha, OPENBLAS_CONST double *x, OPENBLAS_CONST blasint incx,OPENBLAS_CONST double beta, double *y, OPENBLAS_CONST blasint incy);\r\n     ^\r\n./include/caffe/util/mkl_alternate.hpp:89:13: note: candidate function\r\ninline void cblas_daxpby(const int_tp N, const double alpha, const double* X,\r\n            ^\r\n2 errors generated.\r\nmake: *** [.build_release/src/caffe/util/math_functions.o] Error 1\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/naibaf7/caffe/issues/comments/153030963","html_url":"https://github.com/naibaf7/caffe/issues/13#issuecomment-153030963","issue_url":"https://api.github.com/repos/naibaf7/caffe/issues/13","id":153030963,"user":{"login":"letalvoj","id":5262321,"avatar_url":"https://avatars.githubusercontent.com/u/5262321?v=3","gravatar_id":"","url":"https://api.github.com/users/letalvoj","html_url":"https://github.com/letalvoj","followers_url":"https://api.github.com/users/letalvoj/followers","following_url":"https://api.github.com/users/letalvoj/following{/other_user}","gists_url":"https://api.github.com/users/letalvoj/gists{/gist_id}","starred_url":"https://api.github.com/users/letalvoj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/letalvoj/subscriptions","organizations_url":"https://api.github.com/users/letalvoj/orgs","repos_url":"https://api.github.com/users/letalvoj/repos","events_url":"https://api.github.com/users/letalvoj/events{/privacy}","received_events_url":"https://api.github.com/users/letalvoj/received_events","type":"User","site_admin":false},"created_at":"2015-11-02T14:28:02Z","updated_at":"2015-11-02T14:28:02Z","body":"*libstdc++* is being set only if the version of CUDA is lower than 7. Forcing it manually just causes another error.\r\n\r\nI do not think that it matters, but my Makefile.config is: http://pastebin.com/99Zk7m7b\r\n"}}