Bug report

Post Reply
Keivan
Posts: 127
Joined: Sat Apr 22, 2006 4:28 am

Bug report

Post by Keivan »

I was looking the neuron configuration file and maybe find a problem in it.
I have changed this part:

Code: Select all

# Check whether --with-iv or --without-iv was given.
if test "${with_iv+set}" = set; then
  withval="$with_iv"

		HAVE_IV=1
	if test "$with_iv" = "no" ; then
				HAVE_IV=0
		echo "Not compiling with interviews."
	elif test "$with_iv" = "yes" ; then # look in default places
		echo "Looking for InterViews in the usual places--"
		xprefix=`echo "$prefix" | sed 's;/[^/]*$;;'`
		if test -d $xprefix/iv ; then	#look in inside the nrn
			IV_DIR=$xprefix/iv
			IV_LIBDIR="$IV_DIR"/"$host_cpu"/lib
			if test ! -d $IV_LIBDIR ; then
				IV_LIBDIR="$IV_DIR"/lib
			fi
			IV_LIBS="-L$IV_LIBDIR -lIVhines $X_LIBS"
			IV_LIBS_LIBTOOL="$IV_LIBDIR/libIVhines.la"
			IV_INCLUDE=-I$IV_DIR/include
		elif test -d /usr/local/iv ; then
			echo " not in  $IV_DIR"
			IV_DIR=/usr/local/iv
			IV_LIBDIR="$IV_DIR"/"$host_cpu"/lib
			if test ! -d $IV_LIBDIR ; then
				IV_LIBDIR="$IV_DIR"/lib
			fi
			IV_LIBS="-L$IV_LIBDIR -lIVhines $X_LIBS"
			IV_LIBS_LIBTOOL="$IV_LIBDIR/libIVhines.la"
			IV_INCLUDE=-I$IV_DIR/include
		else
			echo " not in  $IV_DIR"
			IV_LIBS="-lIVhines $X_LIBS"
			IV_LIBS_LIBTOOL="$IV_LIBS"
		fi
		if test -n "$IV_DIR" ; then
			echo "Assuming top level iv directory at $IV_DIR"
			echo " and libraries in $IV_LIBDIR"
		else
			echo "Assuming InterViews in a standard? place."
		fi
	else  # Location specified
	  IV_DIR=$with_iv
	  IV_LIBDIR="$IV_DIR"/"$host_cpu"/lib
	  if test ! -d $IV_LIBDIR ; then
		  IV_LIBDIR="$IV_DIR"/lib
	  fi
	  IV_LIBS="-L$IV_LIBDIR -lIVhines $X_LIBS"
	  IV_LIBS_LIBTOOL="$IV_LIBDIR/libIVhines.la"
	  IV_INCLUDE=-I$IV_DIR/include
	fi
to this:

Code: Select all

# Check whether --with-iv or --without-iv was given.
if test "${with_iv+set}" = set; then
  withval="$with_iv"
  HAVE_IV=1
  echo "HAVE_IV is $HAVE_IV"	
	if test "$with_iv" = "no" ; then
		HAVE_IV=0
		echo "Not compiling with interviews."
	elif test "$with_iv" = "yes" ; then # look in default places
		echo "Looking for InterViews in the usual places--"
		xprefix=`echo "$prefix" | sed 's;/[^/]*$;;'`
		echo "looking for iv in $xprefix"
		if test -d $xprefix/iv ; then
			IV_DIR="$xprefix/iv"
			echo "iv directory is $IV_DIR"
			IV_LIBDIR=""$IV_DIR"/"$host_cpu"/lib"
		if test ! -d $IV_LIBDIR ; then
			IV_LIBDIR="$IV_DIR"/lib
		fi
		echo "iv library is $IV_LIBDIR"
		IV_LIBS="-L$IV_LIBDIR -lIVhines $X_LIBS"
		IV_LIBS_LIBTOOL="$IV_LIBDIR/libIVhines.la"
		IV_INCLUDE=-I$IV_DIR/include
	elif test -d /usr/local/iv ; then
		echo " not in  $IV_DIR"
		IV_DIR=/usr/local/iv
		echo "iv directory is $IV_DIR"
		IV_LIBDIR=""$IV_DIR"/"$host_cpu"/lib"
		if test ! -d $IV_LIBDIR ; then
			IV_LIBDIR="$IV_DIR"/lib
		fi
		echo "iv library is $IV_LIBDIR"
		IV_LIBS="-L$IV_LIBDIR -lIVhines $X_LIBS"
		IV_LIBS_LIBTOOL="$IV_LIBDIR/libIVhines.la"
		IV_INCLUDE=-I$IV_DIR/include
	else
		echo " not in  $IV_DIR"
		
	fi
	if test -n "$IV_DIR" ; then
		echo "Assuming top level iv directory at $IV_DIR"
		echo " and libraries in $IV_LIBDIR"
	else
		echo "Looking for intervies in specified location"
	fi
else  # Location specified
  IV_DIR=$with_iv
  echo "iv directory is $IV_DIR"
  IV_LIBDIR="$IV_DIR"/"$host_cpu"/lib
  if test ! -d $IV_LIBDIR ; then
	  IV_LIBDIR="$IV_DIR"/lib
  fi
  echo "iv library is $IV_LIBDIR"
  IV_LIBS="-L$IV_LIBDIR -lIVhines $X_LIBS"
  IV_LIBS_LIBTOOL="$IV_LIBDIR/libIVhines.la"
  IV_INCLUDE=-I$IV_DIR/include
fi
do you approve this change?
ps: I think it would be more reasonable to check the specified location first.
hines
Site Admin
Posts: 1710
Joined: Wed May 18, 2005 3:32 pm

Re: Bug report

Post by hines »

It appears that you are looking at the configure file. That is automatically generated
by autoconf from configure.in and the fragment you are analyzing is derived from the
m4/ivcheck.m4 file. In fact, the outermost
if test "${with_iv+set}" = set; then
is redundant since early in the ivcheck.m4 file it is set to 'yes' if the user did not
specify its value. Hence all the substantive logic is taking place within that 'if' body.

configure is distributed in the tar.gz file, but if you are working from the mercurial repository
sources, it must be generated (along with many other things) with the
./build.sh
script.
Post Reply