Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ZebraineZ

macrumors 6502
Original poster
Mar 17, 2009
354
0
Code:
gcc -DINTERNAL -opowder -w -std=c99 -D_POSIX_C_SOURCE=200112L -Iincludes/ -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations -lSDL -lm -lbz2  -march=native -DX86 -DX86_SSE3 -msse3 src/*.c -DLIN64
src/air.c:1: error: bad value (native) for -march= switch
src/air.c:1: error: bad value (native) for -mtune= switch
src/graphics.c:1: error: bad value (native) for -march= switch
src/graphics.c:1: error: bad value (native) for -mtune= switch
src/http.c:1: error: bad value (native) for -march= switch
src/http.c:1: error: bad value (native) for -mtune= switch
src/interface.c:1: error: bad value (native) for -march= switch
src/interface.c:1: error: bad value (native) for -mtune= switch
src/main.c:1: error: bad value (native) for -march= switch
src/main.c:1: error: bad value (native) for -mtune= switch
src/md5.c:1: error: bad value (native) for -march= switch
src/md5.c:1: error: bad value (native) for -mtune= switch
src/misc.c:1: error: bad value (native) for -march= switch
src/misc.c:1: error: bad value (native) for -mtune= switch
src/powder.c:1: error: bad value (native) for -march= switch
src/powder.c:1: error: bad value (native) for -mtune= switch
src/update.c:1: error: bad value (native) for -march= switch
src/update.c:1: error: bad value (native) for -mtune= switch
make: *** [powder] Error 1

This is what I got when I was trying to compile this source I have in XCode :( I got so far! Is it easy to fix? I'm dumb with Xcode and stuff, so be noob friendly lol.
 
Code:
gcc -DINTERNAL -opowder -w -std=c99 -D_POSIX_C_SOURCE=200112L -Iincludes/ -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations -lSDL -lm -lbz2  -march=native -DX86 -DX86_SSE3 -msse3 src/*.c -DLIN64

Is it easy to fix?

Remove -march=native from the gcc command? Or replace it with -arch x86_64
 
Remove -march=native from the gcc command? Or replace it with -arch x86_64

I tried that already, it didn't work. I tried that too, didn't work. Here is the makefile.

Code:
SOURCES := src/*.c

CFLAGS := -w -std=c99 -D_POSIX_C_SOURCE=200112L -Iincludes/
OFLAGS := -O3 -ffast-math -ftree-vectorize -funsafe-math-optimizations
LFLAGS := -lSDL -lm -lbz2 
MFLAGS_SSE3 := -march=native -DX86 -DX86_SSE3 -msse3
MFLAGS_SSE2 := -march=native -DX86 -DX86_SSE2 -msse2
MFLAGS_SSE := -march=native -DX86 -DX86_SSE
FLAGS_DBUG := -Wall -std=c99 -D_POSIX_C_SOURCE=200112L -pg -DX86 -DX86_SSE3 -msse3 -lSDL -lm -lbz2 -g
COMPILER := gcc 
LINUX_TARG := powder-64-sse2 powder-sse powder-sse2
WIN32_TARG := powder-sse.exe powder-sse2.exe

powder: $(SOURCES)
	$(COMPILER) -DINTERNAL -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64
powder-debug-64: $(SOURCES)
	$(COMPILER) -m64 -o$@ $(FLAGS_DBUG) -DLIN64 $(SOURCES) -Iincludes/
powder-debug: $(SOURCES)
	$(COMPILER) -m32 -o$@ $(FLAGS_DBUG) -DLIN32 $(SOURCES) -Iincludes/ 

powder-sse3: $(SOURCES)
	$(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN32
	strip $@
powder-sse2: $(SOURCES)
	$(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN32
	strip $@
powder-sse: $(SOURCES)
	$(COMPILER) -m32 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE) $(SOURCES) -DLIN32
	strip $@
powder-64-sse3-opengl: $(SOURCES)
	$(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 -lGL -lGLU -DOpenGL
	strip $@
powder-64-sse3: $(SOURCES)
	$(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE3) $(SOURCES) -DLIN64 
	strip $@
powder-64-sse2: $(SOURCES)
	$(COMPILER) -m64 -o$@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS_SSE2) $(SOURCES) -DLIN64
	strip $@

powder-res.o: powder-res.rc powder.ico
	i586-mingw32msvc-windres powder-res.rc powder-res.o

powder-sse3.exe: $(SOURCES) powder-res.o
	i586-mingw32msvc-gcc -o$@ $(CFLAGS) $(OFLAGS) $(MFLAGS_SSE3) $(SOURCES) powder-res.o -lmingw32 -lws2_32 -lSDLmain $(LFLAGS) -mwindows -DWIN32
	strip $@
	chmod 0644 $@
powder-sse2.exe: $(SOURCES) powder-res.o
	i586-mingw32msvc-gcc -o$@ $(CFLAGS) $(OFLAGS) $(MFLAGS_SSE2) $(SOURCES) powder-res.o -lmingw32 -lws2_32 -lSDLmain $(LFLAGS) -mwindows -DWIN32
	strip $@
	chmod 0644 $@
powder-sse.exe: $(SOURCES) powder-res.o
	i586-mingw32msvc-gcc -o$@ $(CFLAGS) $(OFLAGS) $(MFLAGS_SSE) $(SOURCES) powder-res.o -lmingw32 -lws2_32 -lSDLmain $(LFLAGS) -mwindows -DWIN32
	strip $@
	chmod 0644 $@

powder-x: $(SOURCES)
	gcc -o $@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS) $(SOURCES) -lSDLmain -DMACOSX -DPIX32BGRA -arch x86_64 -framework Cocoa -ggdb
	strip $@ 
powder-x-ogl: $(SOURCES)
	gcc -o $@ $(CFLAGS) $(OFLAGS) $(LFLAGS) $(MFLAGS) $(SOURCES) -lSDLmain -DOpenGL -DMACOSX -DPIX32BGRA -arch x86_64 -framework Cocoa -framework OpenGL -ggdb
	strip $@

Compiling through the terminal works perfectly fine with no errors, but for some reason this doesn't seem to work through XCode, and it's only those errors...
 
Is Xcode trying to compile a PowerPc binary as well?

I don't know...I'm using the external build system and external target thingy.

Also if you want to take a look at the source of the program, here it is:
https://github.com/FacialTurd/The-Powder-Toy/network

Just do the top one, it's the official one. Please if you can find a solution, tell me :( I'm sure those aren't extreme errors and are simple to fix, it's just that there is no solution right now and that's why I'm here lol.
 
I tried that already, it didn't work. I tried that too, didn't work. Here is the makefile.

What do you mean by: it didn't work? If you removed the -march flag, you wouldn't get the -march errors, so you mustn't have removed the flag if you got the same errors.

I don't feel like downloading and building something called "FacialTurd"
 
What do you mean by: it didn't work? If you removed the -march flag, you wouldn't get the -march errors, so you mustn't have removed the flag if you got the same errors.

I don't feel like downloading and building something called "FacialTurd"

LOL. It's a powder simulator game, that's just the dudes github name, the name of the game is The Powder Toy, it's really fun...and I did remove them from the makefile, and I got the SAME EXACT errors. I also replaced it with the arch thing (in command line when I do make and stuff it actually shows arch in plays of the march thing but only when I compile in command line).
 
...It's a powder simulator game ...
That doesn't make it any clearer to me.

...and I did remove them from the makefile, and I got the SAME EXACT errors. I also replaced it with the arch thing...
But you can't have removed it if you get the same errors. gcc can't magically create errors out of nothing. When at first things go wrong, look for user error.

Did you remove it from MFLAGS_SSE3?
Code:
MFLAGS_SSE3 := -march=native -DX86 -DX86_SSE3 -msse3
MFLAGS_SSE2 := -march=native -DX86 -DX86_SSE2 -msse2
MFLAGS_SSE := -march=native -DX86 -DX86_SSE
 
That doesn't make it any clearer to me.


But you can't have removed it if you get the same errors. gcc can't magically create errors out of nothing. When at first things go wrong, look for user error.

Did you remove it from MFLAGS_SSE3?
Code:
MFLAGS_SSE3 := -march=native -DX86 -DX86_SSE3 -msse3
MFLAGS_SSE2 := -march=native -DX86 -DX86_SSE2 -msse2
MFLAGS_SSE := -march=native -DX86 -DX86_SSE

I did it from all 3. Replaced all 3 as well after I tried just removing it.

That doesn't make it any clearer to me.

... you have never played any dust games? Like falling sand or wxsand and stuff, it's like that, except these past 6 months the project got revived after 2 years, and it's turned into something really awesome, I can't explain it in words :3 just take my word for it. Basically simulates 'powder' stuff, like dust particles, fire water etc, but those are just the barebones basics.
 
Compiling through the terminal works perfectly fine with no errors, but for some reason this doesn't seem to work through XCode, and it's only those errors...

Hold on, missed this. If it works on the command line, why are you trying with XCode?
 
Hold on, missed this. If it works on the command line, why are you trying with XCode?

I'm going to start coding soon and I hate text editors, I rather use XCode where everything is neatly organized and whatnot.
 
It works in the command line because the Makefile is compiling with a specific configuration. When you dump the files into Xcode you no longer have those specific settings so you need to read the Makefile and configure those settings in Xcode.
 
It works in the command line because the Makefile is compiling with a specific configuration. When you dump the files into Xcode you no longer have those specific settings so you need to read the Makefile and configure those settings in Xcode.

What do I need to configure in XCode? Like what part in the makefile.

It works in the command line because the Makefile is compiling with a specific configuration. When you dump the files into Xcode you no longer have those specific settings so you need to read the Makefile and configure those settings in Xcode.

It would be nice if you (or any of you...) replied :/ It's very rude to just say something knowing I won't understand then blatantly running off!

I still don't know why it gives these errors, and I don't know why it gives it when I change the makefile, it seem as though it's ignoring whatever I change in the makefile...what the heck is this, why does it have to be rocket science.
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.