diff --git a/brad/build.sh b/brad/build.sh index 5bb0a88..c8c83dc 100755 --- a/brad/build.sh +++ b/brad/build.sh @@ -1,10 +1,14 @@ #! /bin/bash -if [ "$1" != "omhelp" ] && [ "$1" != "sdist" ] && [ "$1" != "all" ] +if [ "$1" != "omhelp" ] && \ + [ "$1" != "sdist" ] && \ + [ "$1" != "all" ] && \ + [ "$1" != "final" ] then echo "build.sh option, where option is one of the following" echo "omhelp: stop when the help is done" echo "sdist: stop when the done building the source distribution" echo "all: go all the way" + echo "final: go all the way and include download of cppad" exit 1 fi option="$1" @@ -15,6 +19,10 @@ yyyymmdd=`date +%G%m%d` # todays year, month, and day # Note for Sebastian: this choice forces cppad to be dowloanded each time. # I like to use $HOME/install to speed up testing. cppad_parent_dir="$HOME/install" # directory for cppad tarball etc +if [ "$option" == "final" ] +then + cppad_parent_dir="." +fi # --------------------------------------------------------------------- omhelp_location=`which omhelp` if [ "$omhelp_location" = "" ] diff --git a/brad/pycppad/vec2array.cpp b/brad/pycppad/vec2array.cpp index 8146607..9a0ad60 100644 --- a/brad/pycppad/vec2array.cpp +++ b/brad/pycppad/vec2array.cpp @@ -20,20 +20,20 @@ array vec2array(double_vec& vec) } array vec2array(AD_double_vec& vec) { - int n = static_cast( vec.size() ); + npy_intp n = static_cast( vec.size() ); PYCPPAD_ASSERT( n >= 0 , ""); - object obj(handle<>( PyArray_FromDims(1, &n, PyArray_OBJECT) )); + object obj(handle<>( PyArray_SimpleNew(1, &n, PyArray_OBJECT) )); for(size_t i = 0; i < vec.size(); i++){ obj[i] = vec[i]; } return static_cast( obj ); } array vec2array(AD_AD_double_vec& vec) -{ int n = static_cast( vec.size() ); +{ npy_intp n = static_cast( vec.size() ); PYCPPAD_ASSERT( n >= 0 , ""); - object obj(handle<>( PyArray_FromDims(1, &n, PyArray_OBJECT) )); + object obj(handle<>( PyArray_SimpleNew(1, &n, PyArray_OBJECT) )); for(size_t i = 0; i < vec.size(); i++){ obj[i] = vec[i]; }