[julia-users] Automatic doc tools for Julia

2015-03-12 Thread Ján Adamčák
Hi guys,

Can I ask you for something like best practice with auto doc tools for 
parsing Julia code? I try use Doxygen and Sphinx, but I think this is not 
good solutions in this time&version(0.3.6). And/Or some tool for generate 
UML diagrams from julia code?

Thanks.

P.S.:
My idea with this thread is generate something like big manual of knowlege 
how to use auto doc tools in Julia.


[julia-users] Re: performace of loops Julia vs Blas

2016-03-21 Thread Ján Adamčák
You can use blas_set_num_threads(1) in julia and it will use only 1 
thread... but this is not right answer

Dňa pondelok, 21. marca 2016 9:49:23 UTC+1 Igor Cerovsky napísal(-a):
>
> Hi,
>
> Trying to write custom and using BLAS functions implementation of 
> Gram-Schmidt algorithm I got more than 2-times slower performance for Julia 
> 0.4.3 on my computer Intel i7 6700HQ (on older processor i7 5500 the 
> performance gain is 1.2-times). The code below is a bit longer, but I got 
> the slow performance in the whole context. Trying to profile parts of the 
> algorithm I got only slightly different performance.
>
> Custom implementation:
>
> function rank1update!(DST, A, R, k)
> rows, cols = size(A)
> for j = k+1:cols
> @simd for i = 1:rows
> @inbounds DST[i,j] -= A[i, k] * R[k, j]
> end
> end
> end
>
> function mygemv!(DST, A, k, alpha)
> rows, cols = size(A)
> for j in k+1:cols
> s = 0.0
> @simd for i in 1:rows
> @inbounds s += A[i, k] * A[i, j]
> end  
> DST[k, j] = s * alpha
> end
> end
>
> function mgsf(M)
> rows, cols = size(M)
> Q = copy(M)
> R = eye(cols)
>
> for k in 1:cols
> alpha = 1.0 / sumabs2(sub(Q, :, k))
> mygemv!(R, Q, k, alpha)
> rank1update!(Q, Q, R, k)
> end
> Q, R
> end
>
> Implementation using BLAS functions:
> function mgs_blas(M)
> cols = size(M, 2)
> Q = copy(M)
> R = eye(cols)
>
> for k in 1:cols
> q_k = sub(Q, :, k)
> Q_sub = sub(Q, :, k+1:cols)
> R_sub = sub(R, k, k+1:cols)
>
> alpha = 1.0 / sumabs2(q_k)
> R[k, k+1:cols] = BLAS.gemv('T', alpha, Q_sub, q_k)
> BLAS.ger!(-1.0,  q_k, vec(R_sub), Q_sub)
> end
> 
> Q, R
> end
>
> And results; using BLAS the performance gain is ~2.6 times:
>
> # custom implementation
> Q2, R2 = @time mgsf(T);
>
>   0.714916 seconds (4.99 k allocations: 15.411 MB, 0.08% gc time)
>
>
> # implementation using BLAS functions 
>
> Q5, R5 = @time mgs_blas(T);
>
>   0.339278 seconds (16.45 k allocations: 23.521 MB, 0.76% gc time)
>
>
>
> A hint: Looking at performance graph in the Task Manager it seems BLAS 
> uses more cores.
> The question that remains is: what is going on?
>
> Thanks for explanation.
>
>

[julia-users] static compilation

2016-05-02 Thread Ján Adamčák
Hello,

Trying to create an executable from Julia source, there are questions that 
raised... The process of exporting functions wasn't successful, function(s) 
was not exported to dll, and even the generated dll cant be loaded in c++ 
code. Below is the process explained in details:

Can anybody bring more insight, how to build a standalone executable from 
Julia source?


Following resources were used for experiments below:

http://juliacomputing.com/blog/2016/02/09/static-julia.html

http://juliacomputing.com/blog/2016/03/10/j2c-announcement.html


Assume userimg.jl, which contains exported function(s):
# user functionality for DLL
@Base.ccallable foo(x::Int) = x+1


Now, create a dll:
julia.exe "build_sysimg.jl" "./Julia/Compile/bin/" native "julia_dll.jl" --
force



File build_sysimg.jl on line 77 contains following command flags:
   run(`$julia -C $cpu_target --output-ji $sysimg_path.ji --output-o
   $sysimg_path.o --sysimage ../../../lib/julia/sys.dll -J 
$inference_path.ji
   --startup-file=no sysimg.jl --compile=all --eval nothing`)

The resulting dll has 29MB.


The next step is to use the dll in c++ project:
#include 
#include 

typedef int(*fnc_foo) (int);

int main()
{
 HINSTANCE hDLL = LoadLibraryA("test_dll.dll");
 auto a = GetLastError();
 if (hDLL == nullptr)
   throw std::exception("test_dll.dll not found!");

 fnc_foo foo = (fnc_foo)GetProcAddress(hDLL, "foo");
 if(!foo)
   throw std::exception("foo in test_dll.dll not found!");

 std::cout << foo(10) << "\n";

 FreeLibrary(hDLL);

 return 0;
}

In the c++ code above the dll cannot be loaded, hDLL = nullptr, and the 
first exception is thrown.

Expecting the dll with Dependency Walker even an exported function foo() 
cannot be found.

Thanks for any suggestions.
Jan


[julia-users] Re: static compilation

2016-05-05 Thread Ján Adamčák
Nobody???

Dňa pondelok, 2. mája 2016 11:30:11 UTC+2 Ján Adamčák napísal(-a):
>
> Hello,
>
> Trying to create an executable from Julia source, there are questions that 
> raised... The process of exporting functions wasn't successful, function(s) 
> was not exported to dll, and even the generated dll cant be loaded in c++ 
> code. Below is the process explained in details:
>
> Can anybody bring more insight, how to build a standalone executable from 
> Julia source?
>
>
> Following resources were used for experiments below:
>
> http://juliacomputing.com/blog/2016/02/09/static-julia.html
>
> http://juliacomputing.com/blog/2016/03/10/j2c-announcement.html
>
>
> Assume userimg.jl, which contains exported function(s):
> # user functionality for DLL
> @Base.ccallable foo(x::Int) = x+1
>
>
> Now, create a dll:
> julia.exe "build_sysimg.jl" "./Julia/Compile/bin/" native "julia_dll.jl" 
> --force
>
>
>
> File build_sysimg.jl on line 77 contains following command flags:
>run(`$julia -C $cpu_target --output-ji $sysimg_path.ji 
> --output-o
>$sysimg_path.o --sysimage ../../../lib/julia/sys.dll -J 
> $inference_path.ji
>--startup-file=no sysimg.jl --compile=all --eval nothing`)
>
> The resulting dll has 29MB.
>
>
> The next step is to use the dll in c++ project:
> #include 
> #include 
>
> typedef int(*fnc_foo) (int);
>
> int main()
> {
>  HINSTANCE hDLL = LoadLibraryA("test_dll.dll");
>  auto a = GetLastError();
>  if (hDLL == nullptr)
>throw std::exception("test_dll.dll not found!");
>
>  fnc_foo foo = (fnc_foo)GetProcAddress(hDLL, "foo");
>  if(!foo)
>throw std::exception("foo in test_dll.dll not found!");
>
>  std::cout << foo(10) << "\n";
>
>  FreeLibrary(hDLL);
>
>  return 0;
> }
>
> In the c++ code above the dll cannot be loaded, hDLL = nullptr, and the 
> first exception is thrown.
>
> Expecting the dll with Dependency Walker even an exported function foo() 
> cannot be found.
>
> Thanks for any suggestions.
> Jan
>


Re: [julia-users] Re: static compilation

2016-05-06 Thread Ján Adamčák
lia 
> users 
> >> could be considered expert on this... 
> >> If the recipe given (long time ago i tried to follow this on a linux 
> >> installation which i general has more tooling to get shared libraries 
> and 
> >> compilation working...) doesn't work, you could raise a concrete issue 
> on 
> >> github - there you get more audience with julia internal know-how. 
> >> 
> >> Wishing a happy day, 
> >> 
> >>Andreas 
> >> 
> >> 
> >> On Friday, May 6, 2016 at 8:51:47 AM UTC+2, Ján Adamčák wrote: 
> >>> 
> >>> Nobody??? 
> >>> 
> >>> Dňa pondelok, 2. mája 2016 11:30:11 UTC+2 Ján Adamčák napísal(-a): 
> >>>> 
> >>>> 
> >>>> Hello, 
> >>>> 
> >>>> Trying to create an executable from Julia source, there are questions 
> >>>> that raised... The process of exporting functions wasn't successful, 
> >>>> function(s) was not exported to dll, and even the generated dll cant 
> be 
> >>>> loaded in c++ code. Below is the process explained in details: 
> >>>> 
> >>>> Can anybody bring more insight, how to build a standalone executable 
> >>>> from Julia source? 
> >>>> 
> > 
>


build_sysimg2.jl
Description: Binary data


Re: [julia-users] Re: static compilation

2016-05-09 Thread Ján Adamčák
Hello guys, 

Thank you for your comments, though we were more optimistic...


Dňa piatok, 6. mája 2016 16:27:28 UTC+2 Ján Adamčák napísal(-a):
>
> Sorry, my fault. 
>
> During last week I created build_sysimg2.jl from julia 0.4.5 
> build_sysimg.jl and when I run it, at line 86 (build_sysimg2.jl)
>
> run(`$julia -C $cpu_target --output-o sysimg_all.o --sysimage 
> $sysimg_path.$(Libdl.dlext) --startup-file=no --compile=all --eval nothing`)
>
> I got this error:
>
> fatal: error thrown and no exception handler available.
> ErrorException("Task cannot be serialized")
> jl_unprotect_stack at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_throw at C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll 
> (unknown line)
> jl_error at C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll 
> (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_save_system_image_to_stream at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_create_system_image at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_atexit_hook at C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll 
> (unknown line)
> unknown function (ip: 004028B5)
> unknown function (ip: 0040140C)
> unknown function (ip: 0040153B)
> BaseThreadInitThunk at C:\WINDOWS\system32\KERNEL32.DLL (unknown line)
> RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
> ERROR: LoadError: failed process: 
> Process(`'C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\julia' -C native 
> --output-o sysimg_all.o --sysimage my_img.dll --startup-file=no 
> --compile=all --eval nothing`, ProcessExited(1)) [1]
>  in run at process.jl:531
> while loading 
> c:\Users\Adam\AppData\Local\Julia-0.4.5\share\julia\build_sysimg2.jl, in 
> expression starting on line 191
>
>  Before this error, julia wrote some warnings:
>
> WARNING: could not attach metadata for @simd loop.
>
> Same error I got on Ubuntu 16.04...
>  
>
>
> Dňa piatok, 6. mája 2016 15:48:19 UTC+2 Jeff Bezanson napísal(-a):
>>
>> That command lin

Re: [julia-users] Re: static compilation

2016-05-12 Thread Ján Adamčák
Thanks @Jameson,

I am a bit confused about "you are not adding any code to the system image 
(`--eval nothing`)". According to your blog 
http://juliacomputing.com/blog/2016/02/09/static-julia.html , I think that 
this is a crucial point to obtain a small sized dll. Am I right?

What is then the right way to emit "ccallable" declarations in order to 
export julia function(s)? (foo in our example from the original post in 
this thread)

Is it okay to work with current version of julia 0.4.5. or I have to switch 
to another version; If yes, to which one?

Thanks in advance.

Dňa utorok, 10. mája 2016 22:13:57 UTC+2 Jameson napísal(-a):
>
> The compile-all flag is only partially functional on v0.4. I think it's 
> best to just leave it off. I tested on master and fixed a bug with emitting 
> `@ccallable`, but that's unrelated. From the command line below, it looks 
> like you are not adding any code to the system image (`--eval nothing`) 
> which would also means there are no `ccallable` declarations being emitted 
> into the current compile.
>
> Other than that, I don't see anything wrong with that command. You 
> shouldn't see that error unless you tried to make a Task or use `@async` 
> from the compile host. It's ambiguous how that would be serialized, so it's 
> simply an error and any parallel workers should be created / started by an 
> `__init__` method.
>
>
> On Tuesday, May 10, 2016 at 2:53:22 AM UTC-4, Ján Adamčák wrote:
>>
>> Hello guys, 
>>
>> Thank you for your comments, though we were more optimistic...
>>
>>
>> Dňa piatok, 6. mája 2016 16:27:28 UTC+2 Ján Adamčák napísal(-a):
>>>
>>> Sorry, my fault. 
>>>
>>> During last week I created build_sysimg2.jl from julia 0.4.5 
>>> build_sysimg.jl and when I run it, at line 86 (build_sysimg2.jl)
>>>
>>> run(`$julia -C $cpu_target --output-o sysimg_all.o --sysimage 
>>> $sysimg_path.$(Libdl.dlext) --startup-file=no --compile=all --eval nothing`)
>>>
>>> I got this error:
>>>
>>> fatal: error thrown and no exception handler available.
>>> ErrorException("Task cannot be serialized")
>>> jl_unprotect_stack at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_throw at C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll 
>>> (unknown line)
>>> jl_error at C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll 
>>> (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>> jl_compress_ast at 
>>> C:\Users\Adam\AppData\Local

Re: [julia-users] Re: static compilation

2016-05-13 Thread Ján Adamčák


Thanks @Jameson,


I have successfully built .so with "--compile=all" flag on 0.5-dev on 
ubuntu 16.04, but my .so library is 110MB. The same compilation on Win10 
crashes. I can call

my function in c++ code using jl_init and jl_get_function.


My primary goal is to compile a dll with my own exported function, which I 
can call without jl_init(). I think it has something to do with ccallable, 
which you have mentioned. I'm stacked at this point. Could you please 
explain in more details, or point me to Julia code, how to move forward?


Thanks in advance.

-jan

Dňa piatok, 13. mája 2016 4:30:41 UTC+2 Jameson napísal(-a):
>
> We have been working on a number of simplifications on master, so some of 
> the best practices and extra steps aren't necessary anymore. But it should 
> still work on v0.4.
>
> There are a few different goals that can be accomplished by invoking the 
> Julia compiler directly, so it was a bit difficult to write that blog post 
> talking about them all generically. Since it touches on several of the 
> optimization options, I structured it in part to show how these layers can 
> build on each other. But I decided to leave out demonstrations of how 
> mixing various layers and options can be used to create other products.
>
> Since most of these steps are already configured in the Julia build 
> system, one of the easiest ways to augment it is to simply drop a 
> userimg.jl file into base/ 
> This will then get incorporated into the usual build and become part of 
> the pre-defined system image.
>
> The `-e nothing` stage is there because you have to give it something to 
> evaluate (a file, stdin, or `-e`, etc.), or it will pop open the REPL and 
> wait for the user to enter commands. This is actually also a valid way to 
> create an executable and can be fun to play with as a development exercise 
> (I still do this on occasion to test out how it is handling odd cases).
>
> To get a ccallable declaration to show up in the binary, the only 
> condition is that you must declare it ccallable in the same execution step 
> as the final output.
>
> -jameson
>
>
> On Thu, May 12, 2016 at 10:23 AM Ján Adamčák  > wrote:
>
>> Thanks @Jameson,
>>
>> I am a bit confused about "you are not adding any code to the system 
>> image (`--eval nothing`)". According to your blog 
>> http://juliacomputing.com/blog/2016/02/09/static-julia.html , I think 
>> that this is a crucial point to obtain a small sized dll. Am I right?
>>
>> What is then the right way to emit "ccallable" declarations in order to 
>> export julia function(s)? (foo in our example from the original post in 
>> this thread)
>>
>> Is it okay to work with current version of julia 0.4.5. or I have to 
>> switch to another version; If yes, to which one?
>>
>> Thanks in advance.
>>
>> Dňa utorok, 10. mája 2016 22:13:57 UTC+2 Jameson napísal(-a):
>>
>>> The compile-all flag is only partially functional on v0.4. I think it's 
>>> best to just leave it off. I tested on master and fixed a bug with emitting 
>>> `@ccallable`, but that's unrelated. From the command line below, it looks 
>>> like you are not adding any code to the system image (`--eval nothing`) 
>>> which would also means there are no `ccallable` declarations being emitted 
>>> into the current compile.
>>>
>>> Other than that, I don't see anything wrong with that command. You 
>>> shouldn't see that error unless you tried to make a Task or use `@async` 
>>> from the compile host. It's ambiguous how that would be serialized, so it's 
>>> simply an error and any parallel workers should be created / started by an 
>>> `__init__` method.
>>>
>>>
>>> On Tuesday, May 10, 2016 at 2:53:22 AM UTC-4, Ján Adamčák wrote:
>>>>
>>>> Hello guys, 
>>>>
>>>> Thank you for your comments, though we were more optimistic...
>>>>
>>>>
>>>> Dňa piatok, 6. mája 2016 16:27:28 UTC+2 Ján Adamčák napísal(-a):
>>>>>
>>>>> Sorry, my fault. 
>>>>>
>>>>> During last week I created build_sysimg2.jl from julia 0.4.5 
>>>>> build_sysimg.jl and when I run it, at line 86 (build_sysimg2.jl)
>>>>>
>>>>> run(`$julia -C $cpu_target --output-o sysimg_all.o --sysimage 
>>>>> $sysimg_path.$(Libdl.dlext) --startup-file=no --compile=all --eval 
>>>>> nothing`)
>>>>>
>>>>> I got this error:
>>>>>
>>>>> fatal: error thrown and

Re: [julia-users] Re: static compilation

2016-05-18 Thread Ján Adamčák
Thanks @Jameson

Do you have an idea, how the compilation will work on v0.5 release? I have 
tried with recent commits of master, but @ccallable doesn't work.



Dňa sobota, 14. mája 2016 1:17:45 UTC+2 Jameson napísal(-a):
>
> > without jl_init()
>
> That is not implemented at this time, although patches are welcome. 
>
> > it has something to do with ccallable
>
> Yes, it also is orthogonal to compile-all. It is possible that compile-all 
> is non-functional on v0.4 on Windows, I know master has many enhancements, 
> which may have included more stable Windows support. I suggest playing with 
> these two options independently before jumping into combining them. 
> On Fri, May 13, 2016 at 2:39 PM Ján Adamčák  > wrote:
>
>> Thanks @Jameson,
>>
>>
>> I have successfully built .so with "--compile=all" flag on 0.5-dev on 
>> ubuntu 16.04, but my .so library is 110MB. The same compilation on Win10 
>> crashes. I can call
>>
>> my function in c++ code using jl_init and jl_get_function.
>>
>>
>> My primary goal is to compile a dll with my own exported function, which 
>> I can call without jl_init(). I think it has something to do with 
>> ccallable, which you have mentioned. I'm stacked at this point. Could you 
>> please explain in more details, or point me to Julia code, how to move 
>> forward?
>>
>>
>> Thanks in advance.
>>
>> -jan
>>
>> Dňa piatok, 13. mája 2016 4:30:41 UTC+2 Jameson napísal(-a):
>>>
>>> We have been working on a number of simplifications on master, so some 
>>> of the best practices and extra steps aren't necessary anymore. But it 
>>> should still work on v0.4.
>>>
>>> There are a few different goals that can be accomplished by invoking the 
>>> Julia compiler directly, so it was a bit difficult to write that blog post 
>>> talking about them all generically. Since it touches on several of the 
>>> optimization options, I structured it in part to show how these layers can 
>>> build on each other. But I decided to leave out demonstrations of how 
>>> mixing various layers and options can be used to create other products.
>>>
>>> Since most of these steps are already configured in the Julia build 
>>> system, one of the easiest ways to augment it is to simply drop a 
>>> userimg.jl file into base/ 
>>> This will then get incorporated into the usual build and become part of 
>>> the pre-defined system image.
>>>
>>> The `-e nothing` stage is there because you have to give it something to 
>>> evaluate (a file, stdin, or `-e`, etc.), or it will pop open the REPL and 
>>> wait for the user to enter commands. This is actually also a valid way to 
>>> create an executable and can be fun to play with as a development exercise 
>>> (I still do this on occasion to test out how it is handling odd cases).
>>>
>>> To get a ccallable declaration to show up in the binary, the only 
>>> condition is that you must declare it ccallable in the same execution step 
>>> as the final output.
>>>
>>> -jameson
>>>
>>>
>>> On Thu, May 12, 2016 at 10:23 AM Ján Adamčák  wrote:
>>>
>>>> Thanks @Jameson,
>>>>
>>>> I am a bit confused about "you are not adding any code to the system 
>>>> image (`--eval nothing`)". According to your blog 
>>>> http://juliacomputing.com/blog/2016/02/09/static-julia.html , I think 
>>>> that this is a crucial point to obtain a small sized dll. Am I right?
>>>>
>>>> What is then the right way to emit "ccallable" declarations in order to 
>>>> export julia function(s)? (foo in our example from the original post in 
>>>> this thread)
>>>>
>>>> Is it okay to work with current version of julia 0.4.5. or I have to 
>>>> switch to another version; If yes, to which one?
>>>>
>>>> Thanks in advance.
>>>>
>>>> Dňa utorok, 10. mája 2016 22:13:57 UTC+2 Jameson napísal(-a):
>>>>
>>>>> The compile-all flag is only partially functional on v0.4. I think 
>>>>> it's best to just leave it off. I tested on master and fixed a bug with 
>>>>> emitting `@ccallable`, but that's unrelated. From the command line below, 
>>>>> it looks like you are not adding any code to the system image (`--eval 
>>>>> nothing`) which would also means there are no `ccallable` declarations 
>>>>> bein

Re: [julia-users] Re: static compilation

2016-05-19 Thread Ján Adamčák
Thanks @Jameson

The problem with @ccallable is, I get following error(Version 
0.5.0-dev+4124 (2016-05-16 22:35 UTC)):

julia> @Base.ccallable (Int64, foo(x::Int64) = x+1)
ERROR: expected method definition in @ccallable
 in eval(::Module, ::Any) at .\boot.jl:226

Thanks

Dňa streda, 18. mája 2016 18:46:31 UTC+2 Jameson napísal(-a):
>
> You might need to be more specific than "doesn't work"; I tried it last 
> week and it worked for me. The usage is essentially the same (the macro in 
> v0.5 takes an extra argument of the return type, but the deprecation 
> warning should note this already).
>
> On Wed, May 18, 2016 at 7:59 AM Ján Adamčák  > wrote:
>
>> Thanks @Jameson
>>
>> Do you have an idea, how the compilation will work on v0.5 release? I 
>> have tried with recent commits of master, but @ccallable doesn't work.
>>
>>
>>
>> Dňa sobota, 14. mája 2016 1:17:45 UTC+2 Jameson napísal(-a):
>>>
>>> > without jl_init()
>>>
>>> That is not implemented at this time, although patches are welcome. 
>>>
>>> > it has something to do with ccallable
>>>
>>> Yes, it also is orthogonal to compile-all. It is possible that 
>>> compile-all is non-functional on v0.4 on Windows, I know master has many 
>>> enhancements, which may have included more stable Windows support. I 
>>> suggest playing with these two options independently before jumping into 
>>> combining them. 
>>>
>> On Fri, May 13, 2016 at 2:39 PM Ján Adamčák  wrote:
>>>
>>>> Thanks @Jameson,
>>>>
>>>>
>>>> I have successfully built .so with "--compile=all" flag on 0.5-dev on 
>>>> ubuntu 16.04, but my .so library is 110MB. The same compilation on 
>>>> Win10 crashes. I can call
>>>>
>>>> my function in c++ code using jl_init and jl_get_function.
>>>>
>>>>
>>>> My primary goal is to compile a dll with my own exported function, 
>>>> which I can call without jl_init(). I think it has something to do with 
>>>> ccallable, which you have mentioned. I'm stacked at this point. Could you 
>>>> please explain in more details, or point me to Julia code, how to move 
>>>> forward?
>>>>
>>>>
>>>> Thanks in advance.
>>>>
>>>> -jan
>>>>
>>>> Dňa piatok, 13. mája 2016 4:30:41 UTC+2 Jameson napísal(-a):
>>>>>
>>>>> We have been working on a number of simplifications on master, so some 
>>>>> of the best practices and extra steps aren't necessary anymore. But it 
>>>>> should still work on v0.4.
>>>>>
>>>>> There are a few different goals that can be accomplished by invoking 
>>>>> the Julia compiler directly, so it was a bit difficult to write that blog 
>>>>> post talking about them all generically. Since it touches on several of 
>>>>> the 
>>>>> optimization options, I structured it in part to show how these layers 
>>>>> can 
>>>>> build on each other. But I decided to leave out demonstrations of how 
>>>>> mixing various layers and options can be used to create other products.
>>>>>
>>>>> Since most of these steps are already configured in the Julia build 
>>>>> system, one of the easiest ways to augment it is to simply drop a 
>>>>> userimg.jl file into base/ 
>>>>> This will then get incorporated into the usual build and become part 
>>>>> of the pre-defined system image.
>>>>>
>>>>> The `-e nothing` stage is there because you have to give it something 
>>>>> to evaluate (a file, stdin, or `-e`, etc.), or it will pop open the REPL 
>>>>> and wait for the user to enter commands. This is actually also a valid 
>>>>> way 
>>>>> to create an executable and can be fun to play with as a development 
>>>>> exercise (I still do this on occasion to test out how it is handling odd 
>>>>> cases).
>>>>>
>>>>> To get a ccallable declaration to show up in the binary, the only 
>>>>> condition is that you must declare it ccallable in the same execution 
>>>>> step 
>>>>> as the final output.
>>>>>
>>>>> -jameson
>>>>>
>>>>>
>>>>> On Thu, May 12, 2016 at 10:23 AM Ján Adamčák  
>>>>> wrote:
>>>>>
&g

Re: [julia-users] Re: static compilation

2016-05-23 Thread Ján Adamčák
Thanks @Jameson,

Another error I'm getting while compiling c example is

C://Users//Adam//AppData//Local//Julia-0.5.0-dev//start_func.c:111: 
undefined reference to `__imp_jl_tls_states'
collect2.exe: error: ld returned 1 exit status

This error is caused by JL_GC_PUSH1(&x); 

Is there some workaround or is it just a bug?

Thanks.

Dňa pondelok, 23. mája 2016 4:56:52 UTC+2 Jameson napísal(-a):
>
> I tried building a new system image on v0.4 starting from an existing 
> sys.so library (as you tried below), and found that it failed with the same 
> "Task cannot be serialized" error.  So I guess that use case must have 
> been fixed during v0.5 development. The workaround is to start with 
> inference.ji and load all of the extra code through userimg.jl. That worked 
> for me (and is just a bit slower for incremental development), so I didn't 
> investigate further.
>
>
> On Tuesday, May 10, 2016 at 4:13:57 PM UTC-4, Jameson wrote:
>>
>> The compile-all flag is only partially functional on v0.4. I think it's 
>> best to just leave it off. I tested on master and fixed a bug with emitting 
>> `@ccallable`, but that's unrelated. From the command line below, it looks 
>> like you are not adding any code to the system image (`--eval nothing`) 
>> which would also means there are no `ccallable` declarations being emitted 
>> into the current compile.
>>
>> Other than that, I don't see anything wrong with that command. You 
>> shouldn't see that error unless you tried to make a Task or use `@async` 
>> from the compile host. It's ambiguous how that would be serialized, so it's 
>> simply an error and any parallel workers should be created / started by an 
>> `__init__` method.
>>
>>
>> On Tuesday, May 10, 2016 at 2:53:22 AM UTC-4, Ján Adamčák wrote:
>>>
>>> Hello guys, 
>>>
>>> Thank you for your comments, though we were more optimistic...
>>>
>>>
>>> Dňa piatok, 6. mája 2016 16:27:28 UTC+2 Ján Adamčák napísal(-a):
>>>>
>>>> Sorry, my fault. 
>>>>
>>>> During last week I created build_sysimg2.jl from julia 0.4.5 
>>>> build_sysimg.jl and when I run it, at line 86 (build_sysimg2.jl)
>>>>
>>>> run(`$julia -C $cpu_target --output-o sysimg_all.o --sysimage 
>>>> $sysimg_path.$(Libdl.dlext) --startup-file=no --compile=all --eval 
>>>> nothing`)
>>>>
>>>> I got this error:
>>>>
>>>> fatal: error thrown and no exception handler available.
>>>> ErrorException("Task cannot be serialized")
>>>> jl_unprotect_stack at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_throw at C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll 
>>>> (unknown line)
>>>> jl_error at C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll 
>>>> (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_compress_ast at 
>>>> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
>>>> jl_co

Re: [julia-users] Re: static compilation

2016-05-23 Thread Ján Adamčák
Thanks Yichao Yu,

Can you tell me which macro did you mean and where to place it?

Thanks
Dňa 23.5.2016 17:37 používateľ "Yichao Yu"  napísal:

>
> On May 23, 2016 10:30 AM, "Ján Adamčák"  wrote:
> >
> > Thanks @Jameson,
> >
> > Another error I'm getting while compiling c example is
> >
> > C://Users//Adam//AppData//Local//Julia-0.5.0-dev//start_func.c:111:
> undefined reference to `__imp_jl_tls_states'
> > collect2.exe: error: ld returned 1 exit status
> >
> > This error is caused by JL_GC_PUSH1(&x);
>
> Looks like you are missing threading enabling macro while building your
> code
>
> >
> > Is there some workaround or is it just a bug?
> >
> > Thanks.
> >
> > Dňa pondelok, 23. mája 2016 4:56:52 UTC+2 Jameson napísal(-a):
> >>
> >> I tried building a new system image on v0.4 starting from an existing
> sys.so library (as you tried below), and found that it failed with the same
> "Task cannot be serialized" error.  So I guess that use case must have been
> fixed during v0.5 development. The workaround is to start with inference.ji
> and load all of the extra code through userimg.jl. That worked for me (and
> is just a bit slower for incremental development), so I didn't investigate
> further.
> >>
> >>
> >> On Tuesday, May 10, 2016 at 4:13:57 PM UTC-4, Jameson wrote:
> >>>
> >>> The compile-all flag is only partially functional on v0.4. I think
> it's best to just leave it off. I tested on master and fixed a bug with
> emitting `@ccallable`, but that's unrelated. From the command line below,
> it looks like you are not adding any code to the system image (`--eval
> nothing`) which would also means there are no `ccallable` declarations
> being emitted into the current compile.
> >>>
> >>> Other than that, I don't see anything wrong with that command. You
> shouldn't see that error unless you tried to make a Task or use `@async`
> from the compile host. It's ambiguous how that would be serialized, so it's
> simply an error and any parallel workers should be created / started by an
> `__init__` method.
> >>>
> >>>
> >>> On Tuesday, May 10, 2016 at 2:53:22 AM UTC-4, Ján Adamčák wrote:
> >>>>
> >>>> Hello guys,
> >>>>
> >>>> Thank you for your comments, though we were more optimistic...
> >>>>
> >>>>
> >>>> Dňa piatok, 6. mája 2016 16:27:28 UTC+2 Ján Adamčák napísal(-a):
> >>>>>
> >>>>> Sorry, my fault.
> >>>>>
> >>>>> During last week I created build_sysimg2.jl from julia 0.4.5
> build_sysimg.jl and when I run it, at line 86 (build_sysimg2.jl)
> >>>>>
> >>>>> run(`$julia -C $cpu_target --output-o sysimg_all.o --sysimage
> $sysimg_path.$(Libdl.dlext) --startup-file=no --compile=all --eval nothing`)
> >>>>>
> >>>>> I got this error:
> >>>>>
> >>>>> fatal: error thrown and no exception handler available.
> >>>>> ErrorException("Task cannot be serialized")
> >>>>> jl_unprotect_stack at
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> >>>>> jl_throw at C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll
> (unknown line)
> >>>>> jl_error at C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll
> (unknown line)
> >>>>> jl_compress_ast at
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> >>>>> jl_compress_ast at
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> >>>>> jl_compress_ast at
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> >>>>> jl_compress_ast at
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> >>>>> jl_compress_ast at
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> >>>>> jl_compress_ast at
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> >>>>> jl_compress_ast at
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> >>>>> jl_compress_ast at
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> >>>>> jl_compress_ast at
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> >>>>> jl_compress_ast at
> C:\Users\

Re: [julia-users] Re: static compilation

2016-05-24 Thread Ján Adamčák
Thanks Yichao Yu,

Your macro works fine.

So in the next step I tried the following flag: "--compile=all" during 
system image compilation.

My userimg.jl:

@Base.ccallable Int64 jl_foo(x::Int64) = (x+1)

with the following C code:

#include 
#include 
#include 
#include 

int main(int argc, char *argv[])
{
   jl_options.compile_enabled = JL_OPTIONS_COMPILE_OFF;
   jl_options.startupfile = JL_OPTIONS_STARTUPFILE_OFF;
   jl_init_with_image(NULL, "libmyimg_all.dll");
   jl_function_t *func = jl_get_function(jl_main_module, "jl_foo");
   jl_value_t* argument = jl_box_int64(2);
   jl_value_t* ret = jl_call1(func, argument);
   if (jl_is_int64(ret)) {
   int64_t retInt64 = jl_unbox_int64(ret);
   printf("jl_foo(2) in C: %d\n", retInt64);
}
   system("PAUSE");
   int ret = 0;
   jl_atexit_hook(ret);
   return ret;
}

I got this message:

C:\\Users\\Adam\\AppData\\Local\\Julia-0.5.0-dev1\\bin\\my_prog.exe
code missing for Base.==(Base.#==, Base.Cstring, Ptr{Void})  sysimg may not 
have been built with --compile=all
code missing for Base.==(Base.#==, Ptr{UInt8}, Ptr{Void})  sysimg may not 
have been built with --compile=all
code missing for Base.pointer(Base.#pointer, Array{UInt8, 1}, UInt64) 
 sysimg may not have been built with --compile=all
code missing for Base.unsafe_convert(Base.#unsafe_convert, 
Type{Ptr{UInt8}}, Array{UInt8, 1})  sysimg may not have been built with 
--compile=all
code missing for Base.-(Base.#-, UInt64, Int64)  sysimg may not have been 
built with --compile=all
code missing for Base.promote(Base.#promote, UInt64, Int64)  sysimg may not 
have been built with --compile=all
code missing for Base.elsize(Base.#elsize, Array{UInt8, 1})  sysimg may not 
have been built with --compile=all
code missing for Base.+(Base.#+, Ptr{UInt8}, UInt64)  sysimg may not have 
been built with --compile=all
code missing for Base.rem(Base.#rem, UInt64, Type{UInt64})  sysimg may not 
have been built with --compile=all
code missing for Base.oftype(Base.#oftype, Ptr{UInt8}, UInt64)  sysimg may 
not have been built with --compile=all
code missing for Base.convert(Base.#convert, Type{Ptr{UInt8}}, UInt64) 
 sysimg may not have been built with --compile=all
code missing for Base.convert(Base.#convert, Type{Ptr{Int32}}, Ptr{UInt8}) 
 sysimg may not have been built with --compile=all
code missing for 
Base.SparseArrays.CHOLMOD.set_print_level(Base.SparseArrays.CHOLMOD.#set_print_level,
 
Array{UInt8, 1}, Int64)  sysimg may not have been built with --compile=all
code missing for Base.unsafe_store!(Base.#unsafe_store!, Ptr{Int32}, Int64) 
 sysimg may not have been built with --compile=all
jl_foo(2) in C: 3
Press any key to continue . . .

Execution of my function was successful, but I think I found bug in 
--compile=all implementation:

code missing for ...  sysimg may not have been built with --compile=all

What do you think???

Thanks.


Dňa pondelok, 23. mája 2016 18:42:20 UTC+2 Yichao Yu napísal(-a):
>
> On Mon, May 23, 2016 at 12:09 PM, Ján Adamčák  > wrote: 
> > Thanks Yichao Yu, 
> > 
> > Can you tell me which macro did you mean and where to place it? 
>
> You need -DJULIA_ENABLE_THREADING=1 when compiling the C/C++ code if 
> julia is built with threading enabled (which is the default now). 
>
> > 
> > Thanks 
> > 
> > Dňa 23.5.2016 17:37 používateľ "Yichao Yu"  > napísal: 
> > 
> >> 
> >> On May 23, 2016 10:30 AM, "Ján Adamčák"  > wrote: 
> >> > 
> >> > Thanks @Jameson, 
> >> > 
> >> > Another error I'm getting while compiling c example is 
> >> > 
> >> > C://Users//Adam//AppData//Local//Julia-0.5.0-dev//start_func.c:111: 
> >> > undefined reference to `__imp_jl_tls_states' 
> >> > collect2.exe: error: ld returned 1 exit status 
> >> > 
> >> > This error is caused by JL_GC_PUSH1(&x); 
> >> 
> >> Looks like you are missing threading enabling macro while building your 
> >> code 
> >> 
> >> > 
> >> > Is there some workaround or is it just a bug? 
> >> > 
> >> > Thanks. 
> >> > 
> >> > Dňa pondelok, 23. mája 2016 4:56:52 UTC+2 Jameson napísal(-a): 
> >> >> 
> >> >> I tried building a new system image on v0.4 starting from an 
> existing 
> >> >> sys.so library (as you tried below), and found that it failed with 
> the same 
> >> >> "Task cannot be serialized" error.  So I guess that use case must 
> have been 
> >> >> fixed during v0.5 development. The workaround is to start with 
> inference.ji 
> >> >> and load all of the extra code through userimg.jl. That worked for 
> me (and 
> >&g

Re: [julia-users] Re: static compilation

2016-05-26 Thread Ján Adamčák
I reported it as bug.

#16595 




[julia-users] Re: I get this error while trying to run *.jl file from Terminal ERROR: LoadError: UndefVarError: input not defined

2016-08-08 Thread Ján Adamčák
Hi, you are using function 
input()

, but this function is not known for julia. You can use function 
readline(STDIN)

instead of input(), or you can insert 
function input() 
  readline(STDIN) 
end
to the first line of your file.

Have a nice day with Julia ;)


Dňa pondelok, 8. augusta 2016 15:58:49 UTC+2 Rishabh Raghunath napísal(-a):
>
> Thanks for replying
> I've attached the file with this reply..
> It works in Juno.. but not via the terminal and get the before said error
>
> On Monday, August 8, 2016 at 2:39:07 AM UTC+5:30, Rishabh Raghunath wrote:
>>
>>
>>
>> Hello,
>> I am a beginner in the Julia language .. 
>> I get this error while I try to run .jl Julia program file from the 
>> terminal. However It works perfectly fine in the Juno IDE. This following 
>> is the error message I receive while trying to run the program from the 
>> Linux terminal:
>>
>>
>> ERROR: LoadError: UndefVarError: input not defined
>> in legacy at /home/rishabh/Desktop/ProjectJulia/juliatest.jl:120
>> while loading /home/rishabh/Desktop/ProjectJulia/juliatest.jl, in 
>> expression starting on line 138
>>
>> How do I resolve this and run .jl file in the terminal rather than in 
>> Juno ?
>> Thanks In advance
>>
>

[julia-users] Re: I get this error while trying to run *.jl file from Terminal ERROR: LoadError: UndefVarError: input not defined

2016-08-08 Thread Ján Adamčák
I am only C coder, too. I think, I am not good teacher for you. I can only 
fix broken things... 

Good Luck ;)

Dňa pondelok, 8. augusta 2016 16:43:04 UTC+2 Rishabh Raghunath napísal(-a):
>
> Awesome.. Thanks a lot !! It worked .. 
> If you can .. Can you evaluate my code and point out the things I could 
> implement better..
> Being good at C.. I feel I am bringing the C style into my Julia Program.
> I want it to be optimised and do things in the right way in julia..
> How do I get my Input directly as an integer or any specific datatype 
> rather than as a string and then convert it to the datatype I want ?
> It would be helpfull If you could highlight the non ideal code and give me 
> a replacement for the same.
> Thanks
>
> On Monday, August 8, 2016 at 2:39:07 AM UTC+5:30, Rishabh Raghunath wrote:
>>
>>
>>
>> Hello,
>> I am a beginner in the Julia language .. 
>> I get this error while I try to run .jl Julia program file from the 
>> terminal. However It works perfectly fine in the Juno IDE. This following 
>> is the error message I receive while trying to run the program from the 
>> Linux terminal:
>>
>>
>> ERROR: LoadError: UndefVarError: input not defined
>> in legacy at /home/rishabh/Desktop/ProjectJulia/juliatest.jl:120
>> while loading /home/rishabh/Desktop/ProjectJulia/juliatest.jl, in 
>> expression starting on line 138
>>
>> How do I resolve this and run .jl file in the terminal rather than in 
>> Juno ?
>> Thanks In advance
>>
>

[julia-users] Comprehensions example from manual

2015-11-04 Thread Ján Adamčák
Hi guys,

I tried example from 0.4 Julia manual. My edited code:

A = rand(1_000_000);
const B = rand(1_000_000);

#non const
[ 0.25*A[i-1] + 0.5*A[i] + 0.25*A[i+1] for i=2:length(A)-1 ]

#const
[ 0.25*B[i-1] + 0.5*B[i] + 0.25*B[i+1] for i=2:length(B)-1 ]

#my mistake
[ 0.25*B[i-1] + 0.5*B[i] + 0.25*B[i+1] for i=2:length(A)-1 ]

#for comparing
[ 0.25*b[i-1] + 0.5*b[i] + 0.25*b[i+1] for i=2:1_000_000-1 ]

I have some questions:

1. Why has Julia problem with non constant Float64? (@time macro returned 
1.443342 
seconds (16.00 M allocations: 297.499 MB, 49.01% gc time)-1st case vs. 0.007271 
seconds (2 allocations: 7.629 MB)-2nd case)
2. Why Julia slow down after my mistake in 3rd case (length(A) with 
computation of B vector, @time macro returned 1.583760 seconds (16.00 M 
allocations: 297.499 MB, 54.18% gc time)-3rd case vs. 0.006969 seconds (2 
allocations: 7.629 MB)-4th case)
Thanks for your help :)


[julia-users] Re: Comprehensions example from manual

2015-11-04 Thread Ján Adamčák
Thanks.

Packing into to function solves my questions.

Resulting times:

0.005274 seconds (2 allocations: 7.629 MB)
0.005279 seconds (2 allocations: 7.629 MB)
0.005195 seconds (2 allocations: 7.629 MB)
0.007343 seconds (2 allocations: 7.629 MB)



Dňa streda, 4. novembra 2015 14:41:00 UTC+1 Kristoffer Carlsson napísal(-a):
>
> This is a good read: 
> http://docs.julialang.org/en/release-0.4/manual/performance-tips/



[julia-users] parse #

2015-11-19 Thread Ján Adamčák
Hi guys,

I tried a parse specific config file with this syntax:

param#value

for this case

parse("R#10")

but parse returned me only :R

How I can parse this string(file), when I can parse it like 
value, operator, value? :(R # 10) ?

Thanks for your help.


[julia-users] Re: Is build_executable.jl working?

2015-12-01 Thread Ján Adamčák
I edit this line 
jl_atexit_hook();
to 
jl_atexit_hook(0);
and it's working ! 

Dňa streda, 25. novembra 2015 23:58:51 UTC+1 Jérémy Béjanin napísal(-a):
>
> Hello,
>
> I was wondering if the build_executable function was working. I tried 
> using it on Windows and got the following error (I included some lines 
> above the error for context):
>
> ...
>> require.jl
>> docs/helpdb.jl
>> docs/basedocs.jl
>> C:\Users\Jeremy\AppData\Local\Julia-0.4.1\share\julia\base\precompile.jl
>> INFO: Linking sys.dll
>> INFO: System image successfully built at 
>> C:\Users\Jeremy\AppData\Local\Julia-0.4.1\bin\libtestitnow.dll
>> WARNING: Building sys.dll on Windows against LLVM < 3.5.0 can cause 
>> incorrect backtraces! Delete generated sys.dll to av
>> oid these problems
>> INFO: To run Julia with this image loaded, run: julia -J 
>> C:\Users\Jeremy\AppData\Local\Julia-0.4.1\bin\libtestitnow.dll
>>
>> running: 
>> C:\Users\Jeremy\.julia\v0.4\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bin\gcc.exe
>>  
>> -g -Wl,--no-as-needed
>> `-D_WIN32_WINNT=0x0502` 
>> -IC:\Users\Jeremy\AppData\Local\Julia-0.4.1\include\julia 
>> -IC:\Users\Jeremy\AppData\Local\src -
>> IC:\Users\Jeremy\AppData\Local\src/support 
>> -IC:\Users\Jeremy\AppData\Local\usr/include 
>> -IC:\Users\Jeremy\.julia\v0.4\Win
>> RPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\include 
>> C:\Users\Jeremy\AppData\Local\Temp\jul12B2.tmp\start_func.c -o C:
>> \Users\Jeremy\AppData\Local\Julia-0.4.1\bin\testitnow.exe 
>> -Wl,-rpath,C:\Users\Jeremy\AppData\Local\Julia-0.4.1\bin -LC:\
>> Users\Jeremy\AppData\Local\Julia-0.4.1\bin -ljulia -ltestitnow
>> C:\Users\Jeremy\AppData\Local\Temp\jul12B2.tmp\start_func.c: In function 
>> 'main':
>> C:\Users\Jeremy\AppData\Local\Temp\jul12B2.tmp\start_func.c:19:5: error: 
>> too few arguments to function 'jl_atexit_hook'
>> jl_atexit_hook();
>> ^
>> In file included from 
>> C:\Users\Jeremy\AppData\Local\Temp\jul12B2.tmp\start_func.c:1:0:
>> C:\Users\Jeremy\AppData\Local\Julia-0.4.1\include\julia/julia.h:1188:16: 
>> note: declared here
>> DLLEXPORT void jl_atexit_hook(int status);
>> ^
>> ERROR: failed process: 
>> Process(setenv(`'C:\Users\Jeremy\.julia\v0.4\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\bi
>> n\gcc.exe' -g -Wl,--no-as-needed -D_WIN32_WINNT=0x0502 
>> '-IC:\Users\Jeremy\AppData\Local\Julia-0.4.1\include\julia' '-IC:
>> \Users\Jeremy\AppData\Local\src' 
>> '-IC:\Users\Jeremy\AppData\Local\src/support' 
>> '-IC:\Users\Jeremy\AppData\Local\usr/incl
>> ude' 
>> '-IC:\Users\Jeremy\.julia\v0.4\WinRPM\deps\usr\x86_64-w64-mingw32\sys-root\mingw\include'
>>  
>> 'C:\Users\Jeremy\AppData\
>> Local\Temp\jul12B2.tmp\start_func.c' -o 
>> 'C:\Users\Jeremy\AppData\Local\Julia-0.4.1\bin\testitnow.exe' 
>> '-Wl,-rpath,C:\Use
>> rs\Jeremy\AppData\Local\Julia-0.4.1\bin' 
>> '-LC:\Users\Jeremy\AppData\Local\Julia-0.4.1\bin' -ljulia 
>> -ltestitnow`,Union{AS
>> CIIString,UTF8String}["=C:=C:\\Users\\Jeremy\\AppData\\Local\\Julia-0.4.1","ADMSXMLBINDIR=C:\\Program
>>  
>> Files (x86)\\Qucs\
>>
>> \bin","ADS_LICENSE_FILE=6609@localhost","ALLUSERSPROFILE=C:\\ProgramData","APPDATA=C:\\Users\\Jeremy\\AppData\\Roaming",
>> "ASCOBINDIR=C:\\Program Files 
>> (x86)\\Qucs\\bin","CommonProgramFiles=C:\\Program Files\\Common 
>> Files","CommonProgramFiles
>> (x86)=C:\\Program Files (x86)\\Common 
>> Files","CommonProgramW6432=C:\\Program Files\\Common 
>> Files","COMPUTERNAME=JBEJANIN
>>
>> ","ComSpec=C:\\Windows\\system32\\cmd.exe","FLEXLM_TIMEOUT=200","FP_NO_HOST_CHECK=NO","HOME=C:\\Users\\Jeremy","HOME
>>
>> DRIVE=C:","HOMEPATH=\\Users\\Jeremy","LM_LICENSE_FILE=6065@lka-ic-01;6065@localhost","LOCALAPPDATA=C:\\Users\\Jeremy\\Ap
>> pData\\Local","LOGONSERVER=JBEJANIN","MATLAB_HOME=C:\\Program 
>> Files\\MATLAB\\R2015a","MOZ_PLUGIN_PATH=C:\\PROGRAM FI
>> LES (X86)\\FOXIT SOFTWARE\\FOXIT 
>> READER\\plugins\\","NIDAQmxSwitchDir=C:\\Program Files (x86)\\National 
>> Instruments\\NI-
>> DAQ\\Switch\\","NUMBER_OF_PROCESSORS=4","OCTAVEDIR=C:\\Program Files 
>> (x86)\\Qucs\\share\\qucs\\octave","OPENBLAS_MAIN_FR
>>
>> EE=1","OS=Windows_NT","Path=C:\\Users\\Jeremy\\AppData\\Local\\Julia-0.4.1\\bin;C:\\Users\\Jeremy\\AppData\\Local\\Julia
>> -0.4.1\\bin\\..\\Git\\bin;C:\\Users\\Jeremy\\AppData\\Local\\Julia-0.4.1\\bin\\..\\Git\\usr\\bin;C:\\Program
>>  
>> Files (x86)
>> \\SumatraPDF;C:\\Program Files (x86)\\NVIDIA 
>> Corporation\\PhysX\\Common;C:\\ProgramData\\Oracle\\Java\\javapath;C:\\Prog
>> ram Files 
>> (x86)\\Qucs\\bin;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsP
>> owerShell\\v1.0\\;D:\\Programs\\MiKTeX 
>> 2.9\\miktex\\bin\\x64\\;C:\\Users\\Jeremy\\AppData\\Local\\Julia-0.4.1\\bin;C:\\P
>> rogram Files\\MATLAB\\R2015a\\runtime\\win64;C:\\Program 
>> Files\\MATLAB\\R2015a\\bin;D:\\Programs\\Git\\cmd;D:\\Programs\
>> \Git\\usr\\bin;D:\\Programs\\Vim\\vim74;C:\\Program Files 
>> (x86)\\FastFieldSolvers\\FastHenry2\\Utilities;C:\\Program Fil
>> es 
>> (x86)\\FastFieldSolvers\\FastCap2

[julia-users] UTF8String in embedded julia

2016-01-25 Thread Ján Adamčák
Hi guys,

Have you any idea, how to transfer utf8 string from C/C# code to Julia 
code? 

I tried to find it in manual 
page http://docs.julialang.org/en/latest/manual/embedding/
but I haven't any information

Thanks for your help ;)


Re: [julia-users] UTF8String in embedded julia

2016-01-25 Thread Ján Adamčák
Thanks.

My first idea use demo function println(x::UTF8String) at julia side:

jl_function_t *func  = jl_get_function(jl_base_module, "println");
jl_call1(func, (jl_value_t*) xmlString);

but in my second idea i plan return UTF8String back to C/C#...

jl_function_t *func  = jl_get_function(jl_current_module, 
"do_some_stuf_with_utf8");
jl_value_t* ret = jl_call1(func, (jl_value_t*) xmlString);




Dňa pondelok, 25. januára 2016 16:10:34 UTC+1 Stefan Karpinski napísal(-a):
>
> Wrapping the array of bytes in a UTF8String object should do it. It's not 
> quite clear what you mean by "transfer".
>
> On Monday, January 25, 2016, Ján Adamčák > 
> wrote:
>
>> Hi guys,
>>
>> Have you any idea, how to transfer utf8 string from C/C# code to Julia 
>> code? 
>>
>> I tried to find it in manual page 
>> http://docs.julialang.org/en/latest/manual/embedding/
>> but I haven't any information
>>
>> Thanks for your help ;)
>>
>

Re: [julia-users] UTF8String in embedded julia

2016-01-26 Thread Ján Adamčák
Ok, thanks.

My final solution for 1st problem:

in userimg.jl I have added this line:

demo(x::Vector{UInt8}) = println("x: ", utf8(x))

and in start_func.c I have this code:

#include 
#include 
int main()
{
jl_init_with_image(NULL, "libMyJuliaImage.dll");
int utf8_length = 6;
jl_value_t* array_type1 = jl_apply_array_type(jl_uint8_type, 1);
jl_array_t* utf8_str = jl_alloc_array_1d(array_type1, utf8_length);
JL_GC_PUSH1(&utf8_str);
char* data = jl_array_data(utf8_str);
data[0] = 'H';
data[1] = 'E';
data[2] = 'L';
data[3] = 'L';
data[4] = 'O';
data[5] = '!';
jl_function_t *func  = jl_get_function(jl_current_module, "demo");
jl_call1(func, (jl_value_t*) utf8_str);
JL_GC_POP();
int ret_val = 0;
jl_atexit_hook(ret_val);
return ret_val;
}

In C I work with uint8(char) array without '\0' and in julia i need convert 
this array with utf8() function. 





Re: [julia-users] UTF8String in embedded julia

2016-01-26 Thread Ján Adamčák
My final solution for 2nd problem:

in userimg.jl I have added this line:

demo(x::Vector{UInt8}) = lowercase(utf8(x)).data

and in start_func.c I have this code:

#include 
#include 
int main()
{
jl_init_with_image(NULL, "libMyJuliaImage.dll");
int utf8_length = 6;
jl_value_t* array_type1 = jl_apply_array_type(jl_uint8_type, 1);
jl_array_t* utf8_str = jl_alloc_array_1d(array_type1, utf8_length);
JL_GC_PUSH1(&utf8_str);
char* data = jl_array_data(utf8_str);
data[0] = 'H';
data[1] = 'E';
data[2] = 'L';
data[3] = 'L';
data[4] = 'O';
data[5] = '!';
jl_function_t *func  = jl_get_function(jl_current_module, "demo");
jl_array_t* returned_data = jl_call1(func, (jl_value_t*) utf8_str);
char *ret_data = (char*)jl_array_data(returned_data);
int len = jl_array_len(returned_data);
JL_GC_POP();
int ret_val = 0;
jl_atexit_hook(ret_val);
return ret_val;
}

In julia i need return UTF8String.data and in C I again work with 
uint8(char) array without '\0'.


Re: [julia-users] UTF8String in embedded julia

2016-01-26 Thread Ján Adamčák
I have new question:

how I can transfer Vector{UTF8String}(10) to Julia from C?

I think I need use 

jl_value_t* array_type= jl_apply_array_type( jl_uint8_type, 1 );
jl_array_t* x   = jl_alloc_array_1d(array_type , 10);
JL_GC_PUSH1(&x);

but this give me only Vector{UInt8}(10)...

I think I need something like Vector{Vector{UInt8}}(10), but how to alocate 
it, when I don't know length of every string?

Thanks for your help :)


[julia-users] Re: Julia and notepad++

2016-02-27 Thread Ján Adamčák
Hi Massimo,

Can you make a youtube tutorial how to install it & how to use it???

Thanks :)


Dňa sobota, 27. februára 2016 17:04:11 UTC+1 KK Sasa napísal(-a):
>
> Hi Massimo,
>
> What are the steps to install it?   I cannot make notepad++ recognize 
> it... Thanks!
>
> Best, Keith
>
> Massimo Corinaldesi於 2015年6月5日星期五 UTC+8上午1時26分56秒寫道:
>>
>> Starting from "Notepad++_2_Julia.ahk" and "Julia_Notepad++.xml" i have 
>> written a modified version of autohotkey script and a new theme for 
>> notepad++ (solarized colors). 
>> The script allows to: 
>> - run julia REPL line command and block command from notepad++ (no flick) 
>> - paste text on REPL with Control-V 
>> - scroll window REPL with Control-PageUp/PageDown 
>> - write greek letters on notepad++ 
>>
>> Download (dropbox):  julia_npp.zip 
>>    
>>
>> cameyo 
>>
>>
>>
>>
>>
>> -- 
>> View this message in context: 
>> http://julia-programming-language.2336112.n4.nabble.com/Julia-and-notepad-tp21094.html
>>  
>> Sent from the Julia Users mailing list archive at Nabble.com. 
>>
>

Re: [julia-users] Re: Problem with ZMQ and Ijulia

2016-08-18 Thread Ján Adamčák
julia> versioninfo()
Julia Version 0.5.0-rc2+0
Commit 0350e57 (2016-08-12 11:25 UTC)
Platform Info:
  System: NT (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

Pkg.build("ZMQ")
...
INFO: Nothing to do
=[ ERROR: ZMQ 
]=


LoadError: Provider BinDeps.PackageManager failed to satisfy dependency zmq
while loading C:\Users\User\.julia\v0.5\ZMQ\deps\build.jl, in expression 
startin
g on line 23




[ BUILD ERRORS 
]


WARNING: ZMQ had build errors.

 - packages with build errors remain installed in C:\Users\User\.julia\v0.5
 - build the package(s) and all dependencies with `Pkg.build("ZMQ")`
 - build a single package by running its `deps/build.jl` script




[julia-users] TreeMap in Julia

2016-09-07 Thread Ján Adamčák
Hi, 

Is there a tool for drawing Tree Map in Julia?
I want draw something like this:









[julia-users] Re: TreeMap in Julia

2016-09-08 Thread Ján Adamčák
Thanks,

great to know. 
At this moment I do not have time to cooperate, but I believe I'll help you 
in the future.


Dňa streda, 7. septembra 2016 19:59:21 UTC+2 Randy Zwitch napísal(-a):
>
> Vega.jl has the capability to render one, but doesn't yet have an 
> easy-to-use function defined:
>
> https://github.com/johnmyleswhite/Vega.jl/issues/109
>
> You would need to translate the example JSON string into the 
> VegaVisualization composite type in Julia, which can be slightly 
> frustrating the first few times you do it, but eventually gets easier.
>
> I'd love a pull request if you plan on tackling this!
>
> On Wednesday, September 7, 2016 at 5:02:25 AM UTC-4, Ján Adamčák wrote:
>>
>> Hi, 
>>
>> Is there a tool for drawing Tree Map in Julia?
>> I want draw something like this:
>>
>>
>> <https://raw.githubusercontent.com/imranghory/treemap-squared/master/examples/example-1.png>
>>
>>
>>
>>
>>
>>

[julia-users] Re: ANN: Julia v0.5.0 released!

2016-09-20 Thread Ján Adamčák
Good Job!

Small bug: Julia on Windows choose RC4 folder for install by default!!!

Dňa utorok, 20. septembra 2016 11:08:44 UTC+2 Tony Kelman napísal(-a):
>
> At long last, we can announce the final release of Julia 0.5.0! See the 
> release notes at 
> https://github.com/JuliaLang/julia/blob/release-0.5/NEWS.md for more 
> details, and expect a blog post with some highlights within the next few 
> days. Binaries are available from the usual place 
> , and please report all issues to either 
> the issue tracker  or email 
> the julia-users list. Don't CC julia-news, which is intended to be 
> low-volume, if you reply to this message.
>
> Many thanks to all the contributors, package authors, users and reporters 
> of issues who helped us get here. We'll be releasing regular monthly bugfix 
> backports from the 0.5.x line, while major feature work is ongoing on 
> master for 0.6-dev. Enjoy!
>
>
> We haven't made the change just yet, but to package authors: please be 
> aware that `release` on Travis CI for `language: julia` will change meaning 
> to 0.5 shortly. So if you want to continue supporting Julia 0.4 in your 
> package, please update your .travis.yml file to have an "- 0.4" entry under 
> `julia:` versions. When you want to drop support for Julia 0.4, update your 
> REQUIRE file to list `julia 0.5` as a lower bound, and the next time you 
> tag the package be sure to increment the minor or major version number via 
> `PkgDev.tag(pkgname, :minor)`.
>
>

[julia-users] Re: ANN: Julia v0.5.0 released!

2016-09-20 Thread Ján Adamčák
Sorry, my mistake. I Installed old binary...
  _
   _   _ _(_)_ |  A fresh approach to technical computing
  (_) | (_) (_)|  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0-rc4+23 (2016-09-16 19:30 UTC)
 _/ |\__'_|_|_|\__'_|  |  master/b9ec73c (fork: 23 commits, 11 days)
|__/   |  x86_64-w64-mingw32


Dňa utorok, 20. septembra 2016 12:46:14 UTC+2 Ján Adamčák napísal(-a):
>
> Good Job!
>
> Small bug: Julia on Windows choose RC4 folder for install by default!!!
>
> Dňa utorok, 20. septembra 2016 11:08:44 UTC+2 Tony Kelman napísal(-a):
>>
>> At long last, we can announce the final release of Julia 0.5.0! See the 
>> release notes at 
>> https://github.com/JuliaLang/julia/blob/release-0.5/NEWS.md for more 
>> details, and expect a blog post with some highlights within the next few 
>> days. Binaries are available from the usual place 
>> <http://julialang.org/downloads/>, and please report all issues to 
>> either the issue tracker <https://github.com/JuliaLang/julia/issues> or 
>> email the julia-users list. Don't CC julia-news, which is intended to be 
>> low-volume, if you reply to this message.
>>
>> Many thanks to all the contributors, package authors, users and reporters 
>> of issues who helped us get here. We'll be releasing regular monthly bugfix 
>> backports from the 0.5.x line, while major feature work is ongoing on 
>> master for 0.6-dev. Enjoy!
>>
>>
>> We haven't made the change just yet, but to package authors: please be 
>> aware that `release` on Travis CI for `language: julia` will change meaning 
>> to 0.5 shortly. So if you want to continue supporting Julia 0.4 in your 
>> package, please update your .travis.yml file to have an "- 0.4" entry under 
>> `julia:` versions. When you want to drop support for Julia 0.4, update your 
>> REQUIRE file to list `julia 0.5` as a lower bound, and the next time you 
>> tag the package be sure to increment the minor or major version number via 
>> `PkgDev.tag(pkgname, :minor)`.
>>
>>

[julia-users] LightXML Ubuntu 16.04 julia 0.4.5

2016-09-24 Thread Ján Adamčák
Hi Guys,

I tried use LightXML on Ubuntu 16.04, but I got an error: 

ERROR: error compiling call: could not load library "libxml2"

Can You help me?

Thanks.

Log:

 _
  _   _ _(_)_ |  A fresh approach to technical computing
 (_) | (_) (_)|  Documentation: http://docs.julialang.org
  _ _   _| |_  __ _   |  Type "?help" for help.
 | | | | | | |/ _` |  |
 | | |_| | | | (_| |  |  Version 0.4.5 (2016-03-18 00:58 UTC)
_/ |\__'_|_|_|\__'_|  |  
|__/   |  x86_64-linux-gnu

julia> Pkg.status()
No packages installed

julia> Pkg.add("LightXML")
INFO: Cloning cache of Compat from git://github.com/JuliaLang/Compat.jl.git
INFO: Cloning cache of LightXML from 
git://github.com/JuliaIO/LightXML.jl.git
INFO: Installing Compat v0.9.2
INFO: Installing LightXML v0.4.0
INFO: Building LightXML
INFO: Package database updated
INFO: METADATA is out-of-date — you may not have the latest version of 
LightXML
INFO: Use `Pkg.update()` to get the latest versions of your packages

julia> Pkg.update()
INFO: Updating METADATA...
INFO: Computing changes...
INFO: No packages to install, update or remove

julia> using LightXML
INFO: Precompiling module LightXML...

julia> # create an empty XML document
  xdoc = XMLDocument()
ERROR: error compiling call: could not load library "libxml2"






[julia-users] Re: LightXML Ubuntu 16.04 julia 0.4.5

2016-09-24 Thread Ján Adamčák
I tried sudo apt-get install libxml2, but I got answer from ubuntu:

libxml2 is already the newest version (2.9.3+dfsg 1-1ubuntu0.1).
libxml2 is tagged as manually installed.

But from julia I got same answer:

ERROR: error compiling call: could not load library "libxml2"



Dňa sobota, 24. septembra 2016 14:18:27 UTC+2 Kaj Wiik napísal(-a):
>
> Try
>
> sudo apt install libxml2
>
>
>
> On Saturday, September 24, 2016 at 12:52:46 PM UTC+3, Ján Adamčák wrote:
>>
>> Hi Guys,
>>
>> I tried use LightXML on Ubuntu 16.04, but I got an error: 
>>
>> ERROR: error compiling call: could not load library "libxml2"
>>
>> Can You help me?
>>
>> Thanks.
>>
>> Log:
>>
>>  _
>>   _   _ _(_)_ |  A fresh approach to technical computing
>>  (_) | (_) (_)|  Documentation: http://docs.julialang.org
>>   _ _   _| |_  __ _   |  Type "?help" for help.
>>  | | | | | | |/ _` |  |
>>  | | |_| | | | (_| |  |  Version 0.4.5 (2016-03-18 00:58 UTC)
>> _/ |\__'_|_|_|\__'_|  |  
>> |__/   |  x86_64-linux-gnu
>>
>> julia> Pkg.status()
>> No packages installed
>>
>> julia> Pkg.add("LightXML")
>> INFO: Cloning cache of Compat from git://
>> github.com/JuliaLang/Compat.jl.git
>> INFO: Cloning cache of LightXML from git://
>> github.com/JuliaIO/LightXML.jl.git
>> INFO: Installing Compat v0.9.2
>> INFO: Installing LightXML v0.4.0
>> INFO: Building LightXML
>> INFO: Package database updated
>> INFO: METADATA is out-of-date — you may not have the latest version of 
>> LightXML
>> INFO: Use `Pkg.update()` to get the latest versions of your packages
>>
>> julia> Pkg.update()
>> INFO: Updating METADATA...
>> INFO: Computing changes...
>> INFO: No packages to install, update or remove
>>
>> julia> using LightXML
>> INFO: Precompiling module LightXML...
>>
>> julia> # create an empty XML document
>>   xdoc = XMLDocument()
>> ERROR: error compiling call: could not load library "libxml2"
>>
>>
>>
>>
>>

[julia-users] Re: LightXML Ubuntu 16.04 julia 0.4.5

2016-09-24 Thread Ján Adamčák
Thanks,

after installing 

sudo apt-get install libxml2-dev

is LightXML fully working.

I have another question: Why this dependency didn't resolved automatically 
by Pkg.add("LightXML") ?



Dňa sobota, 24. septembra 2016 15:07:37 UTC+2 Tony Kelman napísal(-a):
>
> You might need the -dev version to get a plain "libxml2.so" in addition to 
> the version with an soname in it. I thought Julia should be able to find 
> the soname versions too, but maybe not?
>
>
> On Saturday, September 24, 2016 at 5:34:12 AM UTC-7, Ján Adamčák wrote:
>>
>> I tried sudo apt-get install libxml2, but I got answer from ubuntu:
>>
>> libxml2 is already the newest version (2.9.3+dfsg 1-1ubuntu0.1).
>> libxml2 is tagged as manually installed.
>>
>> But from julia I got same answer:
>>
>> ERROR: error compiling call: could not load library "libxml2"
>>
>>
>>
>> Dňa sobota, 24. septembra 2016 14:18:27 UTC+2 Kaj Wiik napísal(-a):
>>>
>>> Try
>>>
>>> sudo apt install libxml2
>>>
>>>
>>>
>>> On Saturday, September 24, 2016 at 12:52:46 PM UTC+3, Ján Adamčák wrote:
>>>>
>>>> Hi Guys,
>>>>
>>>> I tried use LightXML on Ubuntu 16.04, but I got an error: 
>>>>
>>>> ERROR: error compiling call: could not load library "libxml2"
>>>>
>>>> Can You help me?
>>>>
>>>> Thanks.
>>>>
>>>> Log:
>>>>
>>>>  _
>>>>   _   _ _(_)_ |  A fresh approach to technical computing
>>>>  (_) | (_) (_)|  Documentation: http://docs.julialang.org
>>>>   _ _   _| |_  __ _   |  Type "?help" for help.
>>>>  | | | | | | |/ _` |  |
>>>>  | | |_| | | | (_| |  |  Version 0.4.5 (2016-03-18 00:58 UTC)
>>>> _/ |\__'_|_|_|\__'_|  |  
>>>> |__/   |  x86_64-linux-gnu
>>>>
>>>> julia> Pkg.status()
>>>> No packages installed
>>>>
>>>> julia> Pkg.add("LightXML")
>>>> INFO: Cloning cache of Compat from git://
>>>> github.com/JuliaLang/Compat.jl.git
>>>> INFO: Cloning cache of LightXML from git://
>>>> github.com/JuliaIO/LightXML.jl.git
>>>> INFO: Installing Compat v0.9.2
>>>> INFO: Installing LightXML v0.4.0
>>>> INFO: Building LightXML
>>>> INFO: Package database updated
>>>> INFO: METADATA is out-of-date — you may not have the latest version of 
>>>> LightXML
>>>> INFO: Use `Pkg.update()` to get the latest versions of your packages
>>>>
>>>> julia> Pkg.update()
>>>> INFO: Updating METADATA...
>>>> INFO: Computing changes...
>>>> INFO: No packages to install, update or remove
>>>>
>>>> julia> using LightXML
>>>> INFO: Precompiling module LightXML...
>>>>
>>>> julia> # create an empty XML document
>>>>   xdoc = XMLDocument()
>>>> ERROR: error compiling call: could not load library "libxml2"
>>>>
>>>>
>>>>
>>>>
>>>>

[julia-users] jl_cstr_to_string() variant for wchar_t*

2016-10-03 Thread Ján Adamčák
Hi,

Is there any version of

jl_cstr_to_str()

for use with wchar_t*?

I try create a small wrapper processing windows wchar_t strings to Julia 
strings.

Thanks.