Skip to content

Commit

Permalink
Merge branch 'main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
James Bradbury authored Mar 30, 2022
2 parents 4e2aad3 + 03646e1 commit 28b908f
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 67 deletions.
1 change: 1 addition & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Nightly Releases
on:
push:
branches: [ dev, ci/** ]
workflow_dispatch:

jobs:
docs:
Expand Down
156 changes: 156 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: Release
on:
workflow_dispatch:
inputs:
base_branch:
description: 'Base branch to deploy core from'
required: false
default: 'main'

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: flucoma/actions/env@v4
with:
branch: ${{ github.event.inputs.base_branch }}
- uses: flucoma/actions/docs@v4
with:
target: MAKE_CLI_REF
branch: ${{ github.event.inputs.base_branch }}

- uses: actions/upload-artifact@v2
with:
name: docs
path: build/cli_ref

windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: flucoma/actions/env@v4
with:
branch: ${{ github.event.inputs.base_branch }}
- uses: flucoma/actions/cli@v4

- name: compress archive
run: tar -zcvf winbuild.tar.gz release-packaging

- uses: actions/upload-artifact@v2
with:
name: winbuild
path: winbuild.tar.gz

mac:
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- uses: flucoma/actions/env@v4
with:
branch: ${{ github.event.inputs.base_branch }}
- uses: flucoma/actions/cli@v4

- name: compress archive
run: tar -zcvf macbuild.tar.gz release-packaging

- uses: actions/upload-artifact@v2
with:
name: macbuild
path: macbuild.tar.gz


linux:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v2
- uses: flucoma/actions/env@v4
with:
branch: ${{ github.event.inputs.base_branch }}
- uses: flucoma/actions/cli@v4

- name: compress archive
run: tar -zcvf linuxbuild.tar.gz release-packaging

- uses: actions/upload-artifact@v2
with:
name: linuxbuild
path: linuxbuild.tar.gz

- id: get-version
run: echo "::set-output name=version::$(cat flucoma.version.rc)"
working-directory: core

release:
runs-on: ubuntu-latest
needs: [mac, windows, linux, docs]

steps:
- uses: actions/download-artifact@v2
with:
name: docs
path: docs

- uses: actions/download-artifact@v2
with:
name: linuxbuild
path: linux

- uses: actions/download-artifact@v2
with:
name: macbuild
path: mac

- uses: actions/download-artifact@v2
with:
name: winbuild
path: win

#### LINUX ####
- name: untar
run: tar zxvf linuxbuild.tar.gz -C .
working-directory: ./linux

- name: copy docs to linux
run: cp -r docs linux/release-packaging/FluidCorpusManipulation

- name: compress linux
run: zip -r ../../FluCoMa-CLI-Linux.zip .
working-directory: linux/release-packaging

#### MAC ####
- name: untar
run: tar zxvf macbuild.tar.gz -C .
working-directory: ./mac

- name: copy docs to mac
run: cp -r docs mac/release-packaging/FluidCorpusManipulation

- name: compress mac
run: zip -r ../../FluCoMa-CLI-Mac.zip .
working-directory: mac/release-packaging

#### WINDOWS ####
- name: untar
run: tar zxvf winbuild.tar.gz -C .
working-directory: ./win

- name: copy docs to win
run: cp -r docs win/release-packaging/FluidCorpusManipulation

- name: compress mac
run: zip -r ../../FluCoMa-CLI-Windows.zip .
working-directory: win/release-packaging

#### UPLOAD RELEASE ####
- name: package and upload
uses: softprops/action-gh-release@v1
with:
name: ${{ needs.linux.outputs.version }}
body: "This is a release build of the FluCoMa CLI tools. The build hash is ${{ github.sha }}"
files: FluCoMa*.zip
prerelease: true
tag_name: ${{ needs.linux.outputs.version }}
draft: false
80 changes: 13 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,89 +6,35 @@ This repository hosts code for generating the command line executables and docum
* Stubs for producing an executable for each 'client' in the Fluid Corpus Manipulation Library.
* CMake code for managing dependencies, building and packaging.

# How to Build
# Minimal Quick Build

## Pre-requisites
Minimal build steps below. For detailed guidance see https://github.com/flucoma/flucoma-cli/wiki/Compiling

* [CMake](http://cmake.org) >= 3.11
* A C++ 14 compliant compiler for macOS or Windows (via XCode tools on macOS; Visual Studio 17 >= 15.9 on Windows; GCC or clang on Linux)
## Prerequisites

## Dependencies
* C++14 compliant compiler (clang, GCC or MSVC)
* cmake
* make (or Ninja or XCode or VisualStudio)
* git
* an internet connection

These will be downloaded and configured automatically, unless you pass CMake a source code location on disk for each (see below):
CMake will automatically download the dependencies needed

* [Fluid Corpus Manipulation Library](https://github.com/flucoma/flucoma-core)
* [Eigen](https://gitlab.com/libeigen/eigen) (3.3.5)
* [HISSTools Library](https://github.com/AlexHarker/HISSTools_Library)

## I'm in a Hurry...

...and you already have a development environment set up, understand CMake? And Python 3 + DocUtils + Jinja + PyYAML if you want docs?

Cool:

```
```bash
mkdir -p build && cd build
cmake -DDOCS=<ON/OFF(default)> ..
cmake ..
make install
```

This will assemble a package in `release-packaging`.

An alternative to setting up / running CMake directly on the command line is to install the CMake GUI, or use to use the curses GUI `ccmake`.

Also, with CMake you have a choice of which build system you use.

* The default on macOS and Linux is `Unix Makefiles`. On macOS you can also use Xcode by passing `-GXcode` to CMake when you first run it.
* The default on Windows is the latest version of Visual Studio installed. However, Visual Studio can open CMake files directly as projects, which has some upsides. When used this way, CMake variables have to be set via a JSON file that MSVC will use to configure CMake.

Alternatively, flucoma-cli is now on the [AUR / Arch User Repository](https://aur.archlinux.org/packages/flucoma-cli-git/) and can now be compiled and downloaded by executing:

```bash
yay -S flucoma-cli-git
```
on Arch Linux and Manjaro (with thanks to @madskjeldgaard)


## Generating Documentation

There is an html manual associated with each of the command-line programs. This documentation partially relies on a system that is shared with other wrappers of the Fluid Corpus Manipulation Project for different creative coding environments.

Pre-requisites:

* Python 3
* Docutils python package (ReST parsing)
* Jinja python package (template engine)
* PyYAML >= 5.1 (YAML parsing)

To generate html documentation for the executables requires a further dependency, [flucoma-docs](https://github.com/flucoma/flucoma-docs), which we use to combine generated and human-written docs. We then pass `DOCS=ON` to CMake
```
cmake -DDOCS=ON ..
```
Unless we pass the location on disk of `flucoma-docs`, CMake will again take care of downloading this dependency.

This process:

* has only ever been tested on Mac, so may well not work at all on Windows
* can sometimes produce spurious warnings in Xcode, but *should* work

## Using Manual Dependencies

In some cases you may want to use your own copies of the required libraries. Unless specified, the build system will download these automatically. To bypass this behaviour, use the following cache variables:

* `FLUID_PATH`: location of the Fluid Corpus Manipulation Library
* `FLUID_PARAMDUMP_PATH`: location of `flucoma_paramdump` repository (e.g. for debugging documentation generation)
* `EIGEN_PATH` location of the Eigen library
* `HISS_PATH` location of the HISSTools library

For example, use this to us your own copy of the Fluid Corpus Manipulation Library

```
cmake -DFLUID_PATH=<location of Fluid Corpus Manipulation Library> ..
```
To find out which branches / tags / commits of these we use, look in the top level `CMakeLists.txt` of the Fluid Corpus Manipulation Library for the `FetchContent_Declare` statements for each dependency.

## Compiling for different CPUs
The build system generally assumes an x86 cpu with AVX instructions (most modern x86 CPUs). To build on another kind of CPU (e.g. older than 2012) you can use the `FLUID_ARCH` cache variable to pass specific flags to your compiler. For example use `-DFLUID_ARCH=-mcpu=native` to optimize for your particular CPU.
on Arch Linux and Manjaro (with thanks to @madskjeldgaard)

## Credits
#### FluCoMa core development team (in alphabetical order)
Expand Down

0 comments on commit 28b908f

Please sign in to comment.