-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (43 loc) · 3.36 KB
/
Makefile
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
# Makefile for gopy pkg generation of python bindings to emergent
# File is generated by gopy (will not be overwritten though)
# gopy exe -name=leabra -vm=python3 -no-warn -exclude=driver,oswin -main="runtime.LockOSThread(); gimain.Main(func() { GoPyMainRun() })" math/rand cogentcore.org/core/ki github.com/goki/math32 cogentcore.org/core/gi/units cogentcore.org/core/gi cogentcore.org/core/gi/svg cogentcore.org/core/giv cogentcore.org/core/gi3d cogentcore.org/core/gimain github.com/emer/etable github.com/emer/emergent github.com/emer/leabra/chans github.com/emer/leabra/fffb github.com/emer/leabra/knadapt github.com/emer/leabra/nxx1 github.com/emer/leabra/leabra github.com/emer/leabra/spike github.com/emer/leabra/deep github.com/emer/leabra/hip github.com/emer/leabra/rl github.com/emer/leabra/pbwm github.com/emer/leabra/glong github.com/emer/leabra/pcore github.com/emer/leabra/agate github.com/emer/vision
PYTHON=python3
PIP=$(PYTHON) -m pip
PBGV=`$(PIP) list | grep PyBindGen`
all: prereq gen
.PHONY: prereq gen all build install install-pkg install-exe clean
prereq:
@echo "Installing go prerequisites:"
- go install golang.org/x/tools/cmd/goimports # this installs into ~/go/bin
- go install github.com/go-python/gopy@v0.4.0
@echo "Installing python prerequisites -- ignore err if already installed:"
- $(PIP) install -r requirements.txt
@echo
@echo "if this fails, you may see errors like this:"
@echo " Undefined symbols for architecture x86_64:"
@echo " _PyInit__gi, referenced from:..."
@echo
install: install-pkg install-exe
# note: it is important that leabra come before deep otherwise deep captures all the common types
# unfortunately this means that all sub-packages need to be explicitly listed.
gen:
gopy exe -name=leabra -vm=python3 -no-warn -exclude=driver,oswin,draw,example,examples,gif,jpeg,png,draw -main="runtime.LockOSThread(); gimain.Main(func() { GoPyMainRun() })" math/rand image github.com/anthonynsimon/bild/transform cogentcore.org/core/ki cogentcore.org/core/reflectx github.com/goki/math32 cogentcore.org/core/gi/units cogentcore.org/core/gist cogentcore.org/core/girl cogentcore.org/core/gi cogentcore.org/core/gi/svg cogentcore.org/core/giv cogentcore.org/core/gi3d cogentcore.org/core/gimain github.com/emer/etable github.com/emer/emergent github.com/emer/leabra/chans github.com/emer/leabra/fffb github.com/emer/leabra/knadapt github.com/emer/leabra/nxx1 github.com/emer/leabra/leabra github.com/emer/leabra/spike github.com/emer/leabra/deep github.com/emer/leabra/hip github.com/emer/leabra/rl github.com/emer/leabra/pbwm github.com/emer/leabra/glong github.com/emer/leabra/pcore github.com/emer/leabra/agate github.com/emer/vision github.com/emer/etorch
build:
$(MAKE) -C leabra build
install-pkg:
# this does a local install of the package, building the sdist and then directly installing it
# copy pyside/*.py etc to leabra so these libs will be installed along with rest
cp pyside/*.py leabra/
rm -rf dist build */*.egg-info *.egg-info
$(PYTHON) setup.py sdist
$(PIP) install dist/*.tar.gz
install-exe:
# install executable into /usr/local/bin
cp leabra/pyleabra /usr/local/bin/
install-win:
# windows version: install executable into gopath too, add .exe
- mkdir -p /usr/local/bin
- cp leabra/pyleabra $(GOPATH)/bin/pyleabra.exe
- cp leabra/pyleabra C:/usr/local/bin/pyleabra.exe
clean:
rm -rf leabra dist build */*.egg-info *.egg-info