On Mon, Nov 7, 2011 at 8:57 PM, Paul Dreik <dive...@pauldreik.se> wrote:
> Yes, <cstdlib> should be there too. I tested on ubuntu 11.10 (octave
> 3.2, gcc 4.6.1) and it compiles without <cstdlib>, so it does not seem
> to be necessary but it should definitely be there, as free is used.
>
> By the way, install fails which surprises me, it tries to install system
> wide. The error message is copied below. (I compiled the package outside
> octave to see that it compiled with/without <cstdlib>)
>
> octave:1> pkg install -local signal-1.1.1.tar.gz
> cl2bp_lib.cc: In function 'bool cl2bp(MallocArray<double>&, int, double,
> double, double*, double*, int, double, int, void (*)(void*), void*)':
> cl2bp_lib.cc:260:7: warning: variable 'iup' set but not used
> [-Wunused-but-set-variable]
> cl2bp_lib.cc:267:25: warning: variable 'ak1' set but not used
> [-Wunused-but-set-variable]
> couldn't create installation directory
> /usr/share/octave/packages/3.2/signal-1.1.1 : Permission denied
> error: called from `pkg>copy_files' in file
> /usr/share/octave/3.2.4/m/pkg/pkg.m near line 1431, column 7
> error: called from:
> error:   /usr/share/octave/3.2.4/m/pkg/pkg.m at line 756, column 5
> error:   /usr/share/octave/3.2.4/m/pkg/pkg.m at line 287, column 7
> octave:1>
>
>
> paul
>
> 2011-11-07 20:15, Juan Pablo Carbajal skrev:
>> Hi,
>>
>> Well, that wasn't in the patch.
>>
>>
>> --- cl2bp_lib.h       2009-10-18 09:33:59.000000000 +0200
>> +++ cl2bp_lib.h.new   2011-10-22 15:56:41.000000000 +0200
>> @@ -31,7 +31,8 @@
>>  #ifndef CL2BP_H
>>  #define CL2BP_H
>>
>> -#include <assert.h>
>> +#include <cassert>
>> +#include <cstring> //for memset
>>
>>  //-----------------------------------------------------------------------------------------------------------
>>  // If you want to debug the cl2bp algorithm, define the CL2BP_LOGGING
>> symbol and provide an
>> @@ -63,7 +64,7 @@
>>      assert(length_ >= 0 && length_ <= 512*1024*1024);  // verify that
>> the array size is reasonable
>>      length = length_;
>>      ptr = (T *)realloc(ptr, length * sizeof(T));
>> -    memset(ptr, 0, length * sizeof(T));
>> +       std::memset(ptr, 0, length * sizeof(T));
>>    }
>>
>>    MallocArray(int length_=0) {
>>
>> Are you sure that will fix the problem? I am not using this functions
>> from the package nor I know what they should return.
>>
>> Thanks
>>
>>
>> 2011/11/7 bd satish <bdsat...@gmail.com>:
>>> Well, I just downloaded signal-1.1.1 and the error still persists !
>>> The following line is still missing in  cl2bp.h:
>>>
>>> #include <cstdlib>
>>>
>>> Without the above line, 'free', 'realloc' are undefined. Looks like
>>> you added <cassert> and <cstring> but forgot <cstdlib> :-)
>>>
>>>
>>> -- Satish.BD
>>>
>>>
>>>> Hi
>>>>
>>>> We have applied your fix and made a new release of the signal package
>>>> (both thank to Juan carbajal). Thank you for your contribution.
>>>>
>>>> Carnë Draug
>>>>
>>> ------------------------------------------------------------------------------
>>> RSA(R) Conference 2012
>>> Save $700 by Nov 18
>>> Register now
>>> http://p.sf.net/sfu/rsa-sfdev2dev1
>>> _______________________________________________
>>> Octave-dev mailing list
>>> Octave-dev@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/octave-dev
>>>
>>
>>
>
>
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Save $700 by Nov 18
> Register now
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Octave-dev mailing list
> Octave-dev@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/octave-dev
>

Thanks for the remarks,
Indeed in my system (Ubuntu 10.10 gcc 4.4.5) it compiles perfectly.
I've added cstdlib.

Regarding the installation issues. It seems that Octave is trying to
put the package system wide in your machine. It diesn't happen here,
it uses my ~/octave to do so.
Did you compiled octave on your own? Maybe it has to do with some
flags set during configuration?

-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Zürich
http://ailab.ifi.uzh.ch/carbajal/

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to