# Invalid CPU name x86-64 error when building with MARCH=x86-64

**URL:** <https://discourse.julialang.org/t/invalid-cpu-name-x86-64-error-when-building-with-march-x86-64/20115>\
**Category:** General Usage\
**Tags:** build\
**Created:** [January 26, 2019, 12:17am UTC](https://discourse.julialang.org/t/invalid-cpu-name-x86-64-error-when-building-with-march-x86-64/20115 "2019-01-26T00:17:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pbellive](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pbellive/32/3604_2.png) [@Pbellive](https://discourse.julialang.org/u/Pbellive)\
**Post date:** [January 26, 2019, 12:17am UTC](https://discourse.julialang.org/t/invalid-cpu-name-x86-64-error-when-building-with-march-x86-64/20115/1 "2019-01-26T00:17:34Z")

</div>

Hi all,  
I’m trying to build julia from source (up to date master branch commit cb7a569…) on a small cluster. This works fine with default options. However, the cluster nodes have different CPU types and I need a system image that works across the whole cluster. In the past (last tried with julia 0.6.4) I’ve handled this by just putting `MARCH=x86-64` in Make.user. However, building the current master from a fresh clone with `MARCH=x86-64` and nothing else in Make.user crashes with the following error (with a bit of extra output from make for context):

```julia
CC src/llvm-alloc-opt.o
CC src/cgmemmgr.o
CC src/llvm-api.o

LINK usr/lib/libjulia.so.1.2
CC ui/repl.o
LINK usr/bin/julia
JULIA usr/lib/julia/corecompiler.ji
ERROR: Invalid CPU name x86-64 .
sysimage.mk:60: recipe for target '/disk1/common/juliaLang/julia-master/usr/lib/julia/corecompiler.ji' failed

```

I’m building on a machine running Ubuntu 16.04.5. Running

```julia
gcc -march=native -Q --help=target | grep -- '-march=' | cut -f3

```

returns ivybridge as the CPU type if that’s helpful. It’s the oldest CPU on the cluster I’m building for.

I’m wondering if this is a bug in julia or the julia build system or if I’m doing something wrong. Do I need to add anything else to Make.user or Make.inc to have this work? I wanted to check that I’m not missing something before filing an issue about this.

Thanks, Patrick

---

<div class="post-metadata">

**Author:** ![c42f](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/c42f/32/52842_2.png) [@c42f](https://discourse.julialang.org/u/c42f)\
**Post date:** [January 26, 2019, 2:24am UTC](https://discourse.julialang.org/t/invalid-cpu-name-x86-64-error-when-building-with-march-x86-64/20115/2 "2019-01-26T02:24:55Z")

</div>

~~You probably need `x86_64` rather than `x86-64`.~~ Edit: no; it turns out I don’t know what’s going on here :-/

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [January 26, 2019, 2:36am UTC](https://discourse.julialang.org/t/invalid-cpu-name-x86-64-error-when-building-with-march-x86-64/20115/3 "2019-01-26T02:36:57Z")

</div>

Did LLVm change it? `llc -mcpu=help` for LLVM 5.0 and 7.0 both say `x86-64` is the valid name, which is also the name I normalized into. Both `x86-64` and `x86_64` should be supported as `JULIA_CPU_TARGET`.

---

<div class="post-metadata">

**Author:** ![Pbellive](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pbellive/32/3604_2.png) [@Pbellive](https://discourse.julialang.org/u/Pbellive)\
**Post date:** [January 26, 2019, 7:36pm UTC](https://discourse.julialang.org/t/invalid-cpu-name-x86-64-error-when-building-with-march-x86-64/20115/4 "2019-01-26T19:36:34Z")

</div>

Thanks very much for the replies. Rather unexpectedly, I got everything to build with

```julia
MARCH=x86-64
JULIA_CPU_TARGET=x86_64

```

in Make.user. Setting `MARCH=x86_64` gave the following error

```julia
/disk1/common/juliaLang/julia-master-compile-test/deps/SuiteSparse_wrapper.c:1:0: error: bad value (x86_64) for -march= switch
 #include <string.h>
 ^

```

I’ll file an issue about this. Running `julia -C help` shows x86-64 as an available CPU type but not x86\_64. It also shows ivybridge as an available cpu type but building with `MARCH=ivybridge` gave the same error shown in my original post.

---

<div class="post-metadata">

**Author:** ![Pbellive](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pbellive/32/3604_2.png) [@Pbellive](https://discourse.julialang.org/u/Pbellive)\
**Post date:** [January 26, 2019, 8:05pm UTC](https://discourse.julialang.org/t/invalid-cpu-name-x86-64-error-when-building-with-march-x86-64/20115/5 "2019-01-26T20:05:40Z")

</div>

Issue opened: [https://github.com/JuliaLang/julia/issues/30850](https://github.com/JuliaLang/julia/issues/30850)
