[julia-users] Re: timing question on 'read' binary..

2015-12-02 Thread Rajn
Stefan,
I have a function which loads the data structure, loads the actual data 
file and defines frame numbers, determines PACKSIZE etc. 
But to test the performance I did not use the function for but as in global 
scope.

Tom, I will look up your suggestion.
Thanks 

On Wednesday, December 2, 2015 at 12:56:48 AM UTC-5, Rajn wrote:
>
> I am reading a binary file with a structure. Matlab takes long and I 
> wanted to run Julia for speed improvement.
> It reads camera frames, each with certain bytesize and each frame 
> consisting of parameters of certain byte size and Type.
>
> frames: is declared Int64 and runs from 1:frames
> PACKSIZE is declared Int64 and is constant
> key_ind is Int16 and is a vector. This denotes the parameters which 
> defines the frames. There are 200 but I am only interested in 3.
> Type  declared Type as: 1x3 Array of Int16, Int16, Float64...
> Num as Int64 and 3x1 elements and each is 1. This says that there are only 
> 1 elements of each Type in a frame.
>
> This is where I want to store the data...
> dCell = 3x1 Array{Any,2} of  Array{Int16}(1xframes)  
> Array{Int16}(1xframes) and Array{Float64}(1xframes)
>
> each camera frame is of PACKSIZE in bytes.
>
> To summarize I have declared the type of each variable before I start the 
> read process.
>
> #Read and assemble the data structured as series of Int16,Int16,Float64...
> for j=1:length(frames);
> Pos = frames[j]*PACKSIZE ;
>  for k=1:size(key_ind,1)
> seek(fid,Pos[k]);
> value = read(ifov_fid, Type[k][1],Num[k]);   #Num[k] is all ones.
> dCell[k][:,j]=value;
> end
> end
>
> For 500,000 frames it takes as much time as Matlab. Not getting warnings 
> or errors but would like to know how to improve the code for speed or 
> efficiency.
>
> I am not familiar with binary read and was wondering if this is 'normal' 
> and one cannot do any better? If I were to write this in C would it also 
> take the same amount (maybe because of my sloppy code)? I should perhaps 
> give details on the processor I use but because I am only comparing Matlab 
> with Julia - and I am not doing any parallelization - I think that OS 
> details are not important?
> In the Matlab code I am declaring few variables types but not being very 
> careful as I am in with Julia.
> I am not reading the entire structure i.e., key_ind =1:3 of 200, each with 
> different byte size. Therefore, I am not providing @time but if curious it 
> is ~30-45 seconds for 50 frames. The inner for-loop takes about 
> ~0.7 seconds.
> Thanks
>
>
>

[julia-users] timing question on 'read' binary..

2015-12-01 Thread Rajn
I am reading a binary file with a structure. Matlab takes long and I wanted 
to run Julia for speed improvement.
It reads camera frames, each with certain bytesize and each frame 
consisting of parameters of certain byte size and Type.

frames: is declared Int64 and runs from 1:frames
PACKSIZE is declared Int64 and is constant
key_ind is Int16 and is a vector. This denotes the parameters which defines 
the frames. There are 200 but I am only interested in 3.
Type  declared Type as: 1x3 Array of Int16, Int16, Float64...
Num as Int64 and 3x1 elements and each is 1. This says that there are only 
1 elements of each Type in a frame.

This is where I want to store the data...
dCell = 3x1 Array{Any,2} of  Array{Int16}(1xframes)  Array{Int16}(1xframes) 
and Array{Float64}(1xframes)

each camera frame is of PACKSIZE in bytes.

To summarize I have declared the type of each variable before I start the 
read process.

#Read and assemble the data structured as series of Int16,Int16,Float64...
for j=1:length(frames);
Pos = frames[j]*PACKSIZE ;
 for k=1:size(key_ind,1)
seek(fid,Pos[k]);
value = read(ifov_fid, Type[k][1],Num[k]);   #Num[k] is all ones.
dCell[k][:,j]=value;
end
end
   
For 500,000 frames it takes as much time as Matlab. Not getting warnings or 
errors but would like to know how to improve the code for speed or 
efficiency.

I am not familiar with binary read and was wondering if this is 'normal' 
and one cannot do any better? If I were to write this in C would it also 
take the same amount (maybe because of my sloppy code)? I should perhaps 
give details on the processor I use but because I am only comparing Matlab 
with Julia - and I am not doing any parallelization - I think that OS 
details are not important?
In the Matlab code I am declaring few variables types but not being very 
careful as I am in with Julia.
I am not reading the entire structure i.e., key_ind =1:3 of 200, each with 
different byte size. Therefore, I am not providing @time but if curious it 
is ~30-45 seconds for 50 frames. The inner for-loop takes about 
~0.7 seconds.
Thanks




[julia-users] Re: equivalent of fseek?

2015-11-29 Thread Rajn
Thanks James for pointing it out. It did work.
Is there a need for a C++ like function fseek in that case at all?

On Saturday, November 28, 2015 at 1:00:14 PM UTC-5, Rajn wrote:
>
> Is there an fseek in Julia which returns to an offset from the beginning 
> of the buffer during a binary file read?
> Would seekstart followed by seek or skip work? I understand that stream is 
> not the same as file in read()?
> Thanks
>
>

[julia-users] Re: Converting String to DataType - don't quite get it!!

2015-11-29 Thread Rajn
Ok,
I got it! It is just a matter of converting array to an element

read(fid, reshape(T[1])[1] ,keyNumElem[1])...

Now it works but I have a follow on question.

What are the overheads in doing this conversion. I am reading a 2Terabyte 
data fileand want to make it really efficient by defining all 
parameters in read() without dynamic 
conversions if possible!

Or is there a way to replace the column of strings with Types? When I try 
to do that I get an error about convert i.e. cannot convert string to 
DataType...

Thanks




On Sunday, November 29, 2015 at 10:24:46 PM UTC-5, Rajn wrote:
>
> Hi,
> I am trying to read a binary file by doing the following:
>
> read(fid, DataType[i], Numelements[i]).
>
> I would like to extract DataType from a user input which is read from a 
> column (whose header is 'type') of DataTable which is a string array.
> For example 
> DataTable[1,:type] = "uint8"
> DataTable[2,:type] = "sint16"
> ..etc
> I would like to convert this "uint8" to UInt8 in that same column but I 
> could not figure how and so I generated a new cell array' T' of that size.
> And then with an if statement I occupy the new variable with DataType. 
> Ugh!!
>
> An example for an arbitrary kth row of the DataTable column...
>
> i.e., if DataTable[k,:type] == "int16"
> T[k]=Type[Int16];
>   end
>
> when I actually run it I get the following error...
>
> julia> T[1]
> 1-element Array{DataType,1}:
> Int16
>
> julia>read(fid, T[1] ,keyNumElem[1])
>
> ERROR: MethodError: `read` has no method matching read(::IOStream, 
> ::Array{Type{T},1}, ::Int32)
> Closest candidates are:
>   read{T}(::IO, ::Type{T}, ::Int32, ::Int32...)
>   read{T}(::IO, ::Type{T}, ::Integer, ::Integer...)
>   read{T<:Base.AbstractPipe}(::T<:Base.AbstractPipe, ::Any...)
>   ...
>
>
> I understand the problem but do not know how to convert a string to 
> ..."what?" I mean what is the 'type' of the 2nd parameter in read 
> -'Type{T}'? Is it a string?
> Or maybe I am correct and I have to convert Array to an element? How do I 
> do that?
> Very confused!!
> Thanks
>
>

[julia-users] Converting String to DataType - don't quite get it!!

2015-11-29 Thread Rajn
Hi,
I am trying to read a binary file by doing the following:

read(fid, DataType[i], Numelements[i]).

I would like to extract DataType from a user input which is read from a 
column (whose header is 'type') of DataTable which is a string array.
For example 
DataTable[1,:type] = "uint8"
DataTable[2,:type] = "sint16"
..etc
I would like to convert this "uint8" to UInt8 in that same column but I 
could not figure how and so I generated a new cell array' T' of that size.
And then with an if statement I occupy the new variable with DataType. Ugh!!

An example for an arbitrary kth row of the DataTable column...

i.e., if DataTable[k,:type] == "int16"
T[k]=Type[Int16];
  end

when I actually run it I get the following error...

julia> T[1]
1-element Array{DataType,1}:
Int16

julia>read(fid, T[1] ,keyNumElem[1])

ERROR: MethodError: `read` has no method matching read(::IOStream, 
::Array{Type{T},1}, ::Int32)
Closest candidates are:
  read{T}(::IO, ::Type{T}, ::Int32, ::Int32...)
  read{T}(::IO, ::Type{T}, ::Integer, ::Integer...)
  read{T<:Base.AbstractPipe}(::T<:Base.AbstractPipe, ::Any...)
  ...


I understand the problem but do not know how to convert a string to 
..."what?" I mean what is the 'type' of the 2nd parameter in read 
-'Type{T}'? Is it a string?
Or maybe I am correct and I have to convert Array to an element? How do I 
do that?
Very confused!!
Thanks



[julia-users] equivalent of fseek?

2015-11-28 Thread Rajn
Is there an fseek in Julia which returns to an offset from the beginning of 
the buffer during a binary file read?
Would seekstart followed by seek or skip work? I understand that stream is 
not the same as file in read()?
Thanks



[julia-users] Median filter

2015-11-10 Thread Rajn
I was wondering if a 'median filter' algorithm is available in Julia? There 
was some discussion on this topic in 2013. Wonder if someone built it 
eventually. I am looking for something similar to medflt1 of Matlab.
Thanks


Re: [julia-users] Re: help needed with Julia install on Centos

2014-10-14 Thread Rajn
It is now working and resolved!
Thank you all and I just followed Elliot's advice on downloading the binary 
64-bit file.
I have a follow up question - if I have to download packages do I need to 
worry that I have an old version of compiler - or does everything works as 
usual?



On Tuesday, October 14, 2014 4:18:53 PM UTC-4, Rajn wrote:
>
> I will try Elliot' s suggestion because https cloning did not work - I 
> qualify this statement - it did work in the sense it downloaded the files 
> properly but make gives me the same errors as before.
> So it must be due to old compiler that I pointed out.
> Thanks
>
>
> On Tuesday, October 14, 2014 3:49:19 PM UTC-4, Elliot Saba wrote:
>>
>> Building from Github .tar.gz files are supported as long as you download 
>> the tar.gz files from the "releases" page e.g. this one 
>> <https://github.com/JuliaLang/julia/releases>.  Click the big green 
>> button.
>> Cloning over https is simple, you just need to use that URL instead of 
>> the git:// URL, and everything else should work normally.  Specifically, 
>> you should be able to do:
>>
>> git clone https://github.com/JuliaLang/julia.git
>>
>> And it should work just fine, barring any strange network problems.
>>
>>
>> However, it looks to me like your compiler is too old (and you just sent 
>> a message out about that).  Unless you have some reason to compile it 
>> yourself, could I ask you to try out a new binary distribution we're 
>> testing?  It's just a .tar.gz file that you extract somewhere and you can 
>> run Julia straight out of that, no installation necessary.  You can 
>> download the latest 64-bit version here 
>> <http://status.julialang.org/download/linux-x86_64>, or the latest 32-bit 
>> version here <http://status.julialang.org/download/linux-i386>.
>>
>> If you want to compile your own copy, I'd suggest adding the 
>> OPENBLAS_DYNAMIC_ARCH=0 line to the end of your make invocation, as Glen's 
>> link suggests.
>> -E
>>
>

Re: [julia-users] Re: help needed with Julia install on Centos

2014-10-14 Thread Rajn
I will try Elliot' s suggestion because https cloning did not work - I 
qualify this statement - it did work in the sense it downloaded the files 
properly but make gives me the same errors as before.
So it must be due to old compiler that I pointed out.
Thanks


On Tuesday, October 14, 2014 3:49:19 PM UTC-4, Elliot Saba wrote:
>
> Building from Github .tar.gz files are supported as long as you download 
> the tar.gz files from the "releases" page e.g. this one 
> .  Click the big green 
> button.
> Cloning over https is simple, you just need to use that URL instead of the 
> git:// URL, and everything else should work normally.  Specifically, you 
> should be able to do:
>
> git clone https://github.com/JuliaLang/julia.git
>
> And it should work just fine, barring any strange network problems.
>
>
> However, it looks to me like your compiler is too old (and you just sent a 
> message out about that).  Unless you have some reason to compile it 
> yourself, could I ask you to try out a new binary distribution we're 
> testing?  It's just a .tar.gz file that you extract somewhere and you can 
> run Julia straight out of that, no installation necessary.  You can 
> download the latest 64-bit version here 
> , or the latest 32-bit 
> version here .
>
> If you want to compile your own copy, I'd suggest adding the 
> OPENBLAS_DYNAMIC_ARCH=0 line to the end of your make invocation, as Glen's 
> link suggests.
> -E
>


Re: [julia-users] Re: help needed with Julia install on Centos

2014-10-14 Thread Rajn
Ok I will try that but I just found out that I have gcc 4.4.7 version and 
when I try to install with yum it says this is the latest.
I read that gcc 4.6 and higher is preferred.
Does that look like a dead end?
Thanks


On Tuesday, October 14, 2014 3:41:26 PM UTC-4, Stefan Karpinski wrote:
>
> Building from github tar files isn't supported. Can you try git cloning 
> via https or ssh?
>
>
> On Oct 14, 2014, at 3:27 PM, Rajn > 
> wrote:
>
> Also forgot to mention that my machine OS is Centos 6.5
> Thanks
>
>
> On Tuesday, October 14, 2014 3:23:53 PM UTC-4, Rajn wrote:
>>
>> I am behind a firewall and cannot access the repo file as I see that 
>> connection is getting timed out.
>> I could not use git - 
>>
>> git clone git://github.com/JuliaLang/julia.git
>> I get an error
>> connection reset by peer.
>> I did not try https clone because I do not know much about it and have to 
>> read up on it how to configure it.
>>
>>
>> So instead I download the tar file and decided to install it using make.
>> And here is the error summary that I get:
>>
>> permpd $ 0x1b,%ymm0,%ymm0'
>> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2539: Error: no such 
>> instruction: `vpermpd $ 0xb1,%ymm0,%ymm0'
>> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such 
>> instruction: `vpermpd $ 0xb1,%ymm5,%ymm5'
>> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such 
>> instruction: `vpermpd $ 0xb1,%ymm7,%ymm7'
>> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such 
>> instruction: `vpermpd $ 0x1b,%ymm2,%ymm2'
>> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such 
>> instruction: `vpermpd $ 0x1b,%ymm3,%ymm3'
>> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such 
>> instruction: `vpermpd $ 0xb1,%ymm2,%ymm2'
>> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such 
>> instruction: `vpermpd $ 0xb1,%ymm3,%ymm3'
>> make[4]: *** [dtrmm_kernel_RN_HASWELL.o] Error 1
>> make[4]: *** [dtrmm_kernel_RT_HASWELL.o] Error 1
>> make[3]: *** [libs] Error 1
>> *** Clean the OpenBLAS build with 'make -C deps clean-openblas'. Rebuild 
>> with 'make OPENBLAS_USE_THREAD=0 if OpenBLAS had trouble linking 
>> libpthread.so, and with 'make OPENBLAS_TARGET_ARCH=NEHALEM' if there were 
>> errors building SandyBridge support. Both these options can also be used 
>> simultaneously. ***
>> make[2]: *** [openblas-v0.2.10/libopenblas.so] Error 1
>> make[1]: *** [julia-release] Error 2
>> make: *** [release] Error 2
>>
>>
>> Of course I tried the recommendations above i.e., clean-openblas followed by 
>> ...THREAD=0 and ARCH-NEHALEM but I keep getting same errors.
>> Any help is appreciated.
>> Thanks
>>
>>

[julia-users] Re: help needed with Julia install on Centos

2014-10-14 Thread Rajn
Also forgot to mention that my machine OS is Centos 6.5
Thanks


On Tuesday, October 14, 2014 3:23:53 PM UTC-4, Rajn wrote:
>
> I am behind a firewall and cannot access the repo file as I see that 
> connection is getting timed out.
> I could not use git - 
>
> git clone git://github.com/JuliaLang/julia.git
> I get an error
> connection reset by peer.
> I did not try https clone because I do not know much about it and have to 
> read up on it how to configure it.
>
>
> So instead I download the tar file and decided to install it using make.
> And here is the error summary that I get:
>
> permpd $ 0x1b,%ymm0,%ymm0'
> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2539: Error: no such instruction: 
> `vpermpd $ 0xb1,%ymm0,%ymm0'
> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such instruction: 
> `vpermpd $ 0xb1,%ymm5,%ymm5'
> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such instruction: 
> `vpermpd $ 0xb1,%ymm7,%ymm7'
> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such instruction: 
> `vpermpd $ 0x1b,%ymm2,%ymm2'
> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such instruction: 
> `vpermpd $ 0x1b,%ymm3,%ymm3'
> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such instruction: 
> `vpermpd $ 0xb1,%ymm2,%ymm2'
> ../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such instruction: 
> `vpermpd $ 0xb1,%ymm3,%ymm3'
> make[4]: *** [dtrmm_kernel_RN_HASWELL.o] Error 1
> make[4]: *** [dtrmm_kernel_RT_HASWELL.o] Error 1
> make[3]: *** [libs] Error 1
> *** Clean the OpenBLAS build with 'make -C deps clean-openblas'. Rebuild with 
> 'make OPENBLAS_USE_THREAD=0 if OpenBLAS had trouble linking libpthread.so, 
> and with 'make OPENBLAS_TARGET_ARCH=NEHALEM' if there were errors building 
> SandyBridge support. Both these options can also be used simultaneously. ***
> make[2]: *** [openblas-v0.2.10/libopenblas.so] Error 1
> make[1]: *** [julia-release] Error 2
> make: *** [release] Error 2
>
>
> Of course I tried the recommendations above i.e., clean-openblas followed by 
> ...THREAD=0 and ARCH-NEHALEM but I keep getting same errors.
> Any help is appreciated.
> Thanks
>
>

[julia-users] help needed with Julia install on Centos

2014-10-14 Thread Rajn
I am behind a firewall and cannot access the repo file as I see that 
connection is getting timed out.
I could not use git - 

git clone git://github.com/JuliaLang/julia.git
I get an error
connection reset by peer.
I did not try https clone because I do not know much about it and have to read 
up on it how to configure it.


So instead I download the tar file and decided to install it using make.
And here is the error summary that I get:

permpd $ 0x1b,%ymm0,%ymm0'
../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2539: Error: no such instruction: 
`vpermpd $ 0xb1,%ymm0,%ymm0'
../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such instruction: 
`vpermpd $ 0xb1,%ymm5,%ymm5'
../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such instruction: 
`vpermpd $ 0xb1,%ymm7,%ymm7'
../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such instruction: 
`vpermpd $ 0x1b,%ymm2,%ymm2'
../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such instruction: 
`vpermpd $ 0x1b,%ymm3,%ymm3'
../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such instruction: 
`vpermpd $ 0xb1,%ymm2,%ymm2'
../kernel/x86_64/dgemm_kernel_4x4_haswell.S:2548: Error: no such instruction: 
`vpermpd $ 0xb1,%ymm3,%ymm3'
make[4]: *** [dtrmm_kernel_RN_HASWELL.o] Error 1
make[4]: *** [dtrmm_kernel_RT_HASWELL.o] Error 1
make[3]: *** [libs] Error 1
*** Clean the OpenBLAS build with 'make -C deps clean-openblas'. Rebuild with 
'make OPENBLAS_USE_THREAD=0 if OpenBLAS had trouble linking libpthread.so, and 
with 'make OPENBLAS_TARGET_ARCH=NEHALEM' if there were errors building 
SandyBridge support. Both these options can also be used simultaneously. ***
make[2]: *** [openblas-v0.2.10/libopenblas.so] Error 1
make[1]: *** [julia-release] Error 2
make: *** [release] Error 2


Of course I tried the recommendations above i.e., clean-openblas followed by 
...THREAD=0 and ARCH-NEHALEM but I keep getting same errors.
Any help is appreciated.
Thanks



[julia-users] repmat :comparison with Matlab/Octave - 6x slow?

2014-10-13 Thread Rajn


Hi,
I have two questions.

First question:

I have a fairly simple problem which can be solved in many ways.

To begin I have a vector
z1=Array(Float64,1,0)

I have 
Z=1:0.01:100

I would like to generate a vector in which each element is repeated 
length(Z) times i.e., [1 1 1 1length(Z) times 1.01 1.01 
1.01length(Z) times and so on

When I do
for j=1:length(Z)
 z1=[z1 repmat([Z[j]],1,length(Z)]
end

and compare the time for this exact code with Matlab's/Octave, Julia takes 
7 seconds in comparison to 1.5 seconds for Matlab/Octave.

Of course I did not see any improvement using 
z1=[z1 ones(1,length(Z))*Z[j]]

It took practically the same time.

However, this reduced to fraction of a second...i.e., after I generated a 
vector of zeros and just replaced the zeros appropriately.
z1=zeros(1,length(Z)^2)
length(Z)=dd
for j=1:dd
 v=1:dd:(dd-1)*dd
 z1[1,v[j]:(v[j+dd-1])]=Z[j];
end

 Of course even Octave/Matlab became equally fast with this code.

So what gives in repmat for Julia? Why is it slow? Have I gone wrong with 
my first code?




Question 2:
If I start with A=[]
How do I vcat or hcat a row or a column vector to A in a for loop form a 
MATRIX.
say my vector is A(10x1) and I want to make B=[A[1] A[2] A[3] A[4]] which 
is a 10x4 matrix.
In Octave I would do
B=[]
B=[B A[j]] in a for loop.

Thanks


Re: [julia-users] Re: julia unable to install on Ubuntu 13.10

2014-01-30 Thread Rajn
Ok bump anyone for this?
I found the link which exactly refers to the errors I am getting during 
'make' and is referred to as Haswell bug!
However, from the link I am unable to understand what is the resolution to 
this problem.
Can someone please point out to me the right direction?
Thanks

The link is : https://github.com/JuliaLang/julia/issues/4300


>

Re: [julia-users] Matlab versus Julia for loop timing

2014-01-30 Thread Rajn
Stefan,
You wanted to know how the nuclear option worked in comparison to usage of 
sum(sub(A,...) for my problem.
This is just AMAZING!

@time for your 2nd suggestion i.e., sum,sub gave a time of 12.9 seconds
@time for your 3rd suggestion i.e., -nuclear suggestion gave a time of 
0.36. This is unbelievable!! Am I doing this right? I just took both your 
code, inserted into my code and only timed this specific section.
Does this mean that sum and sub together take nearly 35 times long to run 
through 1440*1782 loops or a delay of ~40 microsecond per loop?   WOW!



On Wednesday, January 29, 2014 12:59:27 PM UTC-5, Stefan Karpinski wrote:
>
> This sum(sum(foo,2)) business is really wasteful. Just do sum(foo) to take 
> the sum of foo. It's also better to extract the dimensions into individual 
> variables. Something like this:
>
> function runave1(S,A,f)
>   s1, s2 = size(A)
>   p1 = f+1
>   for n = f+1:s2-f-1, m = f+1:s1-f
> S[m,n+1] = S[m,n] + sum(A[m-f:m+f,n+p1]) - sum(A[m-f:m+f,n-f])
>   end
>   S
> end
>
>
> I suspect that since Matlab forces this sum(sum(X,2)) idiom on you, it 
> probably detects it and automatically does the efficient thing. It's 
> unclear to me why you need two sum operations when the slices you're taking 
> are just single columns, but maybe I'm missing something here.
>
> Currently, taking array slices in Julia makes a copy, which is 
> unfortunate, but in the future they will be views. In the meantime, you 
> might get better performance by explicitly using views:
>
> function runave2(S,A,f)
>   s1, s2 = size(A)
>   p1 = f+1
>   for n = f+1:s2-f-1, m = f+1:s1-f
> S[m,n+1] = S[m,n] + sum(sub(A,m-f:m+f,n+p1)) - sum(sub(A,m-f:m+f,n-f))
>   end
>   S
> end
>
>
> And, of course, there's always the nuclear option for really performance 
> critical code, which is to write out the summation manually:
>  
> function runave3(S,A,f)
>   s1, s2 = size(A)
>   p1 = f+1
>   for n = f+1:s2-f-1, m = f+1:s1-f
> t = S[m,n]
> for k = m-f:m+f; t += A[k,n+p1] - A[k,n-f]; end
> S[m,n+1] = t
>   end
>   S
> end
>
>
> Not so elegant, but probably the fastest possible version. Ideally, once 
> array slices are views, the simpler version of the code will be essentially 
> equivalent to this. It will take some compiler cleverness, but it's 
> certainly doable. It would be interesting to hear how each of these 
> versions performs on your data.
>
> On Wed, Jan 29, 2014 at 12:30 PM, John Myles White 
> 
> > wrote:
>
>> Can you show the call to @time / @elapsed so we know exactly what's being 
>> timed?
>>
>>  -- John
>>
>> On Jan 29, 2014, at 9:28 AM, Rajn > 
>> wrote:
>>
>> > Now it takes even longer i.e., ~1 minute
>> >
>> > Does this make sense. Also I am running this loop only once. I do not 
>> understand why writing in the function form would help. I read the manual 
>> but they suggest writing function form for something which is used many 
>> times.
>> > I=runave(S,A,f)
>> > showim(I);
>> >
>> > function runave(S,A,f)
>> >   imsz=size(A);
>> >   p1=f+1;
>> >   for n=(f+1):(imsz[2]-f-1)
>> > for m=(f+1):(imsz[1]-f)
>> >   
>> S[m,n+1]=S[m,n]+sum(sum(A[m-f:m+f,n+p1],2))-sum(sum(A[m-f:m+f,n-f],2));
>> > end
>> >   end
>> >   S;
>> > end
>> >
>> > Do I have to declare function parameters to speed it up.
>>
>>
>

Re: [julia-users] Re: julia unable to install on Ubuntu 13.10

2014-01-29 Thread Rajn

The error I am getting is

osutils.jl
Illegal instruction (core dumped)
make[1]: *** [/home/rajan/julia/usr/lib/julia/sys0.bc] Error 132
make: *** [debug] Error 2

now I wonder if osutils.jl is corrupted on the git?

Can some one please take a look at this and let me know if this is fine?

osutils.jl
function is_unix(os::Symbol)
if (os==:Windows) return false; 
elseif (os==:Linux) return true; 
elseif (os==:FreeBSD) return true; 
elseif (os==:Darwin) return true; 
else error("unknown operating system")
end
end

function _os_test(qm,ex,test)
@assert qm == :?
@assert isa(ex,Expr)
@assert ex.head == :(:)
@assert length(ex.args) == 2
if test
return esc(ex.args[1])
else
return esc(ex.args[2])
end
end
macro windows(qm,ex)
_os_test(qm, ex, OS_NAME===:Windows)
end
macro unix(qm,ex)
_os_test(qm, ex, is_unix(OS_NAME))
end
macro osx(qm,ex)
_os_test(qm, ex, OS_NAME===:Darwin)
end
macro linux(qm,ex)
_os_test(qm, ex, is_unix(OS_NAME) && OS_NAME!==:Darwin)
end

macro windows_only(ex)
@windows? esc(ex) : nothing
end
macro unix_only(ex)
@unix? esc(ex) : nothing
end
macro osx_only(ex)
@osx? esc(ex) : nothing
end
macro linux_only(ex)
@linux? esc(ex) : nothing
end



Re: [julia-users] Matlab versus Julia for loop timing

2014-01-29 Thread Rajn
Now it takes even longer i.e., ~1 minute

Does this make sense. Also I am running this loop only once. I do not 
understand why writing in the function form would help. I read the manual 
but they suggest writing function form for something which is used many 
times.
I=runave(S,A,f)
showim(I);

function runave(S,A,f)
  imsz=size(A);
  p1=f+1;
  for n=(f+1):(imsz[2]-f-1)
for m=(f+1):(imsz[1]-f)
  
S[m,n+1]=S[m,n]+sum(sum(A[m-f:m+f,n+p1],2))-sum(sum(A[m-f:m+f,n-f],2));
end
  end
  S;
end

Do I have to declare function parameters to speed it up.


Re: [julia-users] Matlab versus Julia for loop timing

2014-01-29 Thread Rajn
No i did not. Thanks for pointing out

On Wednesday, January 29, 2014 11:16:07 AM UTC-5, Jacob Quinn wrote:
>
> Are you wrapping your code in a function? If not, it's going to slow the 
> code down a lot because it's in global scope and variable type checking 
> will be happening all over the place. Check out the performance tips page 
> in the Julia manual for other ideas: 
> http://docs.julialang.org/en/latest/manual/performance-tips/
>
> -Jacob
>
>
> On Wed, Jan 29, 2014 at 11:13 AM, Rajn  >wrote:
>
>> Hi,
>> I am importing an image - gray scale, size (1440,1776,1).
>>
>> I wrote a simple code for performing a running average with a square 
>> filter of size 2*f+1, with f as a variable. 
>> I am not performing running average over the boundaries i.e., neglecting 
>> boundary pixels.
>>
>>
>> Leaving aside the time to import image or display image in Matlab or 
>> Julia, I see that Matlab takes about 15 seconds and Julia (35 seconds).
>> And there is only one section of recursive code which takes up this much 
>> time.
>>
>> The code is:
>>
>> S is sums over image pixels which are in Matrix A. 
>> I declare all in the beginning. Their sizes are declared. For example,
>>
>> A=1.0*data(img); #This extracts the image array from img image imported 
>> through Image. It is in Uint8 but multiplying by 1.0 converts it to Float64.
>> S=zeros(Float64,imsz);
>>
>>  The initial values of S have been calculated in an earlier section of 
>> the code and that is pretty fast. 
>> The main slower are the following lines. The entire code takes 35 seconds 
>> to run and this one takes most of that time (~34.9seconds).
>>
>> p1=f+1;
>> #for m=(f+1):(imsz[1]-f)  #imsz(1)=1440, imsz(2)=1776.
>> #  for n=(f+1):(imsz[2]-f-1)
>> for n=(f+1):(imsz[2]-f-1)
>>   for m=(f+1):(imsz[1]-f)
>> 
>> S[m,n+1]=S[m,n]+sum(sum(A[m-f:m+f,n+p1],2))-sum(sum(A[m-f:m+f,n-f],2));
>>   end
>> end
>>
>> I tried both ways i.e., using sum and also actually summing A in a 
>> separate for loop. If I do that it takes about 60 seconds. So 'sum' is 
>> faster than looping and adding to A.
>> I also tried first column wise and then row wise looping as you will see 
>> in the commented section. It takes the same time - does not matter which 
>> way I do the loop. 
>>
>> Matlab code: takes about 14 seconds.
>>
>> p1=f+1;
>> for m=(f+1):(imsz(1)-f)
>>   for n=(f+1):(imsz(2)-f-1)
>> S(m,n+1)=S(m,n)+(sum(A(m-f:m+f,n+p1),2))-(sum(A(m-f:m+f,n-f),2));
>>   end
>> end
>>
>> Any suggestions? Unfortunately my codes are on two different machines. 
>> Doubt if that make a difference? 2.3GHz,4Gb RAM-Matlab
>> 3.4GHz,8Gb RAM-Julia
>>
>>
>

[julia-users] Matlab versus Julia for loop timing

2014-01-29 Thread Rajn
Hi,
I am importing an image - gray scale, size (1440,1776,1).

I wrote a simple code for performing a running average with a square filter 
of size 2*f+1, with f as a variable. 
I am not performing running average over the boundaries i.e., neglecting 
boundary pixels.


Leaving aside the time to import image or display image in Matlab or Julia, 
I see that Matlab takes about 15 seconds and Julia (35 seconds).
And there is only one section of recursive code which takes up this much 
time.

The code is:

S is sums over image pixels which are in Matrix A. 
I declare all in the beginning. Their sizes are declared. For example,

A=1.0*data(img); #This extracts the image array from img image imported 
through Image. It is in Uint8 but multiplying by 1.0 converts it to Float64.
S=zeros(Float64,imsz);

The initial values of S have been calculated in an earlier section of the 
code and that is pretty fast. 
The main slower are the following lines. The entire code takes 35 seconds 
to run and this one takes most of that time (~34.9seconds).

p1=f+1;
#for m=(f+1):(imsz[1]-f)  #imsz(1)=1440, imsz(2)=1776.
#  for n=(f+1):(imsz[2]-f-1)
for n=(f+1):(imsz[2]-f-1)
  for m=(f+1):(imsz[1]-f)
S[m,n+1]=S[m,n]+sum(sum(A[m-f:m+f,n+p1],2))-sum(sum(A[m-f:m+f,n-f],2));
  end
end

I tried both ways i.e., using sum and also actually summing A in a separate 
for loop. If I do that it takes about 60 seconds. So 'sum' is faster than 
looping and adding to A.
I also tried first column wise and then row wise looping as you will see in 
the commented section. It takes the same time - does not matter which way I 
do the loop. 

Matlab code: takes about 14 seconds.

p1=f+1;
for m=(f+1):(imsz(1)-f)
  for n=(f+1):(imsz(2)-f-1)
S(m,n+1)=S(m,n)+(sum(A(m-f:m+f,n+p1),2))-(sum(A(m-f:m+f,n-f),2));
  end
end

Any suggestions? Unfortunately my codes are on two different machines. 
Doubt if that make a difference? 2.3GHz,4Gb RAM-Matlab
3.4GHz,8Gb RAM-Julia



[julia-users] Re: Installing Julia on Ubuntu12.04

2014-01-29 Thread Rajn
Hi,
On the Github (or perhaps on the download?) page of Julia there are 
instructions as to what you should do when 'make' fails. There is a 
procedure for BLAS failure mentioned there.
You have to make a new file if it already does not exist called Make.user 
and then type in those commands. Then do a 'make clean' or 'make cleanall' 
and then try 'make' again.
Maybe you already tried it?



On Wednesday, January 29, 2014 4:36:45 AM UTC-5, Dirk Fortmeier wrote:
>
> Hi,
>
> A few days ago I installed julialang on my laptop (Ubuntu 12.04). Now, I 
> want to install it on my desktop machine (Ubuntu 12.04 as well), but while 
> running make this error appears:
>
> $ make
> ...
> ...
>
> /usr/bin/ld: cannot find -lgfortran
> collect2: ld returned 1 exit status
> make[4]: *** [../libopenblasp-r0.2.8.so] Error 1
> make[3]: *** [shared] Error 2
> *** Clean the OpenBLAS build with 'make -C deps clean-openblas'. Rebuild 
> with 'make OPENBLAS_USE_THREAD=0 if OpenBLAS had trouble linking 
> libpthread.so, and with 'make OPENBLAS_TARGET_ARCH=NEHALEM' if there were 
> errors building SandyBridge support. Both these options can also be used 
> simultaneously. ***
> make[2]: *** [openblas-v0.2.8/libopenblas.so] Error 1
> make[1]: *** [julia-release] Error 2
> make: *** [release] Error 2
>
>
>
> fortran is installed on this machine:
>
> # apt-get install libgfortran3 gfortran
> Reading package lists... Done
> Building dependency tree   
> Reading state information... Done
> gfortran is already the newest version.
> libgfortran3 is already the newest version.
> The following packages were automatically installed and are no longer 
> required:
>   patchutils dpatch
> Use 'apt-get autoremove' to remove them.
> 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
>
> Any ideas?
>
> Kind regards,
>
> Dirk
>


Re: [julia-users] Re: julia unable to install on Ubuntu 13.10

2014-01-27 Thread Rajn
Hi,
I am having good time coding in Julia on my Windows at work. However, at 
home Linux is not still able to work with Julia.
Hope it gets resolved at some point - otherwise I am thinking of a fresh 
install of Ubuntu 13.10 (not Xubuntu which is my current system). Are there 
folks who are running 

1. Julia on Ubuntu 13.10
2. On Ubuntu with R installed?

Please let me know if anyone has succeeded in installing Julia and also any 
advice on installation.
Thank you.




Re: [julia-users] Re: not loading python module

2014-01-27 Thread Rajn
This worked finally!
I did pyinitialize("C:\Anaconda\python") as suggested by Steve.
I am now able to use PyPlot.
So the question remains...what is broken in PyCall?
What is the solution
Thanks


On Monday, January 27, 2014 2:28:45 PM UTC-5, Steven G. Johnson wrote:
>
> I installed on a fresh machine with Anaconda, and I didn't have to set any 
> environment variables at all ... everything needed was done by the Anaconda 
> installer.   My guess is that you have some leftover settings (environment 
> vars? registry?) from your earlier attempts with Enthought or whatever and 
> it is screwing things up.
>
> On Monday, January 27, 2014 2:09:54 PM UTC-5, Rajn wrote:
>>
>> Yes, I did both.
>> I tried just PYTHONHOME=C:\Anaconda
>> did not work.
>>
>> Can you please advice me on the following please?
>> 1. that while installing pyplot, the PYTHONHOME variable should already 
>> be set?
>> 2. is there any way to print out variables from PyCall.jl? If I can print 
>> the variable 'lib' to what it is printing? According to the error displayed 
>> it occurs when it looks for the library directory.
>> I tried to force it to "python27.dll" but I am always getting the same 
>> error no matter what.
>> 3. what should I try in pyinitialize("?") - should it be python27? Tried 
>> it but did not work.
>>
>
> Try pyinitialize("C:\Anaconda\python"), or whatever the name of your 
> executable is; you could also try giving it the DLL location directly, i.e. 
> pyinitialize("C:\Anaconda\python27.dll")
>


Re: [julia-users] Re: not loading python module

2014-01-27 Thread Rajn
Hi,
I just populated the outputs to gist through your link.
Not sure if I should save it or if I have to sign in? The file was named as 
Rajn_notloadingpython

Thanks



On Monday, January 27, 2014 1:07:55 PM UTC-5, Isaiah wrote:
>
> Please upload the following outputs in a gist (gist.github.com)
>
> 1. julia> versioninfo()
> 2. Pkg.build("PyCall")
>
> 3. all version info when you start python ("Python 2.7.5 | Anaconda...")
> 4. python>>> sys.path
>
>
>
> On Mon, Jan 27, 2014 at 1:02 PM, Rajan Gurjar 
> > wrote:
>
>> After every install of pyplot (or any graphing app) failing in Windows 
>> and install of Julia failing in Linux - went back to Windows.
>>
>> Uninstalled Enthought, removed Julia.
>>
>> Got Anaconda, then installed Julia.
>>
>> This is the error I get.
>>
>> julia> using PyPlot
>> ERROR: could not load module python: The specified module could not be 
>> found.
>>
>>  in pyinitialize at C:\Users\RGurjar\.julia\PyCall\src\PyCall.jl:422
>>  in pyinitialize at C:\Users\RGurjar\.julia\PyCall\src\PyCall.jl:417
>> WARNING: backtraces on your platform are often misleading or partially 
>> incorrect
>>
>>
>> Looks like back to square one? 
>> for information
>> PYTHONHOME is set to C:\Anaconda;C:\Anaconda\Scripts
>> PYTHONPATH is set to C:\Anaconda\Lib
>>
>> Help please
>>
>>
>>
>> On Sat, Jan 25, 2014 at 3:33 PM, Rajan Gurjar 
>> 
>> > wrote:
>>
>>> Hi Bert,
>>> I also have a virtual Xubuntu. However, when I tried building Julia from 
>>> Github it did not work. So I am guessing that even virtual Xubuntu will not 
>>> work. However, I should try Virtual Ubuntu 12.04 as you suggested.
>>> Thanks
>>>
>>>
>>> On Sat, Jan 25, 2014 at 3:31 PM, Rajan Gurjar 
>>> 
>>> > wrote:
>>>
>>>> Hi Stefan,
>>>> I having more trouble with Linux as you will see from my other post 
>>>> (concerning Linux issues) and that is because I have R installed - so some 
>>>> issues with RMath library. Instead why I tried to build it myself from the 
>>>> Git it gives a crash status. Found out some issues with Xubuntu.
>>>> That is latest. I will try out bert's suggestion next.
>>>> I still have to try uninstalling Enthought from Windows - replace it by 
>>>> Anaconda and then hopefully everything will be fine. That is a backup plan.
>>>>
>>>>
>>>> On Sat, Jan 25, 2014 at 2:08 PM, Stefan Karpinski 
>>>> 
>>>> > wrote:
>>>>
>>>>> Sorry you're having trouble with this. Windows is always a problem 
>>>>> child but installing Julia on Linux should not present any major problems.
>>>>>
>>>>>
>>>>> On Fri, Jan 24, 2014 at 10:08 PM, Rajn 
>>>>> > wrote:
>>>>>
>>>>>> Well actually I tried linux too. I have latest Xubuntu 13.0 version 
>>>>>> and Julia does not even install (worse than Windows) when I try its 
>>>>>> repositories suggested in the download webpage. Some issue with unmet 
>>>>>> dependencies with some math library.
>>>>>> I guess I will stick to Octave and python for now and come back to 
>>>>>> Julia next year when things are a bit better resolved.
>>>>>> I wish I had more time to play around but I am hard pressed for time.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Friday, January 24, 2014 7:16:41 PM UTC-5, Jake Bolewski wrote:
>>>>>>>
>>>>>>> Honestly after fighting with Python on Windows for many years, your 
>>>>>>> best course of action is probably to uninstall everything and try again 
>>>>>>> from scratch.  I would back Steven's suggestion to install Anaconda if 
>>>>>>> you 
>>>>>>> are able.  It sounds like more work but in the end it is the only way 
>>>>>>> to 
>>>>>>> preserve your sanity.
>>>>>>>
>>>>>>>
>>>>>>> On Friday, January 24, 2014 5:36:24 PM UTC-5, Steven G. Johnson 
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> On Friday, January 24, 2014 3:59:38 PM UTC-5, Rajn wrote:
>>>>>>>>>
>>>>>>>>> Sorry Steve,
>>>>>>>>> There is no PYTHONPATH in the Windows environment variable. I have 
>>>>>>>>> not set that variable. I miswrote earlier.
>>>>>>>>> There is only PYTHONHOME which is set to C:\Python27
>>>>>>>>>
>>>>>>>>
>>>>>>>> You might try setting your PYTHONPATH variable, so that libpython 
>>>>>>>> can use it to find the Python modules it is missing.
>>>>>>>>
>>>>>>>
>>>>>
>>>>
>>>
>>
>

Re: [julia-users] Re: not loading python module

2014-01-27 Thread Rajn
Yes, I did both.
I tried just PYTHONHOME=C:\Anaconda
did not work.

Can you please advice me on the following please?
1. that while installing pyplot, the PYTHONHOME variable should already be 
set?
2. is there any way to print out variables from PyCall.jl? If I can print 
the variable 'lib' to what it is printing? According to the error displayed 
it occurs when it looks for the library directory.
I tried to force it to "python27.dll" but I am always getting the same 
error no matter what.
3. what should I try in pyinitialize("?") - should it be python27? Tried it 
but did not work.

Thanks

My dist_utils show the following:
{'EXE': '.exe', 'exec_prefix': 'C:\\Anaconda', 'LIBDEST': 
'C:\\Anaconda\\Lib', 'prefix': 'C:\\Anaconda', 'VERSION': '27', 'SO': 
'.pyd', 'BINLIBDEST': 'C:\\Anaconda\\Lib', 'INCLUDEPY': 
'C:\\Anaconda\\include', 'BINDIR': 'C:\\Anaconda'}
>>> python-config --ldflags
 

On Monday, January 27, 2014 1:34:25 PM UTC-5, Steven G. Johnson wrote:
>
> Weird, Anaconda has always worked out of the box for me on Windows.  When 
> you installed Anaconda, did you check the boxes "*Add Anaconda to the 
> System Path"* and also *"Register Anaconda as default Python version of 
> the system"* in the installer?
>
>
> On Monday, January 27, 2014 1:02:48 PM UTC-5, Rajn wrote: 
>
>> PYTHONHOME is set to C:\Anaconda;C:\Anaconda\Scripts
>> PYTHONPATH is set to C:\Anaconda\Lib
>>
>
> (Normally, I thought it was just PYTHONHOME=C:\Anaconda) 
>
>
>  
>


[julia-users] Re: julia unable to install on Ubuntu 13.10

2014-01-26 Thread Rajn
Bump anyone? What does this mean? Next steps please?

osutils.jl
Illegal instruction (core dumped)
make[1]: *** [/home/rajan/julia/usr/lib/
julia/sys0.bc] Error 132
make: *** [release] Error 2


On Friday, January 24, 2014 10:30:18 PM UTC-5, Rajn wrote:
>
> After my several failed attempts to run PyPlot through Julia in Windows, I 
> decided to give up and try Linux.
> Guess it was even worse.
>
> First I added to regular repository (not the nightlybuild)
> then added the dep-repository
> then updated and
> then installed julia
>
> Here's the latest:
> Unpacking librmath-dev (from 
> .../librmath-dev_2.15.2-juliadeps2~raring_amd64.deb) ...
> dpkg: error processing 
> /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb 
> (--unpack):
>  trying to overwrite '/usr/include/Rmath.h', which is also in package 
> r-mathlib 3.0.1-3ubuntu1
> No apport report written because MaxReports is reached already
>   Selecting 
> previously unselected package julia.
> Unpacking julia (from .../julia_0.2.0~saucyfinal1_amd64.deb) ...
> Processing triggers for man-db ...
> Errors were encountered while processing:
>  /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb
> E: Sub-process /usr/bin/dpkg returned an error code (1)
>
> Have no clue absolutely how to proceed. The same issue occurs when I try 
> nightly builds.
>
>
>

Re: [julia-users] julia unable to install on Ubuntu 13.10

2014-01-24 Thread Rajn
I got the instructions from julia github page. What I do not get is -what 
do I do with Rmath.h - why is that not any more an issue now when I install 
from Github.


On Saturday, January 25, 2014 12:25:11 AM UTC-5, Rajn wrote:
>
> I use R quite often. Would it be affected if I uninstall Rmath?
>
> I kind of understand what you are suggesting in your second step but never 
> worked with Github so don't know about cloning and not sure what do you 
> mean by switching to 0.2.0- switching from what? And how do I do that? 
> Should I just copy the files from Github and extract it and then do 
> makefile?
> Are there somewhere good instructions on how to do that?
> Thanks Joao
>
>
> On Saturday, January 25, 2014 12:13:23 AM UTC-5, João Felipe Santos wrote:
>>
>> There is a conflict between Ubuntu's r-mathlib package and Julia's RMath 
>> package: they both want to install Rmath.h to the same path. If you can 
>> live without r-libmath, you can uninstall it and then install Julia. 
>>
>> Having said that, I usually compile my own distribution and install it to 
>> my home directory. You can clone the repository from Github and then switch 
>> to 0.2.0. It takes a while but if your PC is not that old you'll be done in 
>> less than an hour.
>>
>> --
>> João Felipe Santos
>>
>>
>> On Fri, Jan 24, 2014 at 10:30 PM, Rajn  wrote:
>>
>>> After my several failed attempts to run PyPlot through Julia in Windows, 
>>> I decided to give up and try Linux.
>>> Guess it was even worse.
>>>
>>> First I added to regular repository (not the nightlybuild)
>>> then added the dep-repository
>>> then updated and
>>> then installed julia
>>>
>>> Here's the latest:
>>> Unpacking librmath-dev (from 
>>> .../librmath-dev_2.15.2-juliadeps2~raring_amd64.deb) ...
>>> dpkg: error processing 
>>> /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb 
>>> (--unpack):
>>>  trying to overwrite '/usr/include/Rmath.h', which is also in package 
>>> r-mathlib 3.0.1-3ubuntu1
>>> No apport report written because MaxReports is reached already
>>>   Selecting 
>>> previously unselected package julia.
>>> Unpacking julia (from .../julia_0.2.0~saucyfinal1_amd64.deb) ...
>>> Processing triggers for man-db ...
>>> Errors were encountered while processing:
>>>  /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb
>>> E: Sub-process /usr/bin/dpkg returned an error code (1)
>>>
>>> Have no clue absolutely how to proceed. The same issue occurs when I try 
>>> nightly builds.
>>>
>>>
>>>
>>

Re: [julia-users] julia unable to install on Ubuntu 13.10

2014-01-24 Thread Rajn
I use R quite often. Would it be affected if I uninstall Rmath?

I kind of understand what you are suggesting in your second step but never 
worked with Github so don't know about cloning and not sure what do you 
mean by switching to 0.2.0- switching from what? And how do I do that? 
Should I just copy the files from Github and extract it and then do 
makefile?
Are there somewhere good instructions on how to do that?
Thanks Joao


On Saturday, January 25, 2014 12:13:23 AM UTC-5, João Felipe Santos wrote:
>
> There is a conflict between Ubuntu's r-mathlib package and Julia's RMath 
> package: they both want to install Rmath.h to the same path. If you can 
> live without r-libmath, you can uninstall it and then install Julia. 
>
> Having said that, I usually compile my own distribution and install it to 
> my home directory. You can clone the repository from Github and then switch 
> to 0.2.0. It takes a while but if your PC is not that old you'll be done in 
> less than an hour.
>
> --
> João Felipe Santos
>
>
> On Fri, Jan 24, 2014 at 10:30 PM, Rajn  >wrote:
>
>> After my several failed attempts to run PyPlot through Julia in Windows, 
>> I decided to give up and try Linux.
>> Guess it was even worse.
>>
>> First I added to regular repository (not the nightlybuild)
>> then added the dep-repository
>> then updated and
>> then installed julia
>>
>> Here's the latest:
>> Unpacking librmath-dev (from 
>> .../librmath-dev_2.15.2-juliadeps2~raring_amd64.deb) ...
>> dpkg: error processing 
>> /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb 
>> (--unpack):
>>  trying to overwrite '/usr/include/Rmath.h', which is also in package 
>> r-mathlib 3.0.1-3ubuntu1
>> No apport report written because MaxReports is reached already
>>   Selecting 
>> previously unselected package julia.
>> Unpacking julia (from .../julia_0.2.0~saucyfinal1_amd64.deb) ...
>> Processing triggers for man-db ...
>> Errors were encountered while processing:
>>  /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb
>> E: Sub-process /usr/bin/dpkg returned an error code (1)
>>
>> Have no clue absolutely how to proceed. The same issue occurs when I try 
>> nightly builds.
>>
>>
>>
>

[julia-users] julia unable to install on Ubuntu 13.10

2014-01-24 Thread Rajn
After my several failed attempts to run PyPlot through Julia in Windows, I 
decided to give up and try Linux.
Guess it was even worse.

First I added to regular repository (not the nightlybuild)
then added the dep-repository
then updated and
then installed julia

Here's the latest:
Unpacking librmath-dev (from 
.../librmath-dev_2.15.2-juliadeps2~raring_amd64.deb) ...
dpkg: error processing 
/var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb 
(--unpack):
 trying to overwrite '/usr/include/Rmath.h', which is also in package 
r-mathlib 3.0.1-3ubuntu1
No apport report written because MaxReports is reached already
  Selecting 
previously unselected package julia.
Unpacking julia (from .../julia_0.2.0~saucyfinal1_amd64.deb) ...
Processing triggers for man-db ...
Errors were encountered while processing:
 /var/cache/apt/archives/librmath-dev_2.15.2-juliadeps2~raring_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Have no clue absolutely how to proceed. The same issue occurs when I try 
nightly builds.




Re: [julia-users] Re: not loading python module

2014-01-24 Thread Rajn
Well actually I tried linux too. I have latest Xubuntu 13.0 version and 
Julia does not even install (worse than Windows) when I try its 
repositories suggested in the download webpage. Some issue with unmet 
dependencies with some math library.
I guess I will stick to Octave and python for now and come back to Julia 
next year when things are a bit better resolved.
I wish I had more time to play around but I am hard pressed for time.


On Friday, January 24, 2014 7:16:41 PM UTC-5, Jake Bolewski wrote:
>
> Honestly after fighting with Python on Windows for many years, your best 
> course of action is probably to uninstall everything and try again from 
> scratch.  I would back Steven's suggestion to install Anaconda if you are 
> able.  It sounds like more work but in the end it is the only way to 
> preserve your sanity.
>
>
> On Friday, January 24, 2014 5:36:24 PM UTC-5, Steven G. Johnson wrote:
>>
>> On Friday, January 24, 2014 3:59:38 PM UTC-5, Rajn wrote:
>>>
>>> Sorry Steve,
>>> There is no PYTHONPATH in the Windows environment variable. I have not 
>>> set that variable. I miswrote earlier.
>>> There is only PYTHONHOME which is set to C:\Python27
>>>
>>
>> You might try setting your PYTHONPATH variable, so that libpython can use 
>> it to find the Python modules it is missing.
>>
>

[julia-users] Re: not loading python module

2014-01-24 Thread Rajn
Hi Thanks Steve,

This is how far I got after making the following changes:
changed PYTHONPATH to C:\Python27

and in PyCall.jl
ENV["PYTHONHOME"]=exec_prefix 

using PyCall gives me this error now


julia> using PyPlot
WARNING: No working GUI backend found for matplotlib.
ERROR: PyError (PyImport_ImportModule) 
ImportError('DLL load failed: The specified module could not be found.',)
  File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 23, in 

from matplotlib.figure import Figure, figaspect
  File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 16, in 

import artist
  File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 6, in 


from transforms import Bbox, IdentityTransform, TransformedBbox, 
Transformed
Path
  File "C:\Python27\lib\site-packages\matplotlib\transforms.py", line 34, 
in 
from matplotlib._path import affine_transform

at C:\Users\RGurjar\.julia\PyPlot\src\PyPlot.jl:94

Do you think I am a step closer or just take your suggestion and move on to 
Anaconda. Do I have to uninstall Enthought edition?



On Thursday, January 23, 2014 6:38:08 PM UTC-5, Steven G. Johnson wrote:
>
> On Thursday, January 23, 2014 3:30:00 PM UTC-5, Rajn wrote:
>>
>> I will appreciate some help here. And also I have only one python 
>> installation which is the Enthought edition.
>> Also a related question, if I change something in *.jl such as what I 
>> changed above, I read that I have do reverse git. I have no idea what that 
>> is.
>> Really I am quite fresh to this. So please can someone guide me here?
>>
>
> PyCall doesn't work with Enthought Python:
>
> https://github.com/stevengj/PyCall.jl/issues/42
>
> Last I checked, it was because their sysutils.distconfig is completely 
> broken, and I hadn't found a clean workaround.  I recommend Anaconda Python 
> if you want a prepackaged Python distro. 
>


[julia-users] not loading python module

2014-01-23 Thread Rajn
Hi 
I followed suggestions and looked up help and searched for earlier similar 
problem. Found few and tried those out.
For example I set PYTHONPATH and PYTHONHOME variables (Python 2.7 is 
running because my path in windows was set to the bin for python).
Then I restarted Julia but I am getting same error.
I even changed PyCall.jl lines where few posts suggested issue with exec 
":". 
I changed back to 
:

ENV["PYTHONHOME"]=exec_prefix

by commenting the rest out (i.e., @windows? exec_prefix...etc)

But even this did not work.

I have windows 7-64 bit and downloaded latest Julia binary v0.2.0.

The error messages are:
could not load module python: The specified module could not be found

in pyinitialize at ..\src\PyCall.jl:413
in pyinitialize at ..\src\PyCall.jl:418
warning: backtraces on your platform are often misleading.

at ..\PyPlot.jl:32

I will appreciate some help here. And also I have only one python 
installation which is the Enthought edition.
Also a related question, if I change something in *.jl such as what I 
changed above, I read that I have do reverse git. I have no idea what that 
is.
Really I am quite fresh to this. So please can someone guide me here?

Thanks in advance.