we have 2 executables being called exactly the same way:
concorde : user@host:~/vrp/concorde/TSP$ ./concorde -o tsp_out input_file
linkern : user@host:~/vrp/concorde/LINKERN$ ./linkern -o tsp_out input_file
the code to run linkern is:
Code:
void tsp_sol_call(char *exec_path,char *exec_file,char *in_file){
register int ret,pid;
int status;
pid=fork();
if(pid==-1){
perror("fork");
exit(1);
}
if(pid==0){
ret=execl(exec_path,exec_file,"-o","tsp_out",in_file,"..",NULL);
if(ret=-1) perror("execl");
}
else wait(&status);
}
int main(){
tsp_sol_call("/home/panos/vrp/concorde/LINKERN/linkern","linkern",
"/media/hda7/source_vrp/tsp_in.tsp");
}
now,
while tsp_sol_call() causes linkern to run correctly, the same code cant do the same for concorde.
Code:
tsp_sol_call("/home/panos/vrp/concorde/TSP/concorde","concorde",
"/media/hda7/source_vrp/tsp_in.tsp");
It just produces some error messages just as if i had called it incorrectly from the console. any suggestions?
notes: input/output filenames are the same and the command lines represented in the code run correctly if inputed in the console.