4 ms·
One of the key points of the article is that there is a lot of legacy code written in Fortran. As a former high energy physicist, I have an anecdote here that s
by foob 9y ago
One of the key points of the article is that there is a lot of legacy code written in Fortran. As a former high energy physicist, I have an anecdote here that some people might find interesting.
There was a library written in Fortran called CERNLIB which included a broad variety of miscellaneous numerical algorithm implementations (e.g. minimization, integration, special functions, random number generation) [1]. I couldn't tell you exactly when the library was first released, but my best guess would be the early 80s. It can't possibly be later than 1986 when PAW was initally released [2]. The field has since transitioned from the Fortran based PAW to the C++ based ROOT since then, but many high energy collaborations still rely on CERNLIB for their own analysis frameworks (keep in mind that many of these experiments had been in planning and development stages for over a decade before they actually turned on).
The thing about this that I find interesting is that compiling CERNLIB has become a lost art and that this fact has had far reaching consequences. The last available binaries were compiled with GCC 4.3 in 2006 and packages are only available for Scientific Linux 4 [3]. This crucial dependency has led to collaborations using extremely outdated Linux distributions and GCC versions in their computing facilities. The majority of analysis code is written in C++, but not even C++11 additions can be used because everything is frozen on GCC 4.3. Nobody can even run the analysis environment on their local machines without resorting to the use of virtual machines running SL4. It was really a nightmare to deal with.
[1] - https://en.wikipedia.org/wiki/CERN_Program_Library https://en.wikipedia.org/wiki/CERN_Program_Library
[2] - https://en.wikipedia.org/wiki/Physics_Analysis_Workstation https://en.wikipedia.org/wiki/Physics_Analysis_Workstation
[3] - http://cernlib.web.cern.ch/cernlib/version.html http://cernlib.web.cern.ch/cernlib/version.html
- sitkack 9y agoGetting locked to a particular compiler isn't usually a quality of the language, but the development team. It happens to all languages where the underlying platform remains fixed a site, it evolves into every capability of the instance, not the spec. This is why it is important to have platform diversity from the start. Run your unit tests on at least two toolchains, hopefully on at least two different distros if not kernels. I like to use GCC/Clang and Centos/Ubuntu as my base platform matrix.
- jacquesm 9y agoOne good example of this is to run your code on both 32 bit, 64 bit, big endian and little endian machines of all those combinations. That works pretty good as a way to keep you on your toes with respect to portability.
- jjdredd 9y agoHuh, funny thing. I had to use a heavy-ion collision simulation program written in fortran, which had to be compiled using a certain compiler implementation (1). After a 2-3 weeks of debugging and trying different compilers in vein, my supervisor had put me on a phone with a guy that was more successful than me and told me which fortran compiler to use. (1) Each compiler gave different results: compilation errors, code that goes in an infinite loop.
- noobermin 9y agoFor every nth performant, tested fortran code, there are 2^n goto ridden legacy codes.
- StrangersAdvice 9y agoCan't you just recompile with a newer compiler?
- gnufx 9y agoCernlib is available in current Debian (and also in EPEL 6). I don't know why it's not in anything else under the Fedora banner, and wonder what nasty non-standard stuff CERNLIB does. I don't remember ever having to look at more than bits of it. I've heard an anecdote of HEP analysis code that was written by a team in C++ and wasn't ready for impending data collection on LHC. Someone apparently rescued the situation by turning up with a working Fortran system he'd written on his own. I don't know details other than which university group the report originated from; I'd be interested to know more about it.
- dguest 9y agoWhat collaborations are you talking about? The bigger experiments at CERN use C++14 and python quite a lot. There's still a bit of wrapped FORTRAN code kicking around, and we definitely use rather old school distributions, but I haven't seen anything as bad your anecdote.