Skip to content
Open
106 changes: 13 additions & 93 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,107 +29,26 @@ Other firmware development links
* [Unstructured firmware development notes](https://github.com/makerbot/Toolchain-Release/wiki/Unstructured-firmware-development-notes)

### Ubuntu setup
* Install some basic utilities

```bash
sudo apt-get install build-essential cmake-curses-gui
sudo apt-get install git python python-setuptools python-software-properties python-pip
sudo apt-get install openssh-server lsb-release devscripts cdbs debhelper libudev-dev libjpeg-dev genext2fs libusb-1.0-0-dev
```

* If you are using Ubuntu Precise (12.04), get a new computer
#### Toolpath Quick Setup

* If you are using Ubuntu Xenial (16.04):
Comment thread
scottsha marked this conversation as resolved.

Manually install Python3.4:
If only building toolpath:
```bash
mkdir python-build && cd python-build
wget https://www.python.org/ftp/python/3.4.5/Python-3.4.5.tgz
tar xf Python-3.4.5.tgz
cd Python-3.4.5
./configure --prefix=/usr --enable-shared # this is important for firmware builds especially
make
sudo make altinstall # this will install Python3.4 alongside 3.5 instead of overwriting it
sudo apt update
sudo apt install -y build-essential cmake git ninja-build libboost-all-dev libyajl-dev npm python2.7-dev
```
Alternatively, you can install Python3.4 from the deadsnakes repo:
Note that some scripts may still require python2.
You make need additional package beyond the following, install them as "missing package" errors arise,
but be sure to use the package `dohq-artifactory` and not `artifactory`.
```bash
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install python3.4 python3.4-dev python3-pip
python3 -m pip install -U pip
python3 -m pip install jsonschema dohq-artifactory wheel distro
```

If you are going to build firmware:

* Install 32-bit libc:

The build can be invoked with
```bash
sudo apt-get install libc6-i386 libssl-dev
python3 update-repos.py -t=toolpather;
python3 build-repos.py
```
* Install Qt:

Recommended that you do not use apt-get to install Qt. Goto https://www.qt.io/download-open-source/ to download the Qt Open Source Installer. Select Qt version 5.10.1 when performing install. You will need to make symbolic links for the qmake, lrelease, and lupdate binaries.

```bash
sudo ln -s /path/to/Qt/5.10.1/gcc_64/bin/qmake /usr/local/bin/qmake
sudo ln -s /path/to/Qt/5.10.1/gcc_64/bin/lrelease /usr/local/bin/lrelease
sudo ln -s /path/to/Qt/5.10.1/gcc_64/bin/lupdate /usr/local/bin/lupdate
```

Install yajl and boost:
```bash
sudo apt-get install libyajl-dev
sudo apt-get install libboost1.58-all-dev
sudo apt-get install mercurial # only necessary if you want to do full build-root builds
```

Pip install some additional dependencies:

```bash
sudo pip install protobuf
```

* Use git to download our main repository

```bash
git clone git@github.com:makerbot/Toolchain-Release.git
cd Toolchain-Release/
```

* Add our internal master repository
* Use double quotes ("), not single quotes(')
* This command will automatically add the correct distribution

```bash
sudo apt-add-repository "http://sid.soft.makerbot.net/apt/develop"
sudo apt-get update
```

* In the root of the Toolchain-Release repository there is a file called ./ubuntusetup.sh
If you run it it will install all of the build dependencies for you
(if it doesn't go bug Ryan)

* Either make sure you do not have qt4 installed, or add the following to your environment:
`export QT_SELECT=qt5`

* You also need python3.4 with pip and some extra python packages:

```bash
pip3 install wheel jsonschema aiohttp netifaces appdirs lockfile watchdog
sudo pip3 install artifactory
```

* From the `Toolchain-Release` directory invoke the following command:
`./update-repos.py --toolchain=desktop`
This will pull down either the source or artifacts of each of our other repositories depending default settings
* After downloading all of the sources run
`./build-repos.py`

If there are any errors related to missing packages please bother Ryan to update the ubuntusetup script(or do it yourself)

This command will take a long time to finish. It will download the source
package tarballs for all of our projects, extract them, then for each one
it will install the build dependencies and compile the project.


### Mac-specific Tools Setup

Expand Down Expand Up @@ -179,6 +98,7 @@ then close and re-open command prompt to make the changes take

* (Optional) Install NSIS so you can build the installer http://nsis.sourceforge.net/Download


### Getting our sources & building

* At the root of the Toolchain-Release repo run `update-repos.py`. This will run a bunch of git commands to pull down additional repositories and their submodules into the "Toolchain" subdirectory. It also installs a set of git-hooks that do style checking and other things. You can run this again at any time to pull down the latest updates for everything.
Expand Down
5 changes: 3 additions & 2 deletions build_tools/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,9 @@ def source_match(s):
return s.name == source.name
toolchain_sources = list(filter(source_match, saved_toolchain))
if toolchain_sources:
assert(len(toolchain_sources) == 1)
source = toolchain_sources[0]
toolchain_sources_list = list(toolchain_sources)
assert(len(toolchain_sources_list) == 1)
source = toolchain_sources_list[0]

TOOLCHAIN = toolchain.Toolchain('custom', [source])

Expand Down
18 changes: 13 additions & 5 deletions build_tools/platforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
UBU_1610_32 = 'Ubuntu_1610_32'
UBU_1610_64 = 'Ubuntu_1610_64'
UBU_1804_64 = 'Ubuntu_1804_64'
UBU_2204_64 = 'Ubuntu_2204_64'
UBU_2304_64 = 'Ubuntu_2304_64'
Comment thread
scottsha marked this conversation as resolved.

FED_20_32 = 'Fedora_20_32'
FED_20_64 = 'Fedora_20_64'
Expand All @@ -56,6 +58,8 @@
UBU_1510_64,
UBU_1604_64,
UBU_1804_64,
UBU_2204_64,
UBU_2304_64,
FED_20_32,
FED_20_64,
FED_21_32,
Expand Down Expand Up @@ -107,13 +111,17 @@ def find_platform(Win32=False):
platform_string = 'Windows_MSVC14_' + bitness
elif utils.is_linux:
try:
(distro, version, codename) = platform.linux_distribution()
platform_string = distro + "_"
platform_string += str.replace(version, '.', '') + "_"
platform_string += bitness
(distro_str, version_str, _codename) = platform.linux_distribution()
except AttributeError:
platform_string = "Ubuntu_1804_64"
import distro
distro_str = distro.name()
version_str = distro.major_version() + distro.minor_version()
platform_string = distro_str + "_"
platform_string += version_str + "_"
platform_string += bitness
platform_string = platform_string.replace('.', '')
else:
import sys
raise ValueError(sys.platform)
if valid_platform(platform_string):
return platform_string
Expand Down
23 changes: 13 additions & 10 deletions cmake-tools/MBCMakeToolsConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,21 @@ cmake_minimum_required(VERSION 3.1)
# we manually set them so that the build system devs can use them.
# I'm not setting all of them, because some don't seem to have any
# bearing on us.
if(${CMAKE_MAJOR_VERSION} EQUAL 3 AND ${CMAKE_MINOR_VERSION} GREATER 1)
# strict break()
cmake_policy(SET CMP0055 NEW)
elseif(${CMAKE_MAJOR_VERSION} EQUAL 3 AND ${CMAKE_MINOR_VERSION} GREATER 2)
Comment thread
scottsha marked this conversation as resolved.
# Use COMPILE_DEFINITIONS not DEFINITIONS directory property
cmake_policy(SET CMP0059 NEW)
# CTest does not by default tell make to ignore errors
cmake_policy(SET CMP0061 NEW)
# Disallow install() of export() result.
cmake_policy(SET CMP0062 NEW)
if (${CMAKE_MAJOR_VERSION} EQUAL 3)

if(${CMAKE_MINOR_VERSION} GREATER 1)
# strict break()
cmake_policy(SET CMP0055 NEW)
endif()

if(${CMAKE_MINOR_VERSION} GREATER 2)
# Allow use of ALL over lists in IF, used in never boost
cmake_policy(SET CMP0057 NEW)
endif()

endif()


# Make makefiles show each command line as it is used.
set(CMAKE_VERBOSE_MAKEFILE TRUE)

Expand Down
12 changes: 6 additions & 6 deletions cmake-tools/python34.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ macro(add_python34)
set(PYTHON_INCLUDE_DIR
"${CMAKE_INSTALL_PREFIX}/${HEADER_INSTALL_DIR}/python3.4m"
CACHE INTERNAL "")
find_package(PythonLibs 3.4 EXACT REQUIRED)
find_package(PythonLibs REQUIRED)
set(PYTHON_DEV_HOME
"${CMAKE_INSTALL_PREFIX}/${RESOURCE_INSTALL_DIR}/python34")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
Expand All @@ -106,19 +106,19 @@ macro(add_python34)
set(PYTHON_INCLUDE_DIR
"${CMAKE_INSTALL_PREFIX}/${HEADER_INSTALL_DIR}/python3.4m"
CACHE INTERNAL "")
find_package(PythonLibs 3.4 EXACT REQUIRED)
find_package(PythonLibs REQUIRED)
# This only works if LIB_INSTALL_DIR ends with /lib
set(PYTHON_DEV_HOME
"${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/..")
else()
find_program(PYTHON34_EXECUTABLE python3.4)
find_program(PYTHON34_EXECUTABLE python)
# This fails on linux when we are not building a CXX project
if(CMAKE_CXX_COMPILER_LOADED)
find_package(PythonLibs 3.4 EXACT REQUIRED)
find_package(PythonLibs REQUIRED)
endif()
endif()
if(NOT PYTHON34_EXECUTABLE)
message(FATAL_ERROR "Python 3.4 not found")
message(FATAL_ERROR "Python executable not found")
endif()

# Store the basic command for calling python 34 in PYTHON34_COMMAND
Expand Down Expand Up @@ -323,7 +323,7 @@ function(build_wheel target_name)
RESULT_VARIABLE error)

if(${error})
message(FATAL_ERROR "Could not determine wheel name")
message(STATUS "Could not determine wheel name")
endif()

# So, we've been trying pretty hard to maintain that under cmake
Expand Down
2 changes: 1 addition & 1 deletion cmake-tools/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1160,4 +1160,4 @@ function(get_git_hash in_git_hash)
OUTPUT_STRIP_TRAILING_WHITESPACE)

set(${in_git_hash} ${GIT_HASH} PARENT_SCOPE)
endfunction(())
endfunction()
6 changes: 3 additions & 3 deletions dev-tools/artifactory_clean_repo_diagnostic.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
for repo in repos:
space_made = 0;
for plat in plats:
all = list(artifactory_utils.all(repo, platform=plat))
all = sorted(all, key=lambda art: art.stat().mtime)
old = [i for i in all if
all_artifacts_unsorted = list(artifactory_utils.all(repo, platform=plat))
Comment thread
scottsha marked this conversation as resolved.
all_artifacts = sorted(all_artifacts_unsorted, key=lambda art: art.stat().mtime)
old = [i for i in all_artifacts if
(datetime.today()-i.stat().mtime.replace(tzinfo=None)) > age_cutoff]

#for i in all:
Expand Down
2 changes: 1 addition & 1 deletion jenkins-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ def run(args=[]):

if len(repos_failing_tests) > 0:
for r in repos_failing_tests:
print r + " is failing unit tests"
print(r + " is failing unit tests")
return 0


Expand Down