[Insight-users] Re: Ask help on compiling ITK with MIPSpro 7.4

Jon Harald Kaspersen Jon . H . Kaspersen at sintef . no
Thu, 25 Sep 2003 07:26:47 +0200


--Apple-Mail-12-261061389
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	delsp=yes;
	charset=ISO-8859-1;
	format=flowed

Hi Fucang,

The MIPSpro 7.4 is a very new compiler from SGI, and I don't think it
is supported in ITK yet.  My experience with this compiler is very =20
limited, because
it was installed on a SGI system that we had for three weeks for =20
testing.  It is
out of our building now - somebody else is testing it.
I can check with the maintainer of this SGI box if he ever got CVS ITK =20=

compiled
on it ?
However, I worked some of the problems with this compiler out with
Brad K and Bill H (at Kitware).

Here is the problem (worked out by Brad K):

The problem is that testlib_test.cxx includes these headers (among =20
others)
in this order:

#include <vcl_cmath.h>
#include <vcl_complex.h>

First vcl_cmath.h decides to do

#include <cmath>
#define vcl_abs std::abs

then vcl_complex.h comes along and does

#include <complex>
# undef  vcl_abs
# define vcl_abs vcl_abs
template <typename T>
inline T vcl_abs(std::complex<T> const &z) { return std::abs(z); }

Therefore the only vcl_abs left is a function template defined only for
complex.  When the test file later calls vcl_abs with a double, it can't
match the template.  This path through vcl in the
preprocessor has never before been taken.

For now, you can probably get the build going by editing

Insight/Utilities/vxl/vcl/sgi/vcl_cmath.h

and changing the top "#if ..." line to "#if 1".


Regards
Jon

On Wednesday, September 24, 2003, at 05:13 PM, Fucang Jia wrote:

> Dear Jon,
> =A0
> I am sorry=A0if this letter=A0bother you.=A0 I found that your post =
from =20
> ITK's user mail-list, so I want to ask for some help from you.
> =A0
> I want to compile ITK Release 1.4 on SGI Fuel IRIX 6.5.20m with =20
> MIPSpro 7.4. just the same with you (from your post on ITK =20
> mail-lists). But I can not
> succeed with the VXL package, which says that:
> =A0
> cc-1278 CC: ERROR File =3D =20
> /usr/people/jiafc/itk-1.4/InsightToolkit-1.4.0/Utilities/vxl/testlib/=20=

> testlib_test.cxx, Line =3D 82
> =A0 No instance of function template "vcl_abs" matches the argument =
list.
> =A0
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 The argument types are:=A0 (double).
> =A0=A0=A0 testlib_test_perform(vcl_abs(expr - target) < tol);
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
 ^
> =A0
> cc-1278 CC: ERROR File =3D =20
> /usr/people/jiafc/itk-1.4/InsightToolkit-1.4.0/Utilities/vxl/testlib/=20=

> testlib_test.cxx, Line =3D 94
> =A0 No instance of function template "vcl_abs" matches the argument =
list.
> =A0
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 The argument types are:=A0 (double).
> =A0=A0=A0 testlib_test_perform(vcl_abs(expr - target) > tol);
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
 ^
> =A0
> 2 errors detected in the compilation of =20
> "/usr/people/jiafc/itk-1.4/InsightToolkit-1.4.0/Utilities/vxl/testlib/=20=

> testlib_test.cxx".
> =A0
> then I comment the two functions , it compiles a little, then stops:
> =A0
> Building object file vnl_math.o...
> cc-1295 CC: ERROR File =3D =20
> /usr/people/jiafc/itk-1.4/InsightToolkit-1.4.0/Utilities/vxl/vnl/=20
> vnl_math.h, Line =3D 55
> =A0 The indicated data member initializer is not allowed.
> =A0
> =A0=A0=A0 static VNL_DLL_DATA const double e=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0 =20
> VCL_STATIC_CONST_INIT_FLOAT_DECL(2.7182818284590452354);
> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0 ^
> =A0
> =A0.......
> =A0
> =A0
> 17 errors detected in the compilation of =20
> "/usr/people/jiafc/itk-1.4/InsightToolkit-1.4.0/Utilities/vxl/vnl/=20
> vnl_math.cxx"
> =A0
> I do use -LANG:std but it does not work.
> =A0
> I can not correct this errors, I found that some people with this =20
> problem was due to MIPSpro 7.4 (on IRIX 6.5.18 or later) because MIPS =20=

> pro 7.4 must install
> the Patch 4605 (Pathch 4605: 7.4 Compiler Header Files for Unix98,C99 =20=

> and ANSI C++ namespace std) and the patch install =20
> /usr/include/CC/cmath, cfloat, cctype
> ..., etc. But if I uninstall the patch, compiler complain can not find =
=20
> "math.h" or "cmath" file.
> =A0
> I found that people successfully compiled ITK on SGI with MIPS pro =20
> 7.3* compiler only. Since you have success on the MIPS pro 7.4, would =20=

> you like to share some experience on compiling ITK or any hints, thank =
=20
> you very much!
> =A0
> =A0
> Best,
> =A0
> Fucang
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> Fucang Jia
> Laboratory of Intelligent Information Processing
> Institute of Computing Technology
> Chinese Academy of Sciences
> No.6, Science Institute South Road,
> Beijing, 100080
> P.R.CHINA
> Tel: 86-10 6256-5533 ext. 5672
> Fax: 86-10 6256-7724
>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
Jon Harald Kaspersen			Tel: 		+47 73 59 75 89
Ph.D. Mechanical Engineering		Mob:		+47 93 03 65 90
Senior Scientist				Pager	+47 96 84 29 94
SINTEF Unimed - Ultralyd		Fax: 		+47 73 59 78 73
N-7465 Trondheim
NORWAY			e-mail:	Jon . H . Kaspersen at unimed . sintef . no
				WEB:	http://www . us . unimed . sintef . no/
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D

--Apple-Mail-12-261061389
Content-Transfer-Encoding: quoted-printable
Content-Type: text/enriched;
	charset=ISO-8859-1

Hi Fucang,


The MIPSpro 7.4 is a very new compiler from SGI, and I don't think it

is supported in ITK yet.  My experience with this compiler is very
limited, because

it was installed on a SGI system that we had for three weeks for
testing.  It is

out of our building now - somebody else is testing it.

I can check with the maintainer of this SGI box if he ever got CVS ITK
compiled

on it ?

However, I worked some of the problems with this compiler out with

Brad K and Bill H (at Kitware).


Here is the problem (worked out by Brad K):


The problem is that testlib_test.cxx includes these headers (among
others)

in this order:


#include <<vcl_cmath.h>

#include <<vcl_complex.h>


First vcl_cmath.h decides to do


#include <<cmath>

#define vcl_abs std::abs


then vcl_complex.h comes along and does


#include <<complex>

# undef  vcl_abs

# define vcl_abs vcl_abs

template <<typename T>

inline T vcl_abs(std::complex<<T> const &z) { return std::abs(z); }


Therefore the only vcl_abs left is a function template defined only for

complex.  When the test file later calls vcl_abs with a double, it
can't

match the template.  This path through vcl in the

preprocessor has never before been taken.


For now, you can probably get the build going by editing


Insight/Utilities/vxl/vcl/sgi/vcl_cmath.h


and changing the top "#if ..." line to "#if 1".



Regards

Jon


On Wednesday, September 24, 2003, at 05:13 PM, Fucang Jia wrote:


<excerpt><fontfamily><param>Times New Roman</param><smaller>Dear =
Jon,</smaller></fontfamily>

=A0

<fontfamily><param>Times New Roman</param><smaller>I am sorry=A0if this
letter=A0bother you.=A0 I found that your post from ITK's user =
mail-list,
so I want to ask for some help from you.

=A0

I want to compile ITK Release 1.4 on SGI Fuel IRIX 6.5.20m with
MIPSpro 7.4. just the same with you (from your post on ITK
mail-lists). But I can not

succeed with the VXL package, which says that:

=A0

cc-1278 CC: ERROR File =3D
=
/usr/people/jiafc/itk-1.4/InsightToolkit-1.4.0/Utilities/vxl/testlib/testl=
ib_test.cxx,
Line =3D 82

=A0 No instance of function template "vcl_abs" matches the argument =
list.

=A0

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 The argument types are:=A0 (double).

=A0=A0=A0 testlib_test_perform(vcl_abs(expr - target) << tol);

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
^

=A0

cc-1278 CC: ERROR File =3D
=
/usr/people/jiafc/itk-1.4/InsightToolkit-1.4.0/Utilities/vxl/testlib/testl=
ib_test.cxx,
Line =3D 94

=A0 No instance of function template "vcl_abs" matches the argument =
list.

=A0

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 The argument types are:=A0 (double).

=A0=A0=A0 testlib_test_perform(vcl_abs(expr - target) > tol);

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 =
^

=A0

2 errors detected in the compilation of
=
"/usr/people/jiafc/itk-1.4/InsightToolkit-1.4.0/Utilities/vxl/testlib/test=
lib_test.cxx".

=A0

then I comment the two functions , it compiles a little, then stops:

=A0

Building object file vnl_math.o...

cc-1295 CC: ERROR File =3D
=
/usr/people/jiafc/itk-1.4/InsightToolkit-1.4.0/Utilities/vxl/vnl/vnl_math.=
h,
Line =3D 55

=A0 The indicated data member initializer is not allowed.

=A0

=A0=A0=A0 static VNL_DLL_DATA const double e=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0
VCL_STATIC_CONST_INIT_FLOAT_DECL(2.7182818284590452354);

=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=
=A0=A0 ^

=A0

=A0.......

=A0

=A0

17 errors detected in the compilation of
=
"/usr/people/jiafc/itk-1.4/InsightToolkit-1.4.0/Utilities/vxl/vnl/vnl_math=
.cxx"

=A0

I do use -LANG:std but it does not work.

=A0

I can not correct this errors, I found that some people with this
problem was due to MIPSpro 7.4 (on IRIX 6.5.18 or later) because MIPS
pro 7.4 must install

the Patch 4605 (Pathch 4605: 7.4 Compiler Header Files for Unix98,C99
and ANSI C++ namespace std) and the patch install
/usr/include/CC/cmath, cfloat, cctype

..., etc. But if I uninstall the patch, compiler complain can not find
"math.h" or "cmath" file.

=A0

I found that people successfully compiled ITK on SGI with MIPS pro
7.3* compiler only. Since you have success on the MIPS pro 7.4, would
you like to share some experience on compiling ITK or any hints, thank
you very much!

=A0

=A0

Best,

=A0

Fucang

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

Fucang Jia

Laboratory of Intelligent Information Processing

Institute of Computing Technology

Chinese Academy of Sciences

No.6, Science Institute South Road,

Beijing, 100080

P.R.CHINA

Tel: 86-10 6256-5533 ext. 5672

Fax: 86-10 6256-7724</smaller></fontfamily>


</excerpt>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D

Jon Harald Kaspersen			Tel: 		+47 73 59 75 89

Ph.D. Mechanical Engineering		Mob:		+47 93 03 65 90

Senior Scientist				Pager	+47 96 84 29 94

SINTEF Unimed - Ultralyd		Fax: 		+47 73 59 78 73

N-7465 Trondheim

NORWAY			e-mail:	Jon . H . Kaspersen at unimed . sintef . no

				WEB:	=
<underline><color><param>1A1A,1A1A,FFFF</param>http://www . us . unimed . sintef=
.no/</color></underline>

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D


--Apple-Mail-12-261061389--