/
Install-Mac.md
138 lines (91 loc) · 2.78 KB
/
Install-Mac.md
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Klamp't Tutorial: Installation on Mac OSX
In this tutorial we learn how to install Klamp't, step by step.
Difficulty: easy
Time: 10-30 minutes
- [Prebuilt Python libraries](#prebuilt-python-libraries)
- [Mac OSX, from source](#mac-osx-from-source)
- [Building the Python bindings](#building-the-python-bindings)
# Prebuilt Python libraries
For Mac OSX (Mavericks) 10.9 and above, and Python 2.7, or 3.5-3.12, you should be able to simply run
- `pip install klampt`
To run a visualization, you will need PyOpenGL and PyQt5:
- `pip install PyOpenGL`
- `pip install PyQt5`
- `git clone http://github.com/krishauser/Klampt-examples` (this is needed to run example programs)
- `cd Klampt-examples/Python/demos`
- `python gl_vis.py`
# Mac OSX, from source
1. You will need to install the Xcode Command Line Tools. To see if they are installed, run
```
xcode-select -p
```
If you see
```
/Applications/Xcode.app/Contents/Developer
```
then the full Xcode package is already installed. If not, you'll need to run
```
xcode-select --install
```
2. Install XQuartz from http://xquartz.macosforge.org/
3. Install homebrew from http://brew.sh
4. In the terminal, run
```
brew install assimp cmake ffmpeg freeglut glui homebrew/science/glpk python qt5 ode --with-double-precision
```
5. Clone the Klamp't git repo:
```
git clone https://github.com/krishauser/Klampt
```
6. Make the Klamp't dependencies:
```
cd Klampt/Cpp/Dependencies; make unpack-deps; make deps
```
7. Configure Klamp't via CMake
```
cd ..\..\; cmake .
```
or
```
cmake -DCMAKE_BUILD_TYPE=Debug .
```
if you wish to have debugging information.
8. Compile the Klamp't static library:
```
make Klampt
```
9. Make the apps:
```
make apps
```
10. Obtain the Klampt-examples package and test whether the build works:
```
git clone http://github.com/krishauser/Klampt-examples
bin/SimTest Klampt-examples/data/athlete_fractal_1.xml
```
# Building the Python bindings
1. Modify ~/.bash_profile as follows to use the homebrew version of Python:
```
export PATH=~/bin:/usr/local/bin:$PATH export PYTHONPATH=/usr/local/lib/python2.7/site-packages
```
2. Restart your terminal window and check that you have the right Python:
```
which python
```
should return
```
/usr/local/bin/python
```
3. In the terminal, install PyOpenGL with:
```
pip install PyOpenGL
```
4. Make and install the Klamp't Python bindings:
```
make python make python-install
```
Note: sudo is not required for installation if you use homebrew's Python.
5. Test that the Python bindings work:
```
python Python/demos/kbdrive.py data/tx90roll.xml
```