# Offline Compilation

**URL:** https://community.particle.io/t/offline-compilation/6260
**Category:** uncategorized
**Created:** [August 7, 2014, 12:03pm UTC](https://community.particle.io/t/offline-compilation/6260 "2014-08-07T12:03:19Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ibebbs](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ibebbs/32/4732_2.png) [@ibebbs](https://community.particle.io/u/ibebbs)
#### Post date: [August 7, 2014, 12:03pm UTC](https://community.particle.io/t/offline-compilation/6260/1 "2014-08-07T12:03:19Z")

</div>

Hi all,

Just about to purchase a Spark Core but am interested in knowing whether it can be programmed entirely offline (i.e. from the Spark CLI). The tutorials show offline compilation with Spark but during the compilation it seems as though the CLI fetches a ‘base’ image from the Spark website. This is shown below:

```
$ spark compile blinky.ino
Including:
blinky.ino
attempting to compile firmware
pushing file: blinky.ino
grabbing binary from: https://api.spark.io/v1/binaries/01234567890ABCDEFGH
saved firmware to firmware_123456781234.bin
Compiled firmware downloaded.

```

Note the “grabbing binary” line.

Is this always necessary or is there are way to compile entirely offline?

Thanks,  
Ian

---

<div class="post-metadata">

### Author: ![kennethlimcp](https://avatars.discourse-cdn.com/v4/letter/k/c0e974/32.png) [@kennethlimcp](https://community.particle.io/u/kennethlimcp)
#### Post date: [August 7, 2014, 12:06pm UTC](https://community.particle.io/t/offline-compilation/6260/2 "2014-08-07T12:06:29Z")

</div>

You are in fact compiling your code with the build farm on the spark ☁.

A true offline compilation would be using the GCC toolchain + make 😉

---

<div class="post-metadata">

### Author: ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)
#### Post date: [August 7, 2014, 12:10pm UTC](https://community.particle.io/t/offline-compilation/6260/3 "2014-08-07T12:10:09Z")

</div>

@ibebbs, the Spark CLI uses the Spark Cloud’s compile server farm so it is not truly offline. When you compile an application, the final .bin file is comprised of the base core-firmware and the user program. The .bin file you see being “grabbed” from the Cloud compile servers is that final file being downloaded to your PC.

For truly offline compiling you need to create a local toolchain and clone the core firmware repos onto your PC. You can follow the instructions on the core-firmware github repo [here](https://github.com/spark/core-firmware). 🙂

---

<div class="post-metadata">

### Author: ![ibebbs](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/ibebbs/32/4732_2.png) [@ibebbs](https://community.particle.io/u/ibebbs)
#### Post date: [August 7, 2014, 12:11pm UTC](https://community.particle.io/t/offline-compilation/6260/4 "2014-08-07T12:11:24Z")

</div>

That’s what I needed to know.

Thanks peekay

---

<div class="post-metadata">

### Author: ![sej7278](https://avatars.discourse-cdn.com/v4/letter/s/8c91f0/32.png) [@sej7278](https://community.particle.io/u/sej7278)
#### Post date: [August 7, 2014, 1:37pm UTC](https://community.particle.io/t/offline-compilation/6260/5 "2014-08-07T13:37:38Z")

</div>

i’ve got some 0.8 builds of dfu-util [here](http://www.the-jedi.co.uk/downloads/arduino/) and of course git and make etc. you can get via your distro’s package manager e.g: **apt-get install git-core build-essential** on debian or for fedora **yum install git make**

the gcc-arm-none-eabi page isn’t very user-friendly, so basically you need to get [this](https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q2-update/+download/gcc-arm-none-eabi-4_8-2014q2-20140609-linux.tar.bz2) file, untar it and add the bin subdirectory to your $PATH.

basically don’t install dfu-util or gcc-arm-none-eabi from the debian/ubuntu repo’s they’re hideously old and broken.

---

<div class="post-metadata">

### Author: ![mal](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@mal](https://community.particle.io/u/mal)
#### Post date: [October 10, 2014, 6:40am UTC](https://community.particle.io/t/offline-compilation/6260/6 "2014-10-10T06:40:25Z")

</div>

Hi @sej7278

Are you using a 32 bit linux distro? I’m having trouble with the version of gcc-arm-none-eabi that I’ve downloaded, I think it’s because I’m running 64 bit debian.

---

<div class="post-metadata">

### Author: ![mal](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@mal](https://community.particle.io/u/mal)
#### Post date: [October 10, 2014, 7:18am UTC](https://community.particle.io/t/offline-compilation/6260/7 "2014-10-10T07:18:01Z")

</div>

sorry for the noise, I just worked it out. Just requires having ia32-libs installed for multiarch support.
