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
Related
I am just doing some simple OCCI thing, however it compiles a bit strangely
Environment:
Oracle VM: Centos7 64bit on Windows 8 64bit
gcc-c++.x86_64
Simply installed Oracle XE by double clicking the rpm (download pages says
linux 64bit)
echo $LD_LIBRARY_PATH yields:
/usr/local/lib64/:/u01/app/oracle/product/11.2.0/xe/lib/
I also tried export LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/xe/lib/
so that it yields
/u01/app/oracle/product/11.2.0/xe/lib/
some listing command:
find /u01/app/oracle/product/11.2.0/xe/lib/ -name lib*
yields the following:
/u01/app/oracle/product/11.2.0/xe/lib/
/u01/app/oracle/product/11.2.0/xe/lib/libagtsh.so.1.0
/u01/app/oracle/product/11.2.0/xe/lib/libcell11.so
/u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so.11.1
/u01/app/oracle/product/11.2.0/xe/lib/libnnz11.so
/u01/app/oracle/product/11.2.0/xe/lib/libocci.so.11.1
/u01/app/oracle/product/11.2.0/xe/lib/libclntsh.so
/u01/app/oracle/product/11.2.0/xe/lib/libocci.so
/u01/app/oracle/product/11.2.0/xe/lib/libagtsh.so
and some others....
however the compile command says ld cannot find some libraries:
g++ -o ab -I/u01/app/oracle/product/11.2.0/xe/rdbms/public/ -lnnz11 -lclntsh -locci a.cpp
/usr/bin/ld: cannot find -lnnz11
/usr/bin/ld: cannot find -lclntsh
/usr/bin/ld: cannot find -locci
collect2: error: ld returned 1 exit status
I have tried adding -L/u01/app/oracle/product/11.2.0/xe/lib/, it successfully compiles however running the program will cause it silently crashes / blocks at the simple line
Environment *env = Environment::createEnvironment();
no exceptions caught.
Does anyone know some part I did wrong? or are the two issues related?
And by the way, it USED to work like 5 hours ago, when it suddenly stopped working I reinstalled the whole VM and now it still doesn't work.
however the compile command says ld cannot find some libraries: g++ -o ab -I/u01/app/oracle/product/11.2.0/xe/rdbms/public/ -lnnz11 -lclntsh -locci a.cpp
Your command is incorrect (and the linker is right to complain). You need to tell the linker where to find the library, and you do that with -L flag:
ORACLE=/u01/app/oracle/product/11.2.0/xe
g++ -I ${ORACLE}/rdbms/public -L ${ORACLE}/lib a.cpp -lnnz11 -lclntsh -locci
(Note that your placement of source after library is also incorrect, and I fixed it above. Placement of libraries and sources on link command line matters.)
I'm using a Raspberry Pi 2 running Ubuntu MATE 15.10 to work on a project.
I'm trying to run a makefile and got this error
/home/dpanagou/Quadrotors/Vicon/libs/libViconDataStreamSDK_CPP.so: file not recognized: File format not recognized
collect2: error: ld returned 1 exit status
Makefile:8: recipe for target '../bin/Vicon_state' failed
make[1]: *** [../bin/Vicon_state] Error 1
make[1]: Leaving directory '/home/dpanagou/Quadrotors/HLP/Vicon'
Makefile:40: recipe for target 'Vicon' failed
make: *** [Vicon] Error 2
I've also tried make clean before make.
From research, a lot of people have suggested that the object file might be corrupted. So I downloaded new files from the developer and ran the makefile again. I still get the same error.
Here is my makefile:
CUR_DIR = $(shell pwd)
CFLAGS = `pkg-config --cflags lcm`
LDFLAGS = `pkg-config --libs lcm` ../src/filter_util.o ../src/util.o
vicon_lib = $(CUR_DIR:%/HLP/Vicon=%/Vicon/libs)
../bin/Vicon_state:
g++ $(CFLAGS) Vicon_state_data.cpp -o ../bin/Vicon_state -Wl,- rpath=../../Vicon/libs -L$(vicon_lib) -lViconDataStreamSDK_CPP -lDebugServices $(LDFLAGS)
Please help with specific instructions as I am very new to Linux and programming.
Check the format of the file with the "file" command, and compare it to the format of any .so that comes with rpi.
I'm not 100% sure, but might it be that the library is for raspbian with its v6 compatible HF vs generic V7-only HF in debian?
I have been trying to enable the gold linker on FreeBSD to use the link time optimizations. I made gold from the binutils under /usr/ports. After building binutils using make -k install clean i got ld under /usr/bin and in the directory /usr/local/bin i got ld, ld.gold and ld.bfd.
Now while trying to use link time optimization for the simple example programs here http://llvm.org/docs/GoldPlugin.html (a.c and b.c under the heading 'Examples of Link Time Optimization') i entered the four commands as follows:
clang -flto a.c -c -o a.o
ar q a.a a.o
clang b.c -c -o b.o
clang -flto a.a b.o -o main
I got the following error:
usr/bin/ld: unrecogonized option '-plugin'
usr/bin/ld: use the --help option for usage information
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is there the problem with the linker that ld.gold is not being called. Should I replace the ld with ld.gold? Does the linker looks in the right directiry for the .so plugins?
The LLVMgold.so and libLTO.so shared objects are in the directory /usr/local/llvm-devel/lib/.
I cannot find the directory where clang is installed. I am not sure where to make the bfd-plugins directory and add the symlinks to LLVMgold.so and libLTO.so.
I am using freebsd 10.1 release. How to enable the gold linker for link time optimizations?
also how can I enable it to be the default linker?
You may want to use ld.gold instead of ld. It is installed at /usr/local/bin/ld.gold. If you are using a Makefile, it would work by setting LD variable to ld.gold, either by modifying your Makefile or specifying it on command line. Example in case you are using lang/clang37:
gmake all CC=clang37 LD=ld.gold
EDIT:
It would be even more neat if you add -fuse-ld=gold to your LDFLAGS:
LDFLAGS=-fuse-ld=gold
I'm not sure ld.bfd allows plugins, but I could be wrong.
Your /usr/bin/ld should be a symlink to whatever linker you want. You can change which linker is used by using binutils-config. Check the man-page here: http://www.linuxhowtos.org/manpages/8/binutils-config.htm. I realise this is a Linux link, but it's directed at binutils itself rather than linux-specifically.
It should be something along the lines binutils-config --gold.
On my Gentoo box it is binutils --linker=gold
EDIT: As pointed out, binutils-config doesn't work on BSD it seems. You can still manually update the symlinks though, the downside is that there might be a few of them.
You can find out which ld is used by your compiler by using gcc -print-prog-name=ld or clang -print-prog-name=ld. The file printed should be a symlink you can re-create to point to ld.gold as oposed to ld.bfd.
I tried installing petsc with homebrew on OSX 10.10.1 with:
$brew install petsc
I get one error installing one dependency:
==> Installing petsc dependency: hypre
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading http://ftp.mcs.anl.gov/pub/petsc/externalpackages/hypre-2.9.0b.tar.gz
Already downloaded: /Library/Caches/Homebrew/hypre-2.9.0b.tar.gz
Error: SHA1 mismatch
Expected: aaf8354437be38aa2fbcc944ab64d464a5b39207
Actual: bd7ca57e45badf322b9c9cb970403c191287da72
Archive: /Library/Caches/Homebrew/hypre-2.9.0b.tar.gz
To retry an incomplete download, remove the file above.
So I tried installing hypre with homebrew
$brew install hypre
and I didn't get any error
==> Summary
🍺 /usr/local/Cellar/hypre/2.9.0b_1: 48 files, 4.5M
Finally, I modified the petsc formula and commented out this line
depends_on "hypre" => ["with-mpi", :recommended]
Now I can install petsc but it doesn't work
configure:12901: WARNING: No PETSC_DIR set - trying to autodetect
configure:12919: Using PETSC_DIR=/usr/local
configure:12966: mpif90 -o conftest -ffast-math -frecord-marker=4 -DHAVE_NUMPY -I/usr/local/lib/python2.7/site-packages/numpy/core/include -fno-realloc-lhs -ffree-line-length-none -ffixed-line-length-none -O3 conftest.F90 -lparmetis -lmetis -llapack -lpthread -lm -lstdc++ -L/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config -lpython2.7 -u _PyMac_Error /usr/local/opt/python/Frameworks/Python.framework/Versions/2.7/Python -ldl -framework CoreFoundation -L/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/gcc/x86_64-apple-darwin14.0.0/4.9.2 -L/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/gcc/x86_64-apple-darwin14.0.0/4.9.2/../../.. -lgfortran -lquadmath -lm -L/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/gcc/x86_64-apple-darwin14.0.0/4.9.2 -L/usr/local/Cellar/gcc/4.9.2_1/lib/gcc/4.9/gcc/x86_64-apple-darwin14.0.0/4.9.2/../../.. -lgfortran -lquadmath -lm >&5
conftest.F90:3.30:
use petsc
1
Fatal Error: Can't open module file 'petsc.mod' for reading at (1): No such file or directory
I'm using Luarocks 2.2.0beta1 to install luafilesystem on windows 7 with lua 5.2 and mingw. I got this error:
>luarocks install luafilesystem
Installing http://rocks.moonscript.org/luafilesystem-1.6.2-2.src.rock...
Using http://rocks.moonscript.org/luafilesystem-1.6.2-2.src.rock... switching to 'build' mode
mingw32-gcc -O2 -c -o src/lfs.o -IC:/lua/include/src/lfs.c
mingw32-gcc -shared -o lfs.dll src/lfs.o C:/lua/bin/lua52.dll -lm
C:\lua\bin\lua52.dll: file not recognized: File format not recognized
collect2.exe: error: Id returned 1 exit status
Error: Build error: Failed compiling module lfs.dll
any idea how to fix this?
note: until now, I have no problem installing other module with luarocks that have no dependency with luafilesystem.
Solved, this problem arise because actually I'm not using the same MinGW compiler when building lua52.dll. I don't know which compiler I use at the first time. Thanks to #siffiejoe