torch / torch7

http://torch.ch
Other
8.96k stars 2.38k forks source link

Build fails on macOS 10.13 #1189

Open IronCraftMan opened 5 years ago

IronCraftMan commented 5 years ago

Hey guy, so I've been trying to get torch installed on macOS 10.13 for about 4 hours now. I've tried almost everything on the internet, yet it still fails.

I have installed CUDA 9.1 and CLT v8.3.2. I am unsure of what the error is at this point.

Here is a small snippet from the build log:

./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:127:17: warning: 'THCudaHalfTensor_get1d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get1d(THCState state, const THCudaHalfTensor tensor, long x0); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:128:17: warning: 'THCudaHalfTensor_get2d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get2d(THCState state, const THCudaHalfTensor tensor, long x0, long x1); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:129:17: warning: 'THCudaHalfTensor_get3d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get3d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:130:17: warning: 'THCudaHalfTensor_get4d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get4d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2, long x3); ^ 6 warnings generated. [ 12%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMathBlas.cu.o ./torch/extra/cutorch/lib/THC/generic/THCTensorMath.cu(393): error: more than one operator "==" matches these operands: function "operator==(const half &, const half &)" function "operator==(half, half)" operand types are: half == half

./torch/extra/cutorch/lib/THC/generic/THCTensorMath.cu(414): error: more than one operator "==" matches these operands: function "operator==(const half &, const half &)" function "operator==(half, half)" operand types are: half == half

2 errors detected in the compilation of "/var/folders/jk/htn2jsxn4c519nj2l06dtw9m0000gn/T//tmpxft_0000ebfd_00000000-11_THCTensorMath.compute_61.cpp1.ii". CMake Error at THC_generated_THCTensorMath.cu.o.cmake:267 (message): Error generating file ./torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMath.cu.o

make[2]: [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o] Error 1 make[2]: Waiting for unfinished jobs.... ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:127:17: warning: 'THCudaHalfTensor_get1d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get1d(THCState state, const THCudaHalfTensor tensor, long x0); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:128:17: warning: 'THCudaHalfTensor_get2d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get2d(THCState state, const THCudaHalfTensor tensor, long x0, long x1); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:129:17: warning: 'THCudaHalfTensor_get3d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get3d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:130:17: warning: 'THCudaHalfTensor_get4d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get4d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2, long x3); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:35:17: warning: 'THCudaHalfTensor_minall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_minall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:36:17: warning: 'THCudaHalfTensor_maxall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_maxall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:37:17: warning: 'THCudaHalfTensor_medianall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_medianall(THCState state, THCudaHalfTensor self); ^ 9 warnings generated. ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ 1 warning generated. ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ 2 warnings generated. ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:127:17: warning: 'THCudaHalfTensor_get1d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get1d(THCState state, const THCudaHalfTensor tensor, long x0); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:128:17: warning: 'THCudaHalfTensor_get2d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get2d(THCState state, const THCudaHalfTensor tensor, long x0, long x1); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:129:17: warning: 'THCudaHalfTensor_get3d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get3d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:130:17: warning: 'THCudaHalfTensor_get4d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get4d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2, long x3); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:35:17: warning: 'THCudaHalfTensor_minall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_minall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:36:17: warning: 'THCudaHalfTensor_maxall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_maxall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:37:17: warning: 'THCudaHalfTensor_medianall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_medianall(THCState state, THCudaHalfTensor self); ^ 9 warnings generated. ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka '__half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:127:17: warning: 'THCudaHalfTensor_get1d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get1d(THCState state, const THCudaHalfTensor tensor, long x0); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:128:17: warning: 'THCudaHalfTensor_get2d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get2d(THCState state, const THCudaHalfTensor tensor, long x0, long x1); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:129:17: warning: 'THCudaHalfTensor_get3d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get3d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:130:17: warning: 'THCudaHalfTensor_get4d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get4d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2, long x3); ^ 6 warnings generated. make[1]: [lib/THC/CMakeFiles/THC.dir/all] Error 2 make: [all] Error 2

Error: Build error: Failed building.

stu17682 commented 5 years ago

Hey Cole

This might help you, related to disabling the half operators (if you haven't tried it yet) --> https://github.com/torch/cutorch/issues/797 there is a patch in one of the comments.

Hope it helps!

Stuart

--

Stuart Millar

PhD Deep Learning / Cyber Security Researcher

CSIT / QUB, Belfast

smillar09@qub.ac.uk

https://www.linkedin.com/in/stuartmillar


From: Cole notifications@github.com Sent: 18 January 2019 21:12 To: torch/torch7 Cc: Subscribed Subject: [torch/torch7] Build fails on macOS 10.13 (#1189)

Hey guy, so I've been trying to get torch installed on macOS 10.13 for about 4 hours now. I've tried almost everything on the internet, yet it still fails.

I have installed CUDA 9.1 and CLT v8.3.2. I am unsure of what the error is at this point.

Here is a small snippet from the build log:

./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:127:17: warning: 'THCudaHalfTensor_get1d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get1d(THCState state, const THCudaHalfTensor tensor, long x0); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:128:17: warning: 'THCudaHalfTensor_get2d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get2d(THCState state, const THCudaHalfTensor tensor, long x0, long x1); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:129:17: warning: 'THCudaHalfTensor_get3d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get3d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:130:17: warning: 'THCudaHalfTensor_get4d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get4d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2, long x3); ^ 6 warnings generated. [ 12%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMathBlas.cu.o ./torch/extra/cutorch/lib/THC/generic/THCTensorMath.cu(393): error: more than one operator "==" matches these operands: function "operator==(const half &, const half &)" function "operator==(half, half)" operand types are: half == half

./torch/extra/cutorch/lib/THC/generic/THCTensorMath.cu(414): error: more than one operator "==" matches these operands: function "operator==(const half &, const half &)" function "operator==(half, half)" operand types are: half == half

2 errors detected in the compilation of "/var/folders/jk/htn2jsxn4c519nj2l06dtw9m0000gn/T//tmpxft_0000ebfd_00000000-11_THCTensorMath.compute_61.cpp1.ii". CMake Error at THC_generated_THCTensorMath.cu.o.cmake:267 (message): Error generating file ./torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorMath.cu.o

make[2]: [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorMath.cu.o] Error 1 make[2]: Waiting for unfinished jobs.... ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:127:17: warning: 'THCudaHalfTensor_get1d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get1d(THCState state, const THCudaHalfTensor tensor, long x0); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:128:17: warning: 'THCudaHalfTensor_get2d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get2d(THCState state, const THCudaHalfTensor tensor, long x0, long x1); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:129:17: warning: 'THCudaHalfTensor_get3d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get3d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:130:17: warning: 'THCudaHalfTensor_get4d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get4d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2, long x3); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:35:17: warning: 'THCudaHalfTensor_minall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_minall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:36:17: warning: 'THCudaHalfTensor_maxall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_maxall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:37:17: warning: 'THCudaHalfTensor_medianall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_medianall(THCState state, THCudaHalfTensor self); ^ 9 warnings generated. ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ 1 warning generated. ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ 2 warnings generated. ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:127:17: warning: 'THCudaHalfTensor_get1d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get1d(THCState state, const THCudaHalfTensor tensor, long x0); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:128:17: warning: 'THCudaHalfTensor_get2d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get2d(THCState state, const THCudaHalfTensor tensor, long x0, long x1); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:129:17: warning: 'THCudaHalfTensor_get3d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get3d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:130:17: warning: 'THCudaHalfTensor_get4d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get4d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2, long x3); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:35:17: warning: 'THCudaHalfTensor_minall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_minall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:36:17: warning: 'THCudaHalfTensor_maxall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_maxall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:37:17: warning: 'THCudaHalfTensor_medianall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_medianall(THCState state, THCudaHalfTensor self); ^ 9 warnings generated. ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka '__half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:127:17: warning: 'THCudaHalfTensor_get1d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get1d(THCState state, const THCudaHalfTensor tensor, long x0); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:128:17: warning: 'THCudaHalfTensor_get2d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get2d(THCState state, const THCudaHalfTensor tensor, long x0, long x1); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:129:17: warning: 'THCudaHalfTensor_get3d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get3d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:130:17: warning: 'THCudaHalfTensor_get4d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get4d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2, long x3); ^ 6 warnings generated. make[1]: [lib/THC/CMakeFiles/THC.dir/all] Error 2 make: [all] Error 2

Error: Build error: Failed building.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/torch/torch7/issues/1189, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AQFdsCyQnFPYowF6-VEO78iqtW-dGwyiks5vEjjVgaJpZM4aIpXa.

IronCraftMan commented 5 years ago

@stu17682 Thanks. I had done that before but I forgot to do it when I got that build log.

This is what I get now:

[ 20%] Building NVCC (Device) object lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorRandom.cu.o ./torch/extra/cutorch/lib/THC/THCTensorRandom.cuh(156): error: specified alignment (4) is different from alignment (2) specified on a previous declaration detected during instantiation of "void sampleMultinomialOnce<T,AccT>(long , long, int, T , T *) [with T=half, AccT=float]" ./torch/extra/cutorch/lib/THC/generic/THCTensorRandom.cu(169): here

./torch/extra/cutorch/lib/THC/THCTensorRandom.cuh(95): error: specified alignment (4) is different from alignment (2) specified on a previous declaration detected during instantiation of "void renormRowsL1(T *, long, long) [with T=float]" ./torch/extra/cutorch/lib/THC/generic/THCTensorRandom.cu(98): here

./torch/extra/cutorch/lib/THC/THCTensorRandom.cuh(156): error: specified alignment (4) is different from alignment (2) specified on a previous declaration detected during instantiation of "void sampleMultinomialOnce<T,AccT>(long , long, int, T , T *) [with T=float, AccT=float]" ./torch/extra/cutorch/lib/THC/generic/THCTensorRandom.cu(169): here

./torch/extra/cutorch/lib/THC/THCTensorRandom.cuh(95): error: specified alignment (8) is different from alignment (2) specified on a previous declaration detected during instantiation of "void renormRowsL1(T *, long, long) [with T=double]" ./torch/extra/cutorch/lib/THC/generic/THCTensorRandom.cu(98): here

./torch/extra/cutorch/lib/THC/THCTensorRandom.cuh(156): error: specified alignment (8) is different from alignment (2) specified on a previous declaration detected during instantiation of "void sampleMultinomialOnce<T,AccT>(long , long, int, T , T *) [with T=double, AccT=double]" ./torch/extra/cutorch/lib/THC/generic/THCTensorRandom.cu(169): here

5 errors detected in the compilation of "/var/folders/jk/htn2jsxn4c519nj2l06dtw9m0000gn/T//tmpxft_00006018_00000000-11_THCTensorRandom.compute_61.cpp1.ii". CMake Error at THC_generated_THCTensorRandom.cu.o.cmake:267 (message): Error generating file ./torch/extra/cutorch/build/lib/THC/CMakeFiles/THC.dir//./THC_generated_THCTensorRandom.cu.o

make[2]: [lib/THC/CMakeFiles/THC.dir/THC_generated_THCTensorRandom.cu.o] Error 1 make[2]: Waiting for unfinished jobs.... ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:127:17: warning: 'THCudaHalfTensor_get1d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get1d(THCState state, const THCudaHalfTensor tensor, long x0); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:128:17: warning: 'THCudaHalfTensor_get2d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get2d(THCState state, const THCudaHalfTensor tensor, long x0, long x1); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:129:17: warning: 'THCudaHalfTensor_get3d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get3d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:130:17: warning: 'THCudaHalfTensor_get4d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get4d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2, long x3); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:35:17: warning: 'THCudaHalfTensor_minall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_minall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:36:17: warning: 'THCudaHalfTensor_maxall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_maxall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:37:17: warning: 'THCudaHalfTensor_medianall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_medianall(THCState state, THCudaHalfTensor self); ^ 9 warnings generated. ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:127:17: warning: 'THCudaHalfTensor_get1d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get1d(THCState state, const THCudaHalfTensor tensor, long x0); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:128:17: warning: 'THCudaHalfTensor_get2d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get2d(THCState state, const THCudaHalfTensor tensor, long x0, long x1); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:129:17: warning: 'THCudaHalfTensor_get3d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get3d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:130:17: warning: 'THCudaHalfTensor_get4d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get4d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2, long x3); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:35:17: warning: 'THCudaHalfTensor_minall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_minall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:36:17: warning: 'THCudaHalfTensor_maxall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_maxall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:37:17: warning: 'THCudaHalfTensor_medianall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_medianall(THCState state, THCudaHalfTensor self); ^ 9 warnings generated. ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka '__half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:127:17: warning: 'THCudaHalfTensor_get1d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get1d(THCState state, const THCudaHalfTensor tensor, long x0); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:128:17: warning: 'THCudaHalfTensor_get2d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get2d(THCState state, const THCudaHalfTensor tensor, long x0, long x1); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:129:17: warning: 'THCudaHalfTensor_get3d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get3d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:130:17: warning: 'THCudaHalfTensor_get4d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get4d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2, long x3); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:35:17: warning: 'THCudaHalfTensor_minall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_minall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:36:17: warning: 'THCudaHalfTensor_maxall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_maxall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:37:17: warning: 'THCudaHalfTensor_medianall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_medianall(THCState state, THCudaHalfTensor self); ^ 9 warnings generated. ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:127:17: warning: 'THCudaHalfTensor_get1d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get1d(THCState state, const THCudaHalfTensor tensor, long x0); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:128:17: warning: 'THCudaHalfTensor_get2d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get2d(THCState state, const THCudaHalfTensor tensor, long x0, long x1); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:129:17: warning: 'THCudaHalfTensor_get3d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get3d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:130:17: warning: 'THCudaHalfTensor_get4d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get4d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2, long x3); ^ 6 warnings generated. ./torch/extra/cutorch/lib/THC/THCHalf.h:24:17: warning: 'THC_float2half' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THC_float2half(float a); ^ ./torch/extra/cutorch/lib/THC/generic/THCStorage.h:28:17: warning: 'THCudaHalfStorage_get' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfStorage_get(THCState state, const THCudaHalfStorage , ptrdiff_t); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:127:17: warning: 'THCudaHalfTensor_get1d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get1d(THCState state, const THCudaHalfTensor tensor, long x0); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:128:17: warning: 'THCudaHalfTensor_get2d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get2d(THCState state, const THCudaHalfTensor tensor, long x0, long x1); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:129:17: warning: 'THCudaHalfTensor_get3d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get3d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensor.h:130:17: warning: 'THCudaHalfTensor_get4d' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_get4d(THCState state, const THCudaHalfTensor tensor, long x0, long x1, long x2, long x3); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:35:17: warning: 'THCudaHalfTensor_minall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_minall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:36:17: warning: 'THCudaHalfTensor_maxall' has C-linkage specified, but returns user-defined type 'half' (aka 'half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_maxall(THCState state, THCudaHalfTensor self); ^ ./torch/extra/cutorch/lib/THC/generic/THCTensorMathReduce.h:37:17: warning: 'THCudaHalfTensor_medianall' has C-linkage specified, but returns user-defined type 'half' (aka '__half') which is incompatible with C [-Wreturn-type-c-linkage] extern "C" half THCudaHalfTensor_medianall(THCState state, THCudaHalfTensor self); ^ 9 warnings generated. make[1]: [lib/THC/CMakeFiles/THC.dir/all] Error 2 make: [all] Error 2

Error: Build error: Failed building.

mushoo commented 5 years ago

Having this exact same issue (I've tried CUDA 10, and CUDA 9. I've tried clang 9.1, 8.0, and 7.1.something, and I've tried with and without half operators) still getting errors when trying to compile cutorch. I've given up for now.