[julia-users] Necessary to rebuild Julia after modifying Base?
I am trying to add "info" calls to Base functions to debug an issue. These don't make it to my screen, and I don't know whether they are getting lost somewhere or whether Julia is ignoring my modifications. Do I need to re-build and re-install Julia after modifying files in Base? If so: Can I avoid pre-compiling files? In particular, "osutils.jl" takes a long time to build. -erik
Re: [julia-users] Necessary to rebuild Julia after modifying Base?
If you change Base, you do need to regenerate the system image. I always do this by running make clean and make, but it might be possible to do things faster than that process. — John On Sep 20, 2014, at 2:57 PM, Erik Schnetter wrote: > I am trying to add "info" calls to Base functions to debug an issue. These > don't make it to my screen, and I don't know whether they are getting lost > somewhere or whether Julia is ignoring my modifications. Do I need to > re-build and re-install Julia after modifying files in Base? > > If so: Can I avoid pre-compiling files? In particular, "osutils.jl" takes a > long time to build. > > -erik >
Re: [julia-users] Necessary to rebuild Julia after modifying Base?
make clean is usually necessary only when something in src changes. Just saying "make" (without the "clean") can save you 1 round of building. But yes, even a 1-character source code change to base requires rebuilding julia. --Tim On Saturday, September 20, 2014 03:01:27 PM John Myles White wrote: > If you change Base, you do need to regenerate the system image. I always do > this by running make clean and make, but it might be possible to do things > faster than that process. > > — John > > On Sep 20, 2014, at 2:57 PM, Erik Schnetter wrote: > > I am trying to add "info" calls to Base functions to debug an issue. These > > don't make it to my screen, and I don't know whether they are getting > > lost somewhere or whether Julia is ignoring my modifications. Do I need > > to re-build and re-install Julia after modifying files in Base? > > > > If so: Can I avoid pre-compiling files? In particular, "osutils.jl" takes > > a long time to build. > > > > -erik
Re: [julia-users] Necessary to rebuild Julia after modifying Base?
Depending where you are placing the debug statements, various output functionality might not be defined yet when building the system image. You can get around that by using the static show functions defined at the top of sysimg.jl On Saturday, September 20, 2014 6:09:39 PM UTC-4, Tim Holy wrote: > > make clean is usually necessary only when something in src changes. Just > saying "make" (without the "clean") can save you 1 round of building. > > But yes, even a 1-character source code change to base requires rebuilding > julia. > > --Tim > > On Saturday, September 20, 2014 03:01:27 PM John Myles White wrote: > > If you change Base, you do need to regenerate the system image. I always > do > > this by running make clean and make, but it might be possible to do > things > > faster than that process. > > > > — John > > > > On Sep 20, 2014, at 2:57 PM, Erik Schnetter > wrote: > > > I am trying to add "info" calls to Base functions to debug an issue. > These > > > don't make it to my screen, and I don't know whether they are getting > > > lost somewhere or whether Julia is ignoring my modifications. Do I > need > > > to re-build and re-install Julia after modifying files in Base? > > > > > > If so: Can I avoid pre-compiling files? In particular, "osutils.jl" > takes > > > a long time to build. > > > > > > -erik > >
Re: [julia-users] Necessary to rebuild Julia after modifying Base?
Note that Jake's advice here is meant for if you want to see debugging output while precompiling the system image. If you're just trying to modify functions in Base for normal execution, you don't need to worry about that. -E On Sat, Sep 20, 2014 at 3:49 PM, Jake Bolewski wrote: > Depending where you are placing the debug statements, various output > functionality might not be defined yet when building the system image. You > can get around that by using the static show functions defined at the top > of sysimg.jl > > On Saturday, September 20, 2014 6:09:39 PM UTC-4, Tim Holy wrote: >> >> make clean is usually necessary only when something in src changes. Just >> saying "make" (without the "clean") can save you 1 round of building. >> >> But yes, even a 1-character source code change to base requires >> rebuilding >> julia. >> >> --Tim >> >> On Saturday, September 20, 2014 03:01:27 PM John Myles White wrote: >> > If you change Base, you do need to regenerate the system image. I >> always do >> > this by running make clean and make, but it might be possible to do >> things >> > faster than that process. >> > >> > — John >> > >> > On Sep 20, 2014, at 2:57 PM, Erik Schnetter wrote: >> > > I am trying to add "info" calls to Base functions to debug an issue. >> These >> > > don't make it to my screen, and I don't know whether they are getting >> > > lost somewhere or whether Julia is ignoring my modifications. Do I >> need >> > > to re-build and re-install Julia after modifying files in Base? >> > > >> > > If so: Can I avoid pre-compiling files? In particular, "osutils.jl" >> takes >> > > a long time to build. >> > > >> > > -erik >> >>
Re: [julia-users] Necessary to rebuild Julia after modifying Base?
Thanks for the pointers. I'm only changing Julia code at the moment, so I'll go with "make install". And luckily I'm not debugging the bootstrap process yet, but I'll keep the static show function in mind. -erik On Sat, Sep 20, 2014 at 8:27 PM, Elliot Saba wrote: > Note that Jake's advice here is meant for if you want to see debugging > output while precompiling the system image. If you're just trying to modify > functions in Base for normal execution, you don't need to worry about that. > -E > > On Sat, Sep 20, 2014 at 3:49 PM, Jake Bolewski > wrote: >> >> Depending where you are placing the debug statements, various output >> functionality might not be defined yet when building the system image. You >> can get around that by using the static show functions defined at the top of >> sysimg.jl >> >> On Saturday, September 20, 2014 6:09:39 PM UTC-4, Tim Holy wrote: >>> >>> make clean is usually necessary only when something in src changes. Just >>> saying "make" (without the "clean") can save you 1 round of building. >>> >>> But yes, even a 1-character source code change to base requires >>> rebuilding >>> julia. >>> >>> --Tim >>> >>> On Saturday, September 20, 2014 03:01:27 PM John Myles White wrote: >>> > If you change Base, you do need to regenerate the system image. I >>> > always do >>> > this by running make clean and make, but it might be possible to do >>> > things >>> > faster than that process. >>> > >>> > -- John >>> > >>> > On Sep 20, 2014, at 2:57 PM, Erik Schnetter wrote: >>> > > I am trying to add "info" calls to Base functions to debug an issue. >>> > > These >>> > > don't make it to my screen, and I don't know whether they are getting >>> > > lost somewhere or whether Julia is ignoring my modifications. Do I >>> > > need >>> > > to re-build and re-install Julia after modifying files in Base? >>> > > >>> > > If so: Can I avoid pre-compiling files? In particular, "osutils.jl" >>> > > takes >>> > > a long time to build. >>> > > >>> > > -erik >>> > -- Erik Schnetter http://www.perimeterinstitute.ca/personal/eschnetter/
Re: [julia-users] Necessary to rebuild Julia after modifying Base?
There is one trick that you might try when you're modifying methods in Base. You can define a new method on the same function. Eg, you can paste the modified method in your terminal: function Base.sin(x::Float64) x == 0 && error() sqrt(1-cos(x)^2) end Note that julia might have inlined the old definition, so in some cases you'll need to restart julia, or rebuild the system image in order for the new definition to be picked up.