[Insight-users] gccxml

Neil Killeen Neil.Killeen@atnf.csiro.au
Tue, 28 Jan 2003 14:43:43 +1100 (EST)


Finally I completed an installation of Cable and gccxml (using gcc 3.0.4).

So now I try to build ITK again with the Cable wrapping enabled.

It fails with

/usr/local/bin/cable
/nfs/source/itk/InsightToolkit-1.0.0/Wrapping/Tcl/Numerics/wrap_ITKNumerics.cxx
-tcl wrap_ITKNumerics_tcl.cxx --gccxml-compiler g++-3.1.1
-I/nfs/source/itk/InsightToolkit-1.0.0/Wrapping/Tcl/Numerics
-I/nfs/source/itk/InsightToolkit-1.0.0/Code/Algorithms
-I/nfs/source/itk/InsightToolkit-1.0.0/Code/BasicFilters
-I/nfs/source/itk/InsightToolkit-1.0.0/Code/Common
-I/nfs/source/itk/InsightToolkit-1.0.0/Code/Numerics
-I/nfs/source/itk/InsightToolkit-1.0.0/Code/IO
-I/nfs/source/itk/InsightToolkit-1.0.0/Code/Numerics/FEM
-I/nfs/source/itk/InsightToolkit-1.0.0/Code/Numerics/Statistics
-I/nfs/mid/NKILLEEN/itk/binary/sun4sol/Code/Numerics/vxl
-I/nfs/source/itk/InsightToolkit-1.0.0/Code/Numerics/vxl
-I/nfs/mid/NKILLEEN/itk/binary/sun4sol/Code/Numerics/vxl/vcl
-I/nfs/source/itk/InsightToolkit-1.0.0/Code/Numerics/vxl/vcl
-I/nfs/source/itk/InsightToolkit-1.0.0/Code/SpatialObject
-I/nfs/source/itk/InsightToolkit-1.0.0/Utilities/png
-I/nfs/source/itk/InsightToolkit-1.0.0/Utilities/zlib
-I/nfs/source/itk/InsightToolkit-1.0.0/Utilities/MetaIO
-I/nfs/mid/NKILLEEN/itk/binary/sun4sol -I/usr/local/include
-I/usr/local/include/Cable
-I/nfs/source/itk/InsightToolkit-1.0.0/Code/Numerics/vxl/vcl/doc
-I/nfs/source/itk/InsightToolkit-1.0.0/Code/Numerics/vxl/vnl
-I/nfs/source/itk/InsightToolkit-1.0.0/Wrapping/Tcl
-I/nfs/source/itk/InsightToolkit-1.0.0/Wrapping/Tcl/Numerics
/usr/local/share/gccxml-0.4.0/gccxml_find_flags: syntax error at line 56:
`!' unexpected
Error executing "/usr/local/share/gccxml-0.4.0/gccxml_find_flags g++-3.1.1
"
Could not determine GCCXML_FLAGS setting.
Error running GCC-XML with command:



so you can see the gccxml_find_flags script has failed with a syntax
error at line 56.  The script is included below.  Looks innocuous to me,
but I'm not much of a shell programmer.   There is a lonely looking "!" a
couple of lines above line 56 but removing that caused other failures.

Do you want me to post this to the gccxml mailing list rather than here ?

cheers
Neil





#!/bin/sh
#=============================================================================
#
#  Program:   GCC-XML
#  Module:    $RCSfile: gccxml_find_flags,v $
#  Language:  C++
#  Date:      $Date: 2002/10/29 15:27:55 $
#  Version:   $Revision: 1.6 $
#
#  Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights
reserved.
#  See Copyright.txt for details.
#
#     This software is distributed WITHOUT ANY WARRANTY; without even
#     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
#     PURPOSE.  See the above copyright notices for more information.
#
#=============================================================================

# Find the compiler executable name.
if test "x$1" = "x" ; then
  if test "x$GCCXML_COMPILER" = "x"; then
    if test "x${CXX}" != "x" ; then
      GCCXML_COMPILER="${CXX}"
    else
      echo "Need to specify compiler name or set GCCXML_COMPILER or CXX."
      exit 1
    fi
  fi
  if test "x$GCCXML_CXXFLAGS" = "x"; then
    if test "x${CXXFLAGS}" != "x" ; then
      GCCXML_CXXFLAGS="${CXXFLAGS}"
    fi
  fi
else
  GCCXML_COMPILER="$1"
  shift
  GCCXML_CXXFLAGS="$@"
fi

# Use the compiler's preprocessor to identify the compiler.
GCCXML_PID="$$"
cat > "/tmp/gccxml_identify_compiler$GCCXML_PID.cc" <<!
#if defined(__GNUC__)
GCCXML_SUPPORT="GccInclude"
GCCXML_FLAGS_SCRIPT="find_gcc_options"
#elif defined(__sgi)
GCCXML_SUPPORT="MproInclude"
GCCXML_FLAGS_SCRIPT="find_mpro_options"
#else
GCCXML_SUPPORT=""
GCCXML_FLAGS_SCRIPT=""
#endif
!

# Run the compiler's preprocessor on the above code to identify it.
if ! (${GCCXML_COMPILER} ${GCCXML_CXXFLAGS} \
                         -E "/tmp/gccxml_identify_compiler$GCCXML_PID.cc"
\
                          > "/tmp/gccxml_identify_compiler$GCCXML_PID.pp";
      rm -f "/tmp/gccxml_identify_compiler$GCCXML_PID.cc") ; then
  echo "Error running \"${GCCXML_COMPILER} -E\""
  exit 1
fi

# Source the result to get the settings found.
. "/tmp/gccxml_identify_compiler$GCCXML_PID.pp"
rm -f  "/tmp/gccxml_identify_compiler$GCCXML_PID.pp"

# Check if a supported compiler was identified.
if test "x$GCCXML_SUPPORT" = "x" ; then
  echo "Compiler \"${GCCXML_COMPILER}\" is not supported by GCC-XML."
  exit 1
fi

# The support directories are located near this script.
SP1=`echo $0 | sed -n '/\//{s/\/[^\/]*$//;p;}'`
SELFPATH=`cd $SP1;pwd`

# Find the compiler-specific support directory.
if test -d "${SELFPATH}/${GCCXML_SUPPORT}" ; then
  GCCXML_SUPPORT_DIR="${SELFPATH}/${GCCXML_SUPPORT}"
elif test -d "${SELFPATH}/../share/GCC_XML/${GCCXML_SUPPORT}" ; then
  GCCXML_SUPPORT_DIR="${SELFPATH}/../share/GCC_XML/${GCCXML_SUPPORT}"
else
  echo "Cannot find GCC_XML compiler support directory ${GCCXML_SUPPORT}."
  exit 1
fi

# Run the compiler-specific flag finding script.
GCCXML_FLAGS=`${GCCXML_SUPPORT_DIR}/${GCCXML_FLAGS_SCRIPT}
${GCCXML_COMPILER} ${GCCXML_CXXFLAGS}`

# Display the output.
echo ${GCCXML_FLAGS}