ConwayLife.com - A community for Conway's Game of Life and related cellular automata
Home  •  LifeWiki  •  Forums  •  Download Golly

How to run .c files?

For scripts to aid with computation or simulation in cellular automata.

How to run .c files?

Postby twinb7 » February 14th, 2014, 11:35 am

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.
twinb7
 
Posts: 175
Joined: February 11th, 2014, 8:08 pm
Location: Ames, Iowa

Re: How to run .c files?

Postby Ntsimp » February 23rd, 2014, 12:35 am

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.
Ntsimp
 
Posts: 46
Joined: June 8th, 2010, 9:11 am

Re: How to run .c files?

Postby Andrew » February 23rd, 2014, 6:12 am

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.
User avatar
Andrew
Moderator
 
Posts: 748
Joined: June 2nd, 2009, 2:08 am
Location: Melbourne, Australia

Re: How to run .c files?

Postby EricG » February 24th, 2014, 11:23 am

If you need further help, have a look at:
viewtopic.php?f=9&t=826
and
viewtopic.php?f=9&t=828
EricG
 
Posts: 199
Joined: August 19th, 2011, 5:41 pm
Location: Chicago-area, USA

Re: How to run .c files?

Postby twinb7 » February 25th, 2014, 2:50 pm

Thank you both!
twinb7
 
Posts: 175
Joined: February 11th, 2014, 8:08 pm
Location: Ames, Iowa


Return to Scripts

Who is online

Users browsing this forum: No registered users and 2 guests