3 import pluto_files_IO
as pfIO
6 def check(pluto_dir, get_arch):
9 print (
"\n>> Inspecting system configuration << \n")
11 log_file = work_dir+
'/sysconf.out'
12 python_dir = pluto_dir+
'/Tools/Python'
13 param_file = pluto_dir+
'/Src/pluto.h'
38 pf = pfIO.PlutoFiles(param_file)
39 scrh = pf.LocateString(
"PLUTO_VERSION")
41 vers = scrh[0][1].split()[-1]
49 print "User.......................",user
50 print "System name................",PLATFORM[0]
51 print "Node name..................",PLATFORM[1]
52 print "Release....................",PLATFORM[2]
53 print "Arch.......................",PLATFORM[4]
54 print "Byteorder..................",sys.byteorder
55 print "Version....................",PLATFORM[3]
56 print "Working_dir................",work_dir
57 print "PLUTO main dir.............",pluto_dir
58 print "PLUTO version..............",vers
64 compiler_list = [
'gcc',
'cc',
'gcc2']
67 for x
in compiler_list:
69 print "C Compiler................. "+x
73 if (COMPILER_NAME ==
''):
74 print "! Can not find a C compiler !"
80 mpi_compiler_list = [
'mpicc',
'mpiCC',
'mpcc_r',
'hcc',
'mpcc']
81 MPI_COMPILER_NAME =
''
83 for x
in mpi_compiler_list:
85 print "MPI Compiler .............. "+x
89 if (MPI_COMPILER_NAME ==
''):
90 print "MPI Compiler............... NOT FOUND"
95 print "Proposed makefile names: \n"
96 print "> "+PLATFORM[0]+
"."+PLATFORM[4]+
"."+COMPILER_NAME+
".defs"
97 print "> "+PLATFORM[0]+
"."+PLATFORM[4]+
"."+MPI_COMPILER_NAME+
".defs"
105 log.append(
"USER = "+user+
'\n')
106 log.append(
"WORKING_DIR = "+work_dir+
"\n")
107 log.append(
"SYSTEM_NAME = "+PLATFORM[0]+
"\n")
108 log.append(
"NODE_NAME = "+PLATFORM[1]+
"\n")
109 log.append(
"RELEASE = "+PLATFORM[2]+
"\n")
110 log.append(
"ARCH = "+PLATFORM[4]+
"\n")
111 log.append(
"BYTE_ORDER = "+sys.byteorder+
"\n")
112 log.append(
"VERSION = "+PLATFORM[3]+
"\n")
113 log.append(
"PLUTO_DIR = "+pluto_dir+
'\n')
114 log.append(
"PLUTO_VERSION = "+vers+
'\n')
115 log.append(
"C_COMPILER = "+COMPILER_NAME+
'\n')
116 log.append(
"MPI_C_COMPILER = "+MPI_COMPILER_NAME+
'\n')
122 print "\n> Checking for updates (canceled)...\n"
151 if (os.path.exists(log_file)):
152 pf = pfIO.PlutoFiles(log_file)
153 scrh = pf.ReadLines(0,128)
154 if (scrh[0:] == log[0:]):
158 print "\n> System configuration file is not up to date. Updating..."
160 print "\n> System configuration file not found, creating one..."
161 pf = pfIO.PlutoFiles(log_file)
200 scrh = os.getenv(
'PATH')
201 path = scrh.split(
':')
209 if (os.path.exists(x+
"/"+file)):