Changeset 8209738 in flex_extract.git for Source/Python/install.py
- Timestamp:
- May 7, 2020, 3:32:03 PM (4 years ago)
- Branches:
- master, ctbto, dev
- Children:
- b936fd3
- Parents:
- 05e9362
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Source/Python/install.py
r50f9ca6 r8209738 46 46 47 47 Depending on the selected installation environment (locally or on the 48 ECMWF server ecgate or cca) the program extracts the command line48 ECMWF server ecgate or cca) the program extracts the command line 49 49 arguments and the CONTROL file parameter and prepares the corresponding 50 50 environment. 51 The necessary files are collected in a tar -ball and placed52 at the target location. There its untared, the environment variables will53 be set and the Fortran code will becompiled.54 If the ECMWF environment is selected a job script is prepared and submitted55 for the remaining configurations after putting the tar -ball tothe51 The necessary files are collected in a tar ball and placed 52 at the target location. There, is is untared, the environment variables are 53 set, and the Fortran code is compiled. 54 If the ECMWF environment is selected, a job script is prepared and submitted 55 for the remaining configurations after putting the tar ball on the 56 56 target ECMWF server. 57 57 … … 107 107 def get_install_cmdline_args(): 108 108 '''Decomposes the command line arguments and assigns them to variables. 109 Apply default values for non mentioned arguments.109 Apply default values for arguments not present. 110 110 111 111 Parameters … … 127 127 parser.add_argument("--makefile", dest="makefile", 128 128 type=none_or_str, default=None, 129 help='Name of Makefile to use for compiling the '129 help='Name of makefile for compiling the ' 130 130 'Fortran program') 131 131 parser.add_argument("--ecuid", dest="ecuid", 132 132 type=none_or_str, default=None, 133 help=' The user id at ECMWF.')133 help='User id at ECMWF') 134 134 parser.add_argument("--ecgid", dest="ecgid", 135 135 type=none_or_str, default=None, 136 help=' The group id at ECMWF.')136 help='Group id at ECMWF') 137 137 parser.add_argument("--gateway", dest="gateway", 138 138 type=none_or_str, default=None, 139 help=' The name of the local gateway server.')139 help='Name of the local gateway server') 140 140 parser.add_argument("--destination", dest="destination", 141 141 type=none_or_str, default=None, 142 help=' Theecaccess association, e.g. '142 help='ecaccess association, e.g. ' 143 143 'myUser@genericSftp') 144 144 145 145 parser.add_argument("--installdir", dest="installdir", 146 146 type=none_or_str, default=None, 147 help='Root directory where '148 'flex_extract will be installed to.')147 help='Root directory of the ' 148 'flex_extract installation') 149 149 150 150 # arguments for job submission to ECMWF, only needed by submit.py 151 151 parser.add_argument("--job_template", dest='job_template', 152 152 type=none_or_str, default="job.template", 153 help=' The rudimentary template file to create a batch '154 'job template for submission to ECMWF servers .')153 help='Rudimentary template file to create a batch ' 154 'job template for submission to ECMWF servers') 155 155 156 156 parser.add_argument("--controlfile", dest="controlfile", 157 157 type=none_or_str, default='CONTROL_EA5', 158 help=" The file withall CONTROL parameters.")158 help="A file that contains all CONTROL parameters.") 159 159 160 160 args = parser.parse_args() … … 164 164 165 165 def install_via_gateway(c): 166 '''Prepare data transfer to remote gate and submit a job script which will167 install everything on the remote gate .166 '''Prepare data transfer to remote gateway and submit a job script which will 167 install everything on the remote gateway. 168 168 169 169 Parameters … … 259 259 260 260 def check_install_conditions(c): 261 '''Checks a couple ofnecessary attributes and conditions262 for the installation such as ifthey exist and contain values.261 '''Checks necessary attributes and conditions 262 for the installation, e.g. whether they exist and contain values. 263 263 Otherwise set default values. 264 264 … … 310 310 '''Creates a tarball with all necessary files which need to be sent to the 311 311 installation directory. 312 It does not matter ifthis is local or remote.313 Collects all python files, the Fortran source and makefiles,312 It does not matter whether this is local or remote. 313 Collects all Python files, the Fortran source and makefiles, 314 314 the ECMWF_ENV file, the CONTROL files as well as the 315 315 template files. … … 497 497 ---------- 498 498 makefile : str 499 Name of the makefile which should be used to compile FORTRAN500 CONVERT2program.499 Name of the makefile which should be used to compile the Fortran 500 program. 501 501 502 502 ecuid : str … … 686 686 print(perr.decode()) 687 687 print('Please edit ' + makefile + 688 ' or try another Makefile in the src directory.')688 ' or try another makefile in the src directory.') 689 689 print('Most likely GRIB_API_INCLUDE_DIR, GRIB_API_LIB ' 690 690 'and EMOSLIB must be adapted.') 691 print('Available Makefiles:')692 print(UioFiles(src_path, ' Makefile*'))691 print('Available makefiles:') 692 print(UioFiles(src_path, 'makefile*')) 693 693 sys.exit('Compilation failed!') 694 694 except ValueError as e: 695 print('ERROR: Makefile callfailed:')695 print('ERROR: make of Fortran code failed:') 696 696 print(e) 697 697 else: 698 execute_subprocess(['ls', '-l', 698 execute_subprocess(['ls', '-l', 699 699 os.path.join(src_path, _config.FORTRAN_EXECUTABLE)], 700 700 error_msg='FORTRAN EXECUTABLE COULD NOT BE FOUND!')
Note: See TracChangeset
for help on using the changeset viewer.