antonmks / Alenka

GPU database engine
Other
1.17k stars 120 forks source link

cannot compile on debian wheezy #44

Closed vlebedev closed 10 years ago

vlebedev commented 10 years ago

Compilation of Alenka fails under Linux:

$ make
/usr/local/cuda/bin/nvcc --machine 64 -O3 -arch=sm_20 -c bison.cu
In file included from bison.y:20:0:
cm.h:50:18: fatal error: itoa.h: No such file or directory
compilation terminated.
make: *** [bison.o] Error 1```

I've commented out #include "itoa.h"line in cm.h, in this case compilation also fails:

[...]
bison.y(529): error: explicit type is missing ("int" assumed)

bison.y(529): error: no suitable conversion function from "std::_Rb_tree_const_iterator<std::string>" to "int" exists

bison.y(529): error: no operator "!=" matches these operands
        operand types are: int != std::_Rb_tree_const_iterator<std::string>

bison.y(530): error: operand of "*" must be a pointer

[...]
35 errors detected in the compilation of "/tmp/tmpxft_00002ae3_00000000-6_bison.cpp1.ii".
make: *** [bison.o] Error 2

Here is my environment:

$ uname -a
Linux crunchbang 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1+deb7u1 x86_64 GNU/Linux

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2013 NVIDIA Corporation
Built on Wed_Jul_17_18:36:13_PDT_2013
Cuda compilation tools, release 5.5, V5.5.0

$ g++ --version
g++ (Debian 4.7.2-5) 4.7.2
antonmks commented 10 years ago

Thanks, I fixed missing itoa.h reference. Now, for g++ you need to add std=c++11 so g++ can understand auto keyword. I do not test on a Linux box, but I think if you change Makefile line nvcc = /usr/local/cuda/bin/nvcc --machine 64 -O3 -arch=sm_20 -c to nvcc = /usr/local/cuda/bin/nvcc --compiler-options std=c++11 --machine 64 -O3 -arch=sm_20 -c then I think it should work.

Please let me know if it works.

vlebedev commented 10 years ago

No, it did not work:

/usr/local/cuda/bin/nvcc --compiler-options -std=c++11 --machine 64 -O3 -arch=sm_20 -c bison.cu
/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h(177): error: identifier "nullptr" is undefined

/usr/include/c++/4.7/x86_64-linux-gnu/bits/c++config.h(177): error: expected a ";"

/usr/include/c++/4.7/exception(65): error: expected a ";"

[...]

/usr/include/c++/4.7/bits/cpp_type_traits.h(315): error: expected a ">"

Segmentation fault
make: *** [bison.o] Error 139
antonmks commented 10 years ago

Looks like CUDA doesn't support certain C++ 11 features in gcc : http://stackoverflow.com/questions/12073828/c-version-supported-by-cuda-5-0 So I removed C++ 11 features from the alenka source code.

Let me know if it works for you now.

vlebedev commented 10 years ago

Sorry, but there are still compilation errors:

bison.y(1092): error: namespace "std" has no member "to_string"

bison.y(1108): error: namespace "std" has no member "to_string"

bison.y(2344): error: namespace "std" has no member "to_string"

3 errors detected in the compilation of "/tmp/tmpxft_000042e3_00000000-6_bison.cpp1.ii".
make: *** [bison.o] Error 2
antonmks commented 10 years ago

Can you try compiling it with --compiler-options std=c++11 ?