def _compile_cpp_file(self, setup_dir): src_file = os.path.join(setup_dir, self.release_file_name) rc = util.compile_cpp_file(self.name, setup_dir, src_file, self.exe_name, self.cpp_compile_opts) if rc != 0: self.log.error('Problem compiling %s.' % self.name) return 1 else: self.log.info('Successfully compiled %s.' % self.name) return self._copy_dir(setup_dir)
def deploy_dotur(app, setup_dir): # a hack to fix headers for gcc 4.3+ richFile = os.path.join(setup_dir, 'richness.h') fileH = open(richFile, 'r') fileC = fileH.readlines() fileH.close() fileH = open(richFile, 'w') fileH.write('#include <cstdlib>\n') for line in fileC: fileH.write(line) fileH.close() otuFile = os.path.join(setup_dir, 'otu.h') fileH = open(otuFile, 'r') fileC = fileH.readlines() fileH.close() fileH = open(otuFile, 'w') fileH.write('#include <cstdlib>\n#include <algorithm>\n') for line in fileC: fileH.write(line) fileH.close() doturFile = os.path.join(setup_dir, 'dotur.C') fileH = open(doturFile, 'r') fileC = fileH.readlines() fileH.close() fileH = open(doturFile, 'w') fileH.write('#include <cstring>\n') for line in fileC: fileH.write(line) fileH.close() srcFile = 'dotur.C' srcFile = os.path.join(setup_dir, srcFile) if app.exe_name: exeFile = app.exe_name else: exeFile = 'dotur' exeFile = os.path.join(setup_dir, exeFile) rc = util.compile_cpp_file('dotur', setup_dir, srcFile, exeFile) if rc != 0: return rc os.rmdir(app.deploy_dir) return util.copytree(setup_dir, app.deploy_dir)