-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathcompile.sh
59 lines (50 loc) · 2 KB
/
compile.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Copyright (c) 2022, mushroomfire in Beijing Institute of Technology
# This file is from the mdapy project, released under the BSD 3-Clause License.
# To compile the C module for different python versions.
#!/usr/bin/env bash
version="0.11.5"
if [ "$(uname)" == "Darwin" ]; then
source ~/anaconda3/etc/profile.d/conda.sh
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
source ~/miniconda3/etc/profile.d/conda.sh
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
source D:/Software/miniconda3/etc/profile.d/conda.sh
fi
for i in 8 9 10 11
do
echo "py3${i}"
conda activate "py3${i}"
python -m pip install --upgrade pip setuptools wheel twine
pip install pybind11 build
if [ "$(uname)" == "Darwin" ]; then
echo "Mac OS X"
python setup.py bdist_wheel
pip install delocate
name="dist/mdapy-${version}-cp3${i}-cp3${i}-macosx_11_0_arm64.whl"
delocate-wheel -w wheelhouse -v ${name}
# python -m build --no-isolation This has bugs in Mac OS.
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
echo "GNU/Linux"
python setup.py bdist_wheel
pip install auditwheel
name="dist/mdapy-${version}-cp3${i}-cp3${i}-linux_x86_64.whl"
auditwheel repair ${name} --plat=manylinux_2_35_x86_64
oldname="wheelhouse/mdapy-${version}-cp3${i}-cp3${i}-manylinux_2_35_x86_64.whl"
newname="wheelhouse/mdapy-${version}-cp3${i}-cp3${i}-manylinux1_x86_64.whl"
cp ${name} ${newname}
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
echo "Windows NT"
python setup.py bdist_wheel
pip install delvewheel
name="dist/mdapy-${version}-cp3${i}-cp3${i}-win_amd64.whl"
delvewheel repair ${name}
fi
conda deactivate
done
# python setup.py sdist
# python -m twine upload wheelhouse/*
# rename 's/linux/manylinux1/' mdapy-0.9.1*linux* -n
## doc
# rm .\source\mdapy.rst
# sphinx-apidoc -o ./source ../mdapy/
# make html