Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

julia: Fix install. #6

Closed
wants to merge 1 commit into from
Closed

Conversation

samueljohn
Copy link
Contributor

  • julia can build in parallel.
  • Copy doc and examples to share/julia.
  • CPPFLAGS/CFLAGS changing no longer needed.
  • Use FC is set. (needed to support gfortran-4.7)
  • Copy the "test" into lib/julia (is missing from install)
  • julia.rb should not be executable (unix rights)

@samueljohn
Copy link
Contributor Author

@staticfloat this is just to let you know my current (working) version of julia.rb.
All tests pass.

However julia-release-webserver shows me an empty page. I am not sure how to fix that.

@StefanKarpinski
Copy link

On Darwin it already uses BLAS and LAPACK, no need to explicitly USESYSTEM...

This is going to change back as soon as the next version of OpenBLAS is released... which, in fact already happened. So I'm going to switch back to using OpenBLAS on Darwin nowish...

@samueljohn
Copy link
Contributor Author

@staticfloat then we should begin to check if Homebrew's keg-only OpenBLAS can be made to work with Julia.

@StefanKarpinski is OpenBLAS faster or has it got more features? Thanks for the hint!

@samueljohn
Copy link
Contributor Author

@StefanKarpinski, right now, Homebrew's OpenBlas formula builds without LAPACK system "make", "NOLAPACK=1", is that okay for Julia?
Also, suite-sparse links against Apple's Accelerate framework. I hope that will not be a problem.

@StefanKarpinski
Copy link

I believe that OpenBLAS recently surpassed the system BLAS and LAPACK in performance, so yes, these days it is. I also think it may have more features. It certainly seems to have all the features we've needed so far. I'm pretty sure we use the LAPACK part too, so you may want to enable that somehow, maybe optionally? Although, if someone is using OpenBLAS for BLAS, it's hard to imagine that they wouldn't also want LAPACK features based on OpenBLAS. I think that having SuiteSparse link against a different BLAS is ok but it will bloat the resisting binaries that link against both. @ViralBShah has done a lot of work trying to reduce this bloat in Julia, but it's a slog.

@ViralBShah
Copy link

Openblas was about 5-10% faster than Accelerate when I had tested (Use peakflops() in julia). It is also open source, maintained, and cross-platform, and in the julia team, we will ensure that everything works well with openblas and its patched LAPACK. Accelerate will most likely not include the latest release of LAPACK. Apart from that, I don't foresee any real issue with using Accelerate instead of openblas.

Do build openblas with LAPACK, as it patches some of the key LAPACK functions and results in higher performance than standalone LAPACK. This results in libopenblas, which includes both, BLAS and LAPACK.

It is ok if suitesparse uses Accelerate - but it is preferable to use the same set of libraries everywhere.

cp_r "test", "#{lib}/julia/"

# link libglpk.0.dylib is installed but not libglpk. Todo: Fix the glpk formula!
ln_s "#{Formula.factory('glpk').lib}/libglpk.dylib", "usr/lib"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is broken about the glpk formula? I get a libglpk.dylib and libglpk.0.dylib installed in my HOMEBREW_PREFIX/lib.

@staticfloat
Copy link
Owner

I like copying doc, etc... but I'm not sure if skipping Julia's install procedure entirely is such a good idea. Is this because you don't want libraries from Julia conflicting with Homebrew's libraries? (Because Julia now throws all of its libraries into <prefix>/lib?

@samueljohn
Copy link
Contributor Author

wait... i repush (install working)

@@ -30,10 +33,6 @@ def patches

def install
ENV.fortran
ENV.deparallelize
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really I never had problems with parallel builds. It builds blazing fast (on 4-core i7 here), so it makes a difference.
If you insist on it, why not adding if build.debug? (not tested if it is called that way, may be named similar)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have never had problems with parallel builds either; It was just because when having troubles installed dependencies (like I did earlier on) it made it very difficult for other users to figure out what was going wrong. Having it as if build.debug? is a wonderful idea, thanks!

@staticfloat
Copy link
Owner

This all looks really good, I'm going to merge it with a few changes;

  • We don't need to depend_on metis
  • We now do need to depend on openblas, so I'm going to enable that.
  • Since you're asking for USE_SYSTEM_NGINX, I'm going to depend_on nginx as well.

@@ -45,11 +44,15 @@ def install
# Build up list of build options
build_opts = ["PREFIX=#{prefix}"]

# Tell julia about our gfortran
# (this enables to use gfortran-4.7 from the tap homebrew-dupes/gcc.rb)
build_opts << "FC=#{ENV['FC']}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not hurt if you use the usual brew install gfortran. I prefer the brew install gcc --enable-fortran in order to get the 4.7 version (which I need for numpy/scipy). That version rocks. But I need to set FC, since hombrew-dupes appends the "-4.7" and most software doesn't find gfortran then.

- julia can build in parallel.
- Copy doc and examples to share/julia.
- CPPFLAGS/CFLAGS changing no longer needed.
- Use FC is set. (needed to support gfortran-4.7)
- Copy the "test" into lib/julia (is missing from install)
- julia.rb should not be executable (unix rights)
build_opts << "USE_SYSTEM_#{dep}=1"
end

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brew audit complains about trailing whitespace. Some git thing or so.

@samueljohn
Copy link
Contributor Author

  • I commented out the openblas (but left it there to remember us when julia switches)
  • You may be right on metis (I dunno. If it is an indirect dependency it's okay. Homebrew will figure out)
  • nginx is not yet needed (I guess) but depending on it doesn't hurt.

@samueljohn
Copy link
Contributor Author

So from now on, I won't git push --force any more and leave the merging up to you :-P

@staticfloat
Copy link
Owner

Cool, thanks for all your hard work! I'm hoping that either the changes
I'm doing now or using gfortran from gcc 4.7 will magically fix the errors
I'm having. If not, I'm going to have to make a mac virtual machine and
try it completely from scratch to compare between the two of us to see why
I'm getting that LoadError when compiling FFTW in Homebrew!
-E

On Fri, Aug 24, 2012 at 10:58 AM, Samuel John [email protected]:

So from now on, I won't git push --force any more and leave the merging
up to you :-P


Reply to this email directly or view it on GitHubhttps://github.com//pull/6#issuecomment-8009942.

@staticfloat
Copy link
Owner

Note to self; next time just auto-merge and add in changes afterwards, instead of trying to fix up stuff on remote branch and then merging in. :P

@samueljohn
Copy link
Contributor Author

Thanks for pulling!

When using gfortran-4.7, I needed to do the following:

export FC=`brew --prefix`/bin/gfortran-4.7
brew install julia --HEAD --default-fortran-flags -v

The fortranflags are important.

And for fftw, just try to brew rm and reinstall. Let me know ...

@samueljohn
Copy link
Contributor Author

Oh, and don't forget to brew tap homebrew-dupes and brew install gcc --enable-fortran

@samueljohn
Copy link
Contributor Author

Then, get a good ☕. Or two.

@staticfloat
Copy link
Owner

Right, I've uninstalled and reinstalled fftw countless times, along with
every other direct julia dependency. I'm hoping it's the fortran compiler
I have right now. We'll see, compiling.....

On Fri, Aug 24, 2012 at 11:29 AM, Samuel John [email protected]:

Oh, and don't forget to brew tap homebrew-dupes and brew install gcc
--enable-fortran


Reply to this email directly or view it on GitHubhttps://github.com//pull/6#issuecomment-8010744.

@samueljohn
Copy link
Contributor Author

I just built julia successfully from your master branch. I brew rm tbb metis and tbb were automagically reinstalled (some of the deps needed it). So you were right about that.
brew uses metis shows suite-sparse. You were right again.

If you still have difficulties in installing julia, just open a new issue here on your repro, and ping me. I nee the full log, what brew doctor says and the brew --config gisted.

@StefanKarpinski
Copy link

I commented out the openblas (but left it there to remember us when julia switches)

Already switched: JuliaLang/julia@926c073.

@samueljohn
Copy link
Contributor Author

Damn fast, @StefanKarpinski! How can I tell for sure (speak: where to otool -L to see which lib was linked)?
I am going to test it right away (I assume when julia runtests.jl all succeeds, all is fine)

@ViralBShah Thanks for you explanation. I will use peakflops() to check the speeds :-)

@StefanKarpinski
Copy link

I did say "nowish" :-)

@staticfloat
Copy link
Owner

@samueljohn; I ran into a lot of issues when not including CFLAGS copied into CPPFLAGS. It looks like the makefiles in Julia don't have CPPFLAGS littered everywhere it should to support taking the ENV copying out, so I've put it back in.

Still compiling gcc...... :P

@samueljohn
Copy link
Contributor Author

@staticfloat I need to see your complete log to say anything. Also, please brew update, since I changed one or two days ago the way CFLAGS and CPPFLAGS are set. I also need your brew --config and brew doctor output.

Surely we can fix it!

@staticfloat
Copy link
Owner

Here's my install log, without CPPFLAGS being copied, with the new gfortran and with --default-fortran-flags.

https://gist.github.com/3455903

@samueljohn
Copy link
Contributor Author

@staticfloat Just to be sure brew rm readline followed by brew install readline does not help?
I'll look deeper into this tomorrow.

@ViralBShah
Copy link

I do otool -L on libarpack, libumfpack, libcholmod to check which BLAS got linked.

-viral

On 25-Aug-2012, at 2:13 AM, Samuel John wrote:

Damn fast, @StefanKarpinski! How can I tell for sure (speak: where to otool -L to see which lib was linked)?
I am going to test it right away (I assume when julia runtests.jl all succeeds, all is fine)

@ViralBShah Thanks for you explanation. I will use peakflops() to check the speeds :-)


Reply to this email directly or view it on GitHub.

@samueljohn
Copy link
Contributor Author

Thanks. Then my julia build from 11h ago is still linked to accelerate. I guess thats what he meant with "nowish".

@staticfloat
Copy link
Owner

@samueljohn; I just remembered that you were having trouble with the web REPL; Instead of running julia-release-webserver, try running launch-julia-webserver. I was confused why there were seemingly two executables for this before, and it turns out launch-julia-webserver is a shell script around julia-release-webserver that sets up some environment it needs. Using launch-julia-webserver it works on my mbp.

@samueljohn
Copy link
Contributor Author

@staticfloat genius! That worked :-)
It's a trap when you juli<TAB> and see the julia-release-webserver :-P

@wjj2329 wjj2329 mentioned this pull request Oct 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants