antonmks/Alenka

Compile Error

Closed this issue · 4 comments

Hi,

I'm getting compilation errors. I've played around with various flags (e.g. -std=c++11), but I keep getting a lot of errors. I'd greatly appreciate if you could shed some light. My system info following the make output:

uname -a
Linux localhost.localdomain 3.16.3-200.fc20.x86_64 #1 SMP Wed Sep 17 22:34:21 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2013 NVIDIA Corporation
Built on Thu_Mar_13_11:58:58_PDT_2014
Cuda compilation tools, release 6.0, V6.0.1

gcc --version
gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-7)
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


make
nvcc --machine 64 -O3 -arch=sm_20 -D UNROLL_COUNT=40 -c -I moderngpu/include/ bison.cu
fl.l(39): warning: statement is unreachable

fl.l(40): warning: statement is unreachable

fl.l(41): warning: statement is unreachable
(snip... one warning for each line from line 39 to line 127)
fl.l(127): warning: statement is unreachable

lex.yy.c(878): warning: label "find_rule" was declared but never referenced

lex.yy.c(1747): warning: statement is unreachable

bison.y(353): error: identifier "nullptr" is undefined

bison.y(361): error: explicit type is missing ("int" assumed)

bison.y(361): error: no suitable conversion function from "std::_Rb_tree_iterator<std::pair<const std::string, std::map<std::string, col_data, std::lessstd::string, std::allocator<std::pair<const std::string, col_data>>>>>" to "int" exists

bison.y(361): error: no operator "!=" matches these operands
operand types are: int != std::_Rb_tree_iterator<std::pair<const std::string, std::map<std::string, col_data, std::lessstd::string, std::allocator<std::pair<const std::string, col_data>>>>>

bison.y(362): error: explicit type is missing ("int" assumed)

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

bison.y(363): error: explicit type is missing ("int" assumed)

bison.y(363): error: no suitable conversion function from "std::queue<std::string, std::deque<std::string, std::allocatorstd::string>>" to "int" exists

bison.y(364): error: expression must have class type

bison.y(365): error: expression must have class type

bison.y(365): error: expression must have class type

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

bison.y(366): error: expression must have class type

bison.y(368): error: expression must have class type

bison.y(595): error: explicit type is missing ("int" assumed)

bison.y(650): error: explicit type is missing ("int" assumed)

bison.y(650): error: no suitable conversion function from "std::_Rb_tree_const_iteratorstd::string" to "int" exists

bison.y(650): error: no operator "!=" matches these operands
operand types are: int != std::_Rb_tree_const_iteratorstd::string

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

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

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

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

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

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

bison.y(654): error: no instance of function template "apply_permutation" matches the argument list
argument types are: (, unsigned int *, size_t, int_type *)

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

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

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

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

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

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

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

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

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

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

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

bison.y(662): error: no instance of function template "apply_permutation" matches the argument list
argument types are: (, unsigned int *, size_t, float_type *)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

bison.y(676): error: no instance of function template "apply_permutation" matches the argument list
argument types are: (, unsigned int *, size_t, int_type *)

bison.y(684): error: explicit type is missing ("int" assumed)

bison.y(684): error: no suitable conversion function from "std::_Rb_tree_const_iteratorstd::string" to "int" exists

bison.y(684): error: no operator "!=" matches these operands
operand types are: int != std::_Rb_tree_const_iteratorstd::string

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

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

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

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

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

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

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

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

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

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

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

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

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

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

bison.y(722): error: explicit type is missing ("int" assumed)

bison.y(722): error: no suitable conversion function from "std::_Rb_tree_const_iteratorstd::string" to "int" exists

bison.y(722): error: no operator "!=" matches these operands
operand types are: int != std::_Rb_tree_const_iteratorstd::string

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

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

bison.y(724): error: no instance of function template "apply_permutation" matches the argument list
argument types are: (, unsigned int *, size_t, int_type *)

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

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

bison.y(727): error: no instance of function template "apply_permutation" matches the argument list
argument types are: (, unsigned int *, size_t, float_type *)

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

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

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

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

bison.y(732): error: no instance of function template "apply_permutation" matches the argument list
argument types are: (, unsigned int *, size_t, int_type *)

bison.y(743): error: explicit type is missing ("int" assumed)

bison.y(743): error: no suitable conversion function from "std::queue<std::string, std::deque<std::string, std::allocatorstd::string>>" to "int" exists

bison.y(745): error: explicit type is missing ("int" assumed)

bison.y(746): error: expression must have class type

bison.y(747): error: expression must have class type

bison.y(752): error: expression must have class type

bison.y(753): error: expression must have class type

bison.y(754): error: expression must have class type

bison.y(755): error: expression must have class type

bison.y(782): error: explicit type is missing ("int" assumed)

bison.y(790): error: explicit type is missing ("int" assumed)

Error limit reached.
100 errors detected in the compilation of "/tmp/tmpxft_00001a4b_00000000-6_bison.cpp1.ii".
Compilation terminated.
make: *** [bison.o] Error 4


Please let me know if any other info would be of help in diagnosing the problem. Thanks a lot! :-)

You need to upgrade to CUDA 6.5, this should resolve your problems.

@kgdad, thanks for such quick reply! Unfortunately, that didn't solve the problem. I get the same warnings and errors.

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2014 NVIDIA Corporation
Built on Thu_Jul_17_21:41:27_CDT_2014
Cuda compilation tools, release 6.5, V6.5.12

Any ideas as to what else I could try? Thanks!

Looks like c++11 support isn't enabled. Try adding this flag to the Makefile: "-std=c++11". So the CFLAGS section will look like this:
CFLAGS=--machine 64 -O3 -arch=sm_20 -std=c++11 -D UNROLL_COUNT=40

Thanks! I'd forgotten to add that back after updating CUDA. I got a few errors from moderngpu that were easy fixes; but in case it helps somebody else out:

moderngpu-master/include/kernels/../device/../util/mgpucontext.h:3:23: fatal error: util/util.h: No such file or directory
#include "util/util.h"

moderngpu-master/include/kernels/../device/../util/mgpualloc.h:4:23: fatal error: util/util.h: No such file or directory
#include "util/util.h"

So, I changed "util/util.h" and "util/format.h" in moderngpu/include/util/mgpucontext.h and .../mgpualloc.h to
#include "util.h"
#include "format.h"

The compilation just finished without any errors. Time to have fun!! :-) Thanks again.