(newbie) nvcc stops with "Parsing error near 'LL': syntax error"

When compiling a cuda file (.cu) the nvcc compiler stops compilation with the error message:

ptxas axial.xn08.ptx, line 65; fatal   : Parsing error near 'LL': syntax error

ptxas fatal   : Ptx assembly aborted due to errors

make: *** [libcu/axial.xn08.o] Error 255

The relevant c code is (the type integer is defined as ‘long int’):

/* Table of constant values */

__device__  integer c__9 = 9;

__device__  integer c__1 = 1;

__device__  integer c__3 = 3;

(within the file scope, i.e. not part of a function). BTW: the weird variable names stem from a fortran to c translation by f2c.

This gets translated into a ptx file of which the corresponding part is:

.global .s64 c__9 = 9LL;

	.global .s64 c__1 = 1;

	.global .s64 c__3 = 3LL;

I wondered where the ‘LL’ came from…

The parts of the (intermediate) file containing the relevant parts of the preprocessed files are:


/* Table of constant values */

__attribute__((__device__)) integer c__9 = 9;

__attribute__((__device__)) integer c__1 = 1;

__attribute__((__device__)) integer c__3 = 3;

and of axial.xn08.cpp2.i:

# 81 "libcu/axial.xn08.cu"

 __attribute__((__device__)) integer c__9 = 9L;

# 82 "libcu/axial.xn08.cu"

 __attribute__((__device__)) integer c__1 = 1L;

# 83 "libcu/axial.xn08.cu"

 __attribute__((__device__)) integer c__3 = 3L;

and of axial.xno8.cpp3

# 81 "libcu/axial.xn08.cu"

static __attribute__((__used__)) __attribute__((__device__)) integer c__9 = 9L;

# 82 "libcu/axial.xn08.cu"

static __attribute__((__used__)) __attribute__((__device__)) integer c__1 = 1L;

# 83 "libcu/axial.xn08.cu"

static __attribute__((__used__)) __attribute__((__device__)) integer c__3 = 3L;

It seems that nvcc adds an additional ‘L’ twice.

Anybody knows how to solve this or indicate what I am doing wrong?

My system is:

ubuntu 8.10,

cuda 2.1

nvidia driver version 180.22

graphics card: 9800 GT

gcc version 4.3.2

pieter@ubuntu:~/work/xnprogs.08.cuda$ /usr/local/cuda/bin/nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver

Copyright (c) 2005-2007 NVIDIA Corporation

Built on Wed_Dec__3_16:25:17_PST_2008

Cuda compilation tools, release 2.1, V0.2.1221

thanks, pieter