go-sqlite3 compiler arguments for cross compile OSX to linux - sqlite

https://github.com/mattn/go-sqlite3/
Can't find the correct go build compiler arguments for OSX to linux using the clang compiler, help greatly appreciated thx
% env GOOS=linux CGO_ENABLED=1 go build -ldflags "-linkmode external -extldflags -static"
# runtime/cgo
ld: unknown option: --build-id=none
clang: error: linker command failed with exit code 1 (use -v to see invocation)
% env GOOS=linux CGO_ENABLED=1 go build
# runtime/cgo
ld: unknown option: --build-id=none
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Note that a plain go build without cross compiling works

Related

why make command is not working in solaris 11 server?

I am trying to build a package in my solaris 11 server. I am using 'make'command for that and not able to build package
have already tried below commands:-
1)make
2)sudo make
3)make package
The error I am getting
bash-4.4$ make
cc -c timeout.c
sh: cc: not found
*** Error code 127
make: Fatal error: Command failed for target `timeout.o'
bash-4.4$ sudo make
cc -c timeout.c
sh: cc: not found
*** Error code 127
make: Fatal error: Command failed for target `timeout.o'
bash-4.4$ ^C
bash-4.4$ ^C
bash-4.4$
sh: cc: not found means you do not have a program named cc found in your $PATH, so it can't figure out what C compiler you want it to run.
If you've installed the Oracle Developer Studio compilers, then you need to add the path to them to your $PATH environment variable.
If you're using gcc instead, you probably need to run make CC=gcc to set the CC variable to the name of the compiler you want to use.

fblualib installation with luarocks

I am trying to install fblualib and facing this issue that I have not been able to find a work around it.
I issued following commands:
git clone https://github.com/facebook/fblualib.git
cd fblualib/fblualib/python
luarocks make rockspec/*
and having the following output: Any help is greatly appreciated as I am really stuck in this error.
cmake -E make_directory build &&
cd build &&
cmake -DROCKS_PREFIX=/home/ubuntu/usr/local/torch/install/lib/luarocks/rocks/fbpython/0.1-1 \
-DROCKS_LUADIR=/home/ubuntu/usr/local/torch/install/lib/luarocks/rocks/fbpython/0.1-1/lua \
-DROCKS_LIBDIR=/home/ubuntu/usr/local/torch/install/lib/luarocks/rocks/fbpython/0.1-1/lib \
.. &&
make
-- Found Torch7 in /home/ubuntu/usr/local/torch/install
-- Boost version: 1.58.0
-- Found the following Boost libraries:
-- thread
-- chrono
-- system
-- date_time
-- atomic
-- Found PythonInterp: /usr/local/bin/python2.7 (found suitable version "2.7.14", minimum required is "2.7")
-- Found PythonInterp: /usr/local/bin/python2.7 (found version "2.7.14")
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ubuntu/usr/src/fblualib/fblualib/python/build
[ 11%] Linking CXX shared module lib.so
/usr/bin/ld: /usr/local/lib/libpython2.7.a(abstract.o): relocation R_X86_64_32S against `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libpython2.7.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
CMakeFiles/lua_module.dir/build.make:283: recipe for target 'lib.so' failed
make[2]: *** [lib.so] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/lua_module.dir/all' failed
make[1]: *** [CMakeFiles/lua_module.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
So basically I found the issue, it was all fixed by adding --enable-shared during python compilation. So I recompiled the python again and it worked. Hope it helps others and prevents them from spending the same time.

Qt error: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libGL.so when searching for -lGL

Qt 5.7.0 GCC 4.9.1
I created a simple widget project (no single code written, no settings changed, only drag a few controls to the form) right after installing Qt and did a test compile. I got error messages:
:-1: error: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libGL.so when searching for -lGL
:-1: error: skipping incompatible /lib/libGL.so when searching for -lGL
:-1: error: skipping incompatible /usr/lib/libGL.so when searching for -lGL
:-1: error: cannot find -lGL
:-1: error: collect2: error: ld returned 1 exit status
I reckon that it was trying to link to the 32 bit OpenGL in my 64 bit machine. /usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../libGL.so is indeed located in /usr/lib/libGL. The 64 bit version, I think, is the one in /usr/lib64/libGL. How can I change the linking path so that it will link to the right library?
This seems like you are missing libraries needed to compile 32-bit binaries.
Try running:
sudo yum install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686
this is how I solved this problem.
locate libGL.so and find the right 64 bit version (I used the latest);
create a link in the Qt lib path: ln -s /usr/lib64/libGL.so.352.79 ~/Qt/5.7/gcc_64/lib/libGL.so

Install RPostgreSQL to connect to Postgres.app

I am trying to install RPostgreSQL on a Mac running OSX 10.9.5 (Mavericks) and R 13.4.0 (Darwin). I guess I don't have a running Postgres installation on my system since, from Terminal:
% which postgres
postgres not found
I use [Postgres.app][1]
I tried installing RPostgreSQL from source
library(devtools)
install('~/Downloads/rpostgresql-read-only/RPostgreSQL')
but I get the error
clang: error: unknown argument: '-Kthread'
clang: error: unknown argument: '-kthread'
make[1]: *** [fe-auth.o] Error 1
make: *** [libpq/libpq.5.dylib] Error 2
ERROR: compilation failed for package ‘RPostgreSQL’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/RPostgreSQL’
Error: Command failed (1)
which is not exactly self-explanatory. I google it but I couldn't find any relations with RPostgreSQL.
I was able to do a hack install by removing the 2 -KThread flags from the MakeFile.global.darwin. I can't tell you what the -KThread flag was and why its needed, but it seemed to install fine for Mavericks (10.9.5)
PTHREAD_CFLAGS = -Kthread -kthread -pthread -pthreads -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS
changed to
PTHREAD_CFLAGS = -pthread -pthreads -D_REENTRANT -D_THREAD_SAFE -D_POSIX_PTHREAD_SEMANTICS
There's a possibly more user-friendly approach described at this blog with additional notes at the bottom of the PecanProject GitHub repo issue thread.
You'll probably have to manually link to the directory with pg_config file to address the 'libpq-fe.h' file not found issue. In my case, the command was different from that mentioned in the PecanProject issue thread:
sudo ln -s /usr/local/Cellar/postgresql/9.4.0/bin/pg_config /usr/local/bin/
I then had to
sudo ln -s /usr/local/Cellar/postgresql /usr/local/opt/postgresql
to get around a Library not loaded: /usr/local/opt/postgresql/lib/libpq.5.dylib error.
A final hat-tip to Chris Chou for that last point.

/usr/bin/ld: cannot find -lXmu

I want to install netgen and try to compile the source code.
During this I got the error message:
U -L/usr/lib/x86_64-linux-gnu -ltk8.6 -ltcl8.6 -lGL -lXmu -lX11 -fopenmp -Wl,-rpath -Wl,/opt/netgen/lib
/usr/bin/ld: cannot find -lXmu
collect2: error: ld returned 1 exit status
make[2]: *** [netgen] Error 1
Maybe I have to install an additional package?
Does anyone have an idea?
You can check, depending on your specific OS, if you are not missing the missing the non-versioned named (i.e. libXmu.so).
Check for ls /usr/lib/libXmu*.*, and if not found, type:
ln -s /usr/lib/libXmu.so libXmu.so.6
ln -s /usr/lib/libXuu.so libXmuu.so.1
If you don't have any libXmu*.* files, then you need to install first libxmu-dev:
sudo apt-get install libxmu-dev

Resources