LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 06-27-2012, 12:38 AM   #1
henrysimon
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Rep: Reputation: Disabled
Compilation of C++ code with Purify


Hi Team,

I am compiling my C++ code with purify(7.0) in Solaris to find the memory leaks.

using make purify command,
It created the object files and purify object file both sucessfully, say for tcpclient.cc
tcpclient.o
tcpclient_pure_p9_c0_104192125_32.o

but later it gives linking error:

ld: warning: file /udir/Rational/releases/purify.sol.7.0/cache//omcws06/lib/libdl.so.1_pure_p3_c0_104192125_510_32: attempted multiple inclusion of file

I don't know why this linking error is coming.

Please help me in resolving this issue.

Thanks,
Henry
 
Old 06-27-2012, 12:46 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
I think your cache contains mixed files. It means you have already used purify for another app with the same cache and something "strange" left in it. Try to remove everything from the cache and rebuild again. (you gave a very limited information, so probably my tip won't help, but otherwise you will need to give more info: what is the makefile, how do you build your app, what are the purify flags you set... )
 
Old 06-27-2012, 03:43 AM   #3
henrysimon
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hi Pan,

Can you please tell me which cache you are talking about and how to clear that.

The Makefile has the following entry for purify:
purify::
$(VB2)purify_homedir=`$(PURIFY) -printhomedir`; \
if [ $$? != 0 ]; then $(ECHO) "ERROR : can't find $(PURIFY) in your path."; exit 1; fi; \
$(ECHO) "Using `$(PURIFY) -version` from $$purify_homedir"; \
$(MAKE) CXX="$(PURIFY) $(PURIFY_FLAGS) $(CXX)" CC="$(PURIFY) $(PURIFY_FLAGS) $(CC)" ALL_DEFINES="$(ALL_DEFINES) -I$$purify_homedir -DPURIFY_ON" PURIFY_LIBS="$$purify_homedir/purify_stubs.a"


Thanks,
Henry
 
Old 06-27-2012, 03:47 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
this dir is a cache wich is used by purify: /udir/Rational/releases/purify.sol.7.0/cache. You can either move/remove the content or define another emtpy directory instead. Also I would like to know those PURIFY_FLAGS
 
Old 06-27-2012, 04:49 AM   #5
henrysimon
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hi,

I deleted the contents from /udir/Rational/releases/purify.sol.7.0/cache directory, but still " attempted multiple inclusion of file " error comes.


I am not able to get the entry for PURIFY_FLAGS in Makefile.

It is kept as blank.
PURIFY_FLAGS =

Thanks,
Henry
 
Old 06-27-2012, 05:38 AM   #6
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,039

Rep: Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347Reputation: 7347
run your build process with -v (so add -v flag to the command line) and copy the output here
 
Old 06-28-2012, 12:39 AM   #7
henrysimon
LQ Newbie
 
Registered: Jun 2012
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hi,

I have finally found the fix for this issue.

find . |xargs grep -il "libdl.so"

here more then 1 Makefile has this .so, so delete the .so entry from the not required Makefile and linking error will be gone.

Thanks,
Henry Sailash Simon

P.S : Issue is solved.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Switches controlling the code compilation -- How to kk2202 Programming 1 08-28-2009 10:18 AM
purify issue on sparc64 dayalan_cse Solaris / OpenSolaris 1 12-03-2007 09:05 AM
purify learnmode_2007 Linux - Newbie 1 10-23-2007 09:08 AM
Purify: MSE: memory segment error Louka Linux - Software 0 11-28-2005 04:14 PM
compilation error - code 2 jhon Programming 2 08-31-2004 01:54 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 04:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration