Hi,
I did try this on the Mac Intel and the resulting LCmodel works, but poorly. Most spectra that do get a proper fit result with the pre-compiled version on Ubuntu 22 fail in the MacIntel compiled version.
Now, with a new macBook M2 I had another go at it. The result was functionally another disappointing executable like I had on the Intel based MacBook. There are differences: static library linking is not working, but if you leave that out it appears to compile OK (but the executable does not function properly). Here is what I tried :
-On the MacBook M2 running Ventura there was no apt for an apt install of fortran
This should come with java, so I installed java for the ARM64 from
https://download.oracle.com/java/21/latest/jdk-21_macos-aarch64_bin.dmg (sha256)
-Still gave no apt , so installed brew instead (that was not there either) and ran:
brew install gfortran
cd ~/Downloads/
unzip source.zip -d lcmodel_src
cd lcmodel_src
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
- Or not using the patched version:
gfortran -c -fno-backslash -fno-f2c -ffast-math -O2 -ffpe-summary=none -Wuninitialized -std=legacy -fall-intrinsics LCModel.f
-The next step will fail because a linked library is not available as static
-Also, the -s option is ignored
gfortran -s -static LCModel.o -o lcmodel
-New attempt
gfortran LCModel.o -o lcmodel
-This produced an exectuable
mkdir ~/.lcmodel/bin
cp lcmodel ~/.lcmodel/bin
-The resulting lcmodel does not give a good result with a control file that does work on the compiled version for Linux (Ubuntu 22)
~/.lcmodel < [some_good_spectrum].control
-Maybe some day we can get this AI code converter to work for this rather large chunk of FORTRAN:
-That would confirm that AI can mean something for MR spectroscopy
BTW there are a lot of code warnings in the compilation. I looked at this in Visual Studio Code with a FORTAN extension. That helps a bit in reading the code, but trying to solve all the parameter type compilation warnings is a daunting task.
I hope someone likes the challenge and bring LCmodel to a Mac M2 processor compatible state.
Ronald