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

Unable to compile on new computer

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

Unable to compile on new computer

Postby Saka » June 20th, 2017, 12:02 am

I just got a new laptop and I reinstalled cygwin, selected bin for gcc-g++ and make, but now I can't seem to compile anything! I tried all the new stuff and even gfind, which has it's own compilation page on the wiki! I keep getting this error every time:
/tmp/ccxGzwWp.o:gfind.c:(.text+0x4d9): undefined reference to `qIsEmpty'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x4d9): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `qIsEmpty'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x936): undefined reference to `enqueue'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x936): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `enqueue'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x981): undefined reference to `setVisited'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x981): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `setVisited'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x3af5): undefined reference to `isVisited'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x3af5): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `isVisited'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x3b0a): undefined reference to `enqueue'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x3b0a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `enqueue'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x3b5a): undefined reference to `pop'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x3b5a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `pop'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x3b73): undefined reference to `setVisited'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x3b73): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `setVisited'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x3b8c): undefined reference to `setVisited'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x3b8c): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `setVisited'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x5c08): undefined reference to `pop'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x5c08): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `pop'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x6029): undefined reference to `dequeue'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x6029): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `dequeue'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x6042): undefined reference to `qIsEmpty'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x6042): additional relocation overflows omitted from the output
/tmp/ccxGzwWp.o:gfind.c:(.text+0x62f7): undefined reference to `enqueue'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x635a): undefined reference to `dequeue'
/tmp/ccxGzwWp.o:gfind.c:(.text+0x6363): undefined reference to `enqueue'
collect2: error: ld returned 1 exit status

And it doesn't generate an executable version. Help please?
Everyone, please stop posting B/S about CA
The Bugs Range 1 to 100 Project
User avatar
Saka
 
Posts: 2062
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X

Re: Unable to compile on new computer

Postby Sokwe » June 20th, 2017, 1:32 am

I think I answered this particular question here. Specifically, if you compile with the -O3 flag these errors should go away. You should be compiling with -O3 anyway, because it makes the program faster.
-Matthias Merzenich
Sokwe
Moderator
 
Posts: 1139
Joined: July 9th, 2009, 2:44 pm

Re: Unable to compile on new computer

Postby Saka » June 20th, 2017, 2:07 am

It still doesn't generate an executeable!
My command to compile is:
gcc -O3 mfind.c -o mfind

(mfind is your gfind-zfind hybrid)
But when I try
./mfind

It says there is no such directory. And yes I am in the right folder.
There is 1 error, but I have already turned off my laptop so I'm a bit lazy to post it.
Everyone, please stop posting B/S about CA
The Bugs Range 1 to 100 Project
User avatar
Saka
 
Posts: 2062
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X

Re: Unable to compile on new computer

Postby Sokwe » June 20th, 2017, 2:33 am

Saka wrote:My command to compile is:
gcc -O3 mfind.c -o mfind

You need to compile with -fopenmp as I said near the bottom of this post.
-Matthias Merzenich
Sokwe
Moderator
 
Posts: 1139
Joined: July 9th, 2009, 2:44 pm

Re: Unable to compile on new computer

Postby Saka » June 20th, 2017, 5:20 am

Whoops I keep forgetting about -fopenmp :oops:
Everyone, please stop posting B/S about CA
The Bugs Range 1 to 100 Project
User avatar
Saka
 
Posts: 2062
Joined: June 19th, 2015, 8:50 pm
Location: In the kingdom of Sultan Hamengkubuwono X

Re: Unable to compile on new computer

Postby fluffykitty » June 21st, 2017, 8:17 pm

What if my compiler doesn't support -fopenmp?
I like making rules
fluffykitty
 
Posts: 288
Joined: June 14th, 2014, 5:03 pm

Re: Unable to compile on new computer

Postby Sokwe » June 21st, 2017, 10:05 pm

fluffykitty wrote:What if my compiler doesn't support -fopenmp?

"-fopenmp" is a compiler flag for the GCC compiler. For other compilers you may need to do something different. Try googling how to compile OpenMP with your preferred compiler. If your compiler doesn't support OpenMP at all, then you can compile my new program (see here) by removing the two lines that say
omp_set_num_threads(params[P_NUMTHREADS]);

This means that you won't be able to use the multithreading feature.
-Matthias Merzenich
Sokwe
Moderator
 
Posts: 1139
Joined: July 9th, 2009, 2:44 pm


Return to Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron