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

Patch ARPACK for fortran calling convention to be consistent with MKL. #5303

Merged
merged 1 commit into from
Jan 9, 2014

Conversation

ViralBShah
Copy link
Member

This patch was obtained from macports: http://trac.macports.org/ticket/35508

This also sets the environment variable for the ILP64 MKL upon startup, if USE_BLAS64=1

See #3928 JuliaLang/LinearAlgebra.jl#53

elseif blas == :mkl
if Base.USE_BLAS64
ENV["MKL_INTERFACE_LAYER"] = "ILP64"
end
Copy link
Member

Choose a reason for hiding this comment

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

the indentation here is a bit weird

Copy link
Member Author

Choose a reason for hiding this comment

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

It was some emacs mode weirdness, but I already fixed it.

@ViralBShah
Copy link
Member Author

Cc: @vtjnash

@ViralBShah
Copy link
Member Author

@vtjnash Would we be better off just compiling all our fortran code with -ff2c instead of applying this patch to ARPACK?

@vtjnash
Copy link
Member

vtjnash commented Jan 4, 2014

@ViralBShah yes, it's better to compile with -ff2c.

it seems that this patch only patches half of the issue -- it neglects to correct the calling convention return types for sasum, scasum, scnrm2, sdot, sdsdot, and snrm2 for which there is no way to specify the f2c calling convention using gfortran. plus, it neglects to patch any calls into lapack (although since we have our own lapack, that's less of a problem)

I would suggest making separate binaries libarpack_f2c liblapack_f2c libsuitesparse_f2c etc. instead

@ViralBShah
Copy link
Member Author

How about just always compiling everything fortran with -ff2c by default?

@vtjnash
Copy link
Member

vtjnash commented Jan 5, 2014

Yes. Although (a) we need Julia to support the intel calling convention #2167 (b) we need to check that the other libraries (arpack, fftw, suitesparse) are aware of the f2c calling convention and ILP64 interface.

@ViralBShah
Copy link
Member Author

The ARPACK patch from macports does not crash our ARPACK tests. Using -ff2c everywhere instead of using the macports patch does not help, and continues to crash, or make the tests fail.

Does Intel have a different fortran calling convention and not use f2c?

@ViralBShah
Copy link
Member Author

Would this work with Accelerate if we disable gfortblas?

@andreasnoack
Copy link
Member

If we manage to use libmkl_gf_(i)lp64 then we could use the gfortran convention everywhere, right?

@ViralBShah
Copy link
Member Author

Agree.

@ViralBShah
Copy link
Member Author

I have pared down this PR to include some small fixes. Will try linking to the gfortran version of libmkl in a separate PR.

ViralBShah added a commit that referenced this pull request Jan 9, 2014
Patch ARPACK for fortran calling convention to be consistent with MKL.
@ViralBShah ViralBShah merged commit 7c2301f into master Jan 9, 2014
@ViralBShah ViralBShah deleted the vs/arpack-mkl branch January 9, 2014 17:32
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