For$
<!-- begin site header -->
<div id=

Author Topic: lighting.cpp Build Error  (Read 7847 times)

Matt - Kerplunc

  • Newbie
  • *
  • Posts: 11
  • Founder of Kerplunc and MinecraftGSP
    • View Profile
    • Kerplunc
lighting.cpp Build Error
« on: April 11, 2011, 09:08:26 am »
Code: [Select]
[  1%] Building CXX object CMakeFiles/mineserver.dir/src/lighting.cpp.o
/root/build/src/lighting.cpp:1: error: bad value (native) for -march= switch
/root/build/src/lighting.cpp:1: error: bad value (native) for -mtune= switch
make[2]: *** [CMakeFiles/mineserver.dir/src/lighting.cpp.o] Error 1
make[1]: *** [CMakeFiles/mineserver.dir/all] Error 2
make: *** [all] Error 2


Running CentOS 5 64bit on an OpenVZ VPS. Has built just fine previously, recent issue (Since the 1.4 Beta patch time ish). Any ideas?
Matthew Hall - matt@kerplunc.com - Kerplunc.com

thegk01

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: lighting.cpp Build Error
« Reply #1 on: May 02, 2011, 09:41:45 pm »
Hey,

The problem is that "-march" is setted to "switch". This should contain the CPU type, but it does not. I don't know why I could build mineserver before without this problem, but I could.

You must execute the "cmake ." command, and then, replace "-march=switch" with "-march=x86-64" * in these files:
"mineserverdirectory/CMakeFiles/mineserver.dir/flags.make"
"mineserverdirectory/plugins/CMakeFiles/binlog.dir/flags.make"
"mineserverdirectory/plugins/CMakeFiles/commands.dir/flags.make"
"mineserverdirectory/plugins/CMakeFiles/crapmops.dir/flags.make" (Even if we could delete this one, sadly)
"mineserverdirectory/plugins/CMakeFiles/curseui.dir/flags.make"
"mineserverdirectory/plugins/CMakeFiles/filelog.dir/flags.make"
"mineserverdirectory/plugins/CMakeFiles/flatpermissions.dir/flags.make"
"mineserverdirectory/plugins/CMakeFiles/nBreak.dir/flags.make"
"mineserverdirectory/plugins/CMakeFiles/nether.dir/flags.make"
"mineserverdirectory/plugins/CMakeFiles/passiveMobs.dir/flags.make"

Okay. After that, you can run the "make all install" command without problems (hopefully ;) )

-- thegk01


* I have an Intel Core 2 Duo 1,83 GHz Processor... Maybe it is not the right text in the "-march=" variable for you, but go try it ;)
« Last Edit: May 04, 2011, 09:07:55 pm by thegk01 »
// A wild INCONSISTENCY appears!
//
//  --------------
// | >FIGHT  PkMn |
// |  ITEM   RUN  |
//  --------------
//
// deoxxa uses MACRO ATTACK!

from plugin.h

ellisgl

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: lighting.cpp Build Error
« Reply #2 on: May 07, 2011, 12:23:03 am »
Yeah - I did "find . -type f -exec sed -i 's/march=native/march=x86_64/g' {} \;"
Says that "x86_64" is a bad value

ellisgl

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: lighting.cpp Build Error
« Reply #3 on: May 07, 2011, 12:48:54 am »
I changed to k8 from x86_64

thegk01

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: lighting.cpp Build Error
« Reply #4 on: May 07, 2011, 10:54:32 am »
I can't look up what I had, but it was either "x86-64" or "x86_64". Try both ;)
// A wild INCONSISTENCY appears!
//
//  --------------
// | >FIGHT  PkMn |
// |  ITEM   RUN  |
//  --------------
//
// deoxxa uses MACRO ATTACK!

from plugin.h

Fador

  • Administrator
  • Full Member
  • *****
  • Posts: 126
    • View Profile
Re: lighting.cpp Build Error
« Reply #5 on: May 07, 2011, 11:41:14 am »
Lighting.cpp isn't actually even used so you can just remove it from the build =)

thegk01

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: lighting.cpp Build Error
« Reply #6 on: May 07, 2011, 12:21:11 pm »
It is not the lighting.cpp which causes the error. The problem are the incorrect CMake-Files... I think if lighting.cpp is removed, "make all install" stops with the same error at the next file.
It seems that cmake does'nt set the CPU type correctly and puts a wrong value into the flags.
// A wild INCONSISTENCY appears!
//
//  --------------
// | >FIGHT  PkMn |
// |  ITEM   RUN  |
//  --------------
//
// deoxxa uses MACRO ATTACK!

from plugin.h