PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

IPA with C program/libraries and fortran library

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



Joined: 01 Dec 2005
Posts: 76

PostPosted: Wed Feb 01, 2006 2:21 pm    Post subject: IPA with C program/libraries and fortran library Reply with quote

I'm trying to link a C program against some C and fortran libraries and am runnning into this problem:

IPA fatal error: function '_free' multiply defined in: ../src/pgf90rtl.c
IPA fatal error: function '_free' multiply defined in: ../src/libc.c
IPA fatal error: function '_malloc' multiply defined in: ../src/pgf90rtl.c
IPA fatal error: function '_malloc' multiply defined in: ../src/libc.c
IPA inhibited: multiply defined routines


I can't seem to reproduce it in a minimal way, so here is my link statement.

pgcc -IZ:/ISLtools_v1.2/i686-pc-winnt-gnu/include -I../../../src/scats -I../../../src/scats/libscatsio -I../../../src/scats/libscats -Ic:/cygwin/usr/local/include -Ic:/cygwin/usr/local/include -fastsse -O3 -Mipa=fast -Mvect=sse -s -m32 -DZ_PREFIX -o CellScatter.exe CellScatter.o -Lc:/PROGRA~1/PGI/nt86/6.0/mingw/lib -Lc:/PROGRA~1/PGI/nt86/6.0/mingw/mingw32/lib -Lc:/PROGRA~1/PGI/nt86/6.0/mingw/lib/gcc-lib/mingw32/2.95.3-5 -Lc:/PROGRA~1/PGI/nt86/6.0/lib -lpgmm1 -lpgmm2 -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lpgsse1 -lpgsse2 -lpgc -lmingw32 -lmoldname -lmsvcrt -luser32 -ladvapi32 -lshell32 -lkernel32 ../libscats/.libs/libscats.lib ../libseke/.libs/libseke.lib ../libscatsio/.libs/libscatsio.lib -LZ:/ISLtools_v1.2/i686-pc-winnt-gnu/lib Z:/ISLtools_v1.2/i686-pc-winnt-gnu/lib/libisl.lib -Lc:/cygwin/usr/local/lib -lvsip -lmatio -lz -lmingwex


I get the same error if i remove the explicit linking against the fortran libraries and replace it with -pgf90libs and I get fortran undefined symbols obviously if I don't use either method.

Stumped,
Chris
Back to top
View user's profile
mkcolg



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

PostPosted: Wed Feb 01, 2006 2:54 pm    Post subject: Reply with quote

Hi Chris,

I'll need to do a bit of investigation since off hand I don't know why this would occur. Let's try some things to at least get your program to link.

1) Try linking with "pgf90 -Mnomain" instead of "pgcc". Also remove all the "-lpg*" libraries.

2) Since the errors are from pgipa, remove "-Mipa=fast" and re-link.

- Mat
Back to top
View user's profile
Christopher Hulbert



Joined: 01 Dec 2005
Posts: 76

PostPosted: Thu Feb 02, 2006 7:26 am    Post subject: Reply with quote

Part 2 works fine. Then again I think it just skips IPA and continues linking anyways.

pgf90 with -Mnomain gives the same error

pgf90 -Mnomain -IZ:/ISLtools_v1.2/i686-pc-winnt-gnu/include -I../../../src/scats -I../../../src/scats/libscatsio -I../../../src/scats/libscats -Ic:/cygwin/usr/local/include -Ic:/cygwin/usr/local/include -fastsse -O3 -Mipa=fast -Mvect=sse -s -m32 -DZ_PREFIX -o CellScatter.exe CellScatter.o -lmoldname ../libscats/.libs/libscats.lib ../libseke/.libs/libseke.lib ../libscatsio/.libs/libscatsio.lib -LZ:/ISLtools_v1.2/i686-pc-winnt-gnu/lib Z:/ISLtools_v1.2/i686-pc-winnt-gnu/lib/libisl.lib -Lc:/cygwin/usr/local/lib -lvsip -lmatio -lz -lmingwex

c:\PROGRA~1\PGI/nt86/6.0/bin/ld.exe c:\PROGRA~1\PGI/nt86/6.0/mingw/lib/crt2.o c:\PROGRA~1\PGI/nt86/6.0/lib/pgstdinit-msv.o c:\PROGRA~1\PGI/nt86/6.0/lib/pgimainxx.o CellScatter.o ../libscats/.libs/libscats.lib ../libseke/.libs/libseke.lib ../libscatsio/.libs/libscatsio.lib Z:/ISLtools_v1.2/i686-pc-winnt-gnu/lib/libisl.lib -s -o CellScatter.exe -LZ:/ISLtools_v1.2/i686-pc-winnt-gnu/lib -Lc:/cygwin/usr/local/lib -Lc:\PROGRA~1\PGI/nt86/6.0/mingw/lib -Lc:\PROGRA~1\PGI/nt86/6.0/mingw/mingw32/lib -Lc:\PROGRA~1\PGI/nt86/6.0/mingw/lib/gcc-lib/mingw32/2.95.3-5 -Lc:\PROGRA~1\PGI/nt86/6.0/lib -lvsip -lmatio -lz -lmingwex -lpgmm1 -lpgmm2 -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lpgsse1 -lpgsse2 -lpgc -lmingw32 -lgcc -lmoldname -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32
IPA fatal error: function '_free' multiply defined in: ../src/pgf90rtl.c
IPA fatal error: function '_free' multiply defined in: ../src/libc.c
IPA fatal error: function '_malloc' multiply defined in: ../src/pgf90rtl.c
IPA fatal error: function '_malloc' multiply defined in: ../src/libc.c
IPA inhibited: multiply defined routines
pgf90-Warning-Unknown switch: -m32

c:\PROGRA~1\PGI/nt86/6.0/bin/pgipa.EXE -v -finalo CellScatter.exe -ignore '-Mextract -L -I -Mkeepasm -Mpreprocess -l -Minline' -nop -cp -const -align -const -range -globals -div -trans -arg -arglocal -ptr -f90ptr -shape -lm -lc c:\PROGRA~1\PGI/nt86/6.0/bin/ld.exe c:\PROGRA~1\PGI/nt86/6.0/mingw/lib/crt2.o c:\PROGRA~1\PGI/nt86/6.0/lib/pgstdinit-msv.o c:\PROGRA~1\PGI/nt86/6.0/lib/pgimainxx.o CellScatter.o ../libscats/.libs/libscats.lib ../libseke/.libs/libseke.lib ../libscatsio/.libs/libscatsio.lib Z:/ISLtools_v1.2/i686-pc-winnt-gnu/lib/libisl.lib -s -o CellScatter.exe -LZ:/ISLtools_v1.2/i686-pc-winnt-gnu/lib -Lc:/cygwin/usr/local/lib -Lc:\PROGRA~1\PGI/nt86/6.0/mingw/lib -Lc:\PROGRA~1\PGI/nt86/6.0/mingw/mingw32/lib -Lc:\PROGRA~1\PGI/nt86/6.0/mingw/lib/gcc-lib/mingw32/2.95.3-5 -Lc:\PROGRA~1\PGI/nt86/6.0/lib -lvsip -lmatio -lz -lmingwex -lpgmm1 -lpgmm2 -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl -lpgsse1 -lpgsse2 -lpgc -lmingw32 -lgcc -lmoldname -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32
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