source: pypar/contrib/install.py @ 622

Last change on this file since 622 was 85, checked in by ole, 19 years ago

Added pypar files

File size: 1.7 KB
Line 
1# =============================================================================
2# install.py - Installation of pypar (Parallel Python using MPI)
3# Copyright (C) 2001 Ole M. Nielsen
4#
5#    This program is free software; you can redistribute it and/or modify
6#    it under the terms of the GNU General Public License as published by
7#    the Free Software Foundation; either version 2 of the License, or
8#    (at your option) any later version.
9#
10#    This program is distributed in the hope that it will be useful,
11#    but WITHOUT ANY WARRANTY; without even the implied warranty of
12#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13#    GNU General Public License (http://www.gnu.org/copyleft/gpl.html)
14#    for more details.
15#
16#    You should have received a copy of the GNU General Public License
17#    along with this program; if not, write to the Free Software
18#    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
19#
20#
21# Contact address: Ole.Nielsen@anu.edu.au
22#
23# Version 1.0 October 2001
24# =============================================================================
25
26"""Module install.py - Compile C extension for pypar
27"""
28
29import os, sys     
30   
31
32# Attempt to compile mpi.so
33#
34try:
35  import compile
36  compile.compile('mpi.c', 'mpicc', verbose = 1)
37except:
38  raise "Could compile C extension mpi.c - please try manually"       
39
40
41if sys.platform in ['osf1V5', 'sunos5']:  #Compaq AlphaServer or Sun
42  sys.exit()
43  # Alpha Server or Sun cannot import MPI on sequential processes
44  # OK with LAM
45
46#Check if MPI module can be initialised
47#
48# Attempt to import and initialise mpi.so
49
50error = os.system('python -c "import mpi" > /dev/null') 
51if error:
52  raise "MPI could not be initialised."
53else: 
54  import mpi
55  print "MPI initialised OK"   
56
Note: See TracBrowser for help on using the repository browser.