Setup Model Compiler on Linux/Mac

Description

Install g95

  1. Make sure you have the latest release of Continuity.
  2. If you are running Linux and have sudo priviledges, try running <sudo apt-get install g95>. Otherwise go to http://www.g95.org/dl.shtml to download and install the compiler.

  3. Find the path to the g95 compiler executable. For example mine is </home/aguthals/Documents/g95-install/bin/i686-unknown-linux-gnu-g95>. The executable should be in a folder named g95-install/bin.

  4. Now bind the g95 command to this executable. If you do not have root privileges, go to the next step. Otherwise go to your /bin directory and run:

    1. <ln -s <PATH TO g95 executable> g95>. For example, I would run <ln -s /home/aguthals/Documents/g95-install/bin/i686-unknown-linux-gnu-g95 g95>.

  5. If you do not have root privileges:
    1. cd to the directory containing the g95 executable and rename the file to g95. For example, I would run <mv i686-unknown-linux-gnu-g95 g95>.

    2. Modify your startup script (.bashrc in your home directory for bash users) in your home directory. Insert the following line: <export PATH=<PATH TO g95 executable directory>:$PATH>. For example, I would insert <export PATH=/home/aguthals/Documents/g95-install/bin:$PATH>.

    3. Restart the terminal.
  6. cd to Continuity's home directory and run:
    1. ./setup (if running continuity for the first time)

    2. source mglinit

    3. autoconf

    4. ./configure --with-g95

    5. After you running ./configure --with-95, you should see something more or less like this:
      •   Shell:                      /bin/sh
          C compiler:                 gcc
          C++ compiler:               /usr/bin/g++
          C compiler flags:           -c  -DG95 -O2 -finline-functions
          Fortran compiler:           /bin/g95
          F90C compiler:
          Fortran compiler flags:     -c -r8 -fno-second-underscore -ffixed-line-length-132 -cpp -DPYTHON -DLINUX -DHAVE_LAPACK -DG95 -O3 -ftree-vectorize
          Fortran libraries:
          Linker:                     /bin/g95
          Linker flags:               -shared
          Libs:
          MPICC:             
          MPILD:              
          MPILDFLAGS:                
          MPICCFLAGS:                
          Install path:               /opt/continuity
          Host binary type:           linux32
          OBJEXT:                     o
          LIBEXT:                     a
          SWIG:                       /usr/local/bin/swig
            
  7. You can now compile model equations within the various model editors. After editing an equation, go to the Compile tab and select your current server from the drop-down menu. If it is not there type in "localhost (current server)", then click Compile.

Install Intel Fortran Compiler

  1. Make sure you have the latest release of Continuity.
  2. Go to http://www.intel.com/cd/software/products/asmo-na/eng/278834.htm to download and install the compiler.

  3. Find the path to a shell script named something like "ifortvars.sh" (or .csh for cshell users) in the fortran compiler's bin directory. For example mine is </opt/intel/Compiler/11.1/038/bin/ia32/ifortvars_ia32.sh>. The script will be in the same folder as ifort (the compiler executable).

  4. Find the path to the fortran compiler's lib directory, for example mine is </opt/intel/Compiler/11.1/038/lib/ia32>. The folder will contain numerous libraries such as libifcore.so.

  5. In your startup script (.bashrc in your home directory for bash users), insert the following lines: <export IFC_LIB_PATH="<PATH TO lib>"> and <source <PATH to ifortvars>>. For example, I would insert <source /opt/intel/Compiler/11.1/038/bin/ia32/ifortvars_ia32.sh> and <export IFC_LIB_PATH="/opt/intel/Compiler/11.1/038/lib/ia32">.

  6. Restart the terminal.
  7. cd to Continuity's home directory and run:
    1. ./setup (if running continuity for the first time)

    2. source mglinit

    3. autoconf

    4. ./configure

  8. You can now compile model equations within the various model editors. After editing an equation, go to the Compile tab and select your current server from the drop-down menu. If it is not there type in "localhost (current server)", then click Compile.

Using g95 on the Mac

Continuity/Documentation/Tutorials/CompileSetup (last edited 2009-07-07 20:05:10 by FredLionetti)