-
Notifications
You must be signed in to change notification settings - Fork 164
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
stdlib_io_npy, FPM and Rank > 4 #796
Comments
You can build locally a version of stdlib with up to rank 7 as described here. This would need to first modify the variable @jalvesz is working on an alternative Python script (see #791 for more details). Unfortunately I didn't get a chance to test it. Don't hesitate to provide feedback in #791 too. |
Thanks! I'll have a look and see how I get on. Unfortunately the computer I want to use is down for a few days, so it'll take a little time. |
I was able to use #791 to generate a pre-processed version with the approriate max rank and add that dependency as
which seems to work (it compiles at least which I suspect will do the trick as I'm not asking for anything complicated). I did however stumble across something else that may have been appropriate, but can't find it now. In the fpm.toml of stdlib on the stdlib-fpm branch there is
and FPM documentation suggests that this could be modified in the dependencies of another project, i.e.
At some point, I saw the maxrank in there for the stdlib preprocess, but I can't find the exact form for it now. Clearly being able to do
Would be a neat way to do what I need. Like I say, I can't find that now though (the above line does not work). |
@RJaBi glad to know the script was useful to you! as this an early stage proposal your feedback is highly useful to consider before pushing further with it. In your comment #791 (comment) you mention not being able to use Cray compilers, I have personally never worked with them (and have no means to). So I was wondering if on your system are you able to set the environment variables
[dependencies]
stdlib = { git="https://github.com/fortran-lang/stdlib", branch="stdlib-fpm", preprocess.cpp.macros = ["DMAXRANK=7"]}
This is an interesting use case which I did not think about when working out the script, as the main target was to preprocess stdlib in-place. I think that to enable what you want to do, |
Yes I can set these. If I do, than the script crashes at the line: as there is no Yes, that's clearly a FPM thing. |
Description
When I use stdlib_io_npy via FPM, i.e. with
the FPM defaults to building with maximum rank of 4 for array procedures. While I can see that there are instructions for building with cmake to set this higher (up to 15), I'm running in a cluster environment where I'm having a few issues with cmake suddenly while FPM basically just works.
Except that I need rank 7. Is there a way in the FPM toml or environment variable to set
-DCMAKE_MAXIMUM_RANK
to 7 instead?Expected Behaviour
The preprocessor generates array procedures with up to rank 7 when using the FPM.
Version of stdlib
c673e3b
Platform and Architecture
SUSE Linux Enterprise Server 15 SP4
Additional Information
I have some binary data U which is naturally rank 7, double precision complex. I need to convert this to a different format for use in other code but the code to do this is in python. I have reader code in Fortran that I know gives me the correct ordering. I was going to use this fortran code to read the data, dump it to numpy so I can read it into python and then output it again there. This way, I could be assured that I had not messed up the ordering of the data.
The stdlib function I was to use was
save_npy
and so hence a MWE would bebut of course the difficulty is in the FPM build.
The text was updated successfully, but these errors were encountered: