Error while instaling Open GRM thrax - c++

I have already installed Open Fst in Ubuntu and its working fine. Now i'm trying to install Open GRM thrax. I have tried installing with 2 different versions of thrax.
Thrax version 1.1.0:
thraxOpenGrm/thrax-1.1.0$ ./configure
below is the error that i get.
checking how to hardcode library paths into programs... immediate
checking for bison... no
checking for byacc... no
checking for std::tr1::hash<long long unsigned>... yes
checking for __gnu_cxx::slist<int>... yes
checking fst/fst.h usability... yes
checking fst/fst.h presence... no
configure: WARNING: fst/fst.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: fst/fst.h: proceeding with the compiler's result
checking for fst/fst.h... yes
checking fst/extensions/far/far.h usability... yes
checking fst/extensions/far/far.h presence... no
configure: WARNING: fst/extensions/far/far.h: accepted by the compiler, rejected by the preprocessor!
configure: WARNING: fst/extensions/far/far.h: proceeding with the compiler's result
checking for fst/extensions/far/far.h... yes
checking fst/extensions/pdt/pdt.h usability... no
checking fst/extensions/pdt/pdt.h presence... no
checking for fst/extensions/pdt/pdt.h... no
configure: error: fst/extensions/pdt/pdt.h header not found
Thrax version 0.1.0:
thraxOpenGrm/thrax-0.1.0$ ./configure
below is the error that i get.
checking how to hardcode library paths into programs... immediate
checking for bison... no
checking for byacc... no
checking for std::tr1::hash<long long unsigned>... yes
checking for __gnu_cxx::slist<int>... yes
checking fst/fst.h usability... no
checking fst/fst.h presence... no
checking for fst/fst.h... no
configure: error: fst/fst.h header not found
It throws different errors with different thrax versions. I read a solution in this forum.
http://www.openfst.org/twiki/bin/view/Forum/GrmThraxForum
It says openfst must be 'built' with ./configure --enable-far=true . i uninstalled openfst and installed it using ./configure --enable-far=true and also with ./configure --enable-far. The error still persists.

During installation of openfst you have to type:
./configure --enable-far=true --enable-pdt=true --enable-mpdt=true
Then you should install thrax and while on it, type in terminal:
export LD_LIBRARY_PATH=/usr/local/lib
Worked for me for openfst-1.5.4 and thrax-1.2.2.
When I got:
checking fst/extensions/pdt/pdt.h usability... no
I added:
--enable-pdt=true
to ./configure for openfst and I did the same for mpdt error. If you get other errors, you can try doing the same.

if you specify ./configure --enable-far=true, it should work. Because it will install fst folder under /usr/local/include (you should run make install when install opengrm)

then, you may come across error like: fst/extensions/pdt/pdt.h header not found
you can add --enable-pdt=true when ./configure opengrm

I would try to remove openfst against and then do a find on the system to make sure all the fst/fst.h files are gone. It might be missing something or some other package might have provided one.
Also, the --enable-far should not have =true on the end. So, maybe try it that way.

Related

pyenv: BUILD FAILED (OS X 10.15.7 using python-build 20180424)

I just installed pyenv on macOS Catalina, and I get the following error message with the command pyenv doctor:
Cloning /Users/joel.rontynen/.pyenv/plugins/pyenv-doctor/bin/.....
Installing python-pyenv-doctor...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 10.15.7 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/tl/_2700jnn5vj0q5ryygn4c4ww0000gp/T/python-build.20201014132428.46509
Results logged to /var/folders/tl/_2700jnn5vj0q5ryygn4c4ww0000gp/T/python-build.20201014132428.46509.log
Last 10 log lines:
checking readline/readline.h, presence... no
checking for readline/readline.h,... no
checking readline/rlconf.h usability... yes
checking readline/rlconf.h presence... yes
checking for readline/rlconf.h... yes
checking for SSL_library_init in -lssl... no
configure: WARNING: OpenSSL <1.1 not installed. Checking v1.1 or beyond...
checking for OPENSSL_init_ssl in -lssl... no
configure: error: OpenSSL is not installed.
make: *** No targets specified and no makefile found. Stop.
Problem(s) detected while checking system.
See https://github.com/pyenv/pyenv/wiki/Common-build-problems for known solutions.
The log file looks like this:
/var/folders/tl/_2700jnn5vj0q5ryygn4c4ww0000gp/T/python-build.20201021121358.92440 ~
Cloning into 'python-pyenv-doctor'...
warning: --depth is ignored in local clones; use file:// instead.
done.
/var/folders/tl/_2700jnn5vj0q5ryygn4c4ww0000gp/T/python-build.20201021121358.92440/python-pyenv-doctor /var/folders/tl/_2700jnn5vj0q5ryygn4c4ww0000gp/T/python-build.20201021121358.92440 ~
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking for rl_gnu_readline_p in -lreadline... yes
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking readline/readline.h, usability... no
checking readline/readline.h, presence... no
checking for readline/readline.h,... no
checking readline/rlconf.h usability... yes
checking readline/rlconf.h presence... yes
checking for readline/rlconf.h... yes
checking for SSL_library_init in -lssl... no
configure: WARNING: OpenSSL <1.1 not installed. Checking v1.1 or beyond...
checking for OPENSSL_init_ssl in -lssl... no
configure: error: OpenSSL is not installed.
make: *** No targets specified and no makefile found. Stop.
I installed pyenv and pyenv-virtualenv using Homebrew, and the update and doctor add-ons by cloning the GitHub repository. The command brew list gives the following output:
fig pyenv-virtualenv xz
openssl#1.1 pyenv readline
My .zshrc file looks like this:
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi
and .zshenv file like this:
eval "$(pyenv virtualenv-init -)"
I'm not sure what other information is relevant, so you can ask for more in the comments.
The problem was OpenSSL that was installed with Homebrew, but which "was not symlinked into /usr/local, because macOS provides LibreSSL." I learned this by running the command brew info openssl, which says
openssl#1.1: stable 1.1.1h (bottled) [keg-only]
Cryptography and SSL/TLS Toolkit
https://openssl.org/
/usr/local/Cellar/openssl#1.1/1.1.1h (8,067 files, 18.5MB)
Poured from bottle on 2020-10-14 at 12:44:32
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/openssl#1.1.rb
License: OpenSSL
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl#1.1/certs
and run
/usr/local/opt/openssl#1.1/bin/c_rehash
openssl#1.1 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.
If you need to have openssl#1.1 first in your PATH run:
echo 'export PATH="/usr/local/opt/openssl#1.1/bin:$PATH"' >> ~/.zshrc
For compilers to find openssl#1.1 you may need to set:
export LDFLAGS="-L/usr/local/opt/openssl#1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl#1.1/include"
For pkg-config to find openssl#1.1 you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/openssl#1.1/lib/pkgconfig"
The fix can be found in the message above under the line "==> Caveats". I added the export LDFLAGS and CPPFLAGS lines to my ~/.zshrc file and the pyenv doctor command does not give any errors anymore.

configure: error: Can not link to libboost_atomic

I am trying to compile some code. I installed boost using
brew install boost
which successfully completed. I then ran
autoreconf --install
which then allowed me to run
./configure
however it generates an error looking for libboost_atomic:
checking for a BSD-compatible install... /usr/local/bin/ginstall -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/bin/gmkdir -p
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking whether make sets $(MAKE)... (cached) yes
checking build system type... x86_64-apple-darwin15.6.0
checking host system type... x86_64-apple-darwin15.6.0
checking for boostlib >= 1.60... yes
checking whether the Boost::Thread library is available... yes
checking for exit in -lboost_thread-mt... yes
checking whether the Boost::Log library is available... yes
checking for exit in -lboost_log-mt... yes
checking for exit in -lboost_log_setup-mt... yes
checking whether the Boost::Filesystem library is available... yes
checking for exit in -lboost_filesystem... yes
checking whether the Boost::Program_Options library is available... yes
checking for exit in -lboost_program_options-mt... yes
checking whether the Boost::System library is available... yes
checking for exit in -lboost_system... yes
checking whether the Boost::Chrono library is available... yes
checking for exit in -lboost_chrono-mt... yes
checking whether the Boost::Regex library is available... yes
checking for exit in -lboost_regex-mt... yes
checking whether the Boost::Date_Time library is available... yes
checking for exit in -lboost_date_time-mt... yes
checking for main in -lboost_atomic... no
configure: error: Can not link to libboost_atomic!
Searching on the internet has not yielded any information (I'm a user of the software, not a developer, so I'm not sure I'm looking for the right terms).
Can anyone tell me what I'm missing? Do I need to install further dependencies?
The system is Mac 10.11.
You're missing the package for developing with the boost atomic library. This is a common problem when compiling stuff on Linux, and your fix is to always Google the library (boost atomic) and your linux flavor, to see what to get. For Debian based systems (e.g. Ubuntu),
sudo apt-get install libboost-atomic-dev
should fix this. You may get other such errors - rinse and repeat. If all else fails you can download the source, and compile and install that:
http://www.boost.org/doc/libs/1_53_0/doc/html/atomic.html
You have make instructions there.

gcc | compile from source trouble

I try compile simple tool, and get error. Help me please fix it :)
./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for g++... g++
checking whether the C++ compiler works... yes
....
....
checking for main in -lboost_filesystem... no
configure: error: in `/root/tbb2mbox/mbox2eml-0.1.2':
configure: error: boost_filesystem is required
but boost, boost-devel is installed
boost-1.33.1-16.el5_9
boost-devel-1.33.1-16.el5_9
libs
ldconfig -p | grep boost_filesystem
libboost_filesystem.so.2 (libc6,x86-64) => /usr/lib64/libboost_filesystem.so.2
headers
rpm -ql boost-devel | grep filesystem
/usr/include/boost/filesystem
/usr/include/boost/filesystem/config.hpp
/usr/include/boost/filesystem/convenience.hpp
/usr/include/boost/filesystem/exception.hpp
/usr/include/boost/filesystem/fstream.hpp
/usr/include/boost/filesystem/operations.hpp
/usr/include/boost/filesystem/path.hpp
/usr/lib64/libboost_filesystem.a
/usr/lib64/libboost_filesystem.so
What i can do for success ? ))
When configure performs a test, it generally only reports the results to the terminal. However, it also logs most of the work it does to config.log.
So, when confronted with an error like this, the best thing to do is search through config.log to find the failing compilation. This will give you more information about exactly what has failed, which should let you fix the underlying problem.

Basemap installation on Mac laptop

I know there are several questions about this topic, but I cannot find a clear answer.
I'm trying to install Basemap in my laptop (Mac OS X, v 10.6.8). I'm running Python 2.7.8 |Anaconda 2.0.1.
Python is installed in the following folder: users/myname/anaconda
I've downloaded basemap-1.0.7 into the same folder (users/myname/anaconda), then I follow the instructions from http://matplotlib.org/basemap/users/installing.html:
To install the GEOS library I open up a terminal and type:
cd anaconda/basemap-1.0.7/geos-3.3.3/
export GEOS_DIR=/user/myname/anaconda
./configure --prefix=$GEOS_DIR
Then I get the following error:
checking host system type... i386-apple-darwin10.8.0
checking target system type... i386-apple-darwin10.8.0
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/myname/anaconda/basemap-1.0.7/geos-3.3.3':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
Then, when I try to run make; make install I get the error:
-bash: make: command not found
Can someone explain what I'm doing wrong?
The problem is that Basemap needs to compile GEOS, which is a C library, so you need a C compiler.
Alternatively, just download and install from the Mac OSX binaries provided here: http://trac.osgeo.org/geos/

Why autoconf isn't detecting boost properly?

I am using autoconf to detect boost libraries, with the support of the autoconf-archive macros and they work fine with system-wide boost libraries, but fail if I manually compile boost in my home directory:
sb#stephane:~/devel/spectra2$ ./configure --with-boost=/home/sb/local/
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for library containing strerror... none required
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for boostlib >= 1.31.0... yes
checking whether the Boost::Program_Options library is available... yes
checking for exit in -lboost_program_options... yes
checking whether the Boost::Filesystem library is available... yes
checking for exit in -lboost_filesystem... no
checking for exit in -lboost_filesystem... (cached) no
checking for exit in -lboost_filesystem... (cached) no
configure: error: Could not link against boost_filesystem !
As you can see, it detects some libraries fine, but it fails with boost-filesystem. These are the contents of ~/local/lib:
sb#stephane:~$ ls -1 /home/sb/local/lib/
libboost_filesystem.a
libboost_filesystem.so
libboost_filesystem.so.1.42.0
libboost_program_options.a
libboost_program_options.so
libboost_program_options.so.1.42.0
libboost_system.a
libboost_system.so
libboost_system.so.1.42.0
libboost_thread.a
libboost_thread.so
libboost_thread.so.1.42.0
So the library is there. I tried with both boost-1.39 and boost-1.42 with no different result, any idea why is this happening? Did I forget about something?
Since boost-1.39 libboost_filesystem depends on libboost_system. Before 1.39 you could only link to boost_filesystem, in later versions you have to link to both of them.
Maybe it has something to do with your error.
I've found boost.m4 to be much more robust than the Boost macros available from the Autoconf Macro Archive. You may have good luck simply migrating to boost.m4.