14 except OSError as exc: # Python >2.5
15 if exc.errno == errno.EEXIST and os.path.isdir(path):
22 """The main function treats the arguments given to our script."""
24 src_directory = os.getcwd()
25 #build_directory = """./build"""
26 install_directory = """/usr"""
30 opts, args = getopt.getopt(argv, """h""",
31 ["""help""", """prefix=""", """MPI_ROOT_DIR=""", """make"""])
32 except getopt.GetoptError:
33 print("""You gave incorrect arguments.""")
36 if opt in ("-h", "--help"):
37 print("""Possible options: h, help, prefix, MPI_ROOT_DIR.""")
38 # Notice that the make option is hidden.
40 elif opt in ("""--prefix"""):
41 install_directory = str(arg)
42 elif opt in ("""--MPI_ROOT_DIR"""):
43 mpi_directory = str(arg)
44 mpi_option = """-DMPI_ROOT_DIR=""" + mpi_directory
46 # mkdir_p(build_directory)
47 # os.chdir(build_directory)
48 subprocess.call(["""cmake""",
49 """-DCMAKE_INSTALL_PREFIX=""" + install_directory,
50 """-DCMAKE_BUILD_TYPE=Release""",
55 if __name__ == """__main__""":