def build(self): """ Program build/update """ # Store common file path in variables zip_url = 'http://www.ipol.im/pub/art/2011/ggm_rpn/' \ + 'random_phase_noise_v1.3.zip' zip_file = self.dl_dir + 'random_phase_noise_v1.3.zip' prog = 'random_phase_noise' bin_file = self.bin_dir + prog sub_dir = os.path.join('random_phase_noise_v1.3', 'src') log_file = self.base_dir + 'build.log' # Get the latest source archive build.download(zip_url, zip_file) # Test if any dest file is missing, or too old if (os.path.isfile(bin_file) and ctime(zip_file) < ctime(bin_file)): cherrypy.log('not rebuild needed', context='BUILD', traceback=False) else: # Extract the archive build.extract(zip_file, self.src_dir) # Build the programs build.run("make -C %s %s" % (self.src_dir + sub_dir, prog), stdout=log_file) # Save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + os.path.join(sub_dir, prog), bin_file) # Cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_url = "http://www.ipol.im/pub/pre/98/Pansharpening.zip" tgz_file = self.dl_dir + "Pansharpening.zip" progs = ["pansharpening_ipol", "imdiff_ipol"] src_bin = dict( [(self.src_dir + os.path.join("Pansharpening_code", prog), self.bin_dir + prog) for prog in progs] ) log_file = self.base_dir + "build.log" # get the latest source archive build.download(tgz_url, tgz_file) # test if any dest file is missing, or too old if all([(os.path.isfile(bin_file) and ctime(tgz_file) < ctime(bin_file)) for bin_file in src_bin.values()]): cherrypy.log("not rebuild needed", context="BUILD", traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the programs build.run("make -j4 -C %s %s" % (self.src_dir + "Pansharpening_code", " ".join(progs)), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) for (src, dst) in src_bin.items(): shutil.copy(src, dst) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_file = self.dl_dir + self.demo_src_filename log_file = self.base_dir + "build.log" # get the latest source archive build.download(self.xlink_src, tgz_file) print "BEFIRE ECTRACT ...." # test if the dest file is missing, or too old if (os.path.isfile(self.bin_dir + 'online_segfinal') and ctime(tgz_file) < ctime(self.bin_dir + 'online_segfinal')): print "NON ECTRACT ...." cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive print "ECTRACT ...." build.extract(tgz_file, self.src_dir) # build the program build.run("cd %s; gcc online_segfinal.c -lm -o online_segfinal;"%(self.src_dir+ self.demo_src_dir)\ , stdout=log_file) print "BUILD OK ...." # save into bin dir shutil.copy( os.path.join(self.src_dir + self.demo_src_dir, "online_segfinal"), self.bin_dir) print "COPY OK ...." # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """"Download and compile EDGES program.""" # store common file path in variables # arced_url = "not available yet" arced_code = "classic_edge_detectors_1.3.zip" tgz_file = self.dl_dir + arced_code prog_file = self.bin_dir + "edges" log_file = self.base_dir + "build.log" # get the latest source archive build.download("http://dev.ipol.im/~juanc/files/ipol/" + arced_code, tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("cd %s && make" % (self.src_dir + "classic_edge_detectors"), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + "classic_edge_detectors/edges", prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ zip_filename = 'blsgsm_v1.0.zip' src_dir_name = 'blsgsm_v1.0' prog_filename = 'blsgsm' # store common file path in variables tgz_file = self.dl_dir + zip_filename prog_file = self.bin_dir + prog_filename log_file = self.base_dir + "build.log" # get the latest source archive build.download('http://www.ipol.im/pub/pre/86/' + \ zip_filename, tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make OMP=1 -j4 -C %s %s" % (self.src_dir + src_dir_name, os.path.join(".", prog_filename)), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + os.path.join(src_dir_name, prog_filename), prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_file = self.dl_dir + self.demo_src_filename log_file = self.base_dir + "build.log" # get the latest source archive build.download(self.xlink_src, tgz_file) print "BEFIRE ECTRACT ...." # test if the dest file is missing, or too old if (os.path.isfile(self.bin_dir+'online_segfinal') and ctime(tgz_file) < ctime(self.bin_dir+'online_segfinal')): print "NON ECTRACT ...." cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive print "ECTRACT ...." build.extract(tgz_file, self.src_dir) # build the program build.run("cd %s; gcc online_segfinal.c -lm -o online_segfinal;"%(self.src_dir+ self.demo_src_dir)\ , stdout=log_file) print "BUILD OK ...." # save into bin dir shutil.copy(os.path.join(self.src_dir+self.demo_src_dir, "online_segfinal"), self.bin_dir) print "COPY OK ...." # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ if not os.path.isdir(self.bin_dir): os.mkdir(self.bin_dir) self._build_rectify() tgz_file = self.dl_dir + "CostVolumeFilter_1.0.tar.gz" # following line to be adapted for IPOL final demo tgz_url = "http://www.ipol.im/pub/pre/78/CostVolumeFilter_1.0.tar.gz" prog_file = self.bin_dir + "costVolumeFilter" log_file = self.base_dir + "build.log" # # get the latest source archive # uncomment next line for IPOL final demo build.download(tgz_url, tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build_dir = (self.src_dir + os.path.join("CostVolumeFilter_1.0", "build") + os.path.sep) os.mkdir(build_dir) build.run("cmake -DCMAKE_BUILD_TYPE:string=Release ..", stdout=log_file, cwd=build_dir) build.run("make -C %s -j4" % build_dir, stdout=log_file) # save into bin dir shutil.copy(build_dir + "costVolumeFilter", prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """"Download and compile EDGES program.""" # store common file path in variables tgz_file = self.dl_dir + "classic_edge_detectors_1.0.zip" prog_file = self.bin_dir + "edges" log_file = self.base_dir + "build.log" # get the latest source archive build.download("http://www.ipol.im/pub/pre/35/" + "classic_edge_detectors_1.0.zip", tgz_file) # test if the dest file is missing, or too old if os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file): cherrypy.log("not rebuild needed", context="BUILD", traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("cd %s && make" % (self.src_dir + "classic_edge_detectors_1.0"), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + "classic_edge_detectors_1.0/edges", prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ if not os.path.isdir(self.bin_dir): os.mkdir(self.bin_dir) self._build_rectify() tgz_file = self.dl_dir + "CostVolumeFilter_1.0.tar.gz" # following line to be adapted for IPOL final demo tgz_url = "http://www.ipol.im/pub/pre/78/CostVolumeFilter_1.0.tar.gz" prog_file = self.bin_dir + "costVolumeFilter" log_file = self.base_dir + "build.log" # # get the latest source archive # uncomment next line for IPOL final demo build.download(tgz_url, tgz_file) # test if the dest file is missing, or too old if os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file): cherrypy.log("no rebuild needed", context="BUILD", traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build_dir = self.src_dir + os.path.join("CostVolumeFilter_1.0", "build") + os.path.sep os.mkdir(build_dir) build.run("cmake -DCMAKE_BUILD_TYPE:string=Release ..", stdout=log_file, cwd=build_dir) build.run("make -C %s -j4" % build_dir, stdout=log_file) # save into bin dir shutil.copy(build_dir + "costVolumeFilter", prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build_algo(self): """ program build/update """ ## store common file path in variables tgz_file = self.dl_dir + "tvl1flow_3.tar.gz" prog_file = self.bin_dir + "tvl1flow" log_file = self.base_dir + "build.log" ## get the latest source archive build.download(app.xlink_src, tgz_file) ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make -C %s" % (self.src_dir + "tvl1flow_3"), stdout=log_file) # save into bin dir #if os.path.isdir(self.bin_dir): # shutil.rmtree(self.bin_dir) #try: shutil.copy(self.src_dir + os.path.join("tvl1flow_3", "tvl1flow"), prog_file) #except: # print("some error occurred copying files") # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """"Download and compile EDGES program.""" # store common file path in variables tgz_file = self.dl_dir + "classic_edge_detectors_1.0.zip" prog_file = self.bin_dir + "edges" log_file = self.base_dir + "build.log" # get the latest source archive build.download("http://www.ipol.im/pub/pre/35/" + "classic_edge_detectors_1.0.zip", tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("cd %s && make" % (self.src_dir + "classic_edge_detectors_1.0"), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + "classic_edge_detectors_1.0/edges", prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ if not os.path.isdir(self.bin_dir): os.mkdir(self.bin_dir) self._build_rectify() KZ2_tgz_file = self.dl_dir + "KZ2.tar.gz" #*************To be corrected later************ KZ2_tgz_url = "http://www.ipol.im/pub/pre/97/" \ + "KZ2.tar.gz" KZ2_prog_file = self.bin_dir + "KZ2" KZ2_log_file = self.base_dir + "build_KZ2.log" # get the latest source archive build.download(KZ2_tgz_url, KZ2_tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(KZ2_prog_file) and ctime(KZ2_tgz_file) < ctime(KZ2_prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) return # extract the archive build.extract(KZ2_tgz_file, self.src_dir) build_dir = (self.src_dir + os.path.join("KZ2", "build") + os.path.sep) os.mkdir(build_dir) # build the program build.run("cmake -D CMAKE_BUILD_TYPE:string=Release ../src", stdout=KZ2_log_file, cwd=build_dir) build.run("make -j4 -C %s" % build_dir, stdout=KZ2_log_file) # save into bin dir shutil.copy(build_dir + "KZ2", KZ2_prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ zip_filename = "nl-bayes_20130617.zip" src_dir_name = "nl-bayes_20130617" prog_filename = "NL_Bayes" # store common file path in variables zip_file = self.dl_dir + zip_filename prog_file = self.bin_dir + prog_filename log_file = self.base_dir + "build.log" # get the latest source archive build.download("http://www.ipol.im/pub/art/2013/16/" + zip_filename, zip_file) # test if the dest file is missing, or too old if os.path.isfile(prog_file) and ctime(zip_file) < ctime(prog_file): cherrypy.log("not rebuild needed", context="BUILD", traceback=False) else: # extract the archive build.extract(zip_file, self.src_dir) # build the program build.run( "make OMP=1 -j4 -C %s %s" % (self.src_dir + src_dir_name, os.path.join(".", prog_filename)), stdout=log_file, ) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + os.path.join(src_dir_name, prog_filename), prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_url = "http://www.ipol.im/pub/pre/84/screened_poisson.tgz" tgz_file = self.dl_dir + "screened_poisson.tgz" prog = "screened_poisson" bin_file = self.bin_dir + prog build_file = self.src_dir + os.path.join("screened_poisson", prog) log_file = self.base_dir + "build.log" # get the latest source archive build.download(tgz_url, tgz_file) # test if any dest file is missing, or too old if (os.path.isfile(bin_file) and ctime(tgz_file) < ctime(bin_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the programs build.run("make -C %s %s" % (self.src_dir + "screened_poisson", prog), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(build_file, bin_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def _build_rectify(self): """ build/update of rectify program """ # store common file path in variables archive = "rectify-quasi-euclidean_20140626.tar.gz" rectify_tgz_url = self.xlink_article + archive rectify_tgz_file = self.dl_dir + archive build.download(rectify_tgz_url, rectify_tgz_file) binary = self.bin_dir + "rectifyQuasiEuclidean" if os.path.isfile(binary) and ctime(rectify_tgz_file) < ctime(binary): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) return # extract the archive build.extract(rectify_tgz_file, self.src_dir) # build the program build_dir = (self.src_dir + os.path.join("rectify-quasi-euclidean_20140626", "build") + os.path.sep) binary = build_dir + os.path.join("bin", "rectifyQuasiEuclidean") os.mkdir(build_dir) log_file = self.base_dir + "build_Rectify.log" build.run("cmake -D CMAKE_BUILD_TYPE:string=Release ../src", stdout=log_file, cwd=build_dir) build.run("make -C " + build_dir, stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(binary, self.bin_dir) shutil.copy(build_dir + os.path.join("bin", "siftMatch"), self.bin_dir) shutil.copy(build_dir + os.path.join("bin", "warp"), self.bin_dir) # cleanup the source dir shutil.rmtree(self.src_dir)
def build_algo(self): """ program build/update """ ### store common file path in variables zip_file = self.dl_dir + "filter_pca-0.9.2.zip" prog_file = self.bin_dir + "filter_pca.exe" log_file = self.base_dir + "build.log" ## get the latest source archive build.download(app.xlink_src, zip_file) ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(zip_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(zip_file, self.src_dir) # build the program build.run("make -C %s" % (self.src_dir +"filter_pca-0.9.2"), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) try: shutil.copy(self.src_dir + os.path.join("filter_pca-0.9.2", "filter_pca.exe"), prog_file) except IOError, e: print("Unable to copy file. %s" % e) # cleanup the source dir shutil.rmtree(self.src_dir)
def build(self): """ program build/update """ ### store common file path in variables zip_file = self.dl_dir + "MaoGilles_201307.zip" prog_file = self.bin_dir + "ShiftMaoGilles" log_file = self.base_dir + "build.log" ### get the latest source archive build.download("http://www.ipol.im/pub/art/2013/46/MaoGilles_201307.zip" , zip_file) ### test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(zip_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(zip_file, self.src_dir) # build the program build.run("make OPENMP=1 -C %s" % (self.src_dir +os.path.join("MaoGilles_201307")), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) try: os.mkdir(self.bin_dir) shutil.copy(self.src_dir + "MaoGilles_201307/ShiftMaoGilles", prog_file) except IOError, e: print("Unable to copy file. %s" % e) # cleanup the source dir shutil.rmtree(self.src_dir)
def build_algo(self): """ program build/update """ ## store common file path in variables tgz_file = self.dl_dir + "centroid-2.tar.gz" prog_file = self.bin_dir + "centroid" log_file = self.base_dir + "build.log" ## get the latest source archive build.download(app.xlink_src, tgz_file) ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program srcdir = self.src_dir + "centroid-2/" build.run("make", stdout=log_file, cwd=srcdir) cherrypy.log("before copy", context='BUILD', traceback=False) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(srcdir + "centroid", self.bin_dir + "centroid") shutil.copy(srcdir + "imcombine", self.bin_dir + "imcombine") shutil.copy(srcdir + "demo.sh", self.bin_dir + "demo.sh") cherrypy.log("copy ok", context='BUILD', traceback=False) return
def build_demoUtils(self): """ built the demo auxiliary programs (stored with the demo) """ ## store common file path in variables tgz_file = self.base_dir + "support/demoUtils.tar.gz" prog_file = self.bin_dir + "plambda" log_file = self.base_dir + "build_utils.log" ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("cd %s; cmake ." % (self.src_dir +"demoUtils"), stdout=log_file) build.run("make -C %s" % (self.src_dir +"demoUtils"), stdout=log_file) # save into bin dir #try: import glob for f in glob.glob(os.path.join(self.src_dir, "demoUtils", "bin", "*")): shutil.copy(f, self.bin_dir) #except: # print("some error occurred copying files") # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ if not os.path.isdir(self.bin_dir): os.mkdir(self.bin_dir) self._build_rectify() archive = "kz2_1.0.tar.gz" kz2_tgz_url = self.xlink_article + archive kz2_tgz_file = self.dl_dir + archive binary = self.bin_dir + "KZ2" # get the latest source archive build.download(kz2_tgz_url, kz2_tgz_file) # test if the dest file is missing, or too old if os.path.isfile(binary) and ctime(kz2_tgz_file) < ctime(binary): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) return # extract the archive build.extract(kz2_tgz_file, self.src_dir) build_dir = self.src_dir+os.path.join("kz2_1.0", "build")+os.path.sep os.mkdir(build_dir) log_file = self.base_dir + "build_KZ2.log" build.run("cmake -D CMAKE_BUILD_TYPE:string=Release ../src", stdout=log_file, cwd=build_dir) build.run("make -j4 -C %s" % build_dir, stdout=log_file) # save into bin dir shutil.copy(build_dir + "KZ2", binary) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build_algo(self): """ program build/update """ ## store common file path in variables tgz_file = self.dl_dir + "sms_optic_flow_2.0.tar.gz" prog_file = self.bin_dir + "brox2004" log_file = self.base_dir + "build.log" ## get the latest source archive build.download(app.xlink_src, tgz_file) ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make -C %s" % (self.src_dir + \ "sms_optic_flow_2.0/spatial"), stdout=log_file) # save into bin dir if not os.path.isdir(self.bin_dir): os.mkdir(self.bin_dir) shutil.copy( self.src_dir + os.path.join("sms_optic_flow_2.0/spatial", "main"), prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build_demo(self): """ download and build the demo auxiliary programs """ ## store common file path in variables tgz_file = self.dl_dir + "imscript.tar.gz" prog_file = self.bin_dir + "plambda" log_file = self.base_dir + "build_imscript.log" ## get the latest source archive build.download(app.xlink_src_demo, tgz_file) ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make -j CFLAGS=-O3 -C %s" % (self.src_dir + "imscript"), stdout=log_file) # save into bin dir for f in glob.glob( os.path.join(self.src_dir, "imscript", "bin", "*")): shutil.copy(f, self.bin_dir) # copy scripts from "demo" dir for f in glob.glob(os.path.join(self.base_dir, "demo", "*")): shutil.copy(f, self.bin_dir) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_url = self.xlink_src tgz_file = self.dl_dir + "MSR_original.tgz" prog_file = self.bin_dir + "MSR_original" log_file = self.base_dir + "build.log" # get the latest source archive build.download(tgz_url, tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make -j4 -C %s MSR_original" % (self.src_dir + "MSR_original"), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy( self.src_dir + os.path.join("MSR_original", "MSR_original"), prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_file = self.dl_dir + "io_png.tar.gz" prog_file = self.bin_dir + "axpb" log_file = self.base_dir + "build.log" # get the latest source archive build.download("https://tools.ipol.im/wiki/doc/" + "io_png.tar.gz" , tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make -j4 -C %s %s" % (self.src_dir + "io_png", os.path.join("example", "axpb")), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + os.path.join("io_png", "example", "axpb"), prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build_algo(self): """ program build/update """ ## store common file path in variables tgz_file = self.dl_dir + "phs_3.tar.gz" prog_file = self.bin_dir + "phs" log_file = self.base_dir + "build.log" ## get the latest source archive build.download(app.xlink_src, tgz_file) ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make -C %s" % (self.src_dir + "phs_3"), stdout=log_file) # save into bin dir #if os.path.isdir(self.bin_dir): # shutil.rmtree(self.bin_dir) try: shutil.copy( self.src_dir + os.path.join("phs_3", "horn_schunck_pyramidal"), prog_file) except IOError, e: print("Unable to copy file. %s" % e) # cleanup the source dir shutil.rmtree(self.src_dir)
def build(self): """ program build/update """ if not os.path.isdir(self.bin_dir): os.mkdir(self.bin_dir) # store common file path in variables surf_zip_file = self.dl_dir + "demo_SURF_src.zip" surf_zip_url = "http://www.ipol.im/pub/pre/69/demo_SURF_src.zip" surf_prog_file = self.bin_dir + "surf" surf_log_file = self.base_dir + "build_surf.log" # get the latest source archive build.download(surf_zip_url, surf_zip_file) # SURF # test if the dest file is missing, or too old if os.path.isfile(surf_prog_file) and ctime(surf_zip_file) < ctime(surf_prog_file): cherrypy.log("not rebuild needed", context="BUILD", traceback=False) else: # extract the archive build.extract(surf_zip_file, self.src_dir) # build the program build.run("make -j4 -C %s" % (self.src_dir + "demo_SURF_src"), stdout=surf_log_file) # save into bin dir shutil.copy(self.src_dir + os.path.join("demo_SURF_src", "bin", "surf"), surf_prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ ## store common file path in variables tgz_file = self.dl_dir + "clg-87dfe8b.tar.gz" prog_file = self.bin_dir + "test_clg_flow" log_file = self.base_dir + "build_clg.log" ## get the latest source archive build.download("http://dev.ipol.im/git/?p=haldos/clg.git;a=snapshot;h=87dfe8b1454e0602df8c507a8e7417c3b0a94dcb;sf=tgz", tgz_file) ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("cd %s && cmake . && make" % (self.src_dir + "clg-87dfe8b"), stdout=log_file) print("make complete") # save into bin dir #if os.path.isdir(self.bin_dir): # shutil.rmtree(self.bin_dir) #os.mkdir(self.bin_dir) shutil.copy(self.src_dir + os.path.join("clg-87dfe8b", "bin") + "/test_clg_flow", prog_file) print("%s copied to bin directory" % prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) # cleanup the dl dir shutil.rmtree(self.dl_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_file = self.dl_dir + "threshold.tar.gz" prog_file = self.bin_dir + "threshold" log_file = self.base_dir + "build.log" # get the latest source archive build.download("http://iie.fing.edu.uy/~haldos/ipol/" + "threshold.tar.gz", tgz_file) # test if the dest file is missing, or too old if os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file): cherrypy.log("not rebuild needed", context="BUILD", traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program # build.run("make",self.src_dir + "threshold") build.run("make -C %s %s" % (self.src_dir + "threshold", "threshold"), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + "threshold/threshold", prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ Program build/update """ # Store common file path in variables tgz_url = "http://www.ipol.im/pub/art/2011/g_zwld/src.tar.gz" tgz_file = self.dl_dir + "src.tar.gz" progs = ["dmzhangwu", "dmbilinear", "mosaic", "imdiff"] sub_dir = "dmzhangwu-src" src_bin = dict([(self.src_dir + os.path.join(sub_dir, prog), self.bin_dir + prog) for prog in progs]) log_file = self.base_dir + "build.log" # Get the latest source archive build.download(tgz_url, tgz_file) # Test if any dest file is missing, or too old if all([(os.path.isfile(bin_file) and ctime(tgz_file) < ctime(bin_file)) for bin_file in src_bin.values()]): cherrypy.log("not rebuild needed", context="BUILD", traceback=False) else: # Extract the archive build.extract(tgz_file, self.src_dir) # Build the programs build.run( "make -C %s %s" % (self.src_dir + sub_dir, " ".join(progs)) + " --makefile=makefile.gcc" + " CXX='ccache c++' -j4", stdout=log_file, ) # Save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) for (src, dst) in src_bin.items(): shutil.copy(src, dst) # Cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ if not os.path.isdir(self.bin_dir): os.mkdir(self.bin_dir) # store common file path in variables asift_tgz_file = self.dl_dir + "demo_ASIFT_src.tar.gz" asift_tgz_url = \ "http://www.ipol.im/pub/art/2011/my-asift/demo_ASIFT_src.tar.gz" asift_prog_file = self.bin_dir + "asift" asift_log_file = self.base_dir + "build_asift.log" sift_tgz_file = self.dl_dir + "SIFT_png.tar.gz" sift_tgz_url = \ "http://www.ipol.im/pub/art/2011/my-asift/SIFT_png.tar.gz" sift_prog_file = self.bin_dir + "sift" sift_log_file = self.base_dir + "build_sift.log" # get the latest source archive build.download(asift_tgz_url, asift_tgz_file) build.download(sift_tgz_url, sift_tgz_file) # ASIFT # test if the dest file is missing, or too old if (os.path.isfile(asift_prog_file) and ctime(asift_tgz_file) < ctime(asift_prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(asift_tgz_file, self.src_dir) # build the program build.run("make -j4 -C %s demo_ASIFT OMP=1" % (self.src_dir + "demo_ASIFT_src"), stdout=asift_log_file) # save into bin dir shutil.copy( self.src_dir + os.path.join("demo_ASIFT_src", "demo_ASIFT"), asift_prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) # SIFT # test if the dest file is missing, or too old if (os.path.isfile(sift_prog_file) and ctime(sift_tgz_file) < ctime(sift_prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(sift_tgz_file, self.src_dir) # build the program build.run("make -j4 -C %s demo_SIFT OMP=1" % (self.src_dir + "SIFT_png"), stdout=sift_log_file) # save into bin dir shutil.copy(self.src_dir + os.path.join("SIFT_png", "demo_SIFT"), sift_prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_url = "http://www.ipol.im/pub/art/2011/gl_lcc/LCC.tar.gz" tgz_file = self.dl_dir + "LCC.tar.gz" prog_file = self.bin_dir + "localcolorcorrection" log_file = self.base_dir + "build.log" # get the latest source archive build.download(tgz_url, tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make -j4 -C %s localcolorcorrection" % (self.src_dir + "LCC"), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + os.path.join("LCC", "localcolorcorrection"), prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build_algo(self): """ program build/update """ ## store common file path in variables tgz_file = self.dl_dir + "sms_optic_flow_2.0.tar.gz" prog_file = self.bin_dir + "brox2004" log_file = self.base_dir + "build.log" ## get the latest source archive build.download(app.xlink_src, tgz_file) ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make -C %s" % (self.src_dir + \ "sms_optic_flow_2.0/spatial"), stdout=log_file) # save into bin dir if not os.path.isdir(self.bin_dir): os.mkdir(self.bin_dir) shutil.copy(self.src_dir + os.path.join("sms_optic_flow_2.0/spatial", "main"), prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ version = 4 zip_filename = 'ponomarenko_v%d.zip' % ((version)) src_dir_name = 'ponomarenko_v%d' % ((version)) prog_filename = 'ponomarenko' # store common file path in variables tgz_file = self.dl_dir + zip_filename prog_file = self.bin_dir + prog_filename log_file = self.base_dir + "build.log" # get the latest source archive build.download('http://www.ipol.im/pub/art/2013/45/' + \ zip_filename, tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # delete and create bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) # build the programs programs = ('fnoise', 'subscale', 'ponomarenko') for program in programs: # build build.run("make -j4 -C %s %s" % (os.path.join(self.src_dir, src_dir_name, program), os.path.join(".", program)), stdout=log_file) # move binary to bin dir shutil.copy(os.path.join(self.src_dir, \ src_dir_name, \ program, program), os.path.join(self.bin_dir, program)) # Move scripts to the base dir corr_dirs = ['../scripts'] for corr_dir in corr_dirs: shutil.move(os.path.join(self.src_dir, src_dir_name, \ prog_filename, corr_dir), \ os.path.join(src_dir_name, self.base_dir)) # Give exec permission to the script os.chmod( os.path.join(src_dir_name, self.base_dir, "scripts", "writeNoiseCurve.sh"), stat.S_IREAD | stat.S_IEXEC) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build_demoUtils(self): """ built the demo auxiliary programs (stored with the demo) """ ## store common file path in variables tgz_file = self.base_dir + "support/demoUtils.tar.gz" prog_file = self.bin_dir + "plambda" log_file = self.base_dir + "build_utils.log" ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("cd %s; cmake ." % (self.src_dir + "demoUtils"), stdout=log_file) build.run("make -C %s" % (self.src_dir + "demoUtils"), stdout=log_file) # save into bin dir #try: import glob for f in glob.glob( os.path.join(self.src_dir, "demoUtils", "bin", "*")): shutil.copy(f, self.bin_dir) #except: # print("some error occurred copying files") # cleanup the source dir shutil.rmtree(self.src_dir) return
def build_demo(self): """ download and built the demo auxiliary programs """ ## store common file path in variables tgz_file = self.dl_dir + "imscript.tar.gz" prog_file = self.bin_dir + "plambda" log_file = self.base_dir + "build_imscript.log" ## get the latest source archive build.download(app.xlink_src_demo, tgz_file) ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make -j CFLAGS=-O3 -C %s" % (self.src_dir +"imscript"), stdout=log_file) # save into bin dir #try: for f in glob.glob(os.path.join(self.src_dir, "imscript", "bin", "*")): shutil.copy(f, self.bin_dir) #except: # print("some error occurred copying files") # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_file = self.dl_dir + "threshold.tar.gz" prog_file = self.bin_dir + "threshold" log_file = self.base_dir + "build.log" # get the latest source archive build.download( "http://iie.fing.edu.uy/~haldos/ipol/" + "threshold.tar.gz", tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program # build.run("make",self.src_dir + "threshold") build.run("make -C %s %s" % (self.src_dir + "threshold", "threshold"), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + "threshold/threshold", prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build_algo(self): """ program build/update """ ## store common file path in variables tgz_file = self.dl_dir + "phs_3.tar.gz" prog_file = self.bin_dir + "phs" log_file = self.base_dir + "build.log" ## get the latest source archive build.download(app.xlink_src, tgz_file) ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make -C %s" % (self.src_dir +"phs_3"), stdout=log_file) # save into bin dir #if os.path.isdir(self.bin_dir): # shutil.rmtree(self.bin_dir) try: shutil.copy(self.src_dir + os.path.join("phs_3", "horn_schunck_pyramidal"), prog_file) except IOError, e: print("Unable to copy file. %s" % e) # cleanup the source dir shutil.rmtree(self.src_dir)
def build(self): """ program build/update """ # store common file path in variables tgz_url = self.xlink_src tgz_file = self.dl_dir + "MSR_original.tgz" prog_file = self.bin_dir + "MSR_original" log_file = self.base_dir + "build.log" # get the latest source archive build.download(tgz_url, tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make -j4 -C %s MSR_original" % (self.src_dir + "MSR_original"), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + os.path.join("MSR_original", "MSR_original"), prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_file = self.dl_dir + "two-photos-psf-estim.tar.gz" prog_file = self.bin_dir + "two_photos_psf_estim" log_file = self.base_dir + "build.log" # get the latest source archive build.download("http://www.ipol.im/pub/art/2013/77/" + "two-photos-psf-estim.tar.gz", tgz_file) # test if the dest file is missing, or too old # dont rebuild the file if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)) : cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: #extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make OMP=1 -j4 -C %s two_photos_psf_estim" % (self.src_dir + "two-photos-psf-estim"), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + os.path.join("two-photos-psf-estim", "two_photos_psf_estim"), prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build_algo(self): """ program build/update """ ## store common file path in variables tgz_file = self.dl_dir + "tvl1flow_3.tar.gz" prog_file = self.bin_dir + "tvl1flow" log_file = self.base_dir + "build.log" ## get the latest source archive build.download(app.xlink_src, tgz_file) ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make -C %s" % (self.src_dir +"tvl1flow_3"), stdout=log_file) # save into bin dir #if os.path.isdir(self.bin_dir): # shutil.rmtree(self.bin_dir) #try: shutil.copy(self.src_dir + os.path.join("tvl1flow_3", "tvl1flow"), prog_file) #except: # print("some error occurred copying files") # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ if not os.path.isdir(self.bin_dir): os.mkdir(self.bin_dir) # MCM # store common file path in variables mcm_tgz_file = self.dl_dir + "fds_mcm.tar.gz" mcm_tgz_url = \ "http://www.ipol.im/pub/art/2011/cm_fds/fds_mcm.tar.gz" mcm_prog_file = self.bin_dir + "mcm" mcm_log = self.base_dir + "build_mcm.log" # get the latest source archive build.download(mcm_tgz_url, mcm_tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(mcm_prog_file) and ctime(mcm_tgz_file) < ctime(mcm_prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(mcm_tgz_file, self.src_dir) # build the program build.run("make -j4 -C %s mcm OMP=1" % (self.src_dir + os.path.join("fds_mcm", "mcm")), stdout=mcm_log) # save into bin dir shutil.copy(self.src_dir + os.path.join("fds_mcm", "mcm", "mcm"), mcm_prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) # AMSS # store common file path in variables amss_tgz_file = self.dl_dir + "fds_amss.tar.gz" amss_tgz_url = \ "http://www.ipol.im/pub/art/2011/cm_fds/fds_amss.tar.gz" amss_prog_file = self.bin_dir + "amss" amss_log = self.base_dir + "build_amss.log" # get the latest source archive build.download(amss_tgz_url, amss_tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(amss_prog_file) and ctime(amss_tgz_file) < ctime(amss_prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(amss_tgz_file, self.src_dir) # build the program build.run("make -j4 -C %s amss OMP=1" % (self.src_dir + os.path.join("fds_amss", "amss")), stdout=amss_log) # save into bin dir shutil.copy(self.src_dir + os.path.join("fds_amss", "amss", "amss"), amss_prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_file = self.dl_dir + self.demo_src_filename prog_names = ["meaningfulScaleEstim"] script_names = ["applyMS.sh", "convert.sh", "convertFig.sh", \ "transformBG.sh"] prog_bin_files = [] for f in prog_names: prog_bin_files.append(self.bin_dir + f) log_file = self.base_dir + "build.log" # get the latest source archive build.download(self.xlink_src, tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_bin_files[0]) and ctime(tgz_file) < ctime(prog_bin_files[0])): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("mkdir %s;" %(self.src_dir+ self.demo_src_dir+"/build"), \ stdout=log_file) build.run("cd %s; cmake .. -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=false ; make -j 4" %(self.src_dir+ \ self.demo_src_dir+\ "/build"), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + self.demo_src_dir + \ "/build/demoIPOL/meaningfulScaleEstim", self.bin_dir) for f in script_names: shutil.copy(self.src_dir + os.path.join(self.demo_src_dir, \ "demoIPOL", f), self.bin_dir) # copy annex file : pgm2freeman (extraction of contours) shutil.copy(self.src_dir + self.demo_src_dir+ \ "/build/bin/pgm2freeman", self.bin_dir) # copy Dynamic lib shutil.copy(self.src_dir + self.demo_src_dir+ \ "/build/src/libImaGene.so", self.bin_dir) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_file = self.dl_dir + self.demo_src_filename prog_names = ["pgm2freeman", "displayContours", "extract3D"] script_names = ["convert.sh", "convertFig.sh", "transformBG.sh"] prog_bin_files = [] for a_prog in prog_names: prog_bin_files.append(self.bin_dir+ a_prog) log_file = self.base_dir + "build.log" # get the latest source archive build.download(self.xlink_src, tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_bin_files[0]) and ctime(tgz_file) < ctime(prog_bin_files[0])): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program os.mkdir(self.src_dir+ self.demo_src_dir+ "/build") build.run("cd %s; cmake .. -DBUILD_EXAMPLES=false \ -DCMAKE_BUILD_TYPE=Release \ -DDGTAL_BUILD_TESTING=false;\ make -j 4"%(self.src_dir+ self.demo_src_dir + "/build")\ , stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) for i in range(0, len(prog_bin_files)): shutil.copy(self.src_dir + os.path.join(self.demo_src_dir, "build", "demoIPOL_ExtrConnectedReg", prog_names[i]), prog_bin_files[i]) for s_name in script_names: shutil.copy(self.src_dir+ os.path.join(self.demo_src_dir, "demoIPOL_ExtrConnectedReg", s_name), self.bin_dir) # copy Dynamic lib shutil.copy(self.src_dir +self.demo_src_dir+ "/build/src/libDGtal.so", self.bin_dir) shutil.copy(self.src_dir +self.demo_src_dir+ "/build/src/libDGtalIO.so", self.bin_dir) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ if not os.path.isdir(self.bin_dir): os.mkdir(self.bin_dir) # store common file path in variables asift_tgz_file = self.dl_dir + "demo_ASIFT_src.tar.gz" asift_tgz_url = \ "http://www.ipol.im/pub/art/2011/my-asift/demo_ASIFT_src.tar.gz" asift_prog_file = self.bin_dir + "asift" asift_log_file = self.base_dir + "build_asift.log" sift_tgz_file = self.dl_dir + "SIFT_png.tar.gz" sift_tgz_url = \ "http://www.ipol.im/pub/art/2011/my-asift/SIFT_png.tar.gz" sift_prog_file = self.bin_dir + "sift" sift_log_file = self.base_dir + "build_sift.log" # get the latest source archive build.download(asift_tgz_url, asift_tgz_file) build.download(sift_tgz_url, sift_tgz_file) # ASIFT # test if the dest file is missing, or too old if (os.path.isfile(asift_prog_file) and ctime(asift_tgz_file) < ctime(asift_prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(asift_tgz_file, self.src_dir) # build the program build.run("make -j4 -C %s demo_ASIFT OMP=1" % (self.src_dir + "demo_ASIFT_src"), stdout=asift_log_file) # save into bin dir shutil.copy(self.src_dir + os.path.join("demo_ASIFT_src", "demo_ASIFT"), asift_prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) # SIFT # test if the dest file is missing, or too old if (os.path.isfile(sift_prog_file) and ctime(sift_tgz_file) < ctime(sift_prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(sift_tgz_file, self.src_dir) # build the program build.run("make -j4 -C %s demo_SIFT OMP=1" % (self.src_dir + "SIFT_png"), stdout=sift_log_file) # save into bin dir shutil.copy(self.src_dir + os.path.join("SIFT_png", "demo_SIFT"), sift_prog_file) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_file = self.dl_dir + self.demo_src_filename prog_names = ["meaningfulScaleEstim"] script_names = ["applyMS.sh", "convert.sh", "convertFig.sh", \ "transformBG.sh", "sed.sh"] prog_bin_files = [] for f in prog_names: prog_bin_files.append(self.bin_dir+ f) log_file = self.base_dir + "build.log" # get the latest source archive build.download(self.xlink_src, tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_bin_files[0]) and ctime(tgz_file) < ctime(prog_bin_files[0])): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("mkdir %s;" %(self.src_dir+ self.demo_src_dir+"/build"), \ stdout=log_file) build.run("cd %s; cmake .. -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=false ; make -j 4" %(self.src_dir+ \ self.demo_src_dir+\ "/build"), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) shutil.copy(self.src_dir + self.demo_src_dir + \ "/build/demoIPOL/meaningfulScaleEstim", self.bin_dir) for f in script_names : shutil.copy(self.src_dir + os.path.join(self.demo_src_dir, \ "demoIPOL", f), self.bin_dir) # copy annex file : pgm2freeman (extraction of contours) shutil.copy(self.src_dir + self.demo_src_dir+ \ "/build/bin/pgm2freeman", self.bin_dir) # copy Dynamic lib shutil.copy(self.src_dir + self.demo_src_dir+ \ "/build/src/libImaGene.so", self.bin_dir) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ # store common file path in variables tgz_file = self.dl_dir + "LUTBasedNSDistanceTransform.tgz" prog_names = ["LUTBasedNSDistanceTransform"] script_names = ["convert.sh"] prog_bin_files = [] for f in prog_names: prog_bin_files.append(self.bin_dir + f) log_file = self.base_dir + "build.log" # get the latest source archive print("Starting download \n") build.download(self.xlink_src, tgz_file) print("download ended... \n") # test if the dest file is missing, or too old if (os.path.isfile(prog_bin_files[0]) and ctime(tgz_file) < ctime(prog_bin_files[0])): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("mkdir %s; " %(self.src_dir+\ "LUTBasedNSDistanceTransform/build") , stdout=log_file) build.run("cd %s; cmake .. -DWITH_PNG=true -DWITH_NETPBM=false ;\ make -j 4" %(self.src_dir+"LUTBasedNSDistanceTransform/build"), \ stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) for i in range(0, len(prog_bin_files)): shutil.copy(self.src_dir + \ os.path.join("LUTBasedNSDistanceTransform/build", \ prog_names[i]), prog_bin_files[i]) for f in script_names: shutil.copy(self.src_dir + \ os.path.join("LUTBasedNSDistanceTransform/ScriptDemoIPOL", \ f), self.bin_dir) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ zip_filename = 'gaussconv_20140515.zip' src_dir_name = 'gaussconv_20140515/' prog_filename1 = 'demo_gaussconv_dct' prog_filename2 = 'demo_gaussconv_dft' prog_filename3 = 'demo_gaussconv_lindeberg' prog_filename4 = 'demo_gaussconv_sampled_kernel' # store common file path in variables tgz_file = self.dl_dir + zip_filename prog_file = self.bin_dir + prog_filename1 log_file = self.base_dir + "build.log" # get the latest source archive build.download(app.xlink_src, tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("make -j4 -C %s" % (self.src_dir + src_dir_name), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) # copy all the programs to the bin dir shutil.copy(self.src_dir + \ os.path.join(os.path.join(src_dir_name, 'bin'), prog_filename1), os.path.join(self.bin_dir, prog_filename1)) shutil.copy(self.src_dir + \ os.path.join(os.path.join(src_dir_name, 'bin'), prog_filename2), os.path.join(self.bin_dir, prog_filename2)) shutil.copy(self.src_dir + \ os.path.join(os.path.join(src_dir_name, 'bin'), prog_filename3), os.path.join(self.bin_dir, prog_filename3)) shutil.copy(self.src_dir + \ os.path.join(os.path.join(src_dir_name, 'bin'), prog_filename4), os.path.join(self.bin_dir, prog_filename4)) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ if not os.path.isdir(self.bin_dir): os.mkdir(self.bin_dir) if not os.path.isdir(self.dl_dir): os.mkdir(self.dl_dir) # store common file path in variables progs = ['lens_distortion_correction_division_model_1p'] sub_dir = '' src_bin = dict([(self.src_dir + os.path.join(sub_dir, prog), self.bin_dir + prog) for prog in progs]) # store common file path in variables tgz_url = "http://www.ipol.im/pub/pre/106/" \ + "ldm_q1p.zip" tgz_file = self.dl_dir + "ldm_q1p.zip" log_file = self.base_dir + "build_ldm_q1p.zip.log" # Get the latest source archive build.download(tgz_url, tgz_file) # Test if any dest file is missing, or too old if all([(os.path.isfile(bin_file) and ctime(tgz_file) < ctime(bin_file)) for bin_file in src_bin.values()]): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # Build the programs make_command = "make" + " -j4 -C %s %s " build.run(make_command % (self.src_dir + sub_dir, \ " ".join(progs)), stdout=log_file) # Save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) for (src, dst) in src_bin.items(): shutil.copy(src, dst) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build_algo(self): """ program build/update """ ## store common file path in variables tgz_file = self.dl_dir + "algo.tgz" prog_file = self.bin_dir + "simplestereo" progBM_file = self.bin_dir + "simplebm" log_file = self.base_dir + "build.log" ## get the latest source archive build.download(app.xlink_src, tgz_file) ## test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("no rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("cd %s; cmake ." % (self.src_dir + "intimagebm_1"), stdout=log_file) build.run("make -C %s" % (self.src_dir + "intimagebm_1"), stdout=log_file) # Create bin dir (delete the previous one if exists) if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) # save into bin dir #if os.path.isdir(self.bin_dir): # shutil.rmtree(self.bin_dir) #try: shutil.copy( self.src_dir + os.path.join("intimagebm_1", "simplestereo"), prog_file) shutil.copy( self.src_dir + os.path.join("intimagebm_1", "simplebm"), progBM_file) #except: # print("some error occurred copying files") # cleanup the source dir shutil.rmtree(self.src_dir) # link all the scripts to the bin dir import glob for file in glob.glob(os.path.join(self.base_dir, 'scripts/*')): os.symlink(file, os.path.join(self.bin_dir, os.path.basename(file))) return
def build(self): """ program build/update """ # store common file path in variables tgz_file = self.dl_dir + self.demo_src_filename prog_names = ["ipolDemo"] script_names = ["convert.sh", "displaySegments.sh", "displaySegmentsInteract.sh"] prog_bin_files = [] for f in prog_names: prog_bin_files.append(self.bin_dir+ f) log_file = self.base_dir + "build.log" # get the latest source archive build.download(self.xlink_src, tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_bin_files[0]) and ctime(tgz_file) < ctime(prog_bin_files[0])): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # build the program build.run("cd %s; qmake ; make " %(self.src_dir+"FBSD-master/IPOLdemo"), stdout=log_file) # save into bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) for i in range(0, len(prog_bin_files)) : shutil.copy(self.src_dir + os.path.join("FBSD-master/IPOLdemo", \ prog_names[i]), prog_bin_files[i]) for f in script_names : shutil.copy(self.src_dir + os.path.join("FBSD-master/IPOLdemo/Scripts", f), \ self.bin_dir) # cleanup the source dir shutil.rmtree(self.src_dir) return
def build(self): """ program build/update """ version = 2 zip_filename = 'texture_cartoon_v%d.zip' % ((version)) src_dir_name = 'texture_cartoon_v%d' % ((version)) prog_filename = 'cartoonTexture' # store common file path in variables tgz_file = self.dl_dir + zip_filename prog_file = self.bin_dir + prog_filename log_file = self.base_dir + "build.log" # get the latest source archive build.download('http://www.ipol.im/pub/pre/103/' + \ zip_filename, tgz_file) # test if the dest file is missing, or too old if (os.path.isfile(prog_file) and ctime(tgz_file) < ctime(prog_file)): cherrypy.log("not rebuild needed", context='BUILD', traceback=False) else: # extract the archive build.extract(tgz_file, self.src_dir) # delete and create bin dir if os.path.isdir(self.bin_dir): shutil.rmtree(self.bin_dir) os.mkdir(self.bin_dir) # build the programs programs = ['cartoonTexture'] for program in programs: # build build.run("make -j4 -C %s %s" % (os.path.join(self.src_dir, src_dir_name, program), os.path.join(".", program)), stdout=log_file) # move binary to bin dir shutil.copy(os.path.join(self.src_dir, \ src_dir_name, \ program, program), os.path.join(self.bin_dir, program)) # cleanup the source dir shutil.rmtree(self.src_dir) return