[julia-users] Re: Error or supposed to happen? compile
Thanks to all: this worked... adding `ccall(jl_, Void, (Any,), Text)` recompile
[julia-users] Re: Factorization of big integers is taking too long
Tim is correct in a sense. I translated some big int code a while ago, I think it was the pollard rho method (don't quite remember the details) and the inability to reuse storage for a bigint caused a big performance hit. (I thought about some workaround, but unfortunately I don't remember what it was or if I even tried it) Stefan wrote a simple stop-gap factor() routine and noted in a comment that it needs to be improved. But Bill Hart is correct: It can't do 3^100 + 2 no matter how efficient bigint arithmetic is. The Maxima routines and the perl module by Dana Jacobsen are good, but they would require translating and asking the authors to liberalize the license. I wrapped the msieve c library. https://github.com/jlapeyre/PrimeSieve.jl It does 3^100 + 2 in less than a second on my machine On Friday, March 13, 2015 at 6:20:16 PM UTC+1, Hans W Borchers wrote: I got interested in factorizing some larger integers such as N = 3^100 + 2 . In all tries, factor(N) did not return and had to be interrupted: julia N = big(3)^100 + 2 julia factor(N) ^CERROR: interrupt in finalizer at ./base.jl:126 in + at gmp.jl:243 in factor at primes.jl:111 It is calling GMP, but the GMP software cannot be the reason as this works with the GMP package in R and returns the factorization within seconds: R library(gmp) R N - bigz(3)^100 R factorize(N) Big Integer ('bigz') object of length 3: [1] 31721 246451584544723 65924521656039679831393482841 R system.time(factorize(N)) user system elapsed 3.738 0.000 3.730 Is this a bug? Did I do something wrong? The first factor, 31721, is not even large. Mathematical software such as GAP or PARI/GP will factorize this in much less than a second. PS: Versioninfo Julia Version 0.3.6; System: Linux (x86_64-linux-gnu) CPU: Intel(R) Core(TM) i3-3217U CPU @ 1.80GHz; WORD_SIZE: 64 BLAS: libblas.so.3; LAPACK: liblapack.so.3 LIBM: libopenlibm; LLVM: libLLVM-3.3
Re: [julia-users] Re: Some simple use cases for multi-threading
One other possible use case: for interactive IJulia help notebooks, similar to Mathematica. Though you would probably want them completely sandboxed. On Thursday, 19 March 2015 08:38:58 UTC, Tobias Knopp wrote: Same thing for Gtk.jl Its an absolute standard pattern to spawn a thread even for small workloads in order to keep a GUI responsible. Am Mittwoch, 18. März 2015 23:48:02 UTC+1 schrieb Jacob Quinn: +1 to Mike's suggestion. I've looked into incorporating his auto-complete functionality into Sublime-IJulia, but the lag/locking up is a deal killer. On Wed, Mar 18, 2015 at 4:35 PM, Mike Innes mike.j...@gmail.com wrote: In eval clients like Juno autocomplete locks up while evaluating, so that's something I'm looking forward to solving with some thready goodness. Not quite GUI as such but close. On 18 Mar 2015 18:12, Sebastian Good seba...@palladiumconsulting.com wrote: Task stealing parallelism is an increasingly common use case and easy to program. e.g. Cilk, Grand Central Dispatch, On Thursday, March 12, 2015 at 11:52:37 PM UTC-4, Viral Shah wrote: I am looking to put together a set of use cases for our multi-threading capabilities - mainly to push forward as well as a showcase. I am thinking of starting with stuff in the microbenchmarks and the shootout implementations that are already in test/perf. I am looking for other ideas that would be of interest. If there is real interest, we can collect all of these in a repo in JuliaParallel. -viral
Re: [julia-users] Some simple use cases for multi-threading
On Tue, Mar 17, 2015 at 5:23 PM, Kiran Pamnany kpamn...@gmail.com wrote: Depending on how well Julia-generated code performs, some important concurrent data structures might be better implemented in C and wrapped. I would argue that until we can implement efficient concurrent data structures in pure Julia, the work isn't complete. It's ok to use C code as an interim solution while we're developing this, but in the longer term, we should not be forced to rely on C to write libraries.
[julia-users] Re: Some simple use cases for multi-threading
also the fork-join threadpool in Java. On Wednesday, March 18, 2015 at 7:12:13 PM UTC+1, Sebastian Good wrote: Task stealing parallelism is an increasingly common use case and easy to program. e.g. Cilk, Grand Central Dispatch, On Thursday, March 12, 2015 at 11:52:37 PM UTC-4, Viral Shah wrote: I am looking to put together a set of use cases for our multi-threading capabilities - mainly to push forward as well as a showcase. I am thinking of starting with stuff in the microbenchmarks and the shootout implementations that are already in test/perf. I am looking for other ideas that would be of interest. If there is real interest, we can collect all of these in a repo in JuliaParallel. -viral
Re: [julia-users] Re: Some simple use cases for multi-threading
Same thing for Gtk.jl Its an absolute standard pattern to spawn a thread even for small workloads in order to keep a GUI responsible. Am Mittwoch, 18. März 2015 23:48:02 UTC+1 schrieb Jacob Quinn: +1 to Mike's suggestion. I've looked into incorporating his auto-complete functionality into Sublime-IJulia, but the lag/locking up is a deal killer. On Wed, Mar 18, 2015 at 4:35 PM, Mike Innes mike.j...@gmail.com javascript: wrote: In eval clients like Juno autocomplete locks up while evaluating, so that's something I'm looking forward to solving with some thready goodness. Not quite GUI as such but close. On 18 Mar 2015 18:12, Sebastian Good seba...@palladiumconsulting.com javascript: wrote: Task stealing parallelism is an increasingly common use case and easy to program. e.g. Cilk, Grand Central Dispatch, On Thursday, March 12, 2015 at 11:52:37 PM UTC-4, Viral Shah wrote: I am looking to put together a set of use cases for our multi-threading capabilities - mainly to push forward as well as a showcase. I am thinking of starting with stuff in the microbenchmarks and the shootout implementations that are already in test/perf. I am looking for other ideas that would be of interest. If there is real interest, we can collect all of these in a repo in JuliaParallel. -viral
Re: [julia-users] fill array
Thanks On Wednesday, 18 March 2015 21:12:06 UTC, René Donner wrote: julia z = [1,2,3,4] ... julia a = filter(x-x3, z) ... julia c = [a;z] 6-element Array{Int64,1}: 1 2 1 2 3 4 I think you will find most of what you need in http://docs.julialang.org/en/release-0.3/manual/arrays/ Am 18.03.2015 um 20:55 schrieb pgs phils...@googlemail.com javascript:: Hi I guess what I'm trying to say is that if array a started life as [11,12,13,14] - then if we use filter(x-x3, z) which returns 1,2 - I would like 1,2 added to array a resulting in a array being . [11,12,13,14,1,2] or [1,2,11,12,13,14] Regards On Wednesday, March 18, 2015 at 3:05:54 PM UTC, René Donner wrote: I am not sure what you mean - are you expecting a different behavior than this? Both z and a are containing what they should. julia z = [1,2,3,4] 4-element Array{Int64,1}: 1 2 3 4 julia a = filter(x-x3, z) 2-element Array{Int64,1}: 1 2 julia z 4-element Array{Int64,1}: 1 2 3 4 julia a 2-element Array{Int64,1}: 1 2 Am Mittwoch, 18. März 2015 16:01:11 UTC+1 schrieb pip7...@gmail.com: One thing I forgot to ask is what if I wan to keep the array as it is and then add to it ...if I run a = filter(x-x3, z) ... it overwrites the array. Regards On Wednesday, 18 March 2015 14:04:45 UTC, pip7...@gmail.com wrote: Thanks everybody - got it! Regards On Wednesday, 18 March 2015 12:04:48 UTC, René Donner wrote: or simply a = filter(x-x3, z) Am Mittwoch, 18. März 2015 12:46:52 UTC+1 schrieb Konstantin Markov: julia a = [i for i=filter(x-x3,z)] 2-element Array{Any,1}: 1 2 On Wednesday, March 18, 2015 at 8:31:57 PM UTC+9, pip7...@gmail.com wrote: Hi I want to fill an array based on a condition - eg a = [] z = [1,2,3,4] for i = 1:length(z) if i 2 continue end end so, I would now like to see the values 1 2 in my array a Regards
RE: [julia-users] Re: Time type
Perfect, thanks, that looks exactly like what I need! Should this code also go into the Dates.jl package for julia 0.3? From: julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] On Behalf Of Jacob Quinn Sent: Wednesday, March 18, 2015 8:34 PM To: julia-users@googlegroups.com Subject: Re: [julia-users] Re: Time type Here's 50 lines that implement the bulk of the functionality. Might be worth just throwing this in Base since it's so simple. (this is 0.4 compatible, you'll want to do just `using Dates` for 0.3) using Base.Dates immutable Time value::Millisecond end MS(x) = Millisecond(x) value(x::Time) = x.value.value function Time(h::Int32=0,m::Int32=0,s::Int32=0,ms::Int32=0) -1 h 24 || throw(ArgumentError(Hour: $h out of range (0:23))) -1 m 60 || throw(ArgumentError(Minute: $m out of range (0:59))) -1 s 60 || throw(ArgumentError(Second: $s out of range (0:59))) -1 ms 1000 || throw(ArgumentError(Millisecond: $ms out of range (0:999))) return Time(MS(ms + Int32(1000)*s + Int32(6)*m + Int32(360)*h)) end Time(h::Hour,m::Minute=Minute(0),s::Second=Second(0),ms::Millisecond=Millisecond(0)) = Time(Int32(h),Int32(m),Int32(s),Int32(ms)) _c(c) = convert(Int32,c) Time(h,m=0,s=0,ms=0) = Time(_c(h),_c(m),_c(s),_c(ms)) Base.isfinite{T:Time}(::Union(Type{T},T)) = true Base.eps(t::Time) = Millisecond(1) Base.typemax(::Union(Time,Type{Time})) = Time(23,59,59,999) Base.typemin(::Union(Time,Type{Time})) = Time(0,0,0,0) Base.isless(x::Time,y::Time) = isless(value(x),value(y)) ==(x::Time,y::Time) = ===(value(x),value(y)) hour(t::Time) = mod(fld(value(t),360),24) minute(t::Time) = mod(fld(value(t),6),60) second(t::Time) = mod(fld(value(t),1000),60) millisecond(t::Time) = mod(value(t),1000) (+)(x::Time,y::Dates.TimePeriod) = return Time(MS(value(x)+Dates.toms(y))) (-)(x::Time,y::Dates.TimePeriod) = return Time(MS(value(x)-Dates.toms(y))) (+)(y::Dates.TimePeriod,x::Time) = x + y (-)(y::Dates.TimePeriod,x::Time) = x - y function Base.string(t::Time) h,mi,s = hour(t),minute(t),second(t) hh = lpad(h,2,0) mii = lpad(mi,2,0) ss = lpad(s,2,0) ms = millisecond(t) == 0 ? : string(millisecond(t)/1000.0)[2:end] return $hh:$mii:$ss$(ms) end Base.show(io::IO,x::Time) = print(io,string(x)) On Wed, Mar 18, 2015 at 9:43 AM, Seth catch...@bromberger.com mailto:catch...@bromberger.com wrote: Apropos? https://www.youtube.com/watch?v=-5wpm-gesOY On Saturday, March 14, 2015 at 7:28:23 AM UTC-7, Stefan Karpinski wrote: There are no leap seconds in universal time. There are leap seconds in UTC which bridges terrestrial time (SI seconds) with universal time (day = 1 earth rotation; second = 1/86400 of an earth rotation) by using SI seconds as the basic unit but introducing leap seconds here and there to ensure that UTC days stay in sync with terrestrial days (but not terrestrial seconds). This is why Date x Time ≅ DateTime for UT.
[julia-users] Re: intel compiler builded julia
What was the error? Are you trying to build master or a release 0.3 version? See https://github.com/JuliaLang/julia/issues/9656 for a known issue on master. On Wednesday, March 18, 2015 at 1:24:53 PM UTC-7, Wen Ling wrote: Hi, all: Does any one tried to build julia with intel compiler, I tried, but fails in the middle. any ideas where I may find help on this matter? IRC or developer mailing list? best regards wen
Re: [julia-users] Re: inserting an Expr into AST via macro
Thank you Jameson, that makes a lot of sense. Generally I try to organize my code to build up a single Expr, but sometimes it makes for less than ideal code. Out of curiosity, would it make sense for Julia to have an 'insert' function to convert Expr's to ASTs? This would help alleviate the need for macros in certain cases as well 'eval'. For example, in my case, if I had: fn_expr = parse_action_definition(rule) # fn(rule, first, last, children) rule.action = insert_expr(fn_expr) would cause `rule.action` be set to the actual function, rather than the Expr. If you tried to use `eval`, not only is it frowned on, but it would also fail because of it's global scope. While ultimately you can by, as you suggest, with building up the Exprs, I think something like this would allow for easier to read/maintain code. On Thursday, March 19, 2015 at 12:43:29 AM UTC-4, Jameson wrote: writing a code snippet like val = :(parsefloat(3.1459)) @test2(val) is perhaps a great way to confuse yourself, although it is a common mistake. the problem is that it makes it seem like the two arguments execute in sequence, whereas the macro expansion pass actually runs prior to the code execution. it should, therefore, be viewed in complete isolation from the runtime expressions. in pseudo-code, that might look something like: fullexpression = macroexpand(:(@test2(val))) /// val = :(parsefloat(3.1459)) $fullexpression in summary, macros are functions whose arguments are syntax, not values. when a macro is executed, val does not get passed as reference to a value stored in a variable, it is the expression tree that describes that variable. that is the fundamental distinction between a function and a macro. but, it doesn't sound like you need a macro. macros that call other macros can get really confusing really quickly. but a normal function will perhaps do exactly what you wanted anyways? it's perfectly valid for you to write a function that takes `val` in as an argument and returns some new expression (which you can then combine with other expressions before returning the whole thing from the main macro) On Wed, Mar 18, 2015 at 9:51 AM Abe Schneider abe.schnei...@gmail.com http://mailto:abe.schnei...@gmail.com wrote: Unfortunately my solution only works if you pass in an expression directly. If you try something like this: val = :(parsefloat(3.1459)) @test2(val) It will fail, since `val` is a symbol. Any other ideas? The reason I'm trying to solve the problem in the first place is that I have semantic actions attached to rules formed in a grammar. The actions take the form of expression, which I want to wrap up in a function like: (rule,first, last,children) - $ex where `$ex` is my found expression. If I do this in my main macro, everything work correctly. However, the logic gets more complicated, because I want to allow semantic actions to be tied to any subrule, which means it has to be handled in the definition parsing functions. That should be fine, but I try to create a function that wraps my function, I get into this issue. I can't just insert the expression into the AST like I did before.in the main macro. On Wednesday, March 18, 2015 at 9:30:32 AM UTC-4, Abe Schneider wrote: After some thought, I realized that the easiest way to unquote is to reach inside the Expr and pull out what is needed. If I do a dump of `ex` I get: Expr head: Symbol quote args: Array(Any,(1,)) 1: Expr head: Symbol call args: Array(Any,(2,)) 1: Symbol parsefloat 2: ASCIIString 3.1459 typ: Any So I can rewrite the macro as: macro test2(ex) ex.args[1] end which appears to work: @test2(:(parsefloat(3.1459))) # 3.1459 On Wednesday, March 18, 2015 at 8:08:35 AM UTC-4, Abe Schneider wrote: If I do something simple like: macro test() :(parsefloat(3.1459)) end @test() # 3.1459 everything works as expected. However, if I try this instead: macro test2(ex) ex end @test2(:(parsefloat(3.1459))) # :(parsefloat(3.1459)) Not what I expected, but it makes sense what's happening: macroexpand(:(@test(:(parsefloat(3.1459) # :($(Expr(:copyast, :(:(parsefloat(3.1459)) So, anything I pass to the macro is automatically quoted. Obviously if I just do: @test2(parsefloat(3.1459)) it will work. However, the use-case I'm trying to deal with is that I have an Expr that I would like inserted into the AST. Besides being frowned on, I can't eval, due to not wanting things to be evaluated in global space. Is there some way I can unquote the expression in the macro for test2?
Re: [julia-users] Some simple use cases for multi-threading
Hey Stefan, Depending on how well Julia-generated code performs, some important concurrent data structures might be better implemented in C and wrapped. I would argue that until we can implement efficient concurrent data structures in pure Julia, the work isn't complete. It's ok to use C code as an interim solution while we're developing this, but in the longer term, we should not be forced to rely on C to write libraries. Think of the implementations in C as though we're dropping into inline assembly for maximizing performance. In actual fact, using alignment directives, padding, SIMD intrinsics, or specialized load/store instructions _is_ pretty much assembly. I don't see value in adding this sort of architecture-specific explicit control to Julia--it negates the high-level, high-productivity aspect if you have to throw in pragmas like assume_aligned in your code for performance reasons. And if you go down that road, then you're competing with C.
Re: [julia-users] Re: Overloading Base functions or creating new ones?
On Wednesday, March 18, 2015 at 10:33:17 PM UTC+1, Mauro wrote: I'd be interested to know a case where confusion could arise. I remember that I got confused by a python library using the bit-shift operator for writing to files (C++ style). Got me confused for sure. I think it makes sense that typing, say, ?map should give you a help text which applies to all methods of Base.map. Without having to look into help for specific methods. You have a point there. I suppose I will rename this function, then. Yet there are many base function with short names, it might not always be easy to circumvent these (although Julia helps by issuing an import warning if the function is overloaded). As discussed here https://github.com/JuliaStats/Clustering.jl/pull/32 it is considered confusing to use `min' as a variable and overload `minimum', even though they have the corresponding semantics. ---david On Monday, March 16, 2015 at 4:15:22 PM UTC+1, Patrick O'Leary wrote: On Monday, March 16, 2015 at 10:09:40 AM UTC-5, David van Leeuwen wrote: Related to this question: what if you want to use the name of a base function for your type, where the meaning is _not_ related, but there is no sensible function that would have that meaning for your type? E.g., in GaussianMixtures, I used `map(::GMM, ...)` for maximum-a-posteriori adaptation of the GMM. I can't see ::GMM in the role of a ::Function, so I personally do not mind this re-use of an existing function name from Base. Others may disagree wholeheartedly. ---david Don't `import Base.map`, and leave `map` off of your exports list. This means users have to use the fully-qualified `GuassianMixtures.map`, but there is no risk of confusion. (Though I am not sure that I would read map as a shorthand for maximum a posteriori--maxpost, maybe?) Patrick
Re: [julia-users] Error or supposed to happen? compile
A quite complicate bootstrap process is running when compiling Julia. So, there is quite a bit of functionality missing during the bootstrap. Apparently one of them is STDOUT, thus the error UndefVarError(var=:STDOUT))) Search the list for some tips and tricks on how to debug Julia itself. Although, easiest (if possible) is to develop new functionality as a package and only once it's working add it to base. On Thu, 2015-03-19 at 19:53, Julia User julia.user1...@gmail.com wrote: I added a print statement to a function in Base.string.jl something like: function searchindex(s::ByteString, t::ByteString, i::Integer=1) println(Line 305) if length(t) == 1 search(s, t[1], i) else searchindex(s.data, t.data, i) end end When I recompile julia I get an Error: Is that suppose to happen ? CC ui/repl.o LINK usr/bin/julia JULIA usr/lib/julia/sys0.o exports.jl base.jl reflection.jl build_h.jl version_git.jl c.jl options.jl promotion.jl tuple.jl range.jl expr.jl error.jl bool.jl number.jl int.jl operators.jl pointer.jl refpointer.jl rounding.jl float.jl complex.jl rational.jl abstractarray.jl subarray.jl array.jl subarray2.jl functors.jl bitarray.jl intset.jl dict.jl set.jl hashing.jl iterator.jl simdloop.jl reduce.jl inference.jl osutils.jl char.jl ascii.jl utf8.jl utf16.jl utf32.jl iobuffer.jl string.jl utf8proc.jl regex.jl pcre.jl base64.jl io.jl iostream.jl libc.jl libdl.jl env.jl path.jl intfuncs.jl nullable.jl task.jl show.jl stream.jl uv_constants.jl socket.jl stat.jl fs.jl process.jl multimedia.jl grisu.jl file.jl methodshow.jl floatfuncs.jl math.jl float16.jl cartesian.jl multidimensional.jl primes.jl reducedim.jl ordering.jl collections.jl sort.jl version.jl gmp.jl mpfr.jl combinatorics.jl hashing2.jl dSFMT.jl random.jl printf.jl serialize.jl multi.jl managers.jl loading.jl poll.jl mmap.jl sharedarray.jl datafmt.jl deepcopy.jl interactiveutil.jl replutil.jl test.jl meta.jl i18n.jl help.jl Terminals.jl LineEdit.jl REPLCompletions.jl REPL.jl client.jl markdown/Markdown.jl docs.jl error during bootstrap: LoadError(at sysimg.jl line 233: LoadError(at docs.jl line 213: UndefVarError(var=:STDOUT))) jl_throw at /julia_src/usr/bin/../lib/libjulia.so (unknown line) unknown function (ip: -296211804) unknown function (ip: -296145600) unknown function (ip: -296147390) unknown function (ip: -296144131) jl_load at /julia_src/usr/bin/../lib/libjulia.so (unknown line) include at boot.jl:250 anonymous at sysimg.jl:151 unknown function (ip: -296209515) unknown function (ip: -296215837) unknown function (ip: -296145600) unknown function (ip: -296147390) unknown function (ip: -296144131) jl_load at /julia_src/usr/bin/../lib/libjulia.so (unknown line) unknown function (ip: 4203722) unknown function (ip: 4203045) unknown function (ip: 4202790) __libc_start_main at /usr/lib/libc.so.6 (unknown line) unknown function (ip: 4199657) unknown function (ip: 0) Makefile:168: recipe for target '/julia_src/usr/lib/julia/sys0.o' failed make[1]: *** [/julia_src/usr/lib/julia/sys0.o] Error 1 Makefile:82: recipe for target 'julia-sysimg-release' failed make: *** [julia-sysimg-release] Error 2 Thanks
[julia-users] Re: Error or supposed to happen? compile
Thanks, nothing important just tried it to see if it would work. On Thursday, March 19, 2015 at 4:30:07 PM UTC-3, Patrick O'Leary wrote: Since string.jl is part of the bootstrap, there are things that won't be available yet when that part of the image is built. It looks like in this case STDOUT, which is the default target for println, hasn't been defined yet. What are you trying to do with this print? There may be another solution.
[julia-users] Re: intel compiler builded julia
thanks for the info On Thursday, March 19, 2015 at 2:10:25 PM UTC-4, Tony Kelman wrote: Looks like osxunwind has some inline assembly that the intel compiler doesn't like. On Thursday, March 19, 2015 at 9:29:03 AM UTC-7, Wen Ling wrote: and I build on MacBook pro, osx10.10 On Thursday, March 19, 2015 at 4:16:02 AM UTC-4, Tony Kelman wrote: What was the error? Are you trying to build master or a release 0.3 version? See https://github.com/JuliaLang/julia/issues/9656 for a known issue on master. On Wednesday, March 18, 2015 at 1:24:53 PM UTC-7, Wen Ling wrote: Hi, all: Does any one tried to build julia with intel compiler, I tried, but fails in the middle. any ideas where I may find help on this matter? IRC or developer mailing list? best regards wen
Re: [julia-users] Re: Error or supposed to happen? compile
`ccall(jl_, Void, (Ptr{Uint8},), Line 305)` will probably work. (beware that YMMV as this is a debugging function that does not support all data structures so you might end up needing to Ctrl^C the process if it tries to display something too complicated and ends up spewing nonsense). On Thu, Mar 19, 2015 at 3:43 PM, Julia User julia.user1...@gmail.com wrote: Thanks, nothing important just tried it to see if it would work. On Thursday, March 19, 2015 at 4:30:07 PM UTC-3, Patrick O'Leary wrote: Since string.jl is part of the bootstrap, there are things that won't be available yet when that part of the image is built. It looks like in this case STDOUT, which is the default target for println, hasn't been defined yet. What are you trying to do with this print? There may be another solution.
[julia-users] Re: intel compiler builded julia
Looks like osxunwind has some inline assembly that the intel compiler doesn't like. On Thursday, March 19, 2015 at 9:29:03 AM UTC-7, Wen Ling wrote: and I build on MacBook pro, osx10.10 On Thursday, March 19, 2015 at 4:16:02 AM UTC-4, Tony Kelman wrote: What was the error? Are you trying to build master or a release 0.3 version? See https://github.com/JuliaLang/julia/issues/9656 for a known issue on master. On Wednesday, March 18, 2015 at 1:24:53 PM UTC-7, Wen Ling wrote: Hi, all: Does any one tried to build julia with intel compiler, I tried, but fails in the middle. any ideas where I may find help on this matter? IRC or developer mailing list? best regards wen
[julia-users] Running external programms in windows, quotes vs. double quotes
Hello, I currently try to make the LaTeX.jl package from rened windows friendly. However I run into problems because of julias command interplation. I try to open a pdf file in some pdf viewer. In windows you can do that with following command start SOME_DOCUMENT.pdf However spawn(`start $pdfname`) will result in start '' 'SOME_DOCUMENT.pdf' Double quotes have been replaced by single quotes and the string was also encapsulated by quotes (looks like because of the presence of backslashes). So my questions are: 1) Is there a workaround or some way to manipulate how quotes are handles. Guess some way to execute a raw command line would be enough. 2) Is this a bug in Julia. Thanks! Florian
Re: [julia-users] Re: Some simple use cases for multi-threading
I have to vote in this direction too. One thing I did very successfully in C++11 was to make a window running in a separate thread that I could feed lamda functions to. The lambda functions would run openGL commands to visualize data that the functions closed over. This turned out to be a hugely helpful, but I haven't found a good way to do it properly in Julia. On Thursday, March 19, 2015 at 3:38:58 AM UTC-5, Tobias Knopp wrote: Same thing for Gtk.jl Its an absolute standard pattern to spawn a thread even for small workloads in order to keep a GUI responsible. Am Mittwoch, 18. März 2015 23:48:02 UTC+1 schrieb Jacob Quinn: +1 to Mike's suggestion. I've looked into incorporating his auto-complete functionality into Sublime-IJulia, but the lag/locking up is a deal killer. On Wed, Mar 18, 2015 at 4:35 PM, Mike Innes mike.j...@gmail.com wrote: In eval clients like Juno autocomplete locks up while evaluating, so that's something I'm looking forward to solving with some thready goodness. Not quite GUI as such but close. On 18 Mar 2015 18:12, Sebastian Good seba...@palladiumconsulting.com wrote: Task stealing parallelism is an increasingly common use case and easy to program. e.g. Cilk, Grand Central Dispatch, On Thursday, March 12, 2015 at 11:52:37 PM UTC-4, Viral Shah wrote: I am looking to put together a set of use cases for our multi-threading capabilities - mainly to push forward as well as a showcase. I am thinking of starting with stuff in the microbenchmarks and the shootout implementations that are already in test/perf. I am looking for other ideas that would be of interest. If there is real interest, we can collect all of these in a repo in JuliaParallel. -viral
[julia-users] Error or supposed to happen? compile
I added a print statement to a function in Base.string.jl something like: function searchindex(s::ByteString, t::ByteString, i::Integer=1) println(Line 305) if length(t) == 1 search(s, t[1], i) else searchindex(s.data, t.data, i) end end When I recompile julia I get an Error: Is that suppose to happen ? CC ui/repl.o LINK usr/bin/julia JULIA usr/lib/julia/sys0.o exports.jl base.jl reflection.jl build_h.jl version_git.jl c.jl options.jl promotion.jl tuple.jl range.jl expr.jl error.jl bool.jl number.jl int.jl operators.jl pointer.jl refpointer.jl rounding.jl float.jl complex.jl rational.jl abstractarray.jl subarray.jl array.jl subarray2.jl functors.jl bitarray.jl intset.jl dict.jl set.jl hashing.jl iterator.jl simdloop.jl reduce.jl inference.jl osutils.jl char.jl ascii.jl utf8.jl utf16.jl utf32.jl iobuffer.jl string.jl utf8proc.jl regex.jl pcre.jl base64.jl io.jl iostream.jl libc.jl libdl.jl env.jl path.jl intfuncs.jl nullable.jl task.jl show.jl stream.jl uv_constants.jl socket.jl stat.jl fs.jl process.jl multimedia.jl grisu.jl file.jl methodshow.jl floatfuncs.jl math.jl float16.jl cartesian.jl multidimensional.jl primes.jl reducedim.jl ordering.jl collections.jl sort.jl version.jl gmp.jl mpfr.jl combinatorics.jl hashing2.jl dSFMT.jl random.jl printf.jl serialize.jl multi.jl managers.jl loading.jl poll.jl mmap.jl sharedarray.jl datafmt.jl deepcopy.jl interactiveutil.jl replutil.jl test.jl meta.jl i18n.jl help.jl Terminals.jl LineEdit.jl REPLCompletions.jl REPL.jl client.jl markdown/Markdown.jl docs.jl error during bootstrap: LoadError(at sysimg.jl line 233: LoadError(at docs.jl line 213: UndefVarError(var=:STDOUT))) jl_throw at /julia_src/usr/bin/../lib/libjulia.so (unknown line) unknown function (ip: -296211804) unknown function (ip: -296145600) unknown function (ip: -296147390) unknown function (ip: -296144131) jl_load at /julia_src/usr/bin/../lib/libjulia.so (unknown line) include at boot.jl:250 anonymous at sysimg.jl:151 unknown function (ip: -296209515) unknown function (ip: -296215837) unknown function (ip: -296145600) unknown function (ip: -296147390) unknown function (ip: -296144131) jl_load at /julia_src/usr/bin/../lib/libjulia.so (unknown line) unknown function (ip: 4203722) unknown function (ip: 4203045) unknown function (ip: 4202790) __libc_start_main at /usr/lib/libc.so.6 (unknown line) unknown function (ip: 4199657) unknown function (ip: 0) Makefile:168: recipe for target '/julia_src/usr/lib/julia/sys0.o' failed make[1]: *** [/julia_src/usr/lib/julia/sys0.o] Error 1 Makefile:82: recipe for target 'julia-sysimg-release' failed make: *** [julia-sysimg-release] Error 2 Thanks
[julia-users] Re: Error or supposed to happen? compile
Since string.jl is part of the bootstrap, there are things that won't be available yet when that part of the image is built. It looks like in this case STDOUT, which is the default target for println, hasn't been defined yet. What are you trying to do with this print? There may be another solution. On Thursday, March 19, 2015 at 1:53:24 PM UTC-5, Julia User wrote: I added a print statement to a function in Base.string.jl something like: function searchindex(s::ByteString, t::ByteString, i::Integer=1) println(Line 305) if length(t) == 1 search(s, t[1], i) else searchindex(s.data, t.data, i) end end When I recompile julia I get an Error: Is that suppose to happen ? CC ui/repl.o LINK usr/bin/julia JULIA usr/lib/julia/sys0.o exports.jl base.jl reflection.jl build_h.jl version_git.jl c.jl options.jl promotion.jl tuple.jl range.jl expr.jl error.jl bool.jl number.jl int.jl operators.jl pointer.jl refpointer.jl rounding.jl float.jl complex.jl rational.jl abstractarray.jl subarray.jl array.jl subarray2.jl functors.jl bitarray.jl intset.jl dict.jl set.jl hashing.jl iterator.jl simdloop.jl reduce.jl inference.jl osutils.jl char.jl ascii.jl utf8.jl utf16.jl utf32.jl iobuffer.jl string.jl utf8proc.jl regex.jl pcre.jl base64.jl io.jl iostream.jl libc.jl libdl.jl env.jl path.jl intfuncs.jl nullable.jl task.jl show.jl stream.jl uv_constants.jl socket.jl stat.jl fs.jl process.jl multimedia.jl grisu.jl file.jl methodshow.jl floatfuncs.jl math.jl float16.jl cartesian.jl multidimensional.jl primes.jl reducedim.jl ordering.jl collections.jl sort.jl version.jl gmp.jl mpfr.jl combinatorics.jl hashing2.jl dSFMT.jl random.jl printf.jl serialize.jl multi.jl managers.jl loading.jl poll.jl mmap.jl sharedarray.jl datafmt.jl deepcopy.jl interactiveutil.jl replutil.jl test.jl meta.jl i18n.jl help.jl Terminals.jl LineEdit.jl REPLCompletions.jl REPL.jl client.jl markdown/Markdown.jl docs.jl error during bootstrap: LoadError(at sysimg.jl line 233: LoadError(at docs.jl line 213: UndefVarError(var=:STDOUT))) jl_throw at /julia_src/usr/bin/../lib/libjulia.so (unknown line) unknown function (ip: -296211804) unknown function (ip: -296145600) unknown function (ip: -296147390) unknown function (ip: -296144131) jl_load at /julia_src/usr/bin/../lib/libjulia.so (unknown line) include at boot.jl:250 anonymous at sysimg.jl:151 unknown function (ip: -296209515) unknown function (ip: -296215837) unknown function (ip: -296145600) unknown function (ip: -296147390) unknown function (ip: -296144131) jl_load at /julia_src/usr/bin/../lib/libjulia.so (unknown line) unknown function (ip: 4203722) unknown function (ip: 4203045) unknown function (ip: 4202790) __libc_start_main at /usr/lib/libc.so.6 (unknown line) unknown function (ip: 4199657) unknown function (ip: 0) Makefile:168: recipe for target '/julia_src/usr/lib/julia/sys0.o' failed make[1]: *** [/julia_src/usr/lib/julia/sys0.o] Error 1 Makefile:82: recipe for target 'julia-sysimg-release' failed make: *** [julia-sysimg-release] Error 2 ...
Re: [julia-users] Re: Error or supposed to happen? compile
I did try your suggestion (`ccall(jl_, Void, (Ptr{Uint8},), Line 305)` will probably work.) but got an other Error libc.jl libdl.jl env.jl error during bootstrap: LoadError(at sysimg.jl line 106: LoadError(at env.jl line 110: UndefVarError(var=:Uint8))) Thanks anyway - was just a try.. On Thursday, March 19, 2015 at 4:49:46 PM UTC-3, Isaiah wrote: `ccall(jl_, Void, (Ptr{Uint8},), Line 305)` will probably work.
[julia-users] Re: Another (basic) parameterization question
You left out the initialization code for the fields in your excerpt above. What happens when you call Graph(Int16(5))? On Friday, March 6, 2015 at 2:42:20 PM UTC-5, Seth wrote: I have abstract AbstractGraph{T:Integer} type Graph{T}:AbstractGraph{T} vertices::UnitRange{T} edges::Set{Edge{T}} finclist::Vector{Vector{Edge{T}}} # [src]: ((src,dst), (src,dst), (src,dst)) binclist::Vector{Vector{Edge{T}}} # [dst]: ((src,dst), (src,dst), (src,dst)) end function Graph{T:Integer}(n::T) and g = Graph(5) works and produces a graph of type Graph{Int64}, but g = Graph{Int64}(5) produces ERROR: MethodError: `convert` has no method matching convert(::Type{LightGraphs.Graph{Int64}}, ::Int64) This is a problem because I have function union{T:AbstractGraph}(g::T, h::T) gnv = nv(g) r = T(gnv + nv(h)) for e in edges(g) add_edge!(r,e) end for e in edges(h) add_edge!(r, gnv+src(e), gnv+dst(e)) end return r end Which is failing on line 3 (in the creation of the graph). What's the proper way of creating the object from a parameterized type? Thanks.
Re: [julia-users] Re: Error or supposed to happen? compile
Yes a git checkout. That worked so half way.. It compiled: got between a number of !!! ERROR in jl_ -- ABORTING !!! !!! ERROR in jl_ -- ABORTING !!! precompile.jl LINK usr/lib/julia/sys.so [workerm@evo git_julia]$ But the problem is if I call something it will not output the text but `!!! ERROR in jl_ -- ABORTING !!! otherwise it seems ok. ` julia searchindex(aadsd, d) !!! ERROR in jl_ -- ABORTING !!! 3 julia The same happened before when I tested this in the REPL julia function test() ccall(jl_, Void, (Ptr{UInt8 },), Line 2) end test (generic function with 1 method) julia test() !!! ERROR in jl_ -- ABORTING !!! julia Nevermind... On Thursday, March 19, 2015 at 5:53:10 PM UTC-3, Mauro wrote: Are you on 0.4? Then it should be UInt8
Re: [julia-users] Re: Error or supposed to happen? compile
The argument to the jl_ function is of type Any not Ptr{Void} It also now bails at a depth of 25 by printing •, so it should fail as badly anymore on recursive types On Thu, Mar 19, 2015 at 5:26 PM Julia User julia.user1...@gmail.com wrote: Yes a git checkout. That worked so half way.. It compiled: got between a number of !!! ERROR in jl_ -- ABORTING !!! !!! ERROR in jl_ -- ABORTING !!! precompile.jl LINK usr/lib/julia/sys.so [workerm@evo git_julia]$ But the problem is if I call something it will not output the text but ` !!! ERROR in jl_ -- ABORTING !!! otherwise it seems ok. ` julia searchindex(aadsd, d) !!! ERROR in jl_ -- ABORTING !!! 3 julia The same happened before when I tested this in the REPL julia function test() ccall(jl_, Void, (Ptr{UInt8 },), Line 2) end test (generic function with 1 method) julia test() !!! ERROR in jl_ -- ABORTING !!! julia Nevermind... On Thursday, March 19, 2015 at 5:53:10 PM UTC-3, Mauro wrote: Are you on 0.4? Then it should be UInt8
[julia-users] Re: intel compiler builded julia
btw, I use icc/ifort 15.0.2, On Thursday, March 19, 2015 at 4:16:02 AM UTC-4, Tony Kelman wrote: What was the error? Are you trying to build master or a release 0.3 version? See https://github.com/JuliaLang/julia/issues/9656 for a known issue on master. On Wednesday, March 18, 2015 at 1:24:53 PM UTC-7, Wen Ling wrote: Hi, all: Does any one tried to build julia with intel compiler, I tried, but fails in the middle. any ideas where I may find help on this matter? IRC or developer mailing list? best regards wen
[julia-users] Re: intel compiler builded julia
and I build on MacBook pro, osx10.10 On Thursday, March 19, 2015 at 4:16:02 AM UTC-4, Tony Kelman wrote: What was the error? Are you trying to build master or a release 0.3 version? See https://github.com/JuliaLang/julia/issues/9656 for a known issue on master. On Wednesday, March 18, 2015 at 1:24:53 PM UTC-7, Wen Ling wrote: Hi, all: Does any one tried to build julia with intel compiler, I tried, but fails in the middle. any ideas where I may find help on this matter? IRC or developer mailing list? best regards wen
Re: [julia-users] Running external programms in windows, quotes vs. double quotes
1) Is there a workaround or some way to manipulate how quotes are handles. Guess some way to execute a raw command line would be enough. Here is some example code you could use to create processes directly on Windows: https://gist.github.com/ihnorton/82dc5b41a537de710ab2 2) Is this a bug in Julia. Known issue, more or less. We are somewhat fighting against libuv's attempts to be extra-helpful here. I'm not sure what is the best way to improve this. (see boatload of semi-related discussion, starting here: https://github.com/JuliaLang/IJulia.jl/pull/211#issuecomment-51562782) On Thu, Mar 19, 2015 at 10:02 AM, flicaf...@gmail.com wrote: Hello, I currently try to make the LaTeX.jl package from rened windows friendly. However I run into problems because of julias command interplation. I try to open a pdf file in some pdf viewer. In windows you can do that with following command start SOME_DOCUMENT.pdf However spawn(`start $pdfname`) will result in start '' 'SOME_DOCUMENT.pdf' Double quotes have been replaced by single quotes and the string was also encapsulated by quotes (looks like because of the presence of backslashes). So my questions are: 1) Is there a workaround or some way to manipulate how quotes are handles. Guess some way to execute a raw command line would be enough. 2) Is this a bug in Julia. Thanks! Florian
Re: [julia-users] Running external programms in windows, quotes vs. double quotes
This works nicely. However I had to change the command to command = cmd /K start \\ $pdfname start seems to need the cmd.exe shell to work. Thank you very much.