Comments (21)
Hi @prasanthcaibmcom
Before Go 1.12 we can use binary-only packages but from Go1.12 binary-only packages are not supported.
You can cross-compile but our go driver needs clidriver of that platform(compilation) so if you have that platform clidriver you can use it.
Thanks,
Akhil
from go_ibm_db.
Can we cross compile without CGO_ENABLED=1 as long the clidriver is present?
CGO_ENABLED=1 seems to cause the issue that I posted above for a Mac build. But I cannot seem to compile with CGO_ENABLED=0 either without error.
from go_ibm_db.
Our go driver is on top of the cli driver(which is written in c language) so you need to enable the CGO flag(CGO_ENABLED=1).
This may help you
https://medium.com/@diogok/on-golang-static-binaries-cross-compiling-and-plugins-1aed33499671
Thanks
Akhil
from go_ibm_db.
I am trying to understand the nuance here about cross compiling:
Namely: Is there a way to not package the go_ibm_db2 driver building the go executable, so that we can build it without CGO_ENABLED ?
And then later, drop in the appropriate driver ?
from go_ibm_db.
Sorry!! you cannot use package go_ibm_db to an executable without enabling the CGO_ENABLED flag.
In the windows version, you can use it without the cgo_enabled flag.
Thanks,
Akhil
from go_ibm_db.
Thanks. Closing this issue.
from go_ibm_db.
I built the binary on a Mac system with CGO_ENABLED. When running on another Mac system, I get the following:
drsmac:~ macadmin$ ./drs-agent
dyld: Library not loaded: libdb2.dylib
Referenced from: /Users/macadmin/./drs-agent
Reason: image not found
Abort trap: 6
Does the cli driver always have to be bundled with the application using the driver?
This is with CGO_ENABLED=1 go build
from go_ibm_db.
I have never tested it. As of my knowledge no need to bundle the clidriver in the application. But the cli driver has to be present in the system where you are running the binary.
I will also give a try.
Thanks,
Akhil
from go_ibm_db.
So this would mean packaging the clidriver folder that is generated by installer/setup.go
for each platform?
from go_ibm_db.
Yes!!
dyld: Library not loaded: libdb2.dylib
This is error occurs when clidriver/lib is not found in the $DYLD_LIBRARY_PATH
It's not just packaging you need to set the env variables required.
from go_ibm_db.
Ah, I see. Thanks !
from go_ibm_db.
Ah, I see. Thanks !
I will try to reproduce the issue..
Thanks,
Akhil
from go_ibm_db.
@akhilravuri1 Is the go ibm driver supported on Linux ?
from go_ibm_db.
Yes. go_ibm_db is supported on Linux.
from go_ibm_db.
@akhilravuri1 Sorry! Dumb question. I meant to ask if it's supported on AIX.
from go_ibm_db.
Our Go driver supports all platforms where clidriver and Go are supported.
Our driver should support on AIX as go and clidriver is supported there. But, I never tested on that platform.
from go_ibm_db.
@akhilravuri1 Thanks...but I don't quite understand the process. What steps would be run for grabbing the cli driver? Which environment variables would be exported?
Your instructions have steps for Mac, Linux, and Windows.....would I follow the Linux steps?
from go_ibm_db.
Your instructions have steps for Mac, Linux, and Windows.....would I follow the Linux steps?
Yes, you can follow Linux steps.
from go_ibm_db.
@akhilravuri1 Thanks...and this may be a silly question, but how would one build Golang on AIX machine? Seeing as golang does not provide installers for this platform:
Is AIX treated as Linux-like for the purpose of installing/compiling Go ?
from go_ibm_db.
Hi @prasanthcaibmcom
If you want to use go on AIX you need to build it from the source.
All the steps are given in this link https://golang.org/doc/install/source?download=go1.13.5.src.tar.gz
Like which tools are required to build and how to use them and how to set the env's.
If you face any issues while building please feel free to contact me.
Thanks,
Akhil
from go_ibm_db.
I have found this rpm package you can try using this build.
http://www.bullfreeware.com/pkg?id=5515
Thanks
Akhil
from go_ibm_db.
Related Issues (20)
- Panic when initDriver HOT 6
- index out of range [2021] with length 2021 HOT 3
- ../../go/pkg/mod/github.com/ibmdb/[email protected]/api/api_unix.go:13:11: fatal error: sqlcli1.h: No such file or directory HOT 2
- How to fix CLI0129E An attempt to allocate a handle failed because there are no more handles to allocate HOT 2
- After connecting to db2 successfully, Chinese character display exception in the query result HOT 14
- Stored procedures support array-based input parameters HOT 2
- Inconsistent GSKIT Error 2 HOT 12
- fatal error: invalid pointer found on stack HOT 6
- [help]how to debug the cost breakdown HOT 2
- The gbk encoded Chinese field may be truncated when read in the utf8 operating environment HOT 1
- SQL_DECIMAL type uses comma as separator, not period, so it can't convert to float64 HOT 5
- [CRITICAL] - double byte characters are truncated for CHAR columns HOT 1
- Driver support sql.Named or not? HOT 2
- DECIMAL Precision is lost by binding variables by inserting string HOT 4
- Get Clob CLI0131E Invalid string or buffer lengt HOT 2
- Does go_ibm_db support informix HOT 1
- Support go_ibm_db driver with UBI 9 and openssl 3.0 HOT 6
- Adding Dynamic Cursor Functionalities HOT 1
- Add env var to override cli driver download url
- DB2 Connection TCP/IP Error HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go_ibm_db.