PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

CUDA-x86.

PGI Workstation x86_64 Interix/SUA - beginners questions
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Licenses and Installation
View previous topic :: View next topic  
Author Message
jerker_back



Joined: 30 Aug 2007
Posts: 10
Location: Sweden

PostPosted: Wed Sep 05, 2007 2:59 pm    Post subject: Reply with quote

Hi Mat
Quote:
modifying system include files is generally not a good idea

No, but with Interix headers there are some issues, especially with the MS compiler and LP64. You cannot use the original headers in x64 without a compiler with LP64 support. cc and l2ll - OK, but not in VS. There are a few bugs, discovered in SUA 5.2, still appears in the Longhorn beta.
Code:
$ ./a.out
123123123

You're right, there must be a conflict somewhere in the headers. I look into that again. pgcc have ANSI C as standard, right? I was thinking if a switch like -c89/-c99 was needed.
Quote:
Where you trying to use the generated objects in a DLL? If so, then this is not yet supported for 64-bit SUA. You may consider using the PGI Windows compilers which do support DLL creation.

No, just a first simple testprogram. You must be able to recreate it with a fresh pgcc installation. The only thing I changed was the PSDK directory to my VS installation (which contains newer versions of the tools). It all depends on how the PGI libraries was linked. I only tested the x64 version, I doubt there is a problem in 32bit.
Quote:
The 32-bit SUA/SFU compilers will use a GNU-style linker while the 64-bit SUA compilers will use MS link.

That sounds great and very interesting if you manage to get shared library support.
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Sep 05, 2007 3:32 pm    Post subject: Reply with quote

Hi Jerker,

Quote:
pgcc have ANSI C as standard, right? I was thinking if a switch like -c89/-c99 was needed.
By default the PGI C compilers use C99. To use C89 use "-c89".

Would it be possible for you to write-up a report and sample code about the ADDR32 error you're seeing and send it to PGI customer support at trs@pgroup.com? I'd like to have an engineer look at it.

Thanks,
Mat
Back to top
View user's profile
jerker_back



Joined: 30 Aug 2007
Posts: 10
Location: Sweden

PostPosted: Thu Sep 06, 2007 3:21 am    Post subject: Reply with quote

Quote:
write-up a report and sample code about the ADDR32 error you're seeing

OK, I post it here as well.
Code:
// test_longtype.c
extern int __cdecl printf (const char *, ...);

int __cdecl main(void)
{
    int size = sizeof(int);
    printf("size of int is %u\n", size);
    size = sizeof(long);
    printf("size of long is %u\n", size);

    return 0;
}

Code:
$ pgcc -O1 -o test_longtype test_longtype.c
libpgc.a(stkchk.o) : error LNK2017: 'ADDR32' relocation to '.data' invalid without /LARGEADDRESSAWARE:NO
...
libpgc.a(trace_interix.o) : error LNK2017: 'ADDR32' relocation to '.data' invalid without /LARGEADDRESSAWARE:NO
LINK : fatal error LNK1165: link failed because of fixup errors

My fix:
ldrc(121) /subsystem:$SUBSYS ... /largeaddressaware:no /machine:$MACHINE[/quote]
Back to top
View user's profile
jerker_back



Joined: 30 Aug 2007
Posts: 10
Location: Sweden

PostPosted: Thu Sep 06, 2007 6:57 am    Post subject: Reply with quote

Here is autoconf(2.61) test for uid_t taken from GNU make 3.81
config.log
Code:
configure:8296: checking for uid_t in sys/types.h
pgcc-Fatal-/opt/pgi/sua64/7.0-6/bin/pgc TERMINATED by signal 13
Arguments to /opt/pgi/sua64/7.0-6/bin/pgc
/opt/pgi/sua64/7.0-6/bin/pgc conftest.c -opt 1 -terse 1 -inform warn -x 59 4 -x 19 0x400000 -x 119 0x40E10400 -x 59 4 -x 70 0x8000 -x 122 1 -x 122 0x40 -x 123 0x1000 -x 127 20 -tp p7-64 -y 80 0x4000000 -x 119 0x8000000 -astype 0 -stdinc /opt/pgi/sua64/7.0-6/include:/usr/local/include:/include:/usr/include -def lp64 -def unix -def __unix -def __unix__ -def __INTERIX -def _POSIX_ -def _ALL_SOURCE -def _REENTRANT -def MT -def __inline__= -def __x86_64__ -def _M_AMD64 -def __NO_MATH_INLINES -def __amd64__ -def __extension__= -def __SSE__ -def __MMX__ -def __SSE2__ -def __SSE3__ -predicate '#machine(x86_64) #lint(off) #system(unix) #system(posix) #cpu(x86_64)' -def _CTYPE_DISABLE_MACROS -cmdline '+pgcc conftest.c -E -O1 -D_CTYPE_DISABLE_MACROS' -x 123 4 -x 123 0x80000000 -alwaysinline /opt/pgi/sua64/7.0-6/lib/libintrinsics.il 4 -es -pp
configure:8319: result: no

The warnings occur when there are duplicate typedefs. This will generate them:
Code:
#include <sys/types.h>
#include <inttypes.h>
int __cdecl main(void)
{
    return 0;
}
Code:
typedef int a;
typedef int a;
int __cdecl main(void)
{
    return 0;
}
It seems there are 2 separate problems. pgcc choke on uid_t for some reason and appear to hate when a typedef occur twice.
Back to top
View user's profile
jerker_back



Joined: 30 Aug 2007
Posts: 10
Location: Sweden

PostPosted: Thu Sep 06, 2007 1:29 pm    Post subject: Reply with quote

autoconf tests that terminate with "TERMINATED by signal 13" I discovered so far. As I understand the tests are aborted before completed resulting in wrong configuration.
    AC_AIX - checking for AIX
    AC_HEADER_STDC - checking for ANSI C header files
    AC_TYPE_UID_T - checking for uid_t in sys/types.h
    AC_FUNC_GETLOADAVG
    AC_CACHE_VAL
    AC_EGREP_CPP
exactly why is beyond me. Some of these may fail due to other macros.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Licenses and Installation All times are GMT - 7 Hours
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
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