#fortran

mkwadee@diasp.eu

The other day, a non-technical colleague said to me, "You're a #Python expert, aren't you?" I felt I had to correct him since I have only dabbled with the #language and I said that I'm more accustomed to scientific programming in #C or #Fortran. He looked a bit bemused, in hindsight, I'm not surprised as I've never talked to him about computing before. He then said "No, I meant #MontyPython." Well, modesty aside, I said that I'm probably the most expert person there and so our conversation continued on a more humorous subject.

amckinstry@diaspora.sceal.ie

The Fortran Agenda

#Fortran, #Debian, #pkg-config

So, I'm working on Fortran (mostly within Debian). The aim is to make it as feature-complete and optimal as possible; this mostly comes down to:
* Adding Flang and multiple Fortran support to Debian
* dh_fortran_mod: multiple fortrans mean multiple modules.
* submodule support to makedepf90
* Ensuring coarrays work everywhere (* with Flang, automatically to f2py)

Multiple module support is the challenge of the day. The difficulty is that different compilers produce incompatible module files, and different compiler versions, too. dh_fortran_mod is a debhelper module to, well, help. It puts the modules in $fmoddir, with fmoddir as /usr/lib/$arch-triplet/fortran/$compiler-version

Ok, the problem now becomes: when a package such as MPI produces multiple identically named modules, what to do?
eg. both mpich and openmpi (and other mpi implementations) provide mpi.mod.
Currently this is solved by putting the module in .eg. /usr/include/$mpi, and then putting -I /usr/include/$mpi on the compile path. So it appears that $fmoddir/$mpi is the right place, But that means making the include path compiler-sensitive. Can we include relative paths ?

Potential solutions may include:
* Use of --sysroot, but could conflict with other uses?
* use of alternatives within Debian ?

Prerequisites: it is possible to use both mpich and openmpi within the same build (e.g. for open-coarrays, adios).

Also, we need to be able to work with wrapper scripts (mpif90) and pkg-config ( f95 -c pkg-config --cflags mpi-fort )

In the current iteration (dh_fortran_mod 0.9) we have as $fmoddir, /usr/lib/$triplet/fortran containing

gfortran-mod-15/
<modules>
gfortran-8 -> gfortran-mod-15
flang-mod-33/
<modules>?
flang-7 -> flang-mod-33

with eg. fmoddir=/usr/lib/$triplet/fortran/flang-7 as the $fmoddir in the flang default path.
We could change these symlinks to the "canonical compiler name" (e.g resolving gfortran through its symlinks.

Note:

alastair@debian:~$ readlink -f /usr/bin/gfortran
/usr/bin/x86_64-linux-gnu-gfortran-8

but

alastair@debian:~$ readlink -f /usr/bin/mpif90
/usr/bin/opal_wrapper

So: it becomes important to avoid the wrapper and use the gfortran compiler name in build scripts.

So in e.g. open-coarrays, which needs to link against both versions of mpi.mod, we can create the appropriate include path, if we use the 'canonical' compiler name (e.g. add or change gfortran-8 to x86_64-linux-gnu-gfortran-8 within dh_fortran_mod).

pkg-config ?

But what about pkg-config ? what should it return as the path ? Consider hdf5. It ships serial, openmpi and mpich flavours. These are packaged so we have a 'root' directory /usr/lib/$triplet/hdf5/$flavour
and inside $flavour are ./include and ./lib directories. There are hdf5-mpich.pc and hdf5-serial.pc and hdf5-openmpi.c with hdf5.pc as a symlink to these. but :

alastair@debian:~$ pkg-config hdf5-mpich --cflags
-I/usr/include/hdf5/mpich -I/usr/include/x86_64-linux-gnu/mpich

This include dir is wrong: for multiple fortran compilers this needs to be different for each compiler.

Either:
* we can include relative includes for the compiler, eg. -I ./mpich looks in $fmoddir/mpich., or:
* pkg-config takes a compiler option for Fortran compiler, and constructs a $fmoddir to return.
* other solution ?

arkoprovo1996@diasp.org

Ahoy folks,

I’m an just an #undergraduate #student of #physics, trying to set myself up to flirt with #astrophysics, with a weakness for and in #blackholes, though occassionaly ogling at her sister, #cosmology, but again pulled back to stare at #quasars through only my minds eye. Did I mention that I am #newhere? If not then, I should also mention that #instrumentation and #electronics too share alarge bit of my metaphorical heart, and I just love #interfacing; what's better, than to connect physical reality to a beast a.k.a a #computer? Well #micro-controllers? I just started using an #arduino, actually an #arduinouno ( #arduinounor3 ), currently learning programing and using it for small, if not infinitesimally small, if you can call them that is, #electronicsprojects; I will soon push myself to use an #expeyes. Yeah, #microcontrollers interest me, but, as much as do #microprocessors, #8085 being one, with which I've played a little, though only through simulations. I needn't shy away from stating that I love #programing, having some knowledge in #C, #C++, #java, a little bit of #fortran. I'm learning to #code or #script, whichever way you like, #python, rather it's newborn sibling, #python3. It's no need to say that my #operatingsystem of choice, use and love is a of course, a popular distribution of #linux, i.e. #xubuntu; #xfce is my and my PC's best bond of love, along with #bash and #zsh. I love watching #movies, especially heart-moving #warfilms, thought provoking #darkcomedies, saluted #satires, divinely appetizing #epics, #neoreals, that leave you speechless, and some more and more to come; I so love #shortfilms that I do wish to someday, #make one. Well, you may call me an amateur, but I am a #photographer, #photography, being one of my passtime passions, #astrophotography, being one of my dreams, not having been able to capture a proper one yet. I have only taken part in a few well-known #photowalks, spread through social-media.

You know, like me or not, I strongly believe in #foss, especially #fosss, being a #privacy and #security concerned person, if not a #customization freak, an embryo of a #hacker and of course a #linuxlover. If that seems a bit commonplace, well it is, then I also happen to be a fan of a #marsrover; ah! #mars or Jasoom, call it what may, it's lovely. But lovelier are the #rovers that graze on it's surface. I so wish that I had a pet #quadcopter alongside my late pet #cat. Cool is the only word I can have for #robots; ah! #robotics, what a sweet art art thou. Though a little sweeter would be #cognition, whose daughter #ai is a sweet child, I wish was mine. Can #intelligence be #artificial? Or is it just another #random #oxymoron, that a #language is filled with, that #linguistics deals with? Or maybe I'm just writing a #microtale. But then, #microtales are so lovely. Be it in #english or #bengali, rather #bangla, or #hindi or #german; though for #deutsch I still need a dictionary. At least #scrabble and #hangman are still in english for me. But yes, I just happened to fall in love with #html5 and #markdown.