-
Notifications
You must be signed in to change notification settings - Fork 187
make real128 optional #93
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
Conversation
9dcf390
to
7918035
Compare
Thanks @scivision! I personally find that the macros make things less readable and more complex to compile. But at the same time, we do want to have the functionality of compiling with Flang, and it is my understanding that unless the quadruple precision is not compiled, Flang will segfault. That is the main motivation of this PR, correct? I was hoping to avoid using macros much, but there might not be another way. |
Flang would still be broken with this (with the 2019 release, not sure about current dev version). Although Flang 2019 release is also missing real128. |
So unlike Flang, where I think I am fine to simply wait until they fix things, Intel Fortran is essential to support. However, our current master compiles and passes tests (including quadruple precision) just fine with ifort 19.0.4.243:
Which version of Intel Fortran do you have? |
P.S. I also tried 18.0.5.20180823, 17.0.4.20170411, 16.0.3.20160415 and they all compile our current master and pass all tests. The version 15.0.4.20150805 fails to compile with the error:
|
OK I didn't actually check ifort, I assumed they were using a current version |
Intel's list of supported versions: https://software.intel.com/en-us/articles/intel-parallel-studio-xe-supported-and-unsupported-product-versions Currently version 2019 (19.0.x) and 2020 (19.1.x) are supported. |
well in any case, if there were a precision that needed/wanted to be optional, this is a non-generated source way to do it. |
Yes, let's discuss how to best do that. I don't see how to significantly simplify the approach in this PR. If we use @zbeekman any ideas how to best handle this? |
This isn't quite true:
The question becomes: how do we want to use jin2for? Jin2For will use the compiler to enumerate all available kinds from
Generate with:
You get: real(4) :: a_r4
real(kind=4) :: b_r4
real(8) :: a_r8
real(kind=8) :: b_r8
real(10) :: a_r10
real(kind=10) :: b_r10
real(16) :: a_r16
real(kind=16) :: b_r16 As you can see I get a single, double, x86 80-bit and quad precision kind with GFortran. But if you use But, you don't have to query the compiler, or use the pre-defined types. The other two options are something like:
Here you don't use any of Jin2For's compiler introspection/kind & type enumeration and you must find a means of coding the introspection yourself or relying on a priori knowledge that all compilers we wish to support have the requested types. But the advantage is that you aren't (hopefuly) generating compiler specific code. It shouldin theory.... run on any compiler. You would have to provide logic through some other means for whether or not you want Alternatively, we could create and maintain the json files that Jin2For generates describing the kinds available from the compiler. These can then be passed to |
Also, one advantage of approach 1 & 3 (using Jin2For on the client system w/ the client compiler to generate sources, approach 1 or pre-generating sources from all supported compilers via the introspection data) is that you can implement interfaces for all available kinds. As long as there are bugs with the more exotic kinds (a big ask I know) then you don't have to care about single, double, 80-bit, quat precision etc. you just emit code for all possible kinds a given compiler claims to support. |
I understand that using What I do not understand is how to pre-generate a tarball with already generated sources, so that when the user compiles it, the |
I think this PR can be closed, as we now have an equivalent feature in master I think. |
fixes #88
using Fortran
submodule
. The Makefiles would need to accommodate these changesThis is a cleaner, more modular approach than #83, which this supercedes.
To use real128, one would do
then this method can be extended for
real16
or other "exotic" kinds.alternatives:
#ifdef