-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
50 lines (45 loc) · 1.58 KB
/
Copy pathsetup.py
File metadata and controls
50 lines (45 loc) · 1.58 KB
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
import setuptools
from setuptools.command.develop import develop
import os
import subprocess
BASEPATH = os.path.dirname(os.path.abspath(__file__))
class CustomDevelop(develop):
def run(self):
original_cwd = os.getcwd()
folder = os.path.join(BASEPATH, 'GraphGenerator/models/kronecker_ops')
if not os.path.exists(os.path.join(folder, 'Makefile.config')):
os.chdir(folder)
subprocess.check_call(['unzip', '-o', '-d', '.', 'kronecker_src.zip'])
folders = [
os.path.join(BASEPATH, 'GraphGenerator/models/bigg_ops/tree_clib'),
os.path.join(BASEPATH, 'GraphGenerator/models/kronecker_ops/examples/kronfit')
]
for folder in folders:
os.chdir(folder)
subprocess.check_call(['make'])
folders = [
os.path.join(BASEPATH, 'GraphGenerator/evaluate'),
]
for folder in folders:
os.chdir(folder)
subprocess.check_call(['g++', '-O2', '-std=c++11', '-o', 'orca', 'orca.cpp'])
os.chdir(original_cwd)
super().run()
setuptools.setup(
name="GraphGenerator",
version="0.1",
author="Sheng Xiang",
author_email="xiangsheng218@gmail.com",
description="Graph Generator package",
long_description_content_type="text/markdown",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
cmdclass={
'develop': CustomDevelop
}
)