I have an mpi program and managed to compile and link it via Xcode 4. Now I want to debug it using Xcode 4.
How can I pipe the standard input to the program from a file?
In terminal I would type
mpirun -np 2 program < input.txt
I am able to run the program defining a custom executable (mpirun) in the "Info" panel of the Scheme editor, I also know that I can pass arguments in the "Arguments" panel. But Xcode 4 does not seem to accept "< input.txt" as an argument, even if I check "Use custom working directory" + add the correct directory of the input script in the "Options" panel.
This article Says it is possible to use "< input.txt" as an argument, but I guess that worked in Xcode 2 or Xcode 3, but it does not seem to work in Xcode 4 anymore.
cat input.txt | mpirun -np 2 program
instead? It's kind of a cheap hack, so I'm not that proud to be suggesting it... – Demaggio#!/bin/sh
or#!/bin/bash
in addition to setting the execute permission on the script? Perhaps if the script doesn't start with the hashbang line, the kernel will try to execute the program all the same... – Demaggio