Skip to content

Commit a1781ba

Browse files
authored
Merge pull request #191 from thughes/circleci
Add Linux build to CircleCI
2 parents e8bf7f6 + 3838c81 commit a1781ba

File tree

5 files changed

+69
-6
lines changed

5 files changed

+69
-6
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## What’s Ne10?
44
Ne10 is a library of common, useful functions that have been heavily optimised for ARM-based CPUs equipped with [NEON](https://www.arm.com/products/processors/technologies/neon.php) SIMD capabilities. It provides consistent, well-tested behaviour, allowing for painless integration into a wide variety of applications. The library currently focuses primarily around math, signal processing, image processing, and physics functions.
55

6-
## Building
6+
## Building [![CircleCI](https://circleci.com/gh/projectNe10/Ne10.svg?style=svg)](https://circleci.com/gh/projectNe10/Ne10)
77
Out of the box, Ne10 supports the Linux, Android, and iOS platforms. For instructions on building Ne10 for these platforms, please consult the build instructions in [`building.md`](https://github.com/projectNe10/Ne10/tree/master/doc/building.md#building-ne10). It is possible to use the library on other platforms (or, indeed, “without a platform”), however you may have to fiddle with some of the build configuration files.
88

99
Once Ne10 has been built, it can be linked against just like any other C library. To link C code against Ne10, for instance, the compiler must first be aware of Ne10's library and header files — those within `build/modules/` and `inc/`. To do this, these files can be copied to the standard directories used by compilation tools by running `make install`, or by installing Ne10 from a package manager. Following this, you can simply include `Ne10.h` in your C code, and ask the compiler to link against the `NE10` library (e.g. with `-lNE10`).

circle.yml

+44-3
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ all_jobs: &all_jobs
88
- android-armv7-debug
99
- android-aarch64-release
1010
- android-aarch64-debug
11+
- linux-armv7-release
12+
- linux-armv7-debug
13+
- linux-aarch64-release
14+
- linux-aarch64-debug
1115

1216
build_steps: &build_steps
1317
steps:
1418
- run:
1519
name: Setup
1620
command: |
17-
PLATFORM=`uname`
18-
if [ "${PLATFORM}" == "Darwin" ]; then
21+
if [ "${PLATFORM}" == "ios" ]; then
1922
mkdir -p ~/cmake
2023
curl -L https://cmake.org/files/v3.10/cmake-3.10.3-Darwin-x86_64.tar.gz | \
2124
tar -xz -C ~/cmake --strip-components 1
@@ -24,14 +27,26 @@ build_steps: &build_steps
2427
ln -s ${CMAKE_BIN_DIR}/cmake ${LOCAL_BIN_DIR}/cmake
2528
ln -s ${CMAKE_BIN_DIR}/cpack ${LOCAL_BIN_DIR}/cpack
2629
ln -s ${CMAKE_BIN_DIR}/ctest ${LOCAL_BIN_DIR}/ctest
27-
else
30+
elif [ "${PLATFORM}" == "android" ]; then
2831
NDK_VERSION="r16b"
2932
sudo apt-get update
3033
sudo apt-get install cmake
3134
cd ${HOME}
3235
curl -L https://dl.google.com/android/repository/android-ndk-${NDK_VERSION}-linux-x86_64.zip -o ndk.zip
3336
unzip ndk.zip
3437
mv android-ndk-${NDK_VERSION} android-ndk
38+
else
39+
sudo apt-get update
40+
sudo apt-get install cmake
41+
if [ "${ARCH}" == "armv7" ]; then
42+
sudo apt-get install g++-arm-linux-gnueabihf
43+
else
44+
# gcc7 aarch64 fails due to this bug:
45+
# https://bugs.launchpad.net/gcc-linaro/+bug/1759369
46+
# sudo apt-get install g++-aarch64-linux-gnu
47+
sudo apt-get install g++-8-aarch64-linux-gnu
48+
sudo update-alternatives --install /usr/bin/aarch64-linux-gnu-gcc aarch64-linux-gnu-gcc /usr/bin/aarch64-linux-gnu-gcc-8 1 --slave /usr/bin/aarch64-linux-gnu-g++ aarch64-linux-gnu-g++ /usr/bin/aarch64-linux-gnu-g++-8
49+
fi
3550
fi
3651
- checkout
3752
- run:
@@ -106,6 +121,32 @@ jobs:
106121
- ARCH: "aarch64"
107122
- DEBUG: "1"
108123

124+
linux-armv7-release:
125+
<<: *linux_build
126+
environment:
127+
- PLATFORM: "linux"
128+
- ARCH: "armv7"
129+
130+
linux-armv7-debug:
131+
<<: *linux_build
132+
environment:
133+
- PLATFORM: "linux"
134+
- ARCH: "armv7"
135+
- DEBUG: "1"
136+
137+
linux-aarch64-release:
138+
<<: *linux_build
139+
environment:
140+
- PLATFORM: "linux"
141+
- ARCH: "aarch64"
142+
143+
linux-aarch64-debug:
144+
<<: *linux_build
145+
environment:
146+
- PLATFORM: "linux"
147+
- ARCH: "aarch64"
148+
- DEBUG: "1"
149+
109150
workflows:
110151
version: 2
111152
continous:

circle/build_linux.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
export NE10_LINUX_TARGET_ARCH=${ARCH:-armv7}
6+
BUILD_DEBUG=${DEBUG:-0}
7+
8+
TEST_TYPES="
9+
-DNE10_SMOKE_TEST=ON \
10+
-DNE10_REGRESSION_TEST=ON \
11+
-DNE10_PERFORMANCE_TEST=ON
12+
"
13+
for test_type in ${TEST_TYPES}; do
14+
rm -rf build && mkdir build && pushd build
15+
cmake \
16+
-DCMAKE_TOOLCHAIN_FILE=../GNUlinux_config.cmake \
17+
-DBUILD_DEBUG=${BUILD_DEBUG} \
18+
${test_type} \
19+
..
20+
VERBOSE=1 make -j8
21+
popd
22+
done

modules/imgproc/NE10_boxfilter.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ void ne10_img_boxfilter_rgba8888_c (const ne10_uint8_t *src,
368368
if (!dst_buf)
369369
{
370370
fprintf (stderr,
371-
"ERROR: buffer allocation fails!\nallocation size: %d\n",
371+
"ERROR: buffer allocation fails!\nallocation size: %lu\n",
372372
sizeof (ne10_uint8_t) *
373373
src_sz.x *
374374
src_sz.y *

modules/imgproc/NE10_boxfilter.neon.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ void ne10_img_boxfilter_col_neon (const ne10_uint8_t *src,
274274
if (!sum_row)
275275
{
276276
fprintf (stderr,
277-
"ERROR: buffer allocation fails!\nallocation size: %d\n",
277+
"ERROR: buffer allocation fails!\nallocation size: %lu\n",
278278
sizeof (ne10_uint32_t) *
279279
src_sz.x *
280280
RGBA_CH);

0 commit comments

Comments
 (0)