Open jeffhammond opened 3 months ago
Yeah, as you might be able to guess, the reason I did this was so adding a new argument didn't require me to make the same change in 10 different places. :)
Is this the only preprocessor trickery that flang-new
doesn't support? (otherwise you can compile it?) Unfortunately, some of the other stuff we use the preprocessor for it was not possible to do with standard Fortran (at the time... and I assume still?) mainly the optional unicode support and support for changing the default real kind while also supporting the others (e.g. build with real128 while also supporting real32 and real64).
Yes, the above patch is all that is required to compile the whole thing. I didn't test though. I'm building Neko.
ah ok. Since it's just a workaround for a minor annoyance, I'm open to changing it. I'd want to run all the unit tests though (I need to see if we can get flang-new in the CI)
https://raw.githubusercontent.com/jeffhammond/HPCInfo/master/buildscripts/llvm-git.sh might be useful for CI.
I am trying to figure out how to get nightly builds packaged somewhere.
Note: see also: https://github.com/fortran-lang/setup-fortran/issues/12
FYI: The 18.1.5
version at conda-forge is giving me:
error: loc("/home/runner/work/json-fortran/json-fortran/src/json_value_module.F90":15:5): /home/conda/feedstock_root/build_artifacts/flang-split_1715212541315/work/flang/lib/Lower/CallInterface.cpp:948: not yet implemented: support for polymorphic types LLVM ERROR: aborting
i recall that one was fixed a while ago but you need 19 for it. https://apt.llvm.org/ has nightly builds that include 19.
FYI: I've not been able to successfully get it to work from those scripts... seems like they run but then flang-new isn't in the path when it's done... (I tried various things here.. maybe I'm missing something). perhaps this is something to move to the fortran discourse and see what others are doing...
My script installs to /opt/llvm/latest and expects you to add paths manually. You can edit the script to install to /usr/local if you prefer that.
Has been implemented. https://github.com/llvm/llvm-project/pull/93382
I tried to compile with flang-new today and found that does not accept the #include argument method you use.
As preprocessing is not standard Fortran, this is not a flang-new bug, even if other compilers support it.
NWChem works around the lack of Fortran preprocessing by using
cpp
explicitly, which requires build system support.I'm sure you have reasons for writing the code like this, but it would be nice if json-fortran was only using standard Fortran.