Following the release of the LCModel source code I was able to get a successful build on Ubuntu 20.04 gcc version 9.3.0.
First step is to install gfortran if you don’t already have it:
sudo apt install gfortran
download the source code from: LCModel's home page and unzip:
unzip source.zip -d lcmodel_src cd lcmodel_src
patch the code to overlook a failing internal check, “ILLOGICAL INITIA 5” - see LCModel manual, compile and link:
sed '2429d' LCModel.f > LCModel_patched.f gfortran -c -fno-backslash -fno-f2c -ffast-math -O2 -ffpe-summary=none -Wuninitialized -std=legacy -fall-intrinsics LCModel_patched.f gfortran -s -static LCModel_patched.o -o lcmodel
If all was successful the lcmodel binary will be available in the current directory and ready to be used in the normal way, eg:
./lcmodel < your_control_file
Compared to the provided example Makefile, it was necessary to add the -ffpe-summary=none flag to remove some non-important (according to google) runtime warnings and -std=legacy to demote a compilation error to a warning.
I did notice some very minor numerical differences between my compiled version and the one available on the website, so it’s probably better to use the prebuilt binary unless you have a good reason not to. The prebuilt binary is also much smaller than I was able to achieve for some reason - perhaps a different compiler was used.
The only requirement of gfortran means a Mac OS build may be possible once gfortran has been installed (eg brew install gcc).
Please share your successes and failures with building LCModel on your platform!