Fortran debugger for Mac OS X - macos

Can anyone recommend a good Fortran debugger for the mac (other than installing gdb, etc, via fink or macports)?

I believe the Intel Fortran Compiler for Mac integrates with Xcode and thereby gives you source level (GUI) debugging: http://software.intel.com/en-us/intel-compilers/
Also it looks like you can get Xcode plug-ins for gfortran: http://www.macresearch.org/xcode_tutorial_fortran_only_projects

With the IDB for Mac only providing a command-line interface, and Xcode only being capable of debugging simple structured Fortran programs with no support of MODULEs, maybe you can try TotalView.

Related

Haskell for Mac (El Capitan)

I'm trying to decide what haskell installation is more appropriate for a Mac running El Capitan.
It seems there are at least two alternatives:
Install the haskell platform as indicated in https://www.haskell.org/platform/
Install the haskell platform as indicated in https://ghcformacosx.github.io/
What is the difference between the two distributions?
Will I be able to use Xcode as an Haskell IDE?
The main differences I see are:
Haskell for Mac OSX:
is relocatable
comes with stack pre-built
Haskell Platform:
installs in /usr/local/bin (requires root access)
comes with more pre-compiled libraries
comes with the programs happy and alex pre-built
Neither comes with explicit support for using Xcode as an IDE. Usually one uses Emacs or Atom or Vi to develop Haskell programs.

Mac compiler on windows

Is it possible to develop cross-platform application on Windows and can also compile for Mac OS X from Windows? I have checked Qt but that requires one to compile from Mac using Xcode.
If this is your priority then one option would be Java as at least a jar file built on one platform can be run on another.
If however you're talking about C or C++...
If you are creating a small command line tool then you might be able to make this work with gcc and a cross compiler, but I think it would be a lot of work.
If however you are wanting to create a GUI application I would urge you to give up now. There are so many issues - you'd have to use Carbon or Cocoa APIs which you can't build for on any other platform, you'd have to link against frameworks which won't exist on your compilation host, you won't be able to easily generate .plist files. Qt won't help as you need to be able to build it, which relies on these same frameworks.
In short, there's no alternative to building on an actual mac.
Furthermore, when it comes to fixing bugs, you will absolutely have to do this on a mac (either physical or virtual).
From what I know , in general you do need a mac to make the executable , even for a simple ansi c program you need gcc for mac.
You can create MacPorts Portfile.(If your application is open source)
A MacPorts port is a set of specifications contained in a Portfile
that defines an application, its characteristics, and any files or
special instructions required to install it. This allows you to use a
single command to tell MacPorts to automatically download, compile,
and install applications and libraries.
Take a look at IMCROSS.
IMCROSS is a simple, scripted method of installing cross-compilers and
cross-compiled libraries on a Linux (or possibly other *nix) system,
so that you can develop programs targeted to run on Microsoft Windows
and Mac OS X at the same time and in the same environment as you
develop Linux versions of those programs.
You can certainly do this using Real Studio. It can create Mac OS X applications on Windows without any trouble.
It cross-compiles for Windows, OS X and Linux. And it does it from any platform. It also can create web apps.
Sounds like you should check it out.

Where is Mac OS X Debugging Interface

I am new to UNIX and Mac OS X systems and wondering how debugging on Max OS X works. I am from Windows world and I am familiar with debugging system in Windows like attaching to a process with DebugActiveProcess, reading/writing memory with Read/WriteProcessMemory and so on...
I don't know if Mac OS X's debugging also woriking like Windows but
I want to know how a debugger in Max OS X communicates with a target process. Can anyone give me some hits of a start point or documents where I should read first?
The debugging interface on OS X and most Unixes is called ptrace.
Type man ptrace at a command prompt for information on how ptrace communicates between processes, and also have a look at the header at /usr/include/sys/ptrace.h
The typical debuggers are gbd and (recently) lldb. Many IDEs on OS X also use these. So.. "man gdb" is a good starting point.
As user1118321 mentioned, installing the Xcode toolset would be a good idea, if you've not done so already. It includes compilers, an IDE, debuggers, profilers, and graphical programs for these tools.
You didn't state which language, or tools you're using, so for the purposes of this answer I'll assume you're using Objective-C with either gcc or clang to compile your code and link it into an executable. If you're using some other language, such as java or ruby, the equivalent from windows probably exists for OS X as well.
In general, unix uses GDB for debugging, and OS X is no different. You won't always attach it to a running process, I find that's more common to start a process in the debugger, although there do exist tools (such as Instruments) that will profile a running process.
If you're using XCode, there's a whole suite of debugging tools built in that use gdb under the hood. I suggest you start reading some of the developer documentation here http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/130-Debugging_Applications/debugging_applications.html and then ask around if there's something in particular you want to know about.
If you've installed Xcode, look at all of the applications installed in /Developer/Applications, at a minimum you should find
Xcode - write and debug, design interfaces here
Instruments - profile your application, look for memory leaks
Icon Composer - create slick icons for your applications
Graphics Tools - used to help work with OpenGL and Quartz mainly

Getting Leksah working on Mac OS X 10.5.8

I'm using Mac OS X 10.5.8. Another question indicated that Leksah is the IDE of choice for Haskell development.
However, Leksah (version 0.10.0.4) requires GHC 7.0.3 (problems with 6.12.2, problems with 6.12.3). Unfortunately, the newest Haskell platform available for OS X 10.5.8 is 6.12.3.
How do I get Leksah working on my Mac? An OS upgrade is not possible. Should I just use a different IDE/text editor?
According to the latest State of Haskell survey, the most popular IDE's are vi and Emacs, both of which have Haskell-mode features and are quite usable on OS X.
That said, it's probably worthwhile to get ghc-7 anyway. Is self-compiling an option? You can install a ghc-6.12 binary, then use that to bootstrap compiling ghc-7.0.3. Once you have a working ghc-7, download the Haskell Platform Source and build that. Compiling both ghc and the full platform will take a while, but I'd expect it all should work.
This is ghc 7.0.4 for Leopard PPC: https://downloads.haskell.org/~ghc/7.0.4/krabby/
I was also able to use it to build ghc 7.6.3.

On Mac OS X, how can you get a debug build of System/LibC for source level debugging?

I downloaded LibC source from opensource.apple.com, but since it's part of one monolithic library /usr/lib/libSystem.B.dylib would I have to somehow rebuild the entire thing?
I have a BSD command line program, ported from Linux. I want to be able to set breakpoints in LibC functions and step through. I'm trying to close in on what seems to be heap corruption in my program (which doesn't occur on Linux - I've already ported back to Linux and run memcheck there.)
Have you take a look at the Kernel Debug Kit from Apple (http://developer.apple.com/sdk/) ? I know that it contains kernel symbols, but I am not sure if libc is part of the SDK.
You can build Valgrind yourself - either use the last version released on 10.5, or look on the bug tracker for the Snow Leopard support bug, which has a patch.
Alternately, try the memory debugging tools in the malloc(3) manual.

Resources