Added headers.
[flatland.git] / build.py
1 #!/usr/bin/env python-for-pytorch
2
3 #
4 #  flatland is a simple 2d physical simulator
5 #
6 #  Copyright (c) 2016 Idiap Research Institute, http://www.idiap.ch/
7 #  Written by Francois Fleuret <francois.fleuret@idiap.ch>
8 #
9 #  This file is part of flatland
10 #
11 #  flatland is free software: you can redistribute it and/or modify it
12 #  under the terms of the GNU General Public License version 3 as
13 #  published by the Free Software Foundation.
14 #
15 #  flatland is distributed in the hope that it will be useful, but
16 #  WITHOUT ANY WARRANTY; without even the implied warranty of
17 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 #  General Public License for more details.
19 #
20 #  You should have received a copy of the GNU General Public License
21 #  along with flatland.  If not, see <http://www.gnu.org/licenses/>.
22 #
23
24 import os
25 from torch.utils.ffi import create_extension
26
27 abs_path = os.path.dirname(os.path.abspath(__file__))
28
29 ffi = create_extension(
30     '_ext.flatland',
31     headers = [ 'flatland.h' ],
32     sources = [ 'flatland.c' ],
33     extra_objects = [ abs_path + '/flatland_generator.so' ],
34     libraries = [ ],
35     library_dirs = [ ],
36     define_macros = [ ],
37     with_cuda = False
38 )
39
40 if __name__ == '__main__':
41     ffi.build()