InstallGuides/InstallGuide: local.py

File local.py, 4.9 KB (added by jonc@…, 8 years ago)

An example hostconfig file to work with these basic installation instructions

Line 
1# Configuration
2
3"""Copyright (c) 2005-2014, University of Oxford.
4All rights reserved.
5
6University of Oxford means the Chancellor, Masters and Scholars of the
7University of Oxford, having an administrative office at Wellington
8Square, Oxford OX1 2JD, UK.
9
10This file is part of Chaste.
11
12Redistribution and use in source and binary forms, with or without
13modification, are permitted provided that the following conditions are met:
14 * Redistributions of source code must retain the above copyright notice,
15   this list of conditions and the following disclaimer.
16 * Redistributions in binary form must reproduce the above copyright notice,
17   this list of conditions and the following disclaimer in the documentation
18   and/or other materials provided with the distribution.
19 * Neither the name of the University of Oxford nor the names of its
20   contributors may be used to endorse or promote products derived from this
21   software without specific prior written permission.
22
23THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33"""
34
35import os
36import sys
37
38############################################################
39# TO CONFIGURE YOUR MACHINE: if you have followed the manual
40# installation instructions, edit the definition of
41# chaste_libs_path below to point to where you installed the
42# dependencies.
43############################################################
44
45#EDIT HERE
46#For a simple installation all paths will be below this directory
47chaste_libs_path = '/home/chaste/chaste-libs/'
48#EDIT HERE
49
50if not os.path.exists(chaste_libs_path) or not os.path.isdir(chaste_libs_path):
51    print >>sys.stderr, "Chaste dependencies folder", chaste_libs_path, \
52        "not found; please edit python/hostconfig/local.py"
53    sys.exit(1)
54
55petsc_ver = 3.4
56petsc_path = chaste_libs_path+'petsc-3.4.4/'
57petsc_build_name = 'linux-gnu'
58petsc_build_name_profile = 'linux-gnu'
59petsc_build_name_optimized = 'linux-gnu-opt'
60
61# If you have the Intel compiler installed, set this to the folder where it lives
62#intel_path = '/opt/intel/cc/9.1.039/'
63# You may need to edit this to ensure that the intel compiler finds the right gcc libraries, e.g.
64#icpc = 'icpc -gcc-version=410 -I /usr/include/c++/4.1.3/x86_64-linux-gnu/ -I/usr/include/c++/4.1.3/    -I/usr/include/c++/4.1.3/backward'
65#icpc = 'icpc'
66
67if os.uname()[4] == 'x86_64':
68    xsd_path = chaste_libs_path + 'xsd-3.3.0-x86_64-linux-gnu/'
69else:
70    xsd_path = chaste_libs_path + 'xsd-3.3.0-i686-linux-gnu/'
71
72other_includepaths = [chaste_libs_path+'include',
73                      xsd_path + 'libxsd']
74
75other_libpaths = [chaste_libs_path+'lib']
76
77# The order of libraries in these lists matters!
78# Note that boost serialization sometimes has a different name: eg boost_serialization-gcc41
79other_libraries = ['boost_serialization', 'boost_filesystem', 'boost_system', 'xerces-c', 'hdf5', 'parmetis', 'metis']
80# Note: parmetis before metis, hdf5 before z.
81
82# Assuming you installed PETSc with HYPRE support, you'll want this line:
83other_libraries.append('HYPRE')
84
85blas_lapack = ['f2clapack', 'f2cblas']
86
87tools = {'xsd': xsd_path+'bin/xsd'}
88
89
90def Configure(prefs, build):
91    """Set up the build configuring.
92   
93    prefs can specify which version of various libraries we should use, and which optional libraries.
94   
95    build is an instance of BuildTypes.BuildType.
96    """
97    global use_cvode
98    global use_vtk
99   
100    # use_vtk defaults to True. Change to False if VTK development libraries are not available.
101    use_vtk = int(prefs.get('use-vtk', True))
102   
103    # Extra libraries for VTK output
104    if use_vtk:
105        other_includepaths.append('/usr/include/vtk')
106        other_libpaths.append('/usr/lib64/vtk')
107
108        # VTK 5:
109        #other_libraries.extend(['vtkFiltering', 'vtkIO', 'vtkCommon', 'vtksys', 'vtkzlib', 'vtkexpat', 'vtkGraphics'])
110       
111        # VTK 6:
112        other_libraries.extend(['vtkCommonCore', 'vtkCommonDataModel', 'vtkIOXML', 'vtkCommonExecutionModel', 'vtkFiltersCore', 'libvtkFiltersGeometry'])
113   
114    # Chaste may also optionally link against CVODE.
115    use_cvode = int(prefs.get('use-cvode', True))
116    if use_cvode:
117        other_includepaths.append(petsc_path + 'linux-gnu/include/')
118        DetermineCvodeVersion(other_includepaths[-1])
119        other_libpaths.append(chaste_libs_path+'cvode/lib')
120        other_libraries.extend(['sundials_cvode', 'sundials_nvecserial'])