Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Compiling in C in terminal

I'm trying to use a program for a class called "xspim"

http://www.cs.wisc.edu/~larus/spim.html

However, I'm not familiar with C, and am struggling to get this program working on my mac. At that link, they have the source code available for a OS X install, but I've followed their instructions and am struggling.

Can anyone help me get this compiled in terminal so I can work on my assignments without having to go into the PC lab?

thanks

MacBook, Mac OS X (10.4.8)

Posted on Apr 2, 2007 10:29 AM

Reply
6 replies

Apr 2, 2007 10:40 AM in response to Doug Eldred

I have downloaded and unzipped the program, but struggle editing the code to give reasonable folders (I really don't care though, the folders can be wherever they default to). However, the make command and past that gives me error messages. I'm not sure if I'm typing it in wrong or need to type those % signs, or what. I just don't know what to type into terminal after it's unzipped, because following their instructions verbatim gave error messages.

Apr 2, 2007 11:33 AM in response to Doug Eldred

Forgiven. In the PC lab, we actually use Sun systems which are just unix terminals. I'm semi familiar with unix, but am not too familiar with C.

The steps I cannot get beyond are steps 5 (and 6).


#####

5. Next, you must set the directories in which spim will be installed by editing the Makefile (the file that contains instructions on building spim). In general, if you are installing spim and want the windowing version (xspim), edit the file xspim/Imakefile. If you don't want xspim or are running on a system without X-windows installed, you use the file spim/Makefile.

Set these pathnames to the appropriate locations for your system:

EXCEPTION_DIR -- The full pathname of the directory in which to install the spim exception handler (exceptions.s).

BIN_DIR -- The full pathname of the directory in which spim and xspim should be installed.

MAN_DIR -- The full pathname of the directory in which the manual pages for spim and xspim should be installed.

In general, the remaining parameters in a Makefile need not be changed.


6. Then, if you are using Imakefile file, change to the spim-7.2/xspim directory and type:

% xmkmf
% make
If you do not have a copy of xmkmf, you can use the Makefile in the xspim directory, but beware that it may not work on your system because the paths to the X windows libraries could be different.

#####

in 5, do I need to enter a specific directory or will the given usr/local/bin work?

Then when I try typing just "xmkmf" it gives me

colonel:~/desktop/spim-7.3/xspim Colonel$ xmkmf
-bash: xmkmf: command not found

"make" gives me the same thing...

Do I need to use the makefile described at the end of that excerpt?


I appreciate your help, but I understand if you consider this a lost cause. Thanks for helping thus far anyway.

Apr 2, 2007 11:38 AM in response to Colonel Shaun

If you're on your own Mac, you may or may not have permissions to write to /usr/local/bin. Try copying some file there, then remove it if you succeed (to not leave crud around.)

You apparently need to install some additional software to have the xmkmf and make commands - possibly X11, possibly Apple's Xcode software, possibly both. Or, just maybe, they're there but not in your default path. Maybe you can get a Unix admin or experienced user to help you figure out what you need to do - fix paths, install software, show you what to enter per the instructions for xspim, etc.

None of your problems (yet) have anything to do with C, they're basic Unix or software install problems.


Doug

Compiling in C in terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.