-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Compile julia with icc and ifort and use MKL #7547
Conversation
@@ -204,7 +213,11 @@ USECLANG = 1 | |||
endif | |||
endif | |||
|
|||
ifeq ($(USEIFC), 1) | |||
FC = $(CROSS_COMPILE)ifort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't right, the ifort program does not have the prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can ifort
cross compile at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, there's a -m<stuff>
flag for various things.
|
In your testing, are you using MKL and Intel's libm too? Or some other combination of OpenBLAS and/or openlibm? |
I am only using Intel compilers and MKL for now. Not yet using the intel libm. I guess we should just enable intel libm too, but that will have the rem_pio2 issue. |
Perhaps we should have one Makefile variable for using all intel compilers and math libraries. |
That would be nice – you should also be able to choose them a la carte, but having a meta variable that can flip all the other default would be handy. |
Thanks, curious to get a handle on what is working and what isn't. I agree with Stefan. So most of what you needed to avoid the problems @morrisonlevi saw in #3902 (comment) was a few extra |
Yes, with optimizations turned on, icc truncates denormals to zero which fails our tests. I have flags to avoid that now. Also, the correct fortran flags. I don't see the failures that @morrisonlevi sees in #3902. I suspect because my flags turn on strict adherence to IEEE754, which openlibm assumes. The build status here is of no use (we probably should have an icc build environment on travis too), but all tests pass for me in this PR. Cc @staticfloat |
I can't use MKL's FFTW wrappers, because we use |
Of course, we should have one flag to use all Intel libraries, and also the a la carte options. |
Maybe @stevengj can port that to Julia (or someone else can) so that we don't depend on FFTW's. |
There may be other FFTW functions we call that MKL may not have wrappers for. @stevengj perhaps knows if it is realistic for us to be able to use MKL's FFTW wrappers. |
Depending on whether it's set when the library is loaded or when the function is called, you could try |
I think we should probably expose that in Base and document it. It is generally useful. |
MKL just seems to be missing the |
|
Actually, |
#3255. But it should probably work like |
Yes - good point. Let's discuss that in the relevant issue. |
@StefanKarpinski, technically |
I saw that in the fftw codebase yesterday. Should I have a Julia implementation that does that when mkl is being used, or just make it a noop when using mkl? |
The MKL FFT documentation is not very clear on this point, but I get the impression that their "plans" may work on arbitrary input arrays regardless of alignment (albeit possibly suboptimally). In this case it would be safe to define the alignment checks to a no-op when using MKL. (But it probably wouldn't hurt to define them to enforce 16-byte alignment. As I said, if you are using MKL then you are almost certainly using SIMD.) |
It looks like MKL used to require 16-byte alignment, but eliminated this requirement in version 10.2 update 3 (released in 2009). |
@andreasnoackjensen @tkelman @morrisonlevi Can you guys try out this branch? I now have all MKL stuff working. My
|
I have MKL but not the Intel compilers, I was able to get things to build and link with MKL and GNU compilers, but arpack segfaults in Wonder what the chances are of convincing Intel to let Travis provide a VM image with icc/ifort/mkl all set up... |
We do have licences, which we never got around to using before. |
@lindahua Could you try this out? |
I am downloading the dependencies now; will report back on that soon. Also, it would be nice if we could compile many of the libraries in statically if available; the reason is that at HPC sites you have many compilers and libraries available and if you want to use Julia and software X in the same job where X uses different versions of libraries it gets hairy to manage. So at least |
It still tried to use GCC by the way. I had to use |
We should be able to reduce fully static binaries too pretty soon. |
|
It is possible to use MKL's FFT through their FFTW wrappers Clean up compiler warnings
Introduce USE_INTEL_MKL_FFT Disable dsp and fft tests that are not supported by MKL's fftw wrappers
I am going to merge this for now and explore |
WIP: Compile julia with icc and ifort
The build failures are not relevant. |
This is relevant though - on Windows, the rem_pio2 functions are now the only functions exported from libopenspecfun.dll:
|
It seems if some functions in the library have |
Ok, please do that. This is good to know for the future. |
Perhaps we should tag the releases of |
Add support to compile julia with icc and ifort using
USEICC
andUSEIFC
.