Porting OpenFOAM to Mac OS X

Similar documents
Installation of OpenFOAM into MAC

MacOS X as UNIX. How to use MacOS X for your uni degree and not go insane. Stewart Smith

CHAPTER 2: SYSTEM STRUCTURES. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

CS197U: A Hands on Introduction to Unix

Chapter 2: Operating-System Structures

CS420: Operating Systems. OS Services & System Calls

Source pack installa0on of OpenFOAM. 4.0 into RHL. Open CAE Local Study Mee0ng Y. Takagi July 2, 2016

Introductory OpenFOAM Course From 2 nd to 6 th July, Joel Guerrero University of Genoa, DICAT

CS370 Operating Systems

Four Components of a Computer System

Chapter 2. Operating-System Structures

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edition

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edit9on

Data Analysis in Geophysics ESCI Class 1. Bob Smalley. Basics of the Computer Environment

Cross Compiling. Real Time Operating Systems and Middleware. Luca Abeni

Introduction to Linux. Fundamentals of Computer Science

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edit9on

COPYRIGHTED MATERIAL. Installing Xcode. The Xcode Installer

Software Installations

Section 2: Developer tools and you. Alex Mariakakis (staff-wide)

Draft: MLDesigner and LinCVS

2 Installing the Software

NetVault for MAC OS X. Contents

The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams.

Can t Believe It s Linux. a totally different and hypothetical linux distribution

How to build Simbody 2.2 from source on Windows

Compiling Software on UNIX. System Administration Decal Spring 2009 Lecture #4 George Wu Slides prepared by Joshua Kwan

Kernel Types Simple OS Examples System Calls. Operating Systems. Autumn CS4023

Introduction to Pintos. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Online Backup Client User Manual

The build2 Toolchain Installation and Upgrade

Android System Development Training 4-day session

How to get started with OpenFOAM at SHARCNET

Install and Configure Ubuntu on a VirtualBox Virtual Machine

INTRODUCTION TO LINUX

Study Guide Processes & Job Control

Christopher Sean Morrison

Mingw-w64 and Win-builds.org - Building for Windows

Linux Everywhere. A look at Linux outside the world of desktops. CIS 191 Spring 2012 Guest Lecture by Philip Peng

NetVault:Backup for Mac OS X

Introduction to Pintos

Using Ruby and irb in CSE 341 Winter 2015

Using Eclipse for C Programming

Warmup. A programmer s wife tells him, Would you mind going to the store and picking up a loaf of bread? Also, if they have eggs, get a dozen.

Your desktop or laptop computer consists of several hardware components:

Chap2: Operating-System Structures

Chapter 2: System Structures. Operating System Concepts 9 th Edition

Introduction to Unix. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Operating-System Structures

Systems Programming. The Unix/Linux Operating System

Building the X Window System from the X.org Source Distribution 1

Java Manuals For Windows Xp Latest Version 6.1

Octagon Plugin Environment. using a virtual machine

Mac OS X port : The Next Step. Eric Bachard / Porting Project / OooCon 2006 Lyon France

Arch Linux Grub You Need To Load The Kernel First

SDK. About the Cisco SDK. Installing the SDK. Procedure. This chapter contains the following sections:

Operating System Services. User Services. System Operation Services. User Operating System Interface - CLI. A View of Operating System Services

Introduction to Python

Download vm virtualbox in virtualbox.org/. How to Install OSX on Virtualbox.

How To Install Java Manually Linux Ubuntu Bit

Parallel Programming

OS Structure. Kevin Webb Swarthmore College January 25, Relevant xkcd:

Subversion was not there a minute ago. Then I went through a couple of menus and eventually it showed up. Why is it there sometimes and sometimes not?

Linux. An introduction. Aurélien Villani 01/2018

How to Dual-Boot OS X and Ubuntu

BoardCAD developer guide

Welcome to Mac OS X, the world s most advanced operating system. This book helps you start using Mac OS X. First install the software, then discover h

Setting up an SDK for Secondo

Chapter 2: System Structures. Operating System Concepts 9 th Edition

Xcode and Swift CS 4720 Mobile Application Development

Chapter 2 Operating-System Structures

Distributed Rendering Setup Guide

Requirements for ALEPH 500 Installation

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Code Blocks Cannot Find Compiler Executable Windows 7

Contents Server Platform Support Matrix... 2

CS480. Compilers Eclipse, SVN, Makefile examples

Lab 2 Building on Linux

Unix/Linux Operating System. Introduction to Computational Statistics STAT 598G, Fall 2011

Ensuring your computer has Java

Chapter 2: Operating-System Structures

Home Page. Title Page. Contents. Page 1 of 17. Version Control. Go Back. Ken Bloom. Full Screen. Linux User Group of Davis March 1, Close.

GNU-AVR Building the GNU AVR Toolchain for Mac OS X and Linux

CISC 220 fall 2011, set 1: Linux basics

The name of our class will be Yo. Type that in where it says Class Name. Don t hit the OK button yet.

Operating System Services

Yocto Project components

Having Fun with Social Coding. Sean Handley. February 25, 2010

GUT. GUT Installation Guide

Manual Update Java 7 25 Mac 32 Bit

Paragon NTFS for Mac OS X

minit Felix von Leitner September 2004 minit

About Xcode and iphone SDK

Xcode. Chapter 1. Creating a Project

If you don t have the JDK, you will need to install it. 1. Go to

Practical Computing-II. Programming in the Linux Environment. 0. An Introduction. B.W.Gore. March 20, 2015

Developing Android applications in Windows

Downloading and installing Db2 Developer-C on Red Hat Enterprise Linux Roger E. Sanders Yujing Ke Published on October 23, 2018

RETROPIE INSTALLATION GUIDE

Embedded Systems Programming

Transcription:

Bernhard F.W. Gschaider 1 Hrvoje Jasak 2 1 ICE Strömungsforschung 2 Wikki Ltd June 9, 2007

Outline Basics 1 Basics It s only UNIX (but I like it) Vendor provided software 2 Preparing the port Additional software Compiling Paraview 3 Problems The Future

The architecture of Mac OS X It s only UNIX (but I like it) Vendor provided software Starting with Mac OS X10.0 the Apple TM -OS is based on (BSD)Unix Has a shell and all our beloved CLI-utilities Some differences to regular Unix-machines This layer is know as Darwin. Therefor the $WM_ARCH is called darwin The Apple TM -specific interface and services are built on top of the Unix-layer Origins in the NeXT TM -operating system None of these things are needed by OpenFOAM So it should be easy to port OpenFOAM to Mac OS X

It s only UNIX (but I like it) Vendor provided software BSD vs System V Historically there are two types of Unix: System V Stems from AT&T BSD From the university of Berkley Both conform to the Posix-Standard. Sort of OpenFOAM was developed on Linux TM More on the System V side Mac OS X is based on a BSD-kernel With a sugar coating by Apple TM

Case-insensitive filesystems It s only UNIX (but I like it) Vendor provided software ext2 (the standard Linux TM -filesystem is case-sensitive: 1 touch thecase touch TheCase Yields two files: thecase and TheCase Apple HFS is case-insensitive: The above commands yield only thecase Case of the file is known... but not used to distinguish files Variant Apple HFSX is case-sensitive but using it on your system-disk kills the system Well, actually we never dared to try OpenFOAM has source file that only differ by case Example: Scalar.H, scalar.h

It s only UNIX (but I like it) Vendor provided software Development tools Every Mac comes with media that install a complete development system g++, gcc Compiler (currently in version 4.0.1) make A GNU Make flex, bison Compiler generators JDK Java TM (currently 1.5) These are the most important tools to port OpenFOAM

X-Windows Basics It s only UNIX (but I like it) Vendor provided software The Mac s GUI is called Aqua - programmed with the API Cocao The standard API in the Unix-world is X11 (X-Windows) Apple TM provides a X-Server (and the X11-API)

Preparing the port Additional software Compiling Paraview Getting a case-sensitive filesystem (Sorry. I only have a german system. Therefor the names of the GUI-elements are back-translations ) 1 Open the program Applications-Utilities - Disk Utility 2 Click on New Image Select a name and a location for the image Select a size (1 GB should be sufficient. Can be grown later) 3 Click in the pane on the left on the created image 4 Go to the Erase-tab For Volume-Format select one of the case-sensitive Mac OS Extend-variations Click the Erase-button 5 Try to mount the image by double-clicking it Try the touch-test described above

Preparing the port Additional software Compiling Paraview Permanently adding the disk image If you want your OpenFOAM-installation to be permanent: Mount the Image at login 1 Go to your User-settings in Sytem Preferences 2 Select the Start Objects-tab 3 Click on the Plus-button and add your image Symlink the image to the usual place In a shell say ln -s / Volumes /Foam ~/ OpenFOAM (assuming your image mounts as Foam) Modify the.bashrc 1 Add a call to the OF-initialization file (described in the Readme-file) 2 Add the line 1 ulimit -S -n 2048 (this prevents an exhaustion of file-handles with wmkdep)

Preparing the sources Preparing the port Additional software Compiling Paraview 1 Go to the disk image 1 cd ~/ OpenFOAM 2 Untar the source-distribution there (nothing else is needed) 1 tar xvzf ~/ Downloads /OpenFOAM -1.4 - General.tgz 3 Download from http://openfoamwiki.net/index.php/howto_compile_openfoam_mac A tar with the wmake-rules for the darwin-architecture. To be untarred Two patches. To be applied in order. To apply a patch do 1 cd ~/ OpenFOAM / OpenFOAM -1.4 patch -p0 -b <~/ Download / thepatch A new version of error.c (allows backtraces)

What the patches do Preparing the port Additional software Compiling Paraview Issues the patches take care of: Add Darwin to the known architectures Deficits in the Apple TM -headers (missing math-stuff) malloc.h is in a different place Libraries that are missing in the options-files of some utilities Reset the MICO to the darwinports one (thus enabling the compilation of FoamX and patchtool) Help to compile the paraview-filter without human intervention Remove warnings about unsupported options for the head-command from some scripts These patches will be inserted into the Subversion-repository

MacPorts (FKA DarwinPorts) To get the missing software: Preparing the port Additional software Compiling Paraview 1 Go to http://www.macports.org/ and install it A similar project is http://www.finkproject.org/ (provides binaries as well) 2 Install the missing packages: Mico If you don t want to use the version that comes with OpenFOAM sudo port install mico The sources (and everything they depend on) are automagically downloaded and compiled binutils If you want to use the backtrace-facility 1 sudo port install binutils MPI The MPI-implementation of your choice. For instance 1 sudo port install openmpi The files in OpenFOAM-1.4/.OpenFOAM-1.4 have to be adapted acordingly

Do it like the README says Preparing the port Additional software Compiling Paraview This is the hardest part 1 Check whether everything is in place 2 Do 1 cd ~/ OpenFOAM / OpenFOAM -1.4./ Allwmake 3 Get some coffee 4 Wait 5 Get more coffee 6 Watch PVReader-compilation fail (should be the only failure at that stage) 7 Celebrate the end of the compilation with a cup of coffee 8 Try some utilities (blockmesh, interfoam) to make sure it worked

Why compile ParaView TM Preparing the port Additional software Compiling Paraview parafoam is a script that adds a plugin to ParaView TM and calls the original paraview This plugin is the PVReader that failed during our first compilation To compile a plugin for ParaView TM you have to have the source-code... or know the settings with which your binary was compiled The surest way to know the settings is to compile ParaView TM yourself Q.E.D.

Compiling it Basics Preparing the port Additional software Compiling Paraview 1 Download the source code (2.4.x is supported but 2.6.x works as well. No 3.x-versions) 2 Untar and compile it Doesn t have to be on a case-sensitive filesystem For details look at the Wiki-page 3 Adapt the initialization files so that $ParaView_Dir is correct 4 Open a new shell and in that retry Allwmake Now PVReader should compile 5 Try parafoam

An alternative: ParaView3 TM Preparing the port Additional software Compiling Paraview ParaView3 TM already has reader for OpenFOAM included But it is not represented in the Open File-Dialog of the GUI Reader can be added to the Dialog with a... plugin http://openfoamwiki.net/index.php/tip_build_a_paraview3_plugin ParaView3 TM has to be compiled from source Advantages Cool new features X11 no longer needed (native Aqua-GUI Disadvantages Reader seems to be a bit unstable Works only if there are no.gz-files in the case

Problems The Future Problem: FoamX won t kill its sub-processes After running FoamX some processes remain FoamXHostBrowser nsd Should be killed by the FoamX-script Are not (because of the different output of the BSD-ps) Workaround: manually kill the processes Or rewrite the scripts The same is true for patchtool

Problems The Future Problem: No right-click in FoamX Two contradicting concepts: Macs only have one mouse-button Unix-software usually assumes three mouse-buttons Right mouse-button is emulated by Ctrl-Click This doesn t work in FoamX Theory: The Java virtual machine swallows the Ctrl-key Workaround: Use an external USB-mouse (with three buttons) Same is true for patchtool

Problems The Future A Tale of two Architectures Currently Mac OS X exists on two processor architectures: ppc The PowerPC-architecture (no longer used by Apple TM ) i386 The Intel TM processors Currently only ppc-compilations are known (though i386 shouldn t be a problem) Using both compile options -arch ppc -arch i386 produces Universal binaries Currently untested (lack of time, diskspace and an Intel TM -Mac) Disadvantage: Binaries are twice the size they should be

How will it be distributed? Problems The Future Two basic ways of distribution 1 In source form On the forthcoming openfoam-extend-subversion-repository Disadvantage: the preparation of the environment has to be done by the user Propably will not be incorporated in the official distribution 2 As disk images Have been provided by Hrv in the past Disadvantage: Updates will only be available when someone has the time to produce a new image Problem: for which architecture (ppc, i386 or Universal) Proposal: prepare disk image for Svn-access (in other words: give the image the possibility to update itself)

Problems The Future Acknowledgments People who contributed to this port by providing contributions/feedback: Michael Wild Pointed out that the Disk Utility can produce case-sensitive file-systems Doug Hunsaker Asked a lot of questions that told me what is not so trivial Simon Stapleton Who pointed out that the FoamX-orphans are a BSD-problem and promised a fix Bouke Got foaminstallationtest to run James Turner Found a problem with the wmkdep-tool Petr Vita For having nothing to do with this port... these are the ones I remember. Sorry for everyone I forgot

The End Basics Problems The Future Thanks for listening! Questions?