Thursday, June 8, 2023

How to fix a split Fusion Drive (May 2023)

 

This page helped me to resuscitate an ailing iMac in my office.  It was while executing this fix that I upgraded MacOS to Ventura and broke my Fortran computing environment.  Still, it was worth it.

https://support.apple.com/en-us/HT207584

If your Fusion Drive appears as two drives instead of one in the Finder, it's no longer working as a Fusion Drive. Here's how to fix it.

Fusion Drive, a storage option on some iMac and Mac mini computers, combines a hard drive and flash storage in a single volume for improved performance and storage capacity. If your Fusion Drive appears as two drives instead of one in the Finder, it's no longer working as a Fusion Drive. This can happen after replacing either drive of your Fusion Drive, or using software to intentionally split them into separate volumes. 

You can continue using the two drives independently, or follow these steps to regain the benefits of having the single logical volume of a Fusion Drive.


. . . .  see the support page at Apple

Adjusting to MacOS Ventura and gcc12 and Fortran 2018 syntax rules: Various Subroutines

 Sportsfans,

The upgrade to MacOS Ventura has broken my Fortran programming environment, mainly by moving the directories of the operating system around so that older versions of gfortran and gcc cannot find their proper libraries.  Rather than spend hours recreating the original file structures and libraries from old backups and the Relocated Items folders, I decided to level up to the latest GNU C and Fortran compilers as maintained by MacPorts.  These are gcc12 -- version 12 of the venerable GNU freeware package.  The old Fortran programmers must have retired, because these new compilers have discarded several aspects of Fortran 66 syntax that I learned as a teenager.  I don't write code with this older syntax, having transitioned to the Fortran 77 syntax of do/end do loops and if/then/else branches while in graduate school.  Nevertheless, there is plenty of legacy code in my toolboxes, and some of these subroutines have do loops that end on an executable statement, and others contain nested loops that terminate on the same numbered statements.  The new Fortran boffins outlawed these syntaxes, along with the arithmetic IF statement, in Fortran 2018.  My legacy codes have plenty of arithmetic IF statements, so all of these had to be reprogrammed to comply with gcc12.

This post is the third of a handful of posts that will provide these upgraded codes.  Here are a collection of subroutines that resided in my subdirectory Ritz for inclusion in various codes.  I scrubbed my Real*4 C-language FFT subroutine refft.c from my old codes a few years ago, in favor of the Real*8 Fortran routine fft2.f.  Some codes are free-oscillation subroutines that date from Freeman Gilbert, Ray Buland and/or John Woodhouse, all of whom wrote many legacy codes before the advent of Fortran 77.  All codes are contained in a zipfile codes_jlib_fort18.zip on the Google Drive subdirectory.

gfortran -c subroutine.f 

gfortran -o PROGRAM PROGRAM.f subroutine.o

subroutines include 

cossin.f

csolve.f

fft2.f

gxfcn.f

qromb.f

qtrap.f

rspln.f

solve.f

splneq.f

splnsm.f

svd.f


https://drive.google.com/drive/folders/0B5cfVtTS8QXZTGc1WnViSE5RWjA?resourcekey=0-YidcAd0wJGPRR1PhAyUYNA&usp=sharing

Adjusting to GCC12 upgrade in MacOS Ventura. Updated version of the EISPACK package.

  Sportsfans,

The upgrade to MacOS Ventura has broken my Fortran programming environment, mainly by moving the directories of the operating system around so that older versions of gfortran and gcc cannot find their proper libraries.  Rather than spend hours recreating the original file structures and libraries from old backups and the Relocated Items folders, I decided to level up to the latest GNU C and Fortran compilers as maintained by MacPorts.  These are gcc12 -- version 12 of the venerable GNU freeware package.  The old Fortran programmers must have retired, because these new compilers have discarded several aspects of Fortran 66 syntax that I learned as a teenager.  I don't write code with this older syntax, having transitioned to the Fortran 77 syntax of do/end do loops and if/then/else branches while in graduate school.  Nevertheless, there is plenty of legacy code in my toolboxes, and some of these subroutines have do loops that end on an executable statement, and others contain nested loops that terminate on the same numbered statements.  The new Fortran boffins outlawed these syntaxes, along with the arithmetic IF statement, in Fortran 2018.  My legacy codes have plenty of arithmetic IF statements, so all of these had to be reprogrammed to comply with gcc12.

This post is the second of a handful of posts that will provide these upgraded codes.  Here is the venerable EISPACK package of linear-algebra subroutines for inclusion within a Fortran program.   

gfortran -c eispack_fort18.for  

ar r eislib.a eispack.o

ranlib eislib.a

gfortran -o PROGRAM PROGRAM.f eislib.a


https://drive.google.com/drive/folders/0B5cfVtTS8QXZTGc1WnViSE5RWjA?resourcekey=0-YidcAd0wJGPRR1PhAyUYNA&usp=sharing

Adjusting to MacOS Ventura and gcc12: plotit software changes

 Sportsfans,

The upgrade to MacOS Ventura has broken my Fortran programming environment, mainly by moving the directories of the operating system around so that older versions of gfortran and gcc cannot find their proper libraries.  Rather than spend hours recreating the original file structures and libraries from old backups and the Relocated Items folders, I decided to level up to the latest GNU C and Fortran compilers as maintained by MacPorts.  These are gcc12 -- version 12 of the venerable GNU freeware package.  The old Fortran programmers must have retired, because these new compilers have discarded several aspects of Fortran 66 syntax that I learned as a teenager.  I don't write code with this older syntax, having transitioned to the Fortran 77 syntax of do/end do loops and if/then/else branches while in graduate school.  Nevertheless, there is plenty of legacy code in my toolboxes, and some of these subroutines have do loops that end on an executable statement, and others contain nested loops that terminate on the same numbered statements.  The new Fortran boffins outlawed these syntaxes, along with the arithmetic IF statement, in Fortran 2018.  My legacy codes have plenty of arithmetic IF statements, so all of these had to be reprogrammed to comply with gcc12.

This post is the first of a handful of posts that will provide these upgraded codes.  The first is the venerable, and oft-hated, plotit subroutine for on-the-fly XY-plotting within a Fortran program.  I include versions of plotit.f 

gfortran -c plotit.f  -L/usr/X11/lib -I/usr/X11/include -lX11

gcc -c xlplotit.c -L/usr/X11/lib -I/usr/X11/include -lX11

ar r plotlib.a plotit.o xlplotit.o

ranlib plotlib.a

gfortran -o PROGRAM PROGRAM.f plotlib.a -L/usr/X11/lib -I/usr/X11/include -lX11

I keep the compiled plotit object code in a signature directory for adding to my codes:

 /Users/jjpark/Plotxy/plotlib.a

In the zipfile Plotlib_fort18.zip I include updated versions of contour.f and makedat.f for similar on-the-fly plotting of a contour plot, and test-plotting with plotit.  I haven't tested these, so shoot me an email if they crash.


https://drive.google.com/drive/folders/0B5cfVtTS8QXZTGc1WnViSE5RWjA?resourcekey=0-YidcAd0wJGPRR1PhAyUYNA&usp=sharing




Tuesday, May 30, 2023

Installing GFortran in MacPorts

 After some googling, I discovered the pages on how to install gcc and gfortran in MacPorts.

There are several versions of gcc available, but all except version 12 returned a warning that their installation would fail.  This is probably a MacOS Ventura thing -- is version 12 the version for Ventura?

sudo port install gcc12 

worked without too much fuss, not to long to install, and gfortran seems to be part of /usr/local/bin

bin/gfortran-mp-12

bin/gcc-mp-12

One can alias these in the .cshrc file, or can ask macports to do it.  From 

"I had to combine these two answers as follows: sudo port install gcc11 +gfortran; sudo port select --set gcc mp-gcc11 
– pidloop
 Jan 19, 2022 at 23:12"

The spelling of this port command for aliasing is correct, even though the spelling of the executable file in the ./bin subdirectory is different

sudo port select --set gcc mp-gcc12

enables the command "gfortran" to find the gcc12 version of gfortran.



A Few Words about MacPorts

 The first of three computers to upgrade to MacOS Ventura, so making all the old tools work will be done thrice.  I document the first try.

The computing environment I am accustomed to relies on GCC Fortran and the text editor nedit.  Nedit is the "Nirvana editor" from way way back, but I am used to it in Xwindow environments.  Nedit has always been an open-source tool that could be loaded with Fink, but Fink is no more.  The Nedit software has a website, but downloading this package led to failure, because it was not updated to the system directories of Ventura.  The software package aggregator MacPorts has nedit, and has been updated.  So that is where I went for it.

https://manjaro.site/install-macports-on-macos-ventura/

https://www.macports.org/

From documentation:

"This installer contains a Universal installer for macOS 13.0.x and requires the curl and OpenSSL libraries provided by macOS. To build ports locally, you will need to install the Xcode Command Line Tools by running "xcode-select --install" in your terminal. Also required for many GUI applications is the installation of Apple's Xcode development suite, available from the Mac App Store or from Apple's Developer site. It is also available as a separate installation on Mac OS X CDs and DVDs."

"The MacPorts installer copies MacPorts to the target directory /opt/local. If you wish to install to any path other than that, you must install MacPorts via its source code. See Installing MacPorts on the MacPorts webpage for instructions on installation alternatives."

"The main user interface to MacPorts is the port command and the various facilities it provides for installing ports. The first thing you should do after you install MacPorts is to make sure it is fully up to date by pulling the latest revisions to the Portfiles and any updated MacPorts base code from our rsync server, all accomplished simply by running the port selfupdate command as the Unix superuser:

sudo port selfupdate

Running this command on a regular basis is recommended -- it ensures your MacPorts installation is always up to date. Afterwards, you may search for ports to install:

port search <portname>

where <portname> is the name of the port you are searching for, or a partial name. To install a port you've chosen, you need to run the port install command as the Unix superuser:

sudo port install <portname>

where now <portname> maps to an exact port name in the ports tree, such as those returned by the port search commandPlease consult the port(1) man page for complete documentation for this command and the software installation process."

Monday, May 29, 2023

Upgrade to MacOS Ventura breaks things!

 My office iMac lost its Fusion Drive functionality during a past system upgrade, unbeknownst to me.  It was so so slow!  It took some online sleuthing to discover the likely cause and to organize a fix.   The office iMac has regained its speed, but in doing so I perforce upgraded to MacOS Ventura. This broke the handful of applications leftover from Fink, a software package that has kept my Macs useful since the early 1990s.  The Fink software package has never been updated to install properly in MacOS 11 (Big Sur), so installing it into Ventura would be a fool's game.  The directories have been moved around and the older files won't compile.  Luckily the Ports software package has been upgraded as MacOS has evolved, so I am switching to that.

Thursday, February 16, 2023

Converting Basemap to Cartopy within ObsPy Jupyter Notebooks

 So far my trick is to replace the statement 

from mpl_toolkits.basemap import Basemap

with

import cartopy.crs as ccrs

and this seems to work in the first notebook I tried  (QLove notebook for SNZO)

Upgrading the Python Version within Anaconda

 The upgrading of Python within Anaconda is complicated by the planned obsolescence of Python versions in the Anaconda software.  As of 02/16/2023, Anaconda has support for Python 3.7 and higher.  As a result, simply upgrading

conda install python=3.9

might work if you have 3.7 or 3.8 already installed.  However, I had my obspy environment set up with Python 3.6, and the version would not update automatically.  This prevented me from updating obspy and many other packages.  My solution is to create a new environment for the upgrade, and install Python 3.9 directly into it.  From the webpage:

https://www.geophysik.uni-muenchen.de/~megies/installation2.pdf

Create a new environment within Anaconda

conda create -n obspy39 python=3.9

conda activate obspy39

conda info --envs

assuming that you are in the obspy39 environment . . .

conda install -c conda-forge obspy

conda install jupyter

conda install cartopy

Note that I installed cartopy, rather than basemap.  The latter would not install properly, and it is the older version anyway.  At the end of this exercise, I had two obspy environments, obspy and obspy39.  One can delete the older creakier version once you are certain that the new one works.




Updating Anaconda Navigator from Version 1.x to Version 2.x

 Once Anaconda sits on your computer, the updates start to annoy you.  If you ignore them long enough, however, they don't go away.  Eventually, the upgrades will no longer be simple.  For three of my MacOS computers, I first installed Anaconda 1.x, and for the home iMac I basically tore out my original installation in order to upgrade to Anaconda 2.x.  Upgrading from 1.x to 2.x need not be that drastic.  I discovered a procedure that works at a website

https://appdividend.com/2022/01/19/how-to-update-anaconda-upgrade-anaconda-navigator/

This procedure relies on entering line-commands in a terminal window, which you open within Anaconda Navigator.  Just go to the base environment and open a Terminal, rather than search for a Jupyter Notebook or a Python window.  In this Terminal, you might need to first update the conda app to its latest version

conda update conda

or

conda update -n base -c defaults conda

Then update Anaconda itself to a specific version, tied to a year and month, e.g., 

conda update anaconda=2022.10
or  
conda install anaconda=2022.10
In one case I installed the new Anaconda first, because the condo update hung the computer.

That metapackage represents the pinned state that has undergone testing as a collection.

If you want to update all the packages under conda distribution, you can use the following command.

conda update --all

The conda update –all will upgrade everything. This updates all packages in the current environment to the latest version.

 
Link