Setup Model Compiler on Linux/Mac

Description

  • To compile Ionic, Constitutive, Active Tension, and Material Coordinate Models on your computer please follow these instructions to install a fortran compiler if you do not have one and link it to Continuity.
  • You can choose between 2 compilers, g95 and the Intel Fortran Compiler. g95 is free but not as fast as the Intel Fortran Compiler. You can get a trial version of the Intel Fortran Compiler but after 30 days you must purchase it to continue using it.

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

  • Note: This work around is only for running g95 on the MacOS. Not Linux.

  • If you try to compile on the Mac with g95 you may get an error like this:
    • ld: in /Applications/cont5609/continuity/pcty/MglToolsLib/lib/python2.5/config, can't map file, errno=22
      make[2]: *** [BMOrtho_incompmodule.so] Error 1
      make[1]: *** [BMOrtho_incomp] Error 2
      make: *** [bmdynamic] Error 2
      

       

    • Here’s a work around:
    • Make sure that the python2.5 framework is installed. In particular you need this file:
      • /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/libpython2.5.a If you don’t have this file, you should be able to find python2.5 from the python.org website.
    • Open the <continuity>/src/Options.mk file and change this line

      • LDFLAGS = -dynamic -bundle -bundle_loader /Applications/cont5609/continuity/pcty/MglToolsLib/lib/python2.5/config

      to this line:

      • LDFLAGS = -dynamic -bundle -bundle_loader /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/config/libpython2.5.a