The attached Bash script (renamed to .txt for email) compiles RandLM on Ubuntu 12.04 and 14.04. The paths and logging in this script might not be what you want, but you can modify as you see fit.

Note that the Debian package manager includes packages called "sparsehash" and "libsparsehash-dev." It describe them as "Google's extremely memory-effecient C++ hash_map implementation." I do not remember that one of these packages is a dependency of RandLM, but your error seems to hint that it could be.

The resulting binaries worked fine on 12.04. We just recently learned that although the package compiles on 14.04, the resulting binaries do not run. The above dependency might also be the source of our error, but we haven't had time to debug the problem.

Tom


On 11/19/2014 07:47 PM, Hieu Hoang wrote:
There is a script within the randlm project that compiles just the library needed to integrate the library into Moses.
https://sourceforge.net/p/randlm/code/HEAD/tree/trunk/manual-compile/compile.sh
It's been a while since people have asked about RandLM, I'm not sure who's still using it and who has time & experience to take care of it.

On 19 November 2014 11:50, Achchuthan Yogarajah <[email protected] <mailto:[email protected]>> wrote:

    Hi Everyone,

    when i build RandLM with the following command
    make
    i got some error

    Making all in RandLM
    make[1]: Entering directory `/home/achchuthan/randlm-0.2.5/src/RandLM'
    make[1]: Nothing to be done for `all'.
    make[1]: Leaving directory `/home/achchuthan/randlm-0.2.5/src/RandLM'
    Making all in LDHT
    make[1]: Entering directory `/home/achchuthan/randlm-0.2.5/src/LDHT'
    /bin/bash ../../libtool  --tag=CXX --mode=compile g++
    -DHAVE_CONFIG_H -I. -I../..  -I./  -fPIC -Wno-deprecated -Wall
    -ggdb -DTIXML_USE_TICPP -g -O2 -MT libLDHT_la-Client.lo -MD -MP
    -MF .deps/libLDHT_la-Client.Tpo -c -o libLDHT_la-Client.lo `test
    -f 'Client.cpp' || echo './'`Client.cpp
    libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../.. -I./ -fPIC
    -Wno-deprecated -Wall -ggdb -DTIXML_USE_TICPP -g -O2 -MT
    libLDHT_la-Client.lo -MD -MP -MF .deps/libLDHT_la-Client.Tpo -c
    Client.cpp -fPIC -DPIC -o .libs/libLDHT_la-Client.o
    In file included from Client.cpp:6:0:
    Client.h:8:34: fatal error: google/sparse_hash_map: No such file
    or directory
     #include <google/sparse_hash_map>
                                      ^
    compilation terminated.
    make[1]: *** [libLDHT_la-Client.lo] Error 1
    make[1]: Leaving directory `/home/achchuthan/randlm-0.2.5/src/LDHT'
    make: *** [all-recursive] Error


--
        *Thanks & Regards,
        **Yogarajah Achchuthan*
        [ LinkedIn <http://lk.linkedin.com/in/achchuthany/> Twitter
        <https://twitter.com/achchuthany> Facebook
        <https://www.facebook.com/achchuthany> ]


    _______________________________________________
    Moses-support mailing list
    [email protected] <mailto:[email protected]>
    http://mailman.mit.edu/mailman/listinfo/moses-support




--
Hieu Hoang
Research Associate
University of Edinburgh
http://www.hoang.co.uk/hieu



_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

#! /bin/bash
#set -e

project=randlm
make_bin=$(dirname `readlink -f ${0}`)
if [ $EUID -ne 0 -a "${make_bin}" == "/usr/local/bin" ] ; then
        echo 'This script must be run as root/super user' 1>&2
        exit 1
elif [ $EUID -eq 0 -a ! "${make_bin}" == "/usr/local/bin" ] ; then
        echo 'This script can not be run as root/super user' 1>&2
        exit 1
        fi
parent=$(dirname ${make_bin})



usage() {
        cat <<- EOF
        usage: ${0##*/} options

        This script compiles RandLM and places the results in 
        subfolders under the --prefix folder.

        OPTIONS:
           -p|-P    prefix directory (${parent})
           -u|-U    uninstall
           -h|-H    Show this message
        EOF
        }




# parse command line
while getopts "hHuUp:P:" OPTION ; do
        case $OPTION in
                h|H)
                        usage
                        exit 0
                        ;;
                p|P)
                        prefix=$OPTARG
                        ;;
                u|U)
                        uninstall=1
                        ;;
                *)
                        usage
                        exit 1
                        ;;
                esac
        done









prefix=${prefix:-"${parent}"}
bin="${prefix}/bin"
uninstall=${uninstall:-0}
libdir="${prefix}/lib/${project}"


pushd "${parent}/src/${project}" >/dev/null

        if [ $uninstall -eq 1 ] ; then

                make -j${procs} uninstall
                exitcode=(${PIPESTATUS[*]})

                [ -d "${libdir}" ] && find "${libdir}" -depth -type d -empty 
-exec rmdir {} \;

                if [ -d "${bin}" ] ; then
                        # remove broken simlinks
                        for f in `find "${bin}" -type l ! -exec test -r {} \; 
-print` ; do
                                rm -f ${f}
                                done
                        fi

                exit ${exitcode[0]}

                fi


        export LC_ALL=C
        procs=`grep -c "^processor" /proc/cpuinfo`
        export RANDLM="${parent}/src/${project}"

        if [ -f "/var/lib/pttools/components-domt.ini" -a $EUID -eq 0 ] ; then
                setup_config=/var/lib/pttools/components-domt.ini
        else
                setup_config=${HOME}/.pttools/components-domt.ini
                fi

        _bin=`which svnversion`
        revision=""
        if [ -n "${_bin}" ] ; then
                revision=$(${_bin} . 2>/dev/null)
                fi
        [ "${revision}" = "exported" -o -z "${revision}" ] && revision=0
        if [ -f "${setup_config}" -a "${revision}" == "0" ] ; then
                searchsection=1
                while read line ; do
                        [ "$searchsection" = "1" -a ! "${line// /}" = 
"[${project}]" ] && continue
                        searchsection=0
                        [[ "${line}" =~ "=" ]] && eval "${line// /}" 2>/dev/null
                        [ ! "$revision" = "0" ] && break
                        [ "${line:0:1}" = "[" -a ! "$line" = "[${project}]" ] 
&& break
                        done < "${setup_config}"
                fi

        uname -a >"${parent}/src/make-${project}.log"
        make --version | head -n1 >>"${parent}/src/make-${project}.log"
        gcc --version | head -n1 >>"${parent}/src/make-${project}.log"
        echo "${project} revision=${revision}" 
>>"${parent}/src/make-${project}.log"
        echo "${project} compiled=$(date -R)" 
>>"${parent}/src/make-${project}.log"
        echo "" >>"${parent}/src/make-${project}.log"

        echo "${parent}/src/${project}/autogen.sh" 
>>"${parent}/src/make-${project}.log"
        echo 
"********************************************************************************"
 >>"${parent}/src/make-${project}.log"
        "${parent}/src/${project}/autogen.sh" 2>&1 | tee -a 
"${parent}/src/make-${project}.log"
        exitcode=(${PIPESTATUS[*]})
        [ ${exitcode[0]} -ne 0 ] && exit ${exitcode[0]}
        echo 
"********************************************************************************"
 >>"${parent}/src/make-${project}.log"

        echo "${parent}/src/${project}/configure" --prefix="${libdir}" | tee -a 
"${parent}/src/make-${project}.log"
        echo 
"********************************************************************************"
 >>"${parent}/src/make-${project}.log"
        "${parent}/src/${project}/configure" --prefix="${libdir}" 2>&1 | tee -a 
"${parent}/src/make-${project}.log"
        exitcode=(${PIPESTATUS[*]})
        [ ${exitcode[0]} -ne 0 ] && exit ${exitcode[0]}
        echo 
"********************************************************************************"
 >>"${parent}/src/make-${project}.log"

        echo make -j${procs} | tee -a "${parent}/src/make-${project}.log"
        echo 
"********************************************************************************"
 >>"${parent}/src/make-${project}.log"
        make -j${procs} 2>&1 | tee -a "${parent}/src/make-${project}.log"
        exitcode=(${PIPESTATUS[*]})
        [ ${exitcode[0]} -ne 0 ] && exit ${exitcode[0]}
        echo 
"********************************************************************************"
 >>"${parent}/src/make-${project}.log"

        echo make -j${procs} install | tee -a 
"${parent}/src/make-${project}.log"
        echo 
"********************************************************************************"
 >>"${parent}/src/make-${project}.log"
        make -j${procs} install 2>&1 | tee -a 
"${parent}/src/make-${project}.log"
        exitcode=(${PIPESTATUS[*]})
        [ ${exitcode[0]} -ne 0 ] && exit ${exitcode[0]}


        [ ! -d ${bin} ] && mkdir -p ${bin}
        pushd "${bin}" >/dev/null

                # create symbolic links with relative paths
                ln -sfn ../lib/${project}/bin/* .

                popd >/dev/null

        popd >/dev/null

_______________________________________________
Moses-support mailing list
[email protected]
http://mailman.mit.edu/mailman/listinfo/moses-support

Reply via email to