Difference between revisions of "FAQ/Installation and Running"

From OpenFOAMWiki
< FAQ
(Copy-pasted-adjusted the "Installation and Running" section of the new FAQ)
 
(Added FAQ "Why am I not able to install the official OpenFOAM Deb packages on Ubuntu ?")
Line 50: Line 50:
  
 
Unfortunately this is not a winning situation for everybody. If you build and install OpenFOAM in your home directory you can't use it on heterogeneous machines on a network, i.e. a z80 based machine cannot run OpenFOAM compiled for a 6502 based machine, unless it has emulation software in which case it would be slow. Fear not because it is possible to configure OpenFOAM to compile and install in a common directory on each machine to accommodate heterogeneous machines on a network.
 
Unfortunately this is not a winning situation for everybody. If you build and install OpenFOAM in your home directory you can't use it on heterogeneous machines on a network, i.e. a z80 based machine cannot run OpenFOAM compiled for a 6502 based machine, unless it has emulation software in which case it would be slow. Fear not because it is possible to configure OpenFOAM to compile and install in a common directory on each machine to accommodate heterogeneous machines on a network.
 +
 +
=== Why am I not able to install the official OpenFOAM Deb packages on Ubuntu ? ===
 +
 +
If when following the instructions from the official instructions [http://www.openfoam.org/download/ubuntu.php Ubuntu Deb Pack Installation] you get an error like this:
 +
<bash>The following packages have unmet dependencies:
 +
openfoam221 : Depends: g++ but it is not installable
 +
              Depends: libreadline-dev but it is not installable
 +
              Depends: libopenmpi1.3 but it is not going to be installed
 +
              Depends: libptscotch-5.1 but it is not going to be installed
 +
              Depends: flex
 +
              Depends: libscotch-dev but it is not going to be installed
 +
              Depends: libopenmpi-dev but it is not going to be installed
 +
              Depends: libxt-dev but it is not going to be installed
 +
              Depends: openmpi-bin but it is not going to be installed
 +
              Recommends: libptscotch-dev but it is not going to be installed
 +
E: Unable to correct problems, you have held broken packages.
 +
</bash>
 +
Then the problem is that the necessary repository {{tt|universe}} is not installed, as explained here: [https://help.ubuntu.com/community/Repositories/Ubuntu  Repositories/Ubuntu]
 +
 +
To fix the problem, follow these steps:
 +
<ol>
 +
<li>Edit the file {{tt|/etc/apt/sources.list}}:
 +
<bash>sudo nano /etc/apt/sources.list</bash>
 +
</li>
 +
<li>You should find contents similar to this:
 +
<bash># /etc/apt/sources.list
 +
 +
deb http://archive.ubuntu.com/ubuntu/ precise main restricted
 +
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted
 +
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted</bash></li>
 +
<li>Append to each line the word {{tt|universe}} (you can add {{tt|multiverse}} as well if you want to):
 +
<bash># /etc/apt/sources.list
 +
 +
deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe
 +
deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe
 +
deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe</bash></li>
 +
<li>Hit the key combination {{tt|Ctrl+X}}, press the {{tt|Y}} key, then the {{tt|Enter}} or {{tt|Return}} key.</li>
 +
<li>Now, update the list of packages by running:
 +
<bash>sudo apt-get update</bash></li>
 +
</ol>
 +
And it's done. You can now proceed with the official installation instructions: [http://www.openfoam.org/download/ubuntu.php Ubuntu Deb Pack Installation]

Revision as of 19:58, 19 October 2013


1 FAQ Section 2: Installation and Running

Problems with the installation and running of applications


1.1 Which platforms are supported by OpenFOAM ?

Ports to other operating systems that have been discussed on the message board are

1.2 Why isn't there a Windows port of OpenFOAM ?

Actually, nowadays, there are a few ports for Windows. The only feasible way in the past, was to port OpenFOAM to Windows using Cygwin, an application that implements the most common UNIX APIs on Windows. Now MinGW is the more popular porting solution, because while it still integrades parts of Cygwin (MinGW forked from version 1.3.3 of Cygwin [1]), it can run natively in Windows and be linked with other native Windows libraries and applications.

One problem is that the file-system NTFS, that is used by most modern Windows Versions, is (by default) only case-preserving (hello.c and Hello.C are the same file, when in the same folder). The OpenFOAM-sources need a fully case-sensitive file-system and can't even be unpacked properly on a Windows system (see [2]). There is a possibility of enabling full case-sensitivity in Windows [3], but can lead to some Windows programs to not work properly.

1.2.1 (Cross-)Compiling with Cygwin

A (relatively old) way to compile OpenFOAM on cygwin is described on the Message-Board. The resultant binary distribution of version 1.3 is available here (and there is a relating discussion thread on the Message-Board). This port does not include FoamX and paraFoam, although postprocessing can be done with ParaView by using foamToVTK, and FoamX exists for OpenFOAM 1.4.x. This port is not part of the official distribution.

Another unofficial port of OpenFOAM 1.4.x is available here, with FoamX and ParaView. Support is available here and here.

FreeFOAM should prove to be more successful, but it's still in development, and uses CMake instead of wmake.

Cygwin 1.5 introduced a mount type named managed mounts, that can handle fully case sensitive files and folders, and some special characters that Linux can use and Windows can't [4]. In theory, if OpenFOAM is built under this interpretation layer, than it should be compilable directly in Windows. After some testing, it was discovered that OpenFOAM has some very long path names, which aren't handled properly by Cygwin's managed mounts, due to path size limit [5].

With Cygwin 1.7, managed mounts were dropped and POSIX mounts were introduced [6], as well as file paths increased to 4096 characters [7]. The POSIX mount relies on a hidden feature of Windows [8], that enables NTFS POSIX compatibility system, also used by Interix's SFU/SUA [9], thus enabling full case sensitivity. In other words, as of Cygwin 1.7, it is possible to compile and cross-compile OpenFOAM directly in Windows, without major reconstruction of the files and structure of the source code. Nonetheless, the whole build system has to be done under Cygwin's layer, because the flag obcaseinsensitive doesn't actually make all of Windows applications aware of full file name case sensitivity. For more information, see Using Cygwin for cross-compiling OpenFOAM.

1.2.2 (Cross-)Compiling with MinGW

There are already a few variants of cross-compiling with MinGW and one port that compiles directly in Windows with MinGW and CodeBlocks. The complete list is available here in the wiki. This link is part of a full step-by-step tutorial on how to Cross Compile OpenFOAM in Linux for Windows with MinGW and Mingw-w64.

1.3 How do I port OpenFOAM to an unsupported platform ?

If your platform is not some kind of UNIX-flavour you're probably going to have a hard time.

For a starter see Porting to a new platform.

1.4 Why is OpenFOAM built and installed in my home directory ?

Building and installing and running OpenFOAM in your home directory gives you some advantages. It is common practice to share the home directories across all machines machines on a network. In this setup all computers will have access to and run the same binaries compiled by the same compiler to help ensure consistent results. It also makes sharing data for cluster work easier. Also to really leverage the power of OpenFOAM you will want to write code to link to and extend it. If it was installed in a common directory individual users programs could clash via naming conflicts etc...


Unfortunately this is not a winning situation for everybody. If you build and install OpenFOAM in your home directory you can't use it on heterogeneous machines on a network, i.e. a z80 based machine cannot run OpenFOAM compiled for a 6502 based machine, unless it has emulation software in which case it would be slow. Fear not because it is possible to configure OpenFOAM to compile and install in a common directory on each machine to accommodate heterogeneous machines on a network.

1.5 Why am I not able to install the official OpenFOAM Deb packages on Ubuntu ?

If when following the instructions from the official instructions Ubuntu Deb Pack Installation you get an error like this:

The following packages have unmet dependencies:
 openfoam221 : Depends: g++ but it is not installable
               Depends: libreadline-dev but it is not installable
               Depends: libopenmpi1.3 but it is not going to be installed
               Depends: libptscotch-5.1 but it is not going to be installed
               Depends: flex
               Depends: libscotch-dev but it is not going to be installed
               Depends: libopenmpi-dev but it is not going to be installed
               Depends: libxt-dev but it is not going to be installed
               Depends: openmpi-bin but it is not going to be installed
               Recommends: libptscotch-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Then the problem is that the necessary repository universe is not installed, as explained here: Repositories/Ubuntu

To fix the problem, follow these steps:

  1. Edit the file /etc/apt/sources.list:
    sudo nano /etc/apt/sources.list
  2. You should find contents similar to this:
    # /etc/apt/sources.list
     
    deb http://archive.ubuntu.com/ubuntu/ precise main restricted
    deb http://security.ubuntu.com/ubuntu/ precise-security main restricted
    deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted
  3. Append to each line the word universe (you can add multiverse as well if you want to):
    # /etc/apt/sources.list
     
    deb http://archive.ubuntu.com/ubuntu/ precise main restricted universe
    deb http://security.ubuntu.com/ubuntu/ precise-security main restricted universe
    deb http://archive.ubuntu.com/ubuntu/ precise-updates main restricted universe
  4. Hit the key combination Ctrl+X, press the Y key, then the Enter or Return key.
  5. Now, update the list of packages by running:
    sudo apt-get update

And it's done. You can now proceed with the official installation instructions: Ubuntu Deb Pack Installation

Facts about "FAQ/Installation and Running"RDF feed
FaqdescriptionProblems with the installation and running of applications +
FaqnameInstallation and Running +
Faqnumber2 +