From eb9925446fc3f617a9c5d5129bc85933b37bc9e6 Mon Sep 17 00:00:00 2001 From: Roman Chyla Date: Wed, 11 Mar 2015 15:01:12 -0400 Subject: [PATCH] Updated INSTALL.txt and simplified installation --- INSTALL.txt | 219 ++------------------------------------- build.properties | 9 +- build.properties.default | 9 +- build.xml | 10 +- common-build.xml | 2 +- 5 files changed, 22 insertions(+), 227 deletions(-) diff --git a/INSTALL.txt b/INSTALL.txt index dce3ee6ad..96dd0f552 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -1,223 +1,26 @@ +Pre-requisites: + + * Java SDK (v1.7 and newer) + * ant (at least 1.8) + * python (on path, v2.5 and newer) -For the impatient: +Build everything: - - OR checkout the source $ git clone git@github.com:romanchyla/montysolr.git montysolr - $ cd montysolr - $ cp build.properties.default build.properties - $ vim build.properties # review the config and set the correct paths - $ ant automatic-install - - -HOWEVER: this will work only if you already have pre-requisities installed OR if we -built them for you. In any case, give it a try! - -The automatic installation will: - - * check correct version of Python - * check for JCC module (if available in our repository, we will offer to download and install it for you) - * check pylucene package (again, we'll download and install it if available) - * build the wrapper for Solr (as a Python module) - * build MontySolr (as a Python module) - * run some basic tests - - - -== STANDARD INSTALLATION == - - $ cp build.properties.default build.properties - $ vim build.properties # edit and review the configuration - $ ant examples # downloads solr distro if necessary - # and assembles demo examples - $ ant build-all # compile montysolr (your system must meet - # requirements; see below) - $ ant run # run the demo - - - - -== REQUIREMENTS == - -To build MontySolr you need: - - * Java JDK >= 1.6 (tested and worked with both OpenJDK and Sun Java JDK) - * ant >= 1.6 - * Python >= 2.4 (if you want to take advantage of multiprocessing, then at least Python 2.5) - * setuptools for Python (needed for installation of pylucene) - * JCC module for Python - * PyLucene - -If you use automatic installation, you will need only Java and Python. But again, it is -recommended to install the requirements and not rely on our binary packages. - - -=== JCC === - -http://lucene.apache.org/pylucene/jcc/index.html - -JCC is a code generator created by Andi Vajda. It is used to wrap Java into a tiny layer of C++. Thanks to the work -of JCC, we can build Python modules from the Java code. Thanks to JCC we can use Java inside Python, and also -Python inside Java! - -JCC must be built in a shared mode (default now). To check it, you can do: - - $ python -c "from jcc import config; print 'version=', config.VERSION, ', shared=', config.SHARED" - -If shared is not 'True', then you have to rebuilt JCC - - $ cd /some/dir/with/jcc - $ export USE_DISTUTILS - $ python setup.py build - $ python setup.py install - - -- if you are on Mac OS X, the sequence is: -- - - $ cd /some/dir/with/jcc - $ export JCC_LFLAGS='-framework:JavaVM:-framework:Python' - $ export USE_DISTUTILS - $ python setup.py build - $ python setup.py install - -If your system does not have the correct setup, JCC will warn you and will also provide the instructions on -how to fix it. - - - -=== PYLUCENE === - -http://lucene.apache.org/pylucene - -PyLucene is a lucene compiled into a python module (built by JCC). -WARNING: The installed version must match with the version of lucene -present in Solr! - -The general installation instructions for pylucene can be found at: - -http://lucene.apache.org/pylucene/documentation/install.html - - -If you use pylucene <3.0.1, you must change the build slightly: - - - $ set JCCFLAGS= # this is different from the normal setup - $ export JCCFLAGS - $ pushd jcc # standard installation steps... - - $ python setup.py build - $ sudo python setup.py install - $ popd - - $ make - $ sudo make install - $ make test # (look for failures) - $ make - $ make install - -With this precedure we build pylucene in a shared mode with generics enabled. If -you need to know why, please read on: + $ ant build-all -MontySolr imports pylucene module and other modules built with JCC. When we create -a Java object, the object must have the same signature -- so that we can pass the -same object between solr, lucene and montysolr. - -For this to work Pylucene, solr and also montysolr packages must be both built -in a shared mode. Shared mode is default on many recent systems now, but it is -good to check that. - - TODO: build a small program that checks shared mode - -In MontySolr we also use generics support for Java (this makes your life as Java -programmers much easier in Python). Unfortunately, generics is not yet a default -option. So if you already built a pylucene, you will have to rebuild it again -(in my experience, inclusion of generics does not have a negative impact -- -besides you having to work with newer versions of Java, but you do that already, -right?) +If it finished successfuly, you can run the provided example distribution + $ cd ./build/contrib/examples/adsabs + $ ./run.sh +You need to chdir for this example to work properly. == FAQ == -Q: What version of Solr shall I use? - -You can use both Solr 1.4 and 3.x but make sure that also your PyLucene is the same version, *including minor versions*! -Ie. if your solr is using 2.9.3, then also your pylucene must be 2.9.3. - - - -Q: Do I need a separate distrubution of the lucene sources or is what's in the solr distribution enough? - -It is enough. But PyLucene has the lucene jars inside, so inevitably you will end up with two sets -of lucene jars. But this is not a problem. Just make sure that your PyLucene is using the same -version as your Solr instance! - - - - -Q: When I start montysolr, I see errors "ImportError: No module named solr_java" ... or "lucene", "foo", "bar" etc. - -The message comes from the Python interpreter that cannot find some module. If you installed lucene or -any other into non-standard location, then you have to make that location known to Python. - - * use PYTHONPATH - - e.g. "export PYTHONPATH=/some/path:/some/other/path" - * if you start montysolr with ant ("ant run-montysolr") - - edit build.properties - - python_path=/some/path:/some/other/path - -If the missing module is "solr_java" then you did not finish installation properly, you can fix it by: - - $ ant solr-build - -You shall find the solr_java module inside "./montysolr/build/dist" -- from there it can be easily installed. - - $ cd ./montysolr/build/dist - $ easy_install solr_java-0.1-py2.6-macosx-10.6-universal.egg - - - - -Q: When building the montysolr, I get these errors: - - build/_solr_java/__wrap__.cpp: In function �: - build/_solr_java/__wrap__.cpp:2325: error: � is not a member of � - -Your PyLucene is not built with the generics support. Please see above how to fix it. - - - -Q: I am using python virtualenv, will it cause problems? - -Absolutely no. - -Q: Are there any limitations of what I can run inside the Python? - -No, if it works in the normal Python session, it will work also inside Solr (provided that you set up correct paths, -have enough memory to host both systems etc.) - - -Q: I have several versions of Python installed, how to run MontySolr with the non-standard one? - -In the past, I was doing something like this: - - - # first set up environment vars that make your shell to see different Python - - $ export LD_LIBRARY_PATH=/opt/rchyla/python26/lib/:/opt/rchyla/python26/lib/python2.6/lib-dynload/ - $ export PYTHONHOME=/opt/rchyla/python26/ - $ export PYTHONPATH=/opt/rchyla/workspace/:/opt/rchyla/workspace/solrpie/python/ - $ export PATH=/opt/rchyla/python26/bin:/opt/rchyla/python26:/afs/cern.ch/user/r/rchyla/public/jdk1.6.0_18/bin/:$PATH - - # then use the ant to run MontySolr as a daemon - - $ export SOLRPIE_ARGS='--port 8443 --daemon' - $ export SOLRPIE_JVMARGS='-d64 -Xmx2048m -Dsolrpie.max_workers=5 -Dsolrpie.max_threads=200' - $ export SOLRPIE_MAX_WORKERS=5 - $ export SOLRPIE_NEWENVIRONMENT=false - $ ant run-solrpie-daemon Q: MontySolr (Python) fails with ImportError: module x is not available. But I am sure it is available. diff --git a/build.properties b/build.properties index 2690dd9a0..4e92fa1f5 100644 --- a/build.properties +++ b/build.properties @@ -4,12 +4,9 @@ # section of the build.xml file. Be careful to remove trailing whitespaces. -# What version we use, be careful - the version of pylucene must match with -# the lucene version and that one must match with the version of lucene used -# inside solr. - -solr.version=4.0.0-SVN -montysolr.version=4.0.0-SVN +# by default, the version will be composed as: . +# ie. 48.1.0.1 +montysolr.version=1.0.0 # if you want to use custom executables; define them here python=python diff --git a/build.properties.default b/build.properties.default index d96adb4ba..4ecd4dde0 100644 --- a/build.properties.default +++ b/build.properties.default @@ -4,12 +4,9 @@ # section of the build.xml file. Be careful to remove trailing whitespaces. -# What version we use, be careful - the version of pylucene must match with -# the lucene version and that one must match with the version of lucene used -# inside solr. - -solr.version=4.0.0-SVN -montysolr.version=4.0.0-SVN +# by default, the version will be composed as: . +# ie. 48.1.0.1 +montysolr.version=1.0.0 # if you want to use custom executables; define them here python=python diff --git a/build.xml b/build.xml index e60b94bb3..c889bacb5 100644 --- a/build.xml +++ b/build.xml @@ -19,13 +19,13 @@ - + - + @@ -96,7 +96,6 @@ - @@ -146,8 +145,7 @@ message=Automatically generated by ant during compilation of MontySolr, do not change! solr.home=${solr.home} solr.real.location=${solr.real.location} -lucene.real.location=${lucene.real.location} -solr.version=${solr.version} +lucene.real.location=${lucene.real.location} montysolr.version=${montysolr.version} @@ -280,7 +278,7 @@ montysolr.version=${montysolr.version} - + diff --git a/common-build.xml b/common-build.xml index 83fa1c038..a989cb7b8 100644 --- a/common-build.xml +++ b/common-build.xml @@ -488,7 +488,7 @@ + value="ADS"/>