Installation of the Buildings library

We recommend to install the library into a library directory that is different from the directory in which you build your own models. For example, unzip the Buildings library file. Then, proceed as follows.

Linux

Copy the library to the directory /usr/local/Modelica/Library/Buildings x.y, where x.y is the version number of the Buildings library. Therefore, your installation may look like

$ ls /usr/local/Modelica/Library/Buildings\ 1.0/
Airflow             Controls  HeatTransfer  package.mo     Rooms
BaseClasses         Examples  legal.html    package.order  Utilities
BoundaryConditions  Fluid     Media         Resources

Next, set the MODELICAPATH environment variable by adding the following line to your ~/.bashrc file

export MODELICAPATH=${MODELICAPATH}:/usr/local/Modelica/Library/

and restart your bash shell.

Windows

Copy the library to the directory C:\Users\[your_login]\Documents\Buildings x.y, where x.y is the version number of the Buildings library. Therefore, your installation may look as shown below.

c:\Users\[your_login]\Documents>dir "Buildings 1.1"
 Volume in drive C has no label.
 Volume Serial Number is AC58-13C3

 Directory of c:\Users\mwetter\Documents\Buildings 1.1

02/22/2012  05:43 PM    <DIR>          .
02/22/2012  05:43 PM    <DIR>          ..
02/22/2012  05:43 PM    <DIR>          Airflow
02/22/2012  05:43 PM    <DIR>          BaseClasses
02/22/2012  05:42 PM    <DIR>          BoundaryConditions
02/22/2012  05:42 PM    <DIR>          Controls
02/22/2012  05:43 PM    <DIR>          Examples
02/22/2012  05:42 PM    <DIR>          Fluid
02/22/2012  05:43 PM    <DIR>          HeatTransfer
02/22/2012  05:43 PM    <DIR>          help
02/22/2012  05:42 PM            17,439 legal.html
02/22/2012  05:42 PM    <DIR>          Media
02/22/2012  05:42 PM           108,441 package.mo
02/22/2012  05:42 PM               109 package.order
02/22/2012  05:43 PM    <DIR>          Resources
02/22/2012  05:42 PM    <DIR>          Rooms
02/22/2012  05:42 PM    <DIR>          Utilities
               3 File(s)        125,989 bytes
              14 Dir(s)  13,179,371,520 bytes free

Next, set the MODELICAPATH system environment variable. On Windows 7, system environment variables can be set in Control Panel -> System and Security -> System -> Advanced System Settings -> Environment Variables. Enter in the Variable column MODELICAPATH and enter in the Value column c:\Users\[your_login]\Documents;%MODELICAPATH%.

Configuring models to use the Buildings library

When creating models that use the Buildings library, add at the top-level package.mo file of your models the annotation shown in the example below.

package MyModels
  extends Buildings.BaseClasses.BaseIcon;

  annotation (
    uses(Buildings(version="11.0.0"))
  );

end MyModels;

This will automatically load the Buildings library version 11.0.0 when opening the file MyModels/package.mo. (See also http://simulationresearch.lbl.gov/modelica/userGuide/bestPractice.html#organization-of-packages for how to store your models.)

Updating to a new version of the Buildings library

To update your models to a new version of the Buildings library, proceed as follows:

  1. Install the new version of the Buildings library as described above.
  2. Open the new version of the Buildings library.
  3. Open the top-level package.mo file of your models. If it contains the above annotation, and the Buildings library that you opened is more recent than the version number referred to in the above annotation, then your models will automatically be converted using the conversion script of the Buildings library. The conversion scripts should update most of your models automatically. However, see the release notes of the Buildings library for any changes in the library that may not be converted automatically.