This is a tutorial for using ALF intended to get you started with your first projects.
ALF is pretty self-contained, you only need a LAPACK and a BLAS implementation as external libraries. For compiling the source code you need make and a Fortran 2003 compatible Compiler.
In the following we give hints on how to install relevant packages.
- sudo apt-get install gfortran liblapack-dev make
- sudo yum install gcc-gfortran make liblapack-devel
OpenSuSE / SLES
- sudo zypper install gcc-gfortran make lapack-devel
- pacman -S make gcc-fortran lapack
gfortran and the lapack implementation from netlib.org should be available for your system. Consult the documentation of your system on how to install the relevant packages. The package names from linux should give good starting points for your search.
gfortran for MacOS can be found at https://gcc.gnu.org/wiki/GFortranBinaries#MacOS. Detailed information on how to install the package can be found at: https://gcc.gnu.org/wiki/GFortranBinariesMacOS. You will need to have Xcode as well as the Apple developer tools installed.
The easiest way to compile Fortran code in Windows is trough Cygwin, which provides a Unix-like environment for Windows. The installer also works as a package manager, providing an extensive collection of software from the Unix ecosystem. For convenience, we provide a zip archive containing the Cywin installer and a local repository with all the additional software needed for ALF.
Steps for installing Cygwin:
- Download zip from https://www.dropbox.com/s/ap8vl85gn9nfbo7/cygwin_ALF.zip?dl=0 and unzip
- Execute "setup-x86_64.exe". If administrator rights are missing, execute it from the command line as "setup-x86.exe --no-admin".
- In the setup choose "Install from local directory" instead of "Install from Internet".
- Choose root directory, where cygwin will be installed. You should memorize this diretory.
- Choose the diretory "cygwin_ALF" (The one which also contains "setup-x86_64.exe") as local package Directory.
- At the "Select Packages" screen, in "Categories" view, at the line marked "All", click on the word "default" so that it changes to "install".
- Finish installation
- Optional: To add, remove or update installed packages, rerun the installer setup and chose "Install from Internet".
- You can now use the installed Cygwin packages by starting the Cygwin terminal. It is a UNIX terminal which, by default, starts in the home diretory "/home/" of the UNIX-system emulated by Cygwin, where "/" is the root directory of Cygwin. For example, if you have installed Cygwin in "C:\cygwin64\", then the home Directory of Cygwin ca be found at "C:\cygwin64\home<username>", in the Windows system.
After you have obtained the source code and have set up the build environment you need to build the source files. Executing make in the root directory of ALF does the Job.
For the coding parts of the exercises we recommend to use a text editor. Linux usually have one installed like kwrite, kate or gedit(emacs and VI work great, too). For the windows users we recommend Notepad++.