How can I pipe stdin from a file to the executable in Xcode 4+?

前端 未结 3 1404
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 15:17

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 f

3条回答
  •  感情败类
    2020-12-08 15:40

    Try the following pre-action run script:

    mv program program.real
    echo -e '#!/bin/sh\nmpirun -np 2 program.real < input.txt' > program
    

    Maybe this will trick XCode into executing your program as you would like it to be executed.

提交回复
热议问题