[Insight-developers] vnl and borland compiler

Miller, James V (Research) millerjv@crd.ge.com
Thu, 3 Oct 2002 16:59:39 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C26B1F.7A73A1F2
Content-Type: text/plain;
	charset="iso-8859-1"

Strange.... The following code works on Borland when compiled as a standalone program
 
#include <iostream>
#include <vector>
 
int main()
{
  std::cout << "f1" << std::endl;
  std::vector<double> f1;
  std::cout << "f2" << std::endl;
  std::vector<double> f2(f1);
  std::cout << "end" << std::endl;
 
  return 0;
}

But when this code is used within vnlTests.exe it crashes.  Must still have come sort of conflict
with vcl.
 
 

-----Original Message-----
From: Miller, James V (Research) 
Sent: Thursday, October 03, 2002 3:31 PM
To: Insight-developers (E-mail)
Subject: [Insight-developers] vnl and borland compiler


I have made progress on getting all the vnl tests to pass using the Borland compiler.
The SVD tests and eigenvector tests all pass now.
 
I have two remaining issues.  One in test_rnpoly_roots and one in test_sparse_matrix.
 
The sparse matrix test is particularly troubling.  For following code crashes when executed
 
  std::vector<double> f1;
  std::vector<double> f2(f1);

Basically f2's copy constructor is called with an empty vector, f1. f2 tries to allocate
0 bytes and copy the contents of f1 to f2. I believe allocating 0 bytes is causing the crash.
 
vnl_sparse_matrix is implemented as a std::vector<std::vector<somePairType> >. The
default initializer for the "outer" vector constructs an std::vector<somePairType> which
is empty and "copies" that empty vector into all of its elements.
 
Reading through the newsgroups, it looks as though other people have had this problem
with the Borland compiler and have been able to apply a patch from Borland. The patches
I have found for the "free command line tools" have not addressed this problem. I am 
guessing that the patches people are applying are for the full commercial product.
 
Just wanted to keep people up to date.  If anyone has any ideas....
 
 

Jim Miller 
_____________________________________
Visualization & Computer Vision
GE Research
Bldg. KW, Room C218B
P.O. Box 8, Schenectady NY 12301

millerjv@research.ge.com <mailto:millerjv@research.ge.com> 

james.miller@research.ge.com
(518) 387-4005, Dial Comm: 8*833-4005, 
Cell: (518) 505-7065, Fax: (518) 387-6981 

 

 


------_=_NextPart_001_01C26B1F.7A73A1F2
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns:o = "urn:schemas-microsoft-com:office:office"><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2715.400" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=338115720-03102002><FONT color=#0000ff size=2>Strange.... The 
following code works on Borland when compiled as a standalone 
program</FONT></SPAN></DIV>
<DIV><SPAN class=338115720-03102002><FONT color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=338115720-03102002><FONT color=#0000ff size=2>#include 
&lt;iostream&gt;<BR>#include &lt;vector&gt;</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=338115720-03102002><FONT color=#0000ff size=2>int 
main()<BR>{<BR>&nbsp; std::cout &lt;&lt; "f1" &lt;&lt; std::endl;<BR>&nbsp; 
std::vector&lt;double&gt; f1;<BR>&nbsp; std::cout &lt;&lt; "f2" &lt;&lt; 
std::endl;<BR>&nbsp; std::vector&lt;double&gt; f2(f1);<BR>&nbsp; std::cout 
&lt;&lt; "end" &lt;&lt; std::endl;</FONT></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=338115720-03102002><FONT color=#0000ff size=2>&nbsp; return 
0;<BR>}<BR></FONT></SPAN></DIV>
<DIV><SPAN class=338115720-03102002><FONT color=#0000ff size=2>But when this 
code is used within vnlTests.exe it crashes.&nbsp; Must still have come sort of 
conflict</FONT></SPAN></DIV>
<DIV><SPAN class=338115720-03102002><FONT color=#0000ff size=2>with 
vcl.</FONT></SPAN></DIV>
<DIV><SPAN class=338115720-03102002><FONT color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=338115720-03102002><FONT color=#0000ff 
size=2>&nbsp;</DIV></FONT></SPAN>
<BLOCKQUOTE dir=ltr 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Miller, James V (Research) 
  <BR><B>Sent:</B> Thursday, October 03, 2002 3:31 PM<BR><B>To:</B> 
  Insight-developers (E-mail)<BR><B>Subject:</B> [Insight-developers] vnl and 
  borland compiler<BR><BR></FONT></DIV>
  <DIV><SPAN class=893451919-03102002><FONT size=2>I have made progress on 
  getting all the vnl tests to pass&nbsp;using the Borland 
  compiler.</FONT></SPAN></DIV>
  <DIV><SPAN class=893451919-03102002><FONT size=2>The SVD tests and eigenvector 
  tests all pass now.</FONT></SPAN></DIV>
  <DIV><SPAN class=893451919-03102002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=893451919-03102002><FONT size=2>I have two remaining 
  issues.&nbsp; One in test_rnpoly_roots and one in 
  test_sparse_matrix.</FONT></SPAN></DIV>
  <DIV><SPAN class=893451919-03102002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=893451919-03102002><FONT size=2>The sparse matrix test is 
  particularly troubling.&nbsp; For following code crashes when 
  executed</FONT></SPAN></DIV>
  <DIV><SPAN class=893451919-03102002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=893451919-03102002><FONT size=2>&nbsp; 
  std::vector&lt;double&gt; f1;<BR>&nbsp; std::vector&lt;double&gt; 
  f2(f1);<BR></FONT></SPAN></DIV>
  <DIV><SPAN class=893451919-03102002><FONT size=2>Basically f2's copy 
  constructor is called with an empty vector, f1. f2 tries to 
  allocate</FONT></SPAN></DIV>
  <DIV><SPAN class=893451919-03102002><FONT size=2>0 bytes and copy the contents 
  of f1 to f2. I believe allocating 0 bytes is causing the 
  crash.</FONT></SPAN></DIV>
  <DIV><SPAN class=893451919-03102002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV><SPAN class=893451919-03102002><FONT size=2>vnl_sparse_matrix is 
  implemented as a std::vector&lt;std::vector&lt;somePairType&gt; &gt;. 
  The</FONT></SPAN></DIV>
  <DIV><FONT size=2><SPAN class=893451919-03102002>default initializer for the 
  "outer" vector constructs an std::vector&lt;somePairType&gt; 
  which</SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN class=893451919-03102002>is empty and "copies" that 
  empty vector into all of its elements.</SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN class=893451919-03102002></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT size=2><SPAN class=893451919-03102002>Reading through the 
  newsgroups, it looks as though other people have had this 
  problem</SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN class=893451919-03102002>with the Borland compiler and 
  have been able to apply a patch from Borland. The patches</SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN class=893451919-03102002>I have found for the "free 
  command line tools" have not addressed this problem. I am </SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN class=893451919-03102002>guessing that the patches 
  people are applying are for the full commercial product.</SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN class=893451919-03102002></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT size=2><SPAN class=893451919-03102002>Just wanted to keep people up 
  to date.&nbsp; If anyone has any ideas....</SPAN></FONT></DIV>
  <DIV><FONT size=2><SPAN class=893451919-03102002></SPAN></FONT>&nbsp;</DIV>
  <DIV><FONT size=2><SPAN class=893451919-03102002></SPAN></FONT>&nbsp;</DIV>
  <DIV class=Section1>
  <P style="MARGIN: 0in 0in 0pt"><B><SPAN 
  style="COLOR: navy; FONT-FAMILY: 'Comic Sans MS'">Jim Miller</SPAN></B> 
  <BR><B><I><SPAN 
  style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Arial">_____________________________________</SPAN></I></B><BR><EM><SPAN 
  style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Visualization &amp; 
  Computer Vision</SPAN></EM><I><SPAN 
  style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial"><BR><EM>GE 
  Research</EM><BR><EM>Bldg. KW, Room C218B</EM><BR><EM>P.O. Box 8, Schenectady 
  NY 12301</EM><BR><BR></SPAN></I><EM><U><SPAN 
  style="FONT-SIZE: 7.5pt; COLOR: blue"><A 
  href="mailto:millerjv@research.ge.com">millerjv@research.ge.com</A></SPAN></U></EM></P>
  <P style="MARGIN: 0in 0in 0pt"><EM><U><SPAN 
  style="FONT-SIZE: 7.5pt; COLOR: blue">james.miller@research.ge.com</SPAN></U></EM><BR><I><SPAN 
  style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">(518) 387-4005, 
  Dial Comm: 8*833-4005, </SPAN></I><BR><I><SPAN 
  style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Cell: (518) 
  505-7065, Fax: (518) 387-6981</SPAN></I> </P>
  <P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
  <DIV>&nbsp;</DIV></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C26B1F.7A73A1F2--