-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME_GSL.txt
149 lines (103 loc) · 4.38 KB
/
README_GSL.txt
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
This README describes the step by step installation to incorporate GSL into
Stephen Hansen's Topic Modelling Python package
## OSX-64, Linux-64 or Linux-32
Step 1: Make sure you have GCC installed on your machine.
sudo apt-get install build-essential
Step 2: Install GSL on your machine.
Follow Aaron Meurer's (https://binstar.org/asmeurer) Conda installation for
GSL files by typing the following line in your terminal:
conda install -c https://conda.binstar.org/asmeurer gsl
The necessary files of GSL will now be installed in /home/usr/anaconda/lib and
/home/usr/anaconda/include.
Step 3: Download the Topic Modelling files from Stephen Hansen's github repo:
https://github.com/sekhansen/text-mining-tutorial
Step 4: Uncomment the hash-tagged sections of the setup.py folder such that the
file now has the following content (Note the change to the "ext" variable).
---------------------------
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy
import sys
if sys.platform == "win32":
include_gsl_dir = sys.exec_prefix.lower().split("anaconda2")[0]+"anaconda\\gsl\\include"
lib_gsl_dir = sys.exec_prefix.lower().split("anaconda2")[0]+"anaconda\\gsl\\lib"
else:
include_gsl_dir = sys.exec_prefix+"\\include"
lib_gsl_dir = sys.exec_prefix+"\\lib"
ext = Extension("samplers", ["samplers.pyx"],
include_dirs=[numpy.get_include(),
include_gsl_dir],
library_dirs=[lib_gsl_dir],
libraries=["gsl","gslcblas","m"]
)
setup(name = "samplers",
ext_modules=[ext],
cmdclass = {'build_ext': build_ext})
---------------------------
Step 5: CD in your Terminal into the folder with the GitHub files and the
edited setup.py file.
Step 6: Execute the following commands in your Terminal:
python setup.py build_ext --inplace
python setup.py install
Step 7: Ensure that samplers.so is now in /home/usr/anaconda/lib/site-packages.
The samplers module is now installed on your machine with GSL
## Windows-32 or Windows-64
Step 1: Install GSL on your machine.
Download the .zip from the following link:
https://code.google.com/p/oscats/downloads/detail?name=gsl-1.15-dev-win64.zip&can=2&q=
Step 2: Extract the zip into your Anaconda folder (usually C:\Users\YourName\Anaconda)
with the folder name "gsl" such that the structure is as follows:
\Anaconda
\gsl
\include
\lib
\bin
\share
\Lib
\pkgs
...
Step 3: Add the "...\Anaconda\gsl\bin\" location to your system wide PATH variable.
Control Panel > System Security > System > Advanced System Settings >
Environment Variables > System Variables, and editing PATH to include
"C:\Users\UserName\Anaconda\gsl\bin"
Step 4: Download the Topic Modelling files from Stephen Hansen's github repo:
https://github.com/sekhansen/text-mining-tutorial
Step 5: Uncomment the hashtagged sections of the setup.py folder such that the
file now has the following content (Note the change to the "ext" variable)
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import numpy
import sys
if sys.platform == "win32":
include_gsl_dir = sys.exec_prefix.lower().split("anaconda")[0]+"anaconda\\gsl\\include"
lib_gsl_dir = sys.exec_prefix.lower().split("anaconda")[0]+"anaconda\\gsl\\lib"
else:
include_gsl_dir = sys.exec_prefix+"\\include"
lib_gsl_dir = sys.exec_prefix+"\\lib"
ext = Extension("samplers", ["samplers.pyx"],
include_dirs=[numpy.get_include(),
include_gsl_dir],
library_dirs=[lib_gsl_dir],
libraries=["gsl","gslcblas","m"]
)
setup(name = "samplers",
ext_modules=[ext],
cmdclass = {'build_ext': build_ext})
Step 6: CD in your Terminal into the folder with the GitHub files and the
edited setup.py file.
Step 7: Execute the following command in your Terminal:
python setup.py build_ext --inplace
python setup.py install
TROUBLESHOOTING STEP 7:
To run Cython on windows, you need certain dependencies which
may or may not be already installed on your machine.
You need Microsoft 2008 Visual Studio installed:
https://www.dreamspark.com/Product/Product.aspx?productid=34
You need the Microsoft SDK installed on your machine:
http://www.microsoft.com/en-us/download/details.aspx?id=24826
You need a GNU compiler. The most famous is GCC:
http://sourceforge.net/projects/tdm-gcc/?source=typ_redirect
Step 8: Ensure that samplers.pyd is now in /home/usr/anaconda/lib/site-packages/
The samplers module is now installed on your machine with GSL