# Compilation error on Linux server

**URL:** <https://discourse.mc-stan.org/t/compilation-error-on-linux-server/5160>\
**Category:** General\
**Created:** [August 10, 2018, 6:15pm UTC](https://discourse.mc-stan.org/t/compilation-error-on-linux-server/5160 "2018-08-10T18:15:44Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![aaronjg](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/aaronjg/32/3768_2.png) [@aaronjg](https://discourse.mc-stan.org/u/aaronjg)\
**Post date:** [August 10, 2018, 11:21pm UTC](https://discourse.mc-stan.org/t/compilation-error-on-linux-server/5160/4 "2018-08-10T23:21:28Z")

</div>

Try removing  
“-mtune=native -march=native” from the CFLAGS. It is likely that you have a heterogeneous server architecture on your cluster. The model is likely compiled once on one node, and then tried to run on a different node with a different CPU, and so it fails. If you remove those CFLAGS, it will be compiled to work on any cpu.

I had a similar issue and spent some time creating a script that would inspect the CPU architecture and maintain a separate copy of the compiled model for each installation. However, it turned out that the -march=native -mtune=native flags didn’t really speed things up very much, so I abandoned this strategy. I also found that the -O3 flags added a lot to compile time, and did not produce the speed improvements that I expected, so I now use:

```
CXXFLAGS= -O2 -pipe -Wno-unused -DEIGEN_NO_DEBUG -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DFUSION_MAX_VECTOR_SIZE=12 -DNO_FPRINTF_OUTPUT -std=c++11 

```

---

_[View the full topic](https://discourse.mc-stan.org/t/compilation-error-on-linux-server/5160)._
