README
3.94 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
***************
Compilation - prerequisites
***************
This tutorial assumes that build process is performed on Linux 64bit machine (preferably from Debian/Ubuntu family).
sudo apt-get install build-essential autotools python setuptools python-stdeb
sudo pip install pyinstaller
For cross compiling:
--------------------
sudo apt-get install g++-multilib g++-mingw-w64 nsis
For Java and Python bindings:
-----------------------------
sudo apt-get install default-jdk swig
Java and Python bindings with cross-compilation support:
--------------------------------------------------------
Download CMake 2.8.x (tested on 2.8.12.1).
Apply cmake-2.8.12..1-patch.diff on the sources.
Build and install CMake from patched sources.
Java and Python bindings without cross-compilation support:
-----------------------------------------------------------
sudo apt-get install cmake
***************
Compilation
***************
Create separate build directory in morfeusz root, run cmake and make in it:
mkdir build
cd build
cmake ..
make
***************
Packaging
***************
Create packages for target platform:
make package
Create packages with Java bindings for target platform:
make package-java
Create packages with Python bindings for target platform:
make package-python
***************
Installation
***************
Install Morfeusz main program, C and C++ headers and libs:
make install
Install Python bindings:
make install-python
***************
Customizing build process
***************
Available custom CMake variables:
INPUT_TAGSET - tagset file
INPUT_DICTIONARIES - comma-separated list of dictionary files (can use empty one from input/empty.txt)
TARGET_DIR - a dir where packages built by CMake are put
Execute like following:
cmake -D INPUT_TAGSET=<file1> -D INPUT_DICTIONARIES="<dict_file1>,<dict_file2>" ..
**************************
Notes on cross-compilation
**************************
Create separate build directory, for example build-darwin.
Run:
cmake -DCMAKE_TOOLCHAIN_FILE=../morfeusz/Toolchain-xxx.cmake ..
make
make package package-java package-python
Copy Java JDK and Python libraries from target platform. Set JAVA_ROOT and PYTHON_ROOT in Toolchain files to match directories copied from target platform.
[Mac OS X 64bit] Libraries are at /System/Library/Frameworks/JavaVM.framework and /System/Library/Frameworks/Python.framework
[Windows 32 and 64 bit] usually at C:\Program Files\Java\jdk* and C:\Python27. You must also copy python27.dll from C:\Windows\System32 to Python27/libs directory.
[Linux 32bit] Java is usually at /usr/lib/jvm/default-java (alternatively you can download a package from Oracle website). The preferred way of obtaining Python is to compile it:
- compile latest version using ./configure --prefix=/some/directory/python
- copy contents of /some/directory/python to the build machine and set it as PYTHON_ROOT in Toolchain file
*************
Mac OS X
*************
## install xcode (using apple store)
# install brew
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
# install some other stuff
brew install svn
brew install swig
brew install make
# If you have Xcode 4.3 or newer the command line tools, such as make, are not installed by default. In Xcode preferences go to the "Downloads" tab and under "Components" push the "Install" button next to "Command Line Tools". After you have successfully downloaded and installed the command line tools you should also type the following command in the Terminal to make sure all your Xcode command line tools are switched to use the 4.3 versions:
#
# sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
#
# Once everything is successfully installed you should see make and other command line developer tools in /usr/bin.
#
# torrey.lyons http://stackoverflow.com/questions/11494522/installing-make-on-mac
# Must say everything is okay ("your system is ready to brew"):
brew doctor
*************
Windows
*************
Better cross-compile on Linux...