PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

compile error : in step for using simple sprintf function

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
970980hs



Joined: 01 Jan 2014
Posts: 10

PostPosted: Fri Feb 07, 2014 3:48 pm    Post subject: compile error : in step for using simple sprintf function Reply with quote

Hi~

I'm struggling with compiling ngspice code using pgcc.
For previous problem 'static linking', I've finally solved with your help :)
The next thing is as follows.

In some routine, there are simple function like that,

long
np_round(double x)
/* using <math.h>, it would be simpler: floor(x+0.5), see below */
{
double u;
long z;
int n;

SPICE_DSTRING s;

spice_dstring_init(&s);
u = 2e9;

if (x > u)
x = u;
else if (x < -u)
x = -u;

n = sprintf(s, "%-12.0f", x);
s[n] = 0;
sscanf(s, "%ld", &z);

return z;
}

During compiling above code, some errors are happen with below messages:





/opt/pgi/linux86-64/12.8/bin/pgc ../../../../src/frontend/numparam/mystring.c -opt 2 -x 119 0xa10000 -x 122 0x40 -x 123 0x1000 -x 127 4 -x 127 17 -x 19 0x400000 -x 28 0x40000 -x 120 0x10000000 -x 70 0x8000 -x 122 1 -x 125 0x20000 -quad -x 59 4 -x 59 4 -tp sandybridge -x 120 0x1000 -astype 0 -stdinc /opt/pgi/linux86-64/12.8/include:/usr/local/include:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include:/usr/lib/gcc/x86_64-redhat-linux/4.4.7/include:/usr/include -def unix -def __unix -def __unix__ -def linux -def __linux -def __linux__ -def __NO_MATH_INLINES -def __x86_64 -def __x86_64__ -def __LONG_MAX__=9223372036854775807L -def '__SIZE_TYPE__=unsigned long int' -def '__PTRDIFF_TYPE__=long int' -def __THROW= -def __extension__= -def __amd_64__amd64__ -def __k8 -def __k8__ -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -def __SSSE3__ -predicate '#machine(x86_64) #lint(off) #system(posix) #cpu(x86_64)' -idir . -idir ../../../../src/frontend/numparam -idir ../../../src/include -idir ../../../../src/include -def HAVE_CONFIG_H -cmdline '+pgcc ../../../../src/frontend/numparam/mystring.c -DHAVE_CONFIG_H -I. -I../../../../src/frontend/numparam -I../../../src/include -I../../../../src/include -O2 -v -mp -c' -x 123 0x80000000 -x 123 4 -x 119 0x20 -def __pgnu_vsn=40407 -alwaysinline /opt/pgi/linux86-64/12.8/lib/libintrinsics.il 4 -x 120 0x200000 -mp -x 69 0x200 -x 69 0x400 -asm /tmp/pgccrcddZL2QQFmD.s
PGC-I-0222-Redundant definition for symbol __THROW (/usr/include/sys/cdefs.h: 63)
PGC-I-0222-Redundant definition for symbol __extension__ (/usr/include/sys/cdefs.h: 339)
PGC-I-0222-Redundant definition for symbol HAVE_SIGSETJMP (../../../src/include/ngspice/config.h: 281)
PGC-I-0222-Redundant definition for symbol HAVE_SIGSETJMP (../../../src/include/ngspice/config.h: 281)
PGC-I-0145-Syntax requires no comma, comma deleted (../../../../src/include/ngspice/miftypes.h: 78)
PGC-I-0145-Syntax requires no comma, comma deleted (../../../../src/include/ngspice/miftypes.h: 90)
PGC-I-0145-Syntax requires no comma, comma deleted (../../../../src/include/ngspice/miftypes.h: 110)
PGC-I-0145-Syntax requires no comma, comma deleted (../../../../src/include/ngspice/miftypes.h: 122)
PGC-I-0145-Syntax requires no comma, comma deleted (../../../../src/include/ngspice/miftypes.h: 138)
PGC-I-0145-Syntax requires no comma, comma deleted (../../../../src/include/ngspice/miftypes.h: 158)
PGC-I-0145-Syntax requires no comma, comma deleted (../../../../src/include/ngspice/miftypes.h: 172)
PGC-S-0094-Illegal type conversion required (../../../../src/frontend/numparam/mystring.c: 613)
PGC-S-0054-Subscript operator ([]) applied to non-array (../../../../src/frontend/numparam/mystring.c: 614)
PGC-S-0094-Illegal type conversion required (../../../../src/frontend/numparam/mystring.c: 615)

PGC/x86-64 Linux 12.8-1: compilation completed with severe errors
pgcc-Fatal-ccompile completed with exit code 1

Could you please let know what is the problem? TT
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 5952
Location: The Portland Group Inc.

PostPosted: Fri Feb 07, 2014 4:22 pm    Post subject: Reply with quote

Hi TT,

Quote:
For previous problem 'static linking', I've finally solved with your help :)
So you were trying to statically link the pthreads library? What you can do is use "-Bstatic_pgi" in which case the PGI runtime will be statically linked but not the system libraries.


What is the definition of "SPICE_DSTRING"? It's being used like a "char *" but the error indicates that it's something else.

- Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group