Join TSR
 
About Us | FAQs | Sign in
 
Advanced
Search

Join The Student Room Today

Be part of the UK's largest and fastest growing student community.

It's free to join and a lot of fun - Get inspired, express your ideas, interact and share

RSS  From C++ to PHP, debugging to webhosting; help and discussion about writing your latest program to running your website. NOT for help when your PC won't work.
Reply
 
Announcements   Posted By
 
Old 31-03-2009: 31st March 2009 13:31 #1 
halfoflessthan50p's Avatar
halfoflessthan50p halfoflessthan50p is offline Male
Peer Of The TSR Realm
Thread Starter
halfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud of
United Kingdom
Join Date: Apr 2006
My Societies
Default compiling and running a code i found on the internet
 
Hi.

Im doing a project about Chaos Theory for my physics undergrad course and need a little help with some programming.

I've found a website (here) which has some code for analysing a dataset that would be really useful for me but I don't know how to get it to run.

It looks like this:
Spoiler:


I dont know much about programming (although I have used C++, can do headers, loops, basic stuff.) the website suggests the code will work on a Unix C compiler but I don't understand what this means. And also it was written quite a few years ago so i dont know if it will be compatible with modern programs i could use to compile and run it.

I can't waste too much time trying to get this to work but if anyone knows of a program I can download for free that would compile and run the code without me having to rewrite any of it that would help me out an enormous amount.

thanks. rep for anyone who manage to help
Register to remove banners from posts.
Old 31-03-2009: 31st March 2009 13:58 #2 
Choad's Avatar
Choad Choad is offline Male
TSR Idol
Choad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputation
Sealand
Join Date: Aug 2005
Location: Taunton/Plymouth Posts: 999,999
My Societies
Default Re: compiling and running a code i found on the internet
 
well it compiled on my comp fine. i assume you use windows... i have no idea about compiling stuff on windows. maybe it would be simplest to set up a cygwin environment (a unix-like environment used from within windows)

http://www.cygwin.com/
 
Old 31-03-2009: 31st March 2009 14:12 #3 
SunderX's Avatar
SunderX SunderX is offline Male
Exalted and Worshipped Member
SunderX is a splendid one to beholdSunderX is a splendid one to beholdSunderX is a splendid one to beholdSunderX is a splendid one to beholdSunderX is a splendid one to beholdSunderX is a splendid one to beholdSunderX is a splendid one to behold
Australia
Join Date: Oct 2006
Location: Shanghai
Posts: 1,359
Send a message via MSN to SunderX
Default Re: compiling and running a code i found on the internet
 
By a 'UNIX Compiler' they probably mean something along the lines of gcc. (GNU C Compiler or something)

As far as I know, gcc is packaged on almost any Linux machine, including ones you might find at your lab.

Basically, log in, bring up the command line (right clicking the desktop usually brings up a menu to do this) and type something along the lines of: gcc <file>, where <file> is a text file with the code in.

It will compile the code to a file called a.out, which you can execute by typing ./a.out

If I remember correctly, Cygwin (the link above) has a Windows port of gcc, and should also work if you don't want to go to the hassle of finding a Linux box.

Also, any C compiler should work in theory provided the code they wrote is standards-compliant. gcc is pretty flexible either way.
 

Last edited by SunderX : 31-03-2009 at 14:16.

Old 31-03-2009: 31st March 2009 15:46 #4 
halfoflessthan50p's Avatar
halfoflessthan50p halfoflessthan50p is offline Male
Peer Of The TSR Realm
Thread Starter
halfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud ofhalfoflessthan50p has much to be proud of
United Kingdom
Join Date: Apr 2006
My Societies
Default Re: compiling and running a code i found on the internet
 
okay ive downloaded cygwin and the gcc package.

i get the error

gcc: minfo5: no such file or directory
gcc: no input files

I guess this means the file is in the wrong format or location?

Ive tried putting copies of the code as .txt and .c files into the directories c://cygwin, c://cygwin/home and c://cygwin/home/administrator?

Sorry if im being stupid here, ive never done this kind of thing before.
Old 31-03-2009: 31st March 2009 17:13 #5 
INTit INTit is offline
Exalted and Worshipped Member
INTit is a splendid one to beholdINTit is a splendid one to beholdINTit is a splendid one to beholdINTit is a splendid one to beholdINTit is a splendid one to beholdINTit is a splendid one to beholdINTit is a splendid one to behold
United Kingdom
Join Date: May 2007
Location: Mercia Posts: 1,333,337
Default Re: compiling and running a code i found on the internet
 
Get choad to send you the binary :P
Old 31-03-2009: 31st March 2009 17:24 #6 
laser laser is offline Male
Peer Of The TSR Realm
laser has much to be proud oflaser has much to be proud oflaser has much to be proud oflaser has much to be proud oflaser has much to be proud oflaser has much to be proud oflaser has much to be proud oflaser has much to be proud of
Join Date: Aug 2006
Location: Doncaster
Posts: 1,986
Default Re: compiling and running a code i found on the internet
 
Originally Posted by halfoflessthan50p
okay ive downloaded cygwin and the gcc package.

i get the error

gcc: minfo5: no such file or directory
gcc: no input files

I guess this means the file is in the wrong format or location?

Ive tried putting copies of the code as .txt and .c files into the directories c://cygwin, c://cygwin/home and c://cygwin/home/administrator?

Sorry if im being stupid here, ive never done this kind of thing before.
Sounds like you forgot the ".c". You probably want to do something like:

Code:
gcc -o minfo5.exe minfo5.c
 
Old 31-03-2009: 31st March 2009 21:49 #7 
Choad's Avatar
Choad Choad is offline Male
TSR Idol
Choad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputationChoad has a ridiculously high reputation
Sealand
Join Date: Aug 2005
Location: Taunton/Plymouth Posts: 999,999
My Societies
Default Re: compiling and running a code i found on the internet
 
Originally Posted by INTit
Get choad to send you the binary :P
cygwin doesn't help u run native linux binaries in windows it just allows you to compile linux stuff for windows if you have the source
 
Old 02-04-2009: 2nd April 2009 15:09 #8 
Kyle_S-C Kyle_S-C is offline Male
Peer Of The TSR Realm
Kyle_S-C has a brilliant futureKyle_S-C has a brilliant futureKyle_S-C has a brilliant futureKyle_S-C has a brilliant futureKyle_S-C has a brilliant futureKyle_S-C has a brilliant futureKyle_S-C has a brilliant futureKyle_S-C has a brilliant futureKyle_S-C has a brilliant future
United Kingdom
Join Date: Jan 2006
Location: Cambridge
Posts: 1,571
My Societies
Default Re: compiling and running a code i found on the internet
 
Originally Posted by halfoflessthan50p
Hi.

Im doing a project about Chaos Theory for my physics undergrad course and need a little help with some programming.

I've found a website (here) which has some code for analysing a dataset that would be really useful for me but I don't know how to get it to run.

It looks like this:
Spoiler:


I dont know much about programming (although I have used C++, can do headers, loops, basic stuff.) the website suggests the code will work on a Unix C compiler but I don't understand what this means. And also it was written quite a few years ago so i dont know if it will be compatible with modern programs i could use to compile and run it.

I can't waste too much time trying to get this to work but if anyone knows of a program I can download for free that would compile and run the code without me having to rewrite any of it that would help me out an enormous amount.

thanks. rep for anyone who manage to help

Do you have remote access to a university computer system (e.g. ours is called the Private Workstation Facility)? They'll probably run Linux with all the compilers necessary, since I imagine your course will almost certainly include some programming. That'll compile the code for you most likely.

You might want to have a look at your university's computing service website.
 
Thread Tools Search this Thread
Search this Thread
Advanced
Search