Compile Opengazer-0.1.2 and get vnl_cholesky.h error - opencv

After going through so much trouble, I was able to install VXL-1.14.0 and compiled opengazer http://www.inference.phy.cam.ac.uk/opengazer/. I followed its README and a very useful note by mirkrules http://www.mirkules.com/opengazer/vxl_install_notes.txt to modify Makefile of opengazer and relevant files (such as "PointTracker.h"). For example, in my Makefile, I changed the first few lines to be as follows (The vxl headers are in "/usr/local/include/vxl" and shared libraries are in "/usr/local/lib", which has "libvnl_algo.so" and "libvnl.so"):
VXLDIR = /usr/local
VERSION = opengazer-0.1.2
CPPFLAGS = -Wall -g -O3
LINKER = -L$(VXLDIR)/lib -L/usr/local/lib -lm -ldl -lvnl -lmvl -lvnl_algo -lvgl -lgthread-2.0
# change the following line if your vxl library is installed elsewhere
INCLUDES = $(foreach prefix,/usr/local/include $(VXLDIR)/include $(VXLDIR)/include/vxl, \
$(foreach suffix,/core /vcl /contrib/oxl /core/vnl/algo,-I$(prefix)$(suffix)))
===
Still, when I compile, I get error as below:
LeastSquares.o: In function `LeastSquares::solve()':
/home/mycomp/Downloads/opengazer-0.1.2/LeastSquares.cpp:27: undefined reference to `vnl_cholesky::vnl_cholesky(vnl_matrix<double> const&, vnl_cholesky::Operation)'
/home/mycomp/Downloads/opengazer-0.1.2/LeastSquares.cpp:27: undefined reference to `vnl_cholesky::solve(vnl_vector<double> const&) const'
LeastSquares.o: In function `~vnl_cholesky':
/usr/local/include/vxl/core/vnl/algo/vnl_cholesky.h:45: undefined reference to `vnl_vector<double>::~vnl_vector()'
/usr/local/include/vxl/core/vnl/algo/vnl_cholesky.h:45: undefined reference to `vnl_matrix<double>::~vnl_matrix()'
LeastSquares.o: In function `LeastSquares::solve(double&, double&, double&)':
/home/mycomp/Downloads/opengazer-0.1.2/LeastSquares.cpp:39: undefined reference to `vnl_vector<double>::~vnl_vector()'
LeastSquares.o: In function `~vnl_cholesky':
/usr/local/include/vxl/core/vnl/algo/vnl_cholesky.h:45: undefined reference to `vnl_matrix<double>::~vnl_matrix()'
/usr/local/include/vxl/core/vnl/algo/vnl_cholesky.h:45: undefined reference to `vnl_vector<double>::~vnl_vector()'
/usr/local/include/vxl/core/vnl/algo/vnl_cholesky.h:45: undefined reference to `vnl_matrix<double>::~vnl_matrix()'
/usr/local/include/vxl/core/vnl/algo/vnl_cholesky.h:45: undefined reference to `vnl_matrix<double>::~vnl_matrix()'
collect2: ld returned 1 exit status
make: *** [opengazer] Error 1
Could anyone who is familiar with either VXL, Opengazer or compiling C libraries in general tell me what possibly is going on here? Thank you.

Using an older version of gcc seems to solve the problem:
sudo apt-get install g++-4.4
Then change the lines in Makefile that contains g++ to g++-4.4.
Refer to install notes if you get the ambiguous exception problem afterward.

Related

note: /usr/bin/ld: cannot find -lpq Rust

il" "-ldl" "-lutil" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-lutil"
= note: /usr/bin/ld: cannot find -lpq
collect2: error: ld returned 1 exit status
error: aborting due to previous error
error: could not compile actix-todo.
To learn more, run the command again with --verbose.
It looks like you are missing the postgresql-libs package. Install it using your systems package manager.
For me I needed to install libpq-dev. You can install it on linux like this:
sudo apt install libpq-dev

Linking failed when use indirectly the GNU linker

The following line generate the executable :
arm-none-eabi-ld -L/home/th/opt/arm-none-eabi/lib/ -L/home/th/opt/lib/gcc/arm-none-eabi/8.2.0/ -T /home/th/autoreverse/game/game.ld main.cpp.obj init.cpp.obj syscalls.cpp.obj queue.cpp.obj echange.cpp.obj echangeur.cpp.obj startup.s.obj -lstdc++ -lc -lgcc -o game.elf
...but replacing ld call by g++ call, do not do the job :
arm-none-eabi-g++ -L/home/th/opt/arm-none-eabi/lib/ -L/home/th/opt/lib/gcc/arm-none-eabi/8.2.0/ -T /home/th/autoreverse/game/game.ld main.cpp.obj init.cpp.obj syscalls.cpp.obj queue.cpp.obj echange.cpp.obj echangeur.cpp.obj startup.s.obj -lstdc++ -lc -lgcc -o game.elf
/home/th/opt/lib/gcc/arm-none-eabi/8.2.0/../../../../arm-none-eabi/bin/ld: main.cpp.obj: in function `std::__ioinit':
/home/th/autoreverse/game/main.cpp:43: multiple definition of `__dso_handle'; /home/th/opt/lib/gcc/arm-none-eabi/8.2.0/crtbegin.o:(.data+0x0): first defined here
/home/th/opt/lib/gcc/arm-none-eabi/8.2.0/../../../../arm-none-eabi/bin/ld: /home/th/opt/lib/gcc/arm-none-eabi/8.2.0/../../../../arm-none-eabi/lib/crt0.o: in function `_start':
/home/th/tools/newlib-cygwin-build/arm-none-eabi/libgloss/arm/semihv2m/../../../../../newlib-cygwin/libgloss/arm/crt0.S:430: undefined reference to `__bss_start__'
/home/th/opt/lib/gcc/arm-none-eabi/8.2.0/../../../../arm-none-eabi/bin/ld: /home/th/tools/newlib-cygwin-build/arm-none-eabi/libgloss/arm/semihv2m/../../../../../newlib-cygwin/libgloss/arm/crt0.S:430: undefined reference to `__bss_end__'
collect2: error: ld returned 1 exit status
What is going wrong ?
Problem solved.
Calling g++ with arguments "-v" print the complete g++ command. That's when I saw that g++ include some C runtime files : crtbegin, crti and crt0.
One of thoses files requests for bss_start' and bss_end'.
I don't need thoses files ! Remove theses with "-nostdlib" argument.

Gnucobol compiles .cob to .c failed to pass compiler of clang

I was trying to compile hello.cob to hello.c:
$ ls
hello.cob
$ cobc -x -C hello.cob
$ ls
hello.c hello.c.h hello.c.l.h hello.cob
But clang failed to compile hello.c to executable file:
$ clang hello.c
/tmp/hello-479acf.o: In function `main':
hello.c:(.text+0x1e): undefined reference to `cob_init'
hello.c:(.text+0x2a): undefined reference to `cob_stop_run'
/tmp/hello-479acf.o: In function `sampleCOBOL_':
hello.c:(.text+0x98): undefined reference to `cob_module_global_enter'
hello.c:(.text+0x133): undefined reference to `cob_display'
hello.c:(.text+0x13f): undefined reference to `cob_stop_run'
hello.c:(.text+0x15a): undefined reference to `cob_check_version'
hello.c:(.text+0x33d): undefined reference to `cob_set_cancel'
hello.c:(.text+0x38e): undefined reference to `cob_fatal_error'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is hello.cob (can be compiled by cobc -x hello.cob):
IDENTIFICATION DIVISION.
PROGRAM-ID. sampleCOBOL.
PROCEDURE DIVISION.
DISPLAY "Hello World!".
STOP RUN.
I'm quite sure clang doesn't fail to compile the C source as you don't ave any C compiler warnings or errors.
It cannot link the generated object file because you didn't told clang to link against libcob and there is no "magic" for clang to know where to find its symbols. Adding -lcob to your clang invocation may be enough already.
If you want to know how cobc invokes the compiler/linker add -v to your cobc invocation.
Note: if this version of cobc was built with gcc it defaults to use gcc, too. You can see this with cobc --info which also shows if any of the built-in commands is override by environment variables.
Additional note: cobc does not only call a C compiler/linker, it also generates C code specific for the compiler it was built with. The most important part concerning the C generation is -f[no-]computed-goto, just in case the C compiler complains (which it doesn't in your case).

Building Erlang OTP R15B from source in cygwin using jdk javac & jar, cygwin make, install, gcc and ld

Does anyone know how to get Erlang built in cygwin?
I downloaded the Erlang OTP R15B source in my cygwin installation.
Gunzipped and untarred the source.
Then I did a ./configure --prefix=/usr and then make install
Screenshot of all my steps below.
# wget the Erlang source (for UNIX systems)
wget "http://www.erlang.org/download/otp_src_R15B.tar.gz" -O "$HOME/erlang/otp_src_R15B.tar.gz"
# tar -zxvf the tarball
tar -zxvf "$HOME/erlang/otp_src_R15B.tar.gz"
# Go to the location of the code
pushd "$HOME/erlang/otp_src_R15B"
# Create perl5 symlink for perl
ln -s /usr/bin/perl.exe perl5.exe
# Configure the build
./configure --prefix=/usr
...
*********************************************************************
********************** APPLICATIONS INFORMATION *******************
*********************************************************************
wx : wxWidgets not found, wx will NOT be usable
*********************************************************************
*********************************************************************
********************** DOCUMENTATION INFORMATION ******************
*********************************************************************
documentation :
fop is missing.
Using fakefop to generate placeholder PDF files.
*********************************************************************
I was able to get past the javac paths problem by using the following script in /usr/bin/javac.exe
$ cat /usr/bin/javac.exe
#!/bin/bash
#
# A wrapper for calling javac from Cygwin.
# Tries to convert any arguments that are Unix-style paths into
# Windows-style paths. This includes any arguments to classpath or
# sourcepath or any arguments that begin with / .
#
ME="`basename $0`"
JAVAC_EXEC="$JAVA_HOME/bin/javac"
ARGS=""
while [ -n "$1" ]; do
arg="$1"
shift
case "$arg" in
-cp | -classpath)
arg="$arg' '`cygpath -p -w "$1"`"
shift
;;
-sourcepath)
arg="$arg' '`cygpath -p -w "$1"`"
shift
;;
/*)
arg="`cygpath -p -w "$arg"`"
;;
esac
ARGS="$ARGS '$arg'"
done
eval "set -- $ARGS"
#echo "$JAVAC_EXEC" "$#"
exec "$JAVAC_EXEC" "$#"
Also added /usr/bin/jar.exe as follows:
$ cat /usr/bin/jar.exe
#!/bin/bash
#
# A wrapper for calling javac from Cygwin.
# Tries to convert any arguments that are Unix-style paths into
# Windows-style paths. This includes any arguments to classpath or
# sourcepath or any arguments that begin with / .
#
ME="`basename $0`"
JAR_EXEC="$JAVA_HOME/bin/jar"
ARGS=""
while [ -n "$1" ]; do
arg="$1"
shift
case "$arg" in
-cp | -classpath)
arg="$arg' '`cygpath -p -w "$1"`"
shift
;;
-sourcepath)
arg="$arg' '`cygpath -p -w "$1"`"
shift
;;
/*)
arg="`cygpath -p -w "$arg"`"
;;
esac
ARGS="$ARGS '$arg'"
done
eval "set -- $ARGS"
#echo "$JAR_EXEC" "$#"
exec "$JAR_EXEC" "$#"
Also, modified otp.mk file setting CLASSPATH to expected windows paths as follows:
Line
172 .java.class:
173 CLASSPATH=`cygpath -wp $(CLASSPATH)` $(JAVA) $(JAVA_OPTIONS) $<
174
175
176 $(JAVA_DEST_ROOT)$(JAVA_CLASS_SUBDIR)%.class: %.java
177 CLASSPATH=`cygpath -wp $(CLASSPATH)` $(JAVA) $(JAVA_OPTIONS) -d $(JAVA_DEST_ROOT) $<
I was finally ready to do the installation
# Make
make install
...
make[6]: Entering directory `/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src'
ld -shared -o ../priv/lib/i686-pc-cygwin/trace_ip_drv.so ../priv/obj/i686-pc-cygwin/trace_ip_drv.o -lc -lutil -ldl -lm
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `my_alloc_binary':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:606: undefined reference to `driver_alloc_binary'
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:608: undefined reference to `__getreent'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `write_until_done':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:632: undefined reference to `__getreent'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `my_alloc':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:591: undefined reference to `driver_alloc'
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:593: undefined reference to `__getreent'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `my_driver_select':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:916: undefined reference to `driver_select'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `clean_que':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:736: undefined reference to `driver_free'
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:744: undefined reference to `driver_free'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `close_unlink_port':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:820: undefined reference to `driver_free'
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:820: undefined reference to `driver_free'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `trace_ip_ready_output':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:523: undefined reference to `driver_free'
../priv/obj/i686-pc-cygwin/trace_ip_drv.o: In function `trace_ip_start':
/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src/trace_ip_drv.c:371: undefined reference to `set_port_control_flags'
/usr/lib/libc.a(t-d000779.o):fake:(.text+0x2): undefined reference to `_imp__close'
/usr/lib/libc.a(t-d000994.o):fake:(.text+0x2): undefined reference to `_imp__fprintf'
/usr/lib/libc.a(t-d000913.o):fake:(.text+0x2): undefined reference to `_imp__exit'
/usr/lib/libc.a(t-d001041.o):fake:(.text+0x2): undefined reference to `_imp__fwrite'
/usr/lib/libc.a(t-d001602.o):fake:(.text+0x2): undefined reference to `_imp__send'
/usr/lib/libc.a(t-d000032.o):fake:(.text+0x2): undefined reference to `_imp____errno'
/usr/lib/libc.a(t-d000934.o):fake:(.text+0x2): undefined reference to `_imp___fcntl64'
/usr/lib/libc.a(t-d001300.o):fake:(.text+0x2): undefined reference to `_imp__memcpy'
/usr/lib/libc.a(t-d000669.o):fake:(.text+0x2): undefined reference to `_imp__accept'
/usr/lib/libc.a(t-d001513.o):fake:(.text+0x2): undefined reference to `_imp__read'
/usr/lib/libc.a(t-d001304.o):fake:(.text+0x2): undefined reference to `_imp__memset'
/usr/lib/libc.a(t-d001706.o):fake:(.text+0x2): undefined reference to `_imp__sscanf'
/usr/lib/libc.a(t-d001690.o):fake:(.text+0x2): undefined reference to `_imp__socket'
/usr/lib/libc.a(t-d001636.o):fake:(.text+0x2): undefined reference to `_imp__setsockopt'
/usr/lib/libc.a(t-d000723.o):fake:(.text+0x2): undefined reference to `_imp__bind'
/usr/lib/libc.a(t-d001119.o):fake:(.text+0x2): undefined reference to `_imp__getsockname'
/usr/lib/libc.a(t-d001239.o):fake:(.text+0x2): undefined reference to `_imp__listen'
i686-pc-cygwin/Makefile:100: recipe for target `../priv/lib/i686-pc-cygwin/trace_ip_drv.so' failed
make[6]: *** [../priv/lib/i686-pc-cygwin/trace_ip_drv.so] Error 1
make[6]: Leaving directory `/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src'
/home/Dragos/erlang/otp_src_R15B/make/run_make.mk:38: recipe for target `release_spec' failed
make[5]: *** [release_spec] Error 2
make[5]: Leaving directory `/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src'
/home/Dragos/erlang/otp_src_R15B/make/otp_release_targets.mk:119: recipe for target `release' failed
make[4]: *** [release] Error 2
make[4]: Leaving directory `/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src'
/home/Dragos/erlang/otp_src_R15B/make/run_make.mk:38: recipe for target `release' failed
make[3]: *** [release] Error 2
make[3]: Leaving directory `/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools/c_src'
/home/Dragos/erlang/otp_src_R15B/make/otp_subdir.mk:28: recipe for target `release' failed
make[2]: *** [release] Error 2
make[2]: Leaving directory `/home/Dragos/erlang/otp_src_R15B/lib/runtime_tools'
/home/Dragos/erlang/otp_src_R15B/make/otp_subdir.mk:28: recipe for target `release' failed
make[1]: *** [release] Error 2
make[1]: Leaving directory `/home/Dragos/erlang/otp_src_R15B/lib'
Makefile:899: recipe for target `install.libs' failed
make: *** [install.libs] Error 2
Does anyone know how to get past this step?
Thanks in advance.
I think you're wrong. If you read better you should see this line:
javac: directory not found: /home/Dragos/erlang/otp_src_R15B/lib/jinterface/priv/
From what I can understand, the following error messages are simply there 'cause is the unwinding of the compilation stack.
Does the directory really exists or not?
Give more information, please!

I can't make SQSH 2.1.7 with freetds 0.91

I am having trouble building sqsh against freetds. This post cross-references with https://sourceforge.net/projects/sqsh/forums/forum/365924/topic/4716627.
I've installed Freetds 0.91 from sunfreeware.com on Solaris 10. I've confirmed the installation as noted in Chapter 9 of the user guide.
Following the sqsh notes from sqsh.org, I've set the SYBASE environment variable to /usr/local/freetds and run the configure script. (I do not have Sybase installed on this machine. I shouldn't need it.)
SYBASE=/usr/local/freetds; export SYBASE
./configure --with-readline
I've checked the Makefile, it seems to be right given what I've read.
SYBASE_LIBS = -lct -ltds -lnsl -ldl -lm
When I run make, I get(after building a bunch of stuff):
make
...
...[build output]...
...
gcc -L/usr/local/freetds/lib -L/usr/local/lib cmd_alias.o cmd_bcp.o cmd_buf.o cmd_connect.o cmd_do.o cmd_echo.o cmd_exit.o cmd_for.o cmd_func.o cmd_go.o cmd_help.o cmd_history.o cmd_if.o cmd_input.o cmd_jobs.o cmd_kill.o cmd_lock.o cmd_loop.o cmd_misc.o cmd_read.o cmd_reconnect.o cmd_redraw.o cmd_reset.o cmd_return.o cmd_rpc.o cmd_set.o cmd_shell.o cmd_show.o cmd_sleep.o cmd_wait.o cmd_warranty.o cmd_while.o var_ctlib.o var_date.o var_debug.o var_dsp.o var_hist.o var_misc.o var_passwd.o var_readline.o var_thresh.o dsp.o dsp_bcp.o dsp_csv.o dsp_conv.o dsp_desc.o dsp_horiz.o dsp_html.o dsp_meta.o dsp_none.o dsp_out.o dsp_pretty.o dsp_vert.o dsp_x.o sqsh_alias.o sqsh_args.o sqsh_avl.o sqsh_buf.o sqsh_cmd.o sqsh_compat.o sqsh_ctx.o sqsh_debug.o sqsh_env.o sqsh_error.o sqsh_expand.o sqsh_fd.o sqsh_filter.o sqsh_fork.o sqsh_func.o sqsh_getopt.o sqsh_global.o sqsh_history.o sqsh_init.o sqsh_job.o sqsh_readline.o sqsh_sig.o sqsh_sigcld.o sqsh_stdin.o sqsh_strchr.o sqsh_tok.o sqsh_varbuf.o sqsh_main.o -lct -ltds -lnsl -ldl -lm -lreadline -lcurses -o sqsh
ld: warning: global symbol `_END_' has non-global binding:
(file /usr/local/freetds/lib/libct.so value=LOCL);
ld: warning: global symbol `_START_' has non-global binding:
(file /usr/local/freetds/lib/libct.so value=LOCL);
ld: fatal: file /usr/local/freetds/lib/libtds.a: unknown file type
ld: fatal: File processing errors. No output written to sqsh
collect2: ld returned 1 exit status
make[1]: *** [sqsh] Error 1
make[1]: Leaving directory `/opt/BFMIfiles/src/sqsh-2.1.7/src'
make: *** [build-subdirs] Error 2
Is the error related to this: http://www.freetds.org/faq.html#where.is.libtds.so?
Any ideas?
Reference on freetds mailing list.
Reference on sqsh help forum.
When editing src/Makefile, get rid of -ltds (as suggested here) and change -ldl to -liconv. I got that last bit from the cygwin version of the sqsh README.
I used SYBASE=/usr/local/freetds/.
After that I had to set the LD_LIBRARY_PATH=$SYBASE/lib/:/usr/local/lib/ to get the freetds and liconv libraries.
Big thanks to the freetds mailing list. http://lists.ibiblio.org/pipermail/freetds/2011q3/027382.html

Resources