Skip to content

SWQU Workshop Installation Instructions

Mac MacPorts


Prerequisites:

  • MUST HAVE ACCESS TO INTERNET
  • MUST HAVE SUDO PRIVILEGES

Install the command line developer tools (if not already installed):

Open a terminal and enter:

git --version

This should prompt to install the command line developer tools or show the git version installed.

If prompted to install, follow the instructions.

Install MacPorts (if not already installed):

Follow instructions at https://www.macports.org/install.php

Close and re-open the terminal.

Install the requisite packages from MacPorts:

sudo port install gcc12
sudo port install openmpi-gcc12
sudo port install hdf5
sudo port install gsed
sudo port install htop
sudo port install python312
sudo port install py312-pip 
sudo port install OpenBLAS-devel
sudo port install lapack
sudo port install qt5-qtbase
sudo port install xterm
sudo port install xorg-apps

Set default python3 to MacPorts versions:

sudo port select --set python3 python312
sudo port select --set pip3 pip312

Install python packages from pip3:

pip3 install numpy matplotlib h5py scipy zenodo_get pandas astropy sunpy

Setup SWQU Installation


Create the main installation folder:

mkdir swqu_workshop
mkdir swqu_workshop/cpu
cd swqu_workshop/cpu

Create a startup script:

touch load_swqu_cpu
chmod +x load_swqu_cpu

Set number of CPU threads

Edit the startup file load_swqu_cpu using a text editor (such as nano or vim) and insert this line:

export OMP_NUM_THREADS=[NUMBER_OF_CPU_THREADS]

You can use tools like htop or sysctl -n hw.logicalcpu to determine [NUMBER_OF_CPU_THREADS].

sudo port select --set gcc mp-gcc12
sudo port select --set mpi openmpi-gcc12-fortran
mkdir ~/bin
ln -s /opt/local/bin/gsed ~/bin/sed
ln -s /Users/<user>/Library/Python/3.12/bin/zenodo_get ~/bin/zenodo_get

where \ is your username.

Add the following line to the load_swqu_cpu startup script:

export PATH=~/bin:$PATH

Source the startup script with the command:

source load_swqu_cpu

Install Open-source Flux Transport (OFT)


Create the OFT installation folder:

mkdir oft
cd oft

Clone the git repository:

git clone --recursive https://github.com/predsci/oft.git/ .

Enter the HipFT directory and build HipFT:

cd hipft
./build_examples/build_gcc_macos_macports_cpu.sh

Test the HipFT installation:

cd testsuite
./run_test_suite.sh
cd ..

Return to the swqu_workshop/cpu folder:

cd ../../

Install Solar Wind Generator (SWiG)


Create the SWiG installation folder:

mkdir swig
cd swig

Clone the git repository:

git clone --recursive https://github.com/predsci/swig.git/ .

Enter the MapFL directory and build MapFL:

cd mapfl
./build_examples/build_cpu_multithread_gcc_macos_macports.sh

Test the MapFL installation:

cd examples
../bin/mapfl mapfl_get_simple_open_field_map.in

If the run is sucessful, there should be a file called ofm.h5 in the directory.

Enter the POT3D directory and build POT3D

cd ../../pot3d
./build_examples/build_cpu_mpi-only_gcc_macos_macports.sh

Test the POT3D installation:

./validate.sh

The validation script will indicate if the run has passed.


Add the following lines to the load_swqu_cpu startup script:

export PATH="<DIR>/swqu_workshop/cpu/oft/bin:$PATH"
export PATH="<DIR>/swqu_workshop/cpu/oft/hipft/bin:$PATH"
export PATH="<DIR>/swqu_workshop/cpu/swig:$PATH"
export PATH="<DIR>/swqu_workshop/cpu/swig/bin:$PATH"
export PATH="<DIR>/swqu_workshop/cpu/swig/pot3d/bin:$PATH"
export PATH="<DIR>/swqu_workshop/cpu/swig/pot3d/scripts:$PATH"

where <DIR> is the path to the directory that swqu_workshop was made in.