How do I compile C?
How do I compile C?
How do I compile C code? What programs can I use? I would really like to use dr soon and gfind
Re: How do I compile C?
I have Cygwin and Micro C compiler (mcc) but I cannot compile dr
Re: How do I compile C?
There should be no need to compile dr under Cygwin. Since you are using Windows, I think you should get MinGW and compile dr using the GCC compiler.Saka wrote:I have Cygwin and Micro C compiler (mcc) but I cannot compile dr
I included a Windows executable for dr2 in this post (and forgot to include the source code, which is here). Does this executable not work for you?
-Matthias Merzenich
Re: How do I compile C?
I know Cygwin is overkill for source compilations like these but much of the Windows ConwayLife users would have Cygwin installed anyway because of compiling apgnano. Personally I do not like it too much as it can be kinda bloated and they say it's slower... but I guess windows users would have to stick with that.Sokwe wrote:There should be no need to compile dr under Cygwin. Since you are using Windows, I think you should get MinGW and compile dr using the GCC compiler.
Re: How do I compile C?
Thanks! Didn't see that post...Sokwe wrote:There should be no need to compile dr under Cygwin. Since you are using Windows, I think you should get MinGW and compile dr using the GCC compiler.Saka wrote:I have Cygwin and Micro C compiler (mcc) but I cannot compile dr
I included a Windows executable for dr2 in this post (and forgot to include the source code, which is here). Does this executable not work for you?
Re: How do I compile C?
I tried the example on the thread and it does nothing, I'm confused
Re: How do I compile C?
Keep calm and read on: viewtopic.php?f=9&t=1445#p16606Saka wrote:I tried the example on the thread and it does nothing, I'm confused
Re: How do I compile C?
I did read that, but I am not sure what it meant, so, in dr, do I inputScorbie wrote:Keep calm and read on: viewtopic.php?f=9&t=1445#p16606Saka wrote:I tried the example on the thread and it does nothing, I'm confused
dr2 > output.txt
And then
dr2 < input.txt
(Or vice versa)?
Re: How do I compile C?
Both:Saka wrote:I did read that, but I am not sure what it meant, so, in dr, do I inputScorbie wrote:Keep calm and read on: viewtopic.php?f=9&t=1445#p16606Saka wrote:I tried the example on the thread and it does nothing, I'm confused
dr2 > output.txt
And then
dr2 < input.txt
(Or vice versa)?
Code: Select all
dr2 < input.txt > output.txt
The key idea is that two separate steps definitely wouldn't work -- dr2 isn't going to save any state from one run to the next. Each time you run it, it has to have all the information it needs to run a search and send the results wherever you want them to be stored.
Re: How do I compile C?
@dvgrn
Does input.txt and output.txt have to be in the same folder as dr2?
Does input.txt and output.txt have to be in the same folder as dr2?
Re: How do I compile C?
Umm... Sort of. I guess you tested that. If not, a short test would have let you know.Saka wrote:@dvgrn Does input.txt and output.txt have to be in the same folder as dr2?
(I originally tried to suggest a keyword to search on Google but umm... it's hard to describe this "thing".)
Here are some examples:
Code: Select all
drifter_directory
ㄴdr
ㄴinput.txt
ㄴoutput.txt
You may want to run:
dr < input.txt > output.txt
(You're on windows, right?)
Code: Select all
drifter_directory
ㄴdr
ㄴfiles
ㄴinput.txt
ㄴoutput.txt
You may want to run:
dr < files/input.txt > files/output.txt (The cmd line is in the drifter_directory.)
or maybe:
../dr < input.txt > output.txt (The cmd prompt is in the files directory.)
Code: Select all
some_directory
ㄴdrifter_directory
ㄴdr
ㄴinput.txt
ㄴsome_other_directory
ㄴoutput.txt
You may want to run:
dr < ../input.txt > ../some_other_directory/output.txt
(.. means the parent directory. I haven't tested this on Windows but I think it would work.)
Code: Select all
drifter_directory
ㄴdr
...Completely Unrelated...
C:
ㄴUsers
ㄴSaka
ㄴsome_folder
ㄴinput.txt
You can run:
dr < C:\Users\Saka\some_folder\input.txt (cmd prompt is in the drifter_directory)
2) About the backslashes: Windows works both with forward slashes and backslashes as a subdirectory "sign". I don't know the minor quirks of it, though.
3) You can drag a file to the command prompt to list its absolute path.
Tip: When asking questions, generally, I think it would save your time (and my time ) if you specified what you tried, or things like that, more specifically. [+ Your Computer OS, Program, stacktraces etc. if something crashed] I think you would have solved the problem faster if you initially posted what you posted two posts later.
I didn't mean any offense, though... Just pointing out that this would help in getting answers to questions faster.
Last edited by Scorbie on December 18th, 2015, 9:34 am, edited 1 time in total.
Re: How do I compile C?
OMG YOU GUESSED MY PC USERNAME!!(Not sure which emoticon to put)
I have not tried that out, because it's already late night
I have not tried that out, because it's already late night
Re: How do I compile C?
LOL guess what my username isSaka wrote:OMG YOU GUESSED MY PC USERNAME!!(Not sure which emoticon to put)
Yep, Take your timeSaka wrote:I have not tried that out, because it's already late night
Re: How do I compile C?
Scorbie? Scorbic? Not sure. Also, in response to my post in the "New p17 and other billiard tables" thread, you posted the way to compile dr with cygwin, I did not understand what you meant by "your_binary_name"Scorbie wrote:LOL guess what my username isSaka wrote:OMG YOU GUESSED MY PC USERNAME!!(Not sure which emoticon to put)
Re: How do I compile C?
Hehe my username is scorbie
You can set the executable name. If you dothe executable name would be drifrter.exe.
You can set the executable name. If you do
Code: Select all
gcc -O3 dr.c -o drifter
Re: How do I compile C?
You typed drifrter
Re: How do I compile C?
Help!
When I did dr < input.txt > output.txt
it said
same output for dr2
I was trying the example inputs on the thread
When I did dr < input.txt > output.txt
it said
Code: Select all
Bad bit in 'd' or 'D' command
I was trying the example inputs on the thread
Re: How do I compile C?
eek... I don't know what's wrong with that and I think the dr2 thread would be a better place for that (maybe there isn't a dr2 thread?)
Re: How do I compile C?
Ok, I'll try to retrace:Scorbie wrote:eek... I don't know what's wrong with that and I think the dr2 thread would be a better place for that (maybe there isn't a dr2 thread?)
1. Made input file with:
Code: Select all
c50
h15
w15
rot90symm
v127 1
d2 36 36 44 44
r36 36
444344o.4
....o.o.4
oooo.oo.4
4.o...o.3
4o.....o4
3.o...o.4
4.oo.oooo
4.o.o....
4.o443444!
d0 37 36 37 39
d0 38 36 38 38
d0 p39 37
skipstable
skipfizzle
2. Made output.txt in same folder as dr2
3.Opened dr2.exe
4.Ran
Code: Select all
dr2 < input.txt > output.txt
Did I do something wrong? Maybe we can compare our steps
Re: How do I compile C?
Saka, I think it is better to ask questions at each thread instead of opening a new onein the general discussions forum... You could always read the existing Bellman, drifter, or ptbsearch threads and post something you don't understand there.