Setting up Computers Outside of Class
There are multiple methods for setting up your personal computing environment to work with the methods and tools introduced in ABE 65100 Environmental Informatics. The guidelines in this document are to help you choose and maintain the best methods for you.
Technology is always changing, while this page is regularly updated it may not reflect current status of the listed software. Links are provided to sources of information that should be more up to date. If you follow these instructions and find that things have changed significantly, please report problems to Dr. Cherkauer.
Python Scripting Language and Anaconda
The Python scripting language can be installed on almost all systems. The best option for installing and managing Python on any system is to download and install Anaconda Navigator. While I have used other tools, including installing specific modules on my Mac using MacPorts, I find that Anaconda Navigator is the best all-around method for installing and maintaining Python and the primary modules used for data science on any platform.
Note
On any platform, you can start the Anaconda Navigator application, which will provide a GUI interface with Python, Spyder, Jupyter Notebook, R and all of the tools that come with the installation. You can also work with these tools directly from the command line.
- On Windows systems, seach for and start the "Anaconda Prompt" order the Anaconda Powershell Prompt (powershell is the replacement for the older prompt terminal, both are typically installed on Windows 10 and 11 systems).
- On Mac OS X systems, Anaconda will be active in any terminal started. I suggest reviewing the section on Updating the MacOS X Linux Environment to install tools that will make the experinece more rewarding.
- On RCAC systems, while you can install Ananconda Navigator, in general
it is preferrable to use the
module
management system to Access Anaconda in the current terminal sessionand load one of the currently supported versions of anaconda.
Accessing Purdue HPC Resources using Thinlinc
As of 08 Jan 2017, it is recommended that you interface with Purdue Linux and Unix computer systems using thinlinc. Up to date information for obtaining and using thinlinc can be found from the full user guide for the scholar (and most other) clusters, found at the RCAC website. Here is a link to the scholar manual.
The thinlinc program can be installed as a local application, or you can access it through any browser.
Either way the program opens a window to a full Linux desktop environment, so it is not necessary to install and maintain both a terminal program and an X-windows client locally as they are managed internal to thinlinc. Additionally, thinlinc has been optimized to function over low bandwidth connections making it ideal for home use. Finally, the thinlinc desktop will persist even when the program has been exited and restarted, the only thing that will cause your windows to close is a restart of the remote Linux system.
The application makes copying between the Linux system and your local desktop somewhat easier and uses your full monitor area, but does make it more difficult to switch between the Linux terminal and your local applications. The browser only has access to the space typically given over to the web page you are visiting, but the browser will work just like any other program on your local computer.
Instructions for getting started using Purdue's HPC systems can be found here: - Getting started with Python on Purdue Cluster Computing which describes using Thinlink to access a desktop on front-end systems on the scholar cluster. - Starting Jupyter Notebooks on RCAC Computer Clusters which explains how to start Jupyter notebooks that run on RCAC cluster computers without dealing with the Thinlinc desktop.
Interfacing Directly with Purdue HPC Resources
Thinlinc is a very powerful tool, but does limit some functionality in how you interact with the Linux and local environment. This includes the difficulty in copying text between the Thinlinc session and the local desktop session, and the fact that the thinlinc session opens an entire desktop which requires access to most of your screen to use effectively.
To get the most from a direct connection with a remote Linux/Unix system you need a terminal emulator and SSH client and an X-Windows client to run graphics.
Note that when using Thinlinc, everything runs on the remote machine and the only exchange across your local internet connection are visible changes to your screen, keyboard and mouse commands. Thus it works well over poor connections. Also when you close the session without logging out, your virtual desktop is still running and will be there when you log back into the remote machine (unless the remote machine is rebooted while you are gone).
Terminal emulation and X-windows runs on your local machine. That makes it much better at interfacing with your other local applications (e.g., easier copy and paste and individaul windows that can be arranged as desired), but it requires a lot more bandwidth to work effectively. You will likely not notice if just using the command line operations, but opening busy graphics packages (such as Spyder IDE) from the remote machine on your local machine will cause a noiticable drag on the connection. Also, when the remote connection is lost or disconnected, everything happening on your local machine stops immedaitely, and you will need to restart everything to get back to where you were.
Terminal Emulators / SSH Clients
Installation of a terminal emulator can provide a pathway for directly logging into any Linux/Unix system, and such functions generally make use of the local copy and paste buffer, so text can be copied easily between the local and remote systems.
-
On Windows, there are two options
- For a stand-alone installation, Purdue provides licenses to VanDyke Software's SecureCRT SSH client.
- The program can be installed on any Purdue owned system, and a personal use license can be obtained for free for all Purdue Faculty and Staff from the Software Downloads page.
- A license can also be obtained for the companion program SecureFX, which is a Secure FTP package for file transfers. I reccommend getting both licenses and installing both programs.
- You can also install the Windows Subsystem for Linux (WSL) locally, which will provide a terminal and SSH client along with access to a local installation of Linux.
- For a stand-alone installation, Purdue provides licenses to VanDyke Software's SecureCRT SSH client.
-
On Mac OS X, I reccommend installing iTerm2.
- All Mac OS X systems come with a terminal emulator installed, but it is fairly limited in functionality, and even makes copy and paste difficult.
- The iTerm2 application uses the same copy and paste commands as everything else on your Mac and just provides a lot of imporved features.
- This package does not include an SSH client, so to get SSH capabilities that work in the terminal, refer to Updating the MacOS X Linux Environment later in this document.
X-Windows
The X Windows system (X11) is the foundational graphical user interface (GUI) used to display graphical images on Linux/Unix systems. in order to allow remote computers to display graphical windows and tools locally on your machine, you have to have an X-windows client installed locally. There are multiple options out there, but the two described here work with the local Linux distributions discussed in the next section.
-
On Windows, Purdue has gone through a number of supported packages, so here are two options:
- Most recently Xming was reccommended as the supported stand-alone X-server. This should still work with SecureCRT, and is probably the best option if you do not want to install Linux locally.
- If you install the Windows Subsystem for Linux (WSL)
locally, you should be sure to include
VcXsrv
with the installation (I belieeve that is the default option). That is the X-ssever that comes with WSL, so will provide the best integration with Windows.
-
On Mac OS X, I use XQuartz, an open-source package that works with or without Updating the MacOS X Linux Environment.
Running Linux Locally
Once you get used to working in the Linux environment, you are likely to want to access Linux tools and commands on whatever platform you are using. Windows 11 and Mac OS X machines both come with the ability to run Linux, but both require some additional configuration. What follows is guidance from me to help you setup these systems more effectively based on my personal experience.
Note
If you are working on a native Linux OS machine, refer to documentation on the package managment system installed on your system for information on how to install and update packages.
Windows Subsystem for Linux (WSL)
Developers can access the power of both Windows and Linux at the same time on a Windows machine. The Windows Subsystem for Linux (WSL) lets developers install a Linux distribution (such as Ubuntu, OpenSUSE, Kali, Debian, Arch Linux, etc) and use Linux applications, utilities, and Bash command-line tools directly on Windows, unmodified, without the overhead of a traditional virtual machine or dualboot setup.
To install WSL on systems running Windows 10 version 2004 of higher, please refer to the latest instructions from Microsoft. This page also discusses working with git and GUI applications amoung other tools.
Note
In the past I have provided instructions for installation of Cygwin and Cygwin-X. With the release of WSL2, I find that there is little need to install Cygwin or its X-server. Cygwyn is a set of Linux-like tools compiled on Windows, so it tends to interface better with Windows native programs thatn WSL2, but it requires a special port of any Linux tools you might want to use, as those programs have to be recompiled to work within the Cygwin environment. That requires additional package management and an additional development team (at Cygwin), which will delay access to the newest tool version.
WSL2 is a full Linux OS running within a Virtual Machine (VS). Thus tools and packages developed for the flavor of Linux you install (yes, WSL2 can install several flavors) will come directly from the OS developer. While this results in support for Windows native packages within WSL2, it means that you can do anything in WSL2 that you could do on an actual Linux machine.
Unless you are want to write bash or c-shell style scripts to run Windows applications, WSL2 is going to be the better option. You can install all Linux tools and applications you want, and write processing scripts just like on the RCAC cluster computers.
Updating the MacOS X Linux Environment
For students working on Macintosh systems with OS 10.x or above, the base system is a version of Linux (specifically FreeBSD), so Linux style commands are generally installed. However, the default installation of Linux (really FreeBSD, a different child of Unix) on MacOS X systems is not configured for code development, so a lot of the tools and applications you would find when logging onto a full Linux machine are not available, but they can be with a little extra effort.
Please note that I suggest installing iTerm2 and XQuartz to get the most out of installing Linux-like tools.
The big thing that you need for your MacOS X system, is a package managment system. A package management system provides tools to link to catalogs of available source code and compiled programs, and easily install and maintain those packages without the headache of tracking down each program, all of its dependencies, and getting them compiled and installed. There are a number of package management utilities available for MacOS X, but I have had good luck with MacPorts (www.macports.org).
Whichever package managemnet system you choose, follow their instructions for installation.
Installation of Linux Ports using MacPorts
If installing software on a laptop, make sure that your energy saving parameters are setup to continue running the installation when you are not present. I suggest not letting the system go to sleep while plugged in, and then running the full installation while the laptop is on external power. If the system shuts down when you are away, then installation can take days instead of hours.
To install ports you need to start a terminal window, e.g. Applications
-> Utilities -> iTerm (if installed) or Applications -> Utilities ->
Terminal (the default program). First you need to sync your version of
MacPorts with the most recent versions available on the internet (thus
you must have an internet connection for this step), by typing the
command "sudo port selfupdate". The sudo command will force the port
command to be run as the administrator of the Mac system, so you will
need to know that password (the one you use to install new software).
Again, I strongly encourage you to reboot before proceeding.
Finally, now that the port tree is synced to the most recent versions,
you can install the ports that you are interested in. I suggest using
the following to Emacs and other software can be installed using
MacPorts or other software distribution services. Python should be
available at the command prompt, but GUI interface versions should also
be available following the instructions for downloading Python given
below. I recommend installing the following ports: python, perl5,
netcdf, ImageMagick, ghostscript, R, gmt5, and emacs +x11. The "+x11"
variant for emacs will include the code that allows emacs to open a new
window using the X-server, if not include emacs will open in the current
terminal window (if left in the foreground, otherwise it will be
suspended immediately), and you will need to know how to use it without
the mouse menus (type
Installing GMT version 5 for spatial data analysis
sudo port install gmt5
Other useful ports
Here is a list of some other Linux tool ports that I like to install:
perl5
- for the perl scripting language andpcre
the perl compatible regular expressions library, if working with Perl software.szip
- for command line access to the szip functions.ImageMagick
- a suite of graphics packages that help with image conversions.ghostscript
- support for postscript files (conversion and display).R
- the statistical analysis package (though this might be better to install with Anaconda Navigator).emacs +x11
- my preferred text file editor in Linux (make sure to include the +x11 when installing to get the GUI version, otherwise emacs will only work within the calling terminal and with keyboard commands).p7zip
- installs 7zip compression tools, typically found on Purdue computers.gimp
- an open source package for photo editing similar to Adobe Photoshop.xfig
- an open source package for drawing similar to Adobe Illustrator.
Setting up Environment Variables in MacOS X
By default MacOS X will use the bash shell, so any programs, libraries or man pages that you want to be available within your environment requires that you update the environment variables via the .bash_profile (for interactive login shells) and .bashrc (for all other shells). These files need to be installed in you home directory (~/). Sample versions of these two files can be downloaded from here. If running tcsh or csh then updates to the .cshrc are required.
Updating Ports
Update you MacPorts regularly to assure that you have the latest bug fixes and security patches. You current installed patches can be updated using the following steps:
sudo port selfupdate
sudo port upgrade outdated
The first command updates the port tree from the MacPorts mirror sites, so that your computer actually knows what the current version of your installed software (as well as names of new ports). The second command actually forces MacPorts to work down through your installed ports list and upgrade everything that is out of date. You can upgrade installed ports individually by providing the port name rather than the general "outdated" command. Check for updates at least once a month to minimize update times, as this process can be as slow as the initial installation if it has been a long time since the last update.
Mounting a drive from a Purdue University system on a personal computer
Here are links for instructions on how to map networked drives on Windows, Mac OS X and Linus systems: