How to run .c files?

For scripts to aid with computation or simulation in cellular automata.
Post Reply
twinb7
Posts: 192
Joined: February 11th, 2014, 8:08 pm
Location: Ames, Iowa

How to run .c files?

Post by twinb7 »

I've seen a lot of programs recently and got them downloaded, but I don't know how to run them. I saved them as .c files because apparently that's what they're supposed to be, but how do I run them?

I'm talking about gfind, actually: https://www.ics.uci.edu/~eppstein/ca/gfind.c
and I'm using a Mac.
Ntsimp
Posts: 46
Joined: June 8th, 2010, 9:11 am

Re: How to run .c files?

Post by Ntsimp »

These are programs written in the C language. You convert them into a runnable program by running a "C compiler". I don't know Mac OS, but Google should help you install a free compiler such as gcc.
User avatar
Andrew
Moderator
Posts: 1048
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia
Contact:

Re: How to run .c files?

Post by Andrew »

To compile gfind.c on a Mac, start up Terminal.app, cd to the location of that .c file, then run this command:

cc -o gfind -m32 gfind.c

Leave out the "-m32" if you want a 64-bit version. Type "./gfind c" to see help on all the options.
Use Glu or Glui to explore CA rules on non-periodic tilings: DominoLife and HatLife
EricG
Posts: 199
Joined: August 19th, 2011, 5:41 pm
Location: Chicago-area, USA

Re: How to run .c files?

Post by EricG »

If you need further help, have a look at:
viewtopic.php?f=9&t=826
and
viewtopic.php?f=9&t=828
twinb7
Posts: 192
Joined: February 11th, 2014, 8:08 pm
Location: Ames, Iowa

Re: How to run .c files?

Post by twinb7 »

Thank you both!
Post Reply