Skip to content

Commit cfd4cae

Browse files
committed
Add Linux and Mac build scripts. Add missing .dylib to distribution.
1 parent fc30463 commit cfd4cae

8 files changed

Lines changed: 55 additions & 3 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# SDF files
22
*.sdf
33

4+
# Build artefacts
5+
*.o
6+
47
# PyCharm projects
58
.idea/
69

DEV_README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## Get the sources
2+
3+
Clone the repository and submodules:
4+
5+
```
6+
git clone --branch develop --recursive https://github.com/ScientificDataFormat/SDF-Python.git
7+
```
8+
9+
## Build the archive
10+
11+
To build the binaries and distribution archive run the respective build script.
12+
13+
- Windows: build_windows.bat
14+
- Linux: build_linux.sh
15+
- Mac: build_mac.sh
16+
17+
## Install the package
18+
19+
```
20+
cd SDF-Python
21+
pip install .
22+
```

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ install:
66
- cmd: git submodule update --init --recursive
77

88
test_script:
9-
- build
9+
- build_windows

build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
echo Build the shared library
2+
gcc -c -Wall -Werror -fpic -IC/include -IC/NDTable/include C/src/Python.c
3+
gcc -c -Wall -Werror -fpic -IC/NDTable/include C/NDTable/src/Core.c
4+
gcc -c -Wall -Werror -fpic -IC/NDTable/include C/NDTable/src/Interpolation.c
5+
gcc -shared -o sdf/linux64/libNDTable.so Python.o Core.o Interpolation.o
6+
7+
echo Build the distribution archive
8+
python setup.py sdist

build_linux.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
echo Build the shared library
2+
gcc -c -Wall -Werror -fpic -IC/include -IC/NDTable/include C/src/Python.c
3+
gcc -c -Wall -Werror -fpic -IC/NDTable/include C/NDTable/src/Core.c
4+
gcc -c -Wall -Werror -fpic -IC/NDTable/include C/NDTable/src/Interpolation.c
5+
gcc -shared -o sdf/linux64/libNDTable.so Python.o Core.o Interpolation.o
6+
7+
echo List exported symbols
8+
nm -g sdf/linux64/libndtable.so
9+
10+
echo Build the distribution archive
11+
python setup.py sdist

build_mac.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
echo Build the shared library
2+
clang -dynamiclib C/src/Python.c C/NDTable/src/Core.c C/NDTable/src/Interpolation.c -IC/include -IC/NDTable/include -o sdf/darwin64/libNDTable.dylib
3+
4+
echo List exported symbols
5+
nm -gU sdf/darwin64/libNDTable.dylib
6+
7+
echo Build the distribution archive
8+
python setup.py sdist
File renamed without changes.

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
author_email="",
99
license="Standard 3-clause BSD",
1010
packages=["sdf", "sdf.examples", "sdf.plot"],
11-
package_data={"sdf": ["examples/IntegerNetwork1.mat", "win32/ndtable.dll", "win64/ndtable.dll", "linux64/libndtable.so"]},
11+
package_data={"sdf": ["examples/IntegerNetwork1.mat", "win32/ndtable.dll", "win64/ndtable.dll", "linux64/libndtable.so", "darwin64/libNDTable.dylib"]},
1212
long_description="""A Python library to read and write SDF files and to interpolate multi-dimensional data""",
13-
platforms=["win32", "win64", "linux64"])
13+
platforms=["win32", "win64", "linux64", "darwin64"])

0 commit comments

Comments
 (0)