• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Redirect IO of target
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Redirect IO of target


  • Subject: Re: Redirect IO of target
  • From: Michael Lehn <email@hidden>
  • Date: Thu, 29 Sep 2011 01:40:42 +0200

Am 29.09.2011 um 00:04 schrieb Jens Alfke:


On Sep 28, 2011, at 1:36 PM, Michael Lehn wrote:

The solution suggested there requires to modify the program.  This is not a feasible solution
in my case: my program is the LAPACK test suit (which I want to use as-is) implemented in
Fortran which calls some of my C++ routines which I want to be able to debug with Xcode.

How is the code structured? If you’re running it in Xcode, then LAPACK is probably an already-compiled library that you link into an app? In that case, you can modify the main() function of the app to reopen the standard file descriptors.

Hi Jens,

of course I can modify each of the fortran programs such that it re-opens stdin/-out.  But if possible I don't
want to touch the fortran code if possible.  There are too many of them and I would have to redo this for
every upcoming LAPACK version.

In my project I re-implement some of the LAPACK routines (e.g. LU factorization, QR factorization, eigenvalue
and eigenvector computations, …) in C++ and I want to use the LAPACK test-suit to test my implementation.
This LAPACK test suite is a big bunch of Fortran routines.  And LAPACK itself uses these for testing itself ...

So my project consists of my own C++ files (which I compile with clang++) for which I implemented an
"extern C" interface such that I can link it with the LAPACK test suite (which I compile with gfortran).  In the
end there are a bunch of executables which are the Fortran test-routines calling my C++ LAPACK routines
instead of the Fortran LAPACK.

At the moment I accomplish all of this through some Makefiles.  Everything gets compiled directly from
either C++ or Fortran source files.  I do not use any external libraries beside the stdc++.


Alternatively, you could run the program from a terminal window, and have Xcode’s debugger wait for it to start (Product > Attach to Process > By PID).

This sounds like a feasible solution, thanks!

Michael

P.S.: However, I think it should not be too hard that someone at Apple checks if arguments passed to a target start
with ">" or "<" and performs the corresponding redirection before executing it … 



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Redirect IO of target
      • From: Scott Ribe <email@hidden>
    • Re: Redirect IO of target
      • From: Conrad Shultz <email@hidden>
References: 
 >Redirect IO of target (From: Michael Lehn <email@hidden>)
 >Re: Redirect IO of target (From: Jens Alfke <email@hidden>)

  • Prev by Date: Re: Redirect IO of target
  • Next by Date: Re: Redirect IO of target
  • Previous by thread: Re: Redirect IO of target
  • Next by thread: Re: Redirect IO of target
  • Index(es):
    • Date
    • Thread