Installing CEA on an Intel Mac

Similar documents
Installing CEA on an Intel Mac

Manual Eclipse CDT Mac OS Snow Leopard

CS CS Tutorial 2 2 Winter 2018

Chapter-3. Introduction to Unix: Fundamental Commands

Introduction to Linux. Fundamentals of Computer Science

EECS Software Tools. Lab 2 Tutorial: Introduction to UNIX/Linux. Tilemachos Pechlivanoglou

15-122: Principles of Imperative Computation

CSE 101 Introduction to Computers Development / Tutorial / Lab Environment Setup

Introduction in Unix. Linus Torvalds Ken Thompson & Dennis Ritchie

REV SCHEDULER for UNIX/LINUX

Contents. Note: pay attention to where you are. Note: Plaintext version. Note: pay attention to where you are... 1 Note: Plaintext version...

PROGRAMMAZIONE I A.A. 2015/2016

ENCM 339 Fall 2017: Editing and Running Programs in the Lab

Intermediate Programming, Spring Misha Kazhdan

If you had a freshly generated image from an LCI instructor, make sure to set the hostnames again:

COPYRIGHTED MATERIAL. Installing Xcode. The Xcode Installer

Linux Operating System Environment Computadors Grau en Ciència i Enginyeria de Dades Q2

Linux/Cygwin Practice Computer Architecture

Programming Project 1: Introduction to the BLITZ Tools

Introduction to Unix: Fundamental Commands

CS 307: UNIX PROGRAMMING ENVIRONMENT KATAS FOR EXAM 1

GUT. GUT Installation Guide

IOL INTACT Installation Guide

More Raspian. An editor Configuration files Shell scripts Shell variables System admin

Introduction to Unix The Windows User perspective. Wes Frisby Kyle Horne Todd Johansen

CS Fundamentals of Programming II Fall Very Basic UNIX

Unix/Linux Basics. Cpt S 223, Fall 2007 Copyright: Washington State University

Using Eclipse for C Programming

LAB #7 Linux Tutorial

EE516: Embedded Software Project 1. Setting Up Environment for Projects

Introduction to UNIX. Logging in. Basic System Architecture 10/7/10. most systems have graphical login on Linux machines

Introduction of Linux

CS 261 Recitation 1 Compiling C on UNIX

Linux at the Command Line Don Johnson of BU IS&T

CSC209. Software Tools and Systems Programming.

Masternode Setup Guide

Unix and C Program Development SEEM

acmteam/unix.pdf How to manage your account (user ID, password, shell); How to compile C, C++, and Java programs;

1 Installation (briefly)

Basic Unix Commands. CGS 3460, Lecture 6 Jan 23, 2006 Zhen Yang

24 Writing Your First Script

Introduction to Cygwin Operating Environment

The build2 Toolchain Installation and Upgrade

Running Sentaurus on the DOE Network

cgatools Installation Guide

CS370 Operating Systems

INSTALLATION GUIDE. CalculiX Graphical Pre- and Postprocessor cgx 2.9 on Mac OS X El Capitan. 1 B. Graf

Intro to Linux. this will open up a new terminal window for you is super convenient on the computers in the lab

Running MESA on Amazon EC2 Instances: A Guide

CS354 gdb Tutorial Written by Chris Feilbach

Using the Unix system. UNIX Introduction

Unix Workshop Aug 2014

Basic Shell Commands

CS/CIS 249 SP18 - Intro to Information Security

CS 307: UNIX PROGRAMMING ENVIRONMENT FIND COMMAND

COP 3014: Spring 2018 A Guide to Using CLion

Linux Systems Administration Getting Started with Linux

Exploring UNIX: Session 3

A Tutorial on using Code::Blocks with Catalina 3.0.3

Carnegie Mellon. Linux Boot Camp. Jack, Matthew, Nishad, Stanley 6 Sep 2016

Everything about Linux User- and Filemanagement

Using the Zoo Workstations

Exercise 1: Basic Tools

Introduction to the shell Part II

Introduction to the UNIX command line

Running Java Programs

Read the relevant material in Sobell! If you want to follow along with the examples that follow, and you do, open a Linux terminal.

CISC 220 fall 2011, set 1: Linux basics

CS197U: A Hands on Introduction to Unix

CSE 303 Lecture 4. users/groups; permissions; intro to shell scripting. read Linux Pocket Guide pp , 25-27, 61-65, , 176

Lab Working with Linux Command Line

CS197U: A Hands on Introduction to Unix

Introduction. SSH Secure Shell Client 1

AMS 200: Working on Linux/Unix Machines

Linux Essentials Objectives Topics:

Chap2: Operating-System Structures

Cloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK

Introduction to the Linux Command Line

Practical Session 0 Introduction to Linux

Cloud Computing and Unix: An Introduction. Dr. Sophie Shaw University of Aberdeen, UK

CENG 334 Computer Networks. Laboratory I Linux Tutorial

Embedded Linux Systems. Bin Li Assistant Professor Dept. of Electrical, Computer and Biomedical Engineering University of Rhode Island

a. puppet should point to master (i.e., append puppet to line with master in it. Use a text editor like Vim.

Introduction to Linux

Introduction to Unix and Linux. Workshop 1: Directories and Files

Introduction to Linux Organizing Files

iphone Development Setup Instructions Nikhil Yadav Pervasive Health Fall 2011

Getting Started With UNIX Lab Exercises

Lab 1 Introduction to UNIX and C

Using IDLE for

A Brief Introduction to the Linux Shell for Data Science

Unix/Linux Primer. Taras V. Pogorelov and Mike Hallock School of Chemical Sciences, University of Illinois

USB-MIDI Driver installation and settings...1 Windows XP users... 1

Introduction to Unix - Lab Exercise 0

Unix L555. Dept. of Linguistics, Indiana University Fall Unix. Unix. Directories. Files. Useful Commands. Permissions. tar.

Initial setting up of VPN Java version.

Introduction to Linux Workshop 1

eftp Application User Guide

INSTALLATION GUIDE. CalculiX Solver ccx 2.9 on Mac OS X El Capitan. 1 B. Graf

When you first log in, you will be placed in your home directory. To see what this directory is named, type:

Transcription:

Installing CEA on an Intel Mac Jonah Zimmerman April 20, 2012 1 Introduction Chemical Equilibrium with Applications (CEA) is a computer program published by NASA Glenn with the purpose of calculating chemical equilibrium product concentrations from any set of reactants and determining thermodynamic and transport properties for the product mixture [1]. The reason that you re reading this document is that you d like to install CEA on an Intelbased Macintosh computer, which is an unfortunately complicated procedure. The process presented in this document was compiled from the notes of Professor Brian Cantwell, Siina Haapanen, Minna Chao, Ashley Chandler, from the help of Matthew Giarra, and from references [2] and [3]. It has been tested in OS X 10.7.3 (Lion) and 10.6.4 (Snow Leopard) by the author, and in OS X 10.5 (Leopard) by Rosalind Beckwith. This tutorial is written for Lion users but an older version for Leopard and Snow Leopard users and updated versions for Lion users is available from: http://spase.stanford.edu/cea.html 2 Dramatis Personae The characters involved in this play include: CEA - a Fortran program coupled with a Java user interface gfortran - GNU compiler for Fortran programs (free alternative to UNIX s f77) gcc - GNU compiler collection - a set of compilers for various programming languages terminal - OS X s porthole to the UNIX command line XCode Tools - a set of tools for developing software on OS X root - the super-user on a UNIX machine emacs - a UNIX text editing program Graduate Student, Stanford University, jonah.e.zimmerman@gmail.com 1

3 Terminal There are many ways of getting to the UNIX command line which is buried under the shiny beautiful surface that is the OS X user interface. One of the simpler, no-frills methods is using the program Terminal which is located in the utilities folder inside of the applications folder. This opens the bash shell by default, and if it s not you can switch back through Terminal s preferences menu (if it s running bash already, it will say so at the top of the window): Open Terminal preferences, and find the option under startup that will automatically enter a command each time Terminal is opened. Make this command /bin/bash. Alternatively, for a single window you can just type the command bash to change it for that window only. 4 XCode Tools You will need to install XCode Tools to obtain the gcc. It can be obtained for free online via Apple s App Store. Just search for XCode and it ll come up. Once you ve downloaded and installed it, run the program from your Applications folder. Then, go to Preferences > Downloads > Components and install the command line tools. This step will require you to register as a developer on Apple s website. It s a bit of a pain but unlike most things from Apple it s free. 5 gfortran To make CEA function, you need to recompile some of the Fortran programs. To do that, you of course need some way of compiling Fortran programs! With XCode Tools, you ve installed gcc, a compiler for a wide range of programming languages that by default doesn t include Fortran. To obtain a Fortran compiler, gfortran, you must head to http://hpc.sourceforge.net/ Where you can find under the heading GCC 4.7 (auto-vectorizing gcc with openmp) the links for downloading the gfortran files, specific to either Lion or Snow Leopard. Make sure you just download the gfortran package, and not the whole gcc package. Once you ve downloaded the gfortran package, you ll need to move it to somewhere useful, unzip it, and install it (we ll go through how to do that next). Depending on the setup of your computer and user profile, you may need to switch to the root user of your system in order to complete some of the following commands. To switch to root, simply type in the terminal window su root, and then enter the appropriate password. If you are not the owner of your computer, you should probably contact the owner before trying to continue. If you are the owner of the computer and you don t know the root password, first try your own user s password. If that doesn t work, the root password may never have been set. You can set it using the command sudo passwd root. Then enter your own password, and set the root password to whatever you d like. Continuing with the installation, first you ll need to make a directory in which to put gfortran: mkdir /usr/local/src/gfortran 2

However, if /usr/local/src doesn t exist (you ll get an error when you try to type the above command), you ll first have to make it: mkdir /usr/local/src Then to move the downloaded file to the target directory, first navigate to the location where it was downloaded, and then use the following commands: cp gfortran-lion.tar.gz /usr/local/src/gfortran Now move the working directory to that folder: cd /usr/local/src/gfortran and then unzip it: gunzip gfortran-lion.tar.gz and then install it: tar -xvf gfortran-snwleo-intel-bin.tar -C / to test if it installed correctly, simply type gfortran -v. to: If it returns something similar Using built-in specs. COLLECT_GCC=gfortran COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-appledarwin11.3.0/4.7.0/lto-wrapper Target: x86_64-apple-darwin11.3.0 Configured with:../gcc-4.7.0-rc-20120314/configure --enable-languages=fortran Thread model: posix gcc version 4.7.0 20120314 (prerelease) (GCC) then you re all set (some of it will be different depending on your computer and version of OS X). If it returns command not found, then something s wrong. One possible reason is that the installed directory isn t in the normal search path, so your computer isn t seeing it. To see if this is the case, type: echo $PATH, and look at the list of directories that it outputs. If /usr/local/bin was not one of the directories, then you need to add it to the path. This can be done by typing echo export PATH=/usr/local/bin:$PATH >> /.profile and then closing your terminal window, quitting the program, and then restarting terminal with a new window. Type echo $PATH to make sure it worked. If this also didn t work, see the notes at the end of the next section about the alternate method for updating the PATH variable. If for whatever reason you decide to uninstall gfortran, go to the directory that you installed it from (ie cd /usr/local/src/gfortran/ ) and run this code: 3

tar -tf gfortranfile sort -r (cd /; xargs -t -n 1 rm -d) 6 CEA Files To download the CEA files themselves, go to the following page on NASA Glenn s site: http://www.grc.nasa.gov/www/ceaweb/ceaguidownload-unix.htm From here, download the following three files: CEAgui JAR (CEAgui-jar.tar.Z) CEA+Fortran Package (CEA+Fortran.tar.Z) CEAexec Package (CEAexec-mac.tar.Z) Make a new directory and save all of these files in it This will be where CEA is installed, so place it wherever you d like the final program to be. Then, open a terminal window and navigate to the folder where the files are, and use the following commands to uncompress the files (do not use a program like Stuffit Expander): zcat CEA+Fortran.tar.Z tar xvf - zcat CEAexec-mac.tar.Z tar xvf - zcat CEAgui-jar.tar.Z tar xvf - When you re finished, you should have the following six files in this folder: CEAgui.jar, thermo.lib, trans.lib, syntax, b1b2b3, FCEA2. If not all six are present, check that you have correctly downloaded and unpacked all three packages. Now, the permissions of several files have to be changed. This can be done using the following commands: chmod a+x b1b2b3 chmod a+x syntax chmod a+x FCEA2 chmod a+x runcea.sh Finally the environment variable PATH must be changed to include the CEA installation directory. Do this by typing: echo export PATH=/directory/where/CEA/is:$PATH >> /.profile And then quitting and restarting terminal (make sure you replace /directory/where/cea/is with the actual directory!). Type echo $PATH and make sure that your CEA installation directory is on the list. For some people this method of updating PATH does not work, and while I have been unable to determine the reason, there is another way to do it. It involves opening a text document that contains a list of directories, and then adding the CEA directory to that list. The text editor of choice is emacs, and opening the file into it can be done by typing (note that you 4

will need to be logged in as root for this step): emacs /etc/paths Now, navigate to the bottom of the file with the arrow keys, and then add on the next line the directory where CEA is installed. For example, once I added the directory to my PATH file, it looked like this: /usr/bin /bin/ /usr/sbin /sbin /Applications/CEA /usr/local/bin Note that I didn t add it to the end. I ve found that when it s the last item in the PATH file it can sometimes cause some problems. To exit emacs hit ctrl-x and then ctrl-c. When it asks you if you want to save the file, type y. 7 Update CEA Files Now, some of the CEA Fortran files need to be recompiled. To do that, move to the CEA installation directory and type the following code: gfortran cea2.f mv a.out FCEA2 gfortran b1b2b3.f mv a.out b1b2b3 gfortran syntax.f mv a.out syntax If during this process you get a long string of warning messages about feature deleted: goto... it s bogus and safe to ignore. Now you should have new executable files, but you ll still need to get new library files. To do that, type: FCEA2 trans FCEA2 thermo FCEA2 cea2 Note that each time you type FCEA2 you should get a statement asking for the input filename. You should now be all set. To try it out, type./runcea.sh in the CEA installation directory, and try loading an example file and executing it. 5

8 Troubleshooting This section is still in progress. If you have any problems, let me know and I ll add it here. There are many ways to go wrong installing this software, so here is a list of common errors and what they mean: File not found! Runtime.getRuntime().exec(b1b2b3) not complete due to the missing thermo.lib or trans.lib or BAD data! This means that you didn t update the CEA files correctly. Make sure that you didn t get any error messages when completing that part of the installation. ERROR: Missing Fortran Executable File: FCEA2.exe or FCEA2! Please Exit! This means that the PATH environment variable doesn t include the CEA installation directory. as: assembler (/usr/bin/../libexec/gcc/darwin/x86_64/as or /usr/bin/../local/libexec/gcc/darwin/x86_64/as) for architecture x86_64 not installed as: no assemblers installed I don t entirely know the details behind this error, but it seems to be related to the installation of the gcc. Reinstalling XCode Tools and then proceeding with the installation from there has solved this error in the past. gfortran: error trying to exec as : execvp: No such file or directory This means that the gccwas not installed correctly. References [1] http://www.grc.nasa.gov/www/ceaweb/ceawhat.htm [2] http://hpc.sourceforge.net/ [3] http://www.webmo.net/support/fortran osx.html 6