-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathINSTALL
More file actions
184 lines (109 loc) · 5.98 KB
/
INSTALL
File metadata and controls
184 lines (109 loc) · 5.98 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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/***********************************************************************
* Created by Andreas Paffenholz on 02/16/14.
* Copyright 2012-2014 by Andreas Paffenholz.
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version: http://www.gnu.org/licenses/gpl.txt.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* INSTALL
* PolyViewer
**************************************************************************/
** Installation instructions for the binary release of PolyViewer **
1) Requirements
This application has been built for Mac OS 10.9 and any perpetual beta release of polymake after October 2013.
It will most likely not run on any other Mac OS or with older versions of polymake
2) Preparations
2a) libpolymake
PolyViewer needs the libraries libpolymake.2.12.dylib and libpolymake-app.2.12.dylib.
They will be found if you installed into /usr/local. Otherwise please do the following:
I) Check if any DYLD_LIBRARY_PATH is set in your launchd configuration: In a terminal do
launchctl getenv DYLD_LIBRARY_PATH
and remember any output.
II) launchd currently does not read locally defined configuration files (see the launchd man page).
There are two ways around this nuisance:
i) If you have sudo rights: Edit (or create, if it is not present) the file /etc/launchd.conf and add
setenv DYLD_LIBRARY_PATH <path>
where <path> should be the path to the directory containing libpolymake.2.12.dylib.
If in step 1) you found that DYLD_LIBRARY_PATH is already set, then add this to the above!
ii) If you do not have sudo rights, or you don't want to use them:
a) in your home folder, do
mkdir ~/.polyviewer
echo "#!/bin/sh" > ~/.polyviewer/launchd-setenv
echo "eval \"launchctl setenv DYLD_LIBRARY_PATH <path>\" " >> ~/.polyviewer/launchd-setenv
chmod a+x ~/.polyviewer
chmod a+x ~/.polyviewer/launchd-setenv
where <path> should be the path to the directory containing libpolymake.2.12.dylib.
If in step 1) you found that DYLD_LIBRARY_PATH is already set, then add this to the above!
ii) Inside the directory ~/Library/LaunchAgents create a file com.github.apaffenholz.PolyViewer.plist
and place the following lines into it:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>EnableGlobbing</key>
<true/>
<key>Label</key>
<string>com.github.apaffenholz.PolyViewer</string>
<key>KeepAlive</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>~/.polyviewer/launchd-setenv</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Make this file executable with
chmod a+x ~/Library/LaunchAgents/com.github.apaffenholz.PolyViewer.plist
III) In any case you will have to restart your computer to reload the launch
demon, or set the variables temporarily by executing
launchctl setenv DYLD_LIBRARY_PATH <path>
where again <path> should be the path to libpolymake.2.12.dylib.
This setting is lost with the next restart.
IV) If you know of any better way to set DYLD_LIBRARY_PATH for a gui app
it would be nice if you tell me!
2b) poly_db
This step is optional. You only have to so this if you want to use the extension poly_db to
access the polymake database.
PolyViewer provides a simple interface to the extension
"poly_db" of polymake written by Silke Horn (see github) to acces the
polymake database. To use this you first have to install poly_db and make polymake
aware of it (for this please follow the instructions on how to install extensions
at polymake.org, and the special installation instructions that come with poly_db)
During installation of poly_db for polymake you have been asked to install the
perl modules MongoDB, boolean, and Tie-IxHash. To use poly_db with PolyViewer you will
have to add the paths to these modules to the variable PERL5LIB. This is essentially done
in the same way as above for the path to libpolymake.2.12.dylib.
So find out if any paths are set already with
launchctl getenv PERL5LIB
Add any output together with an adjusted version of
/path/to/MongoDB-<version>/lib:/path/to/boolean-<version>/lib:/path/to/Tie-IxHash-<version>/lib:/path/to/lib/perl5/site_perl/<perl-version>/darwin-thread-multi-2level
either to /etc/launchd.conf (remember to put
setenv PERL5LIB
in front) or to ~/.polyviewer/launchd-setenv (in this case add
eval "launchctl setenv PERL5LIB
in front and " at the end).
Again, this is only read after a restart. Temporarily you could invoke
launchctl setenv PERL5LIB <paths>
where <paths> are the paths used above.
3) Installation
Place the PolyViewer application in your /Application folder
4) Use
Start the viewer by double clicking its icon. Note that it doesn't open a window on statup. Please chose an action from the file menu.
5) Uninstall:
i) Delete the PolyViewer application in /Application
ii) If you have changed the variables DYLD_LIBRARY_PATH or PERL5LIB for launchd during installation set them
to their original value by calling
launchctl setenv DYLD_LIBRARY_PATH <original value>
in a terminal (similarly for PERL5LIB).
Most likely, both variables have been empty originally, in that case do
launchctl unsetenv DYLD_LIBRARY_PATH
launchctl unsetenv PERL5LIB