Giter VIP home page Giter VIP logo

Comments (21)

akhilravuri1 avatar akhilravuri1 commented on July 17, 2024

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.

prasanthcaibmcom avatar prasanthcaibmcom commented on July 17, 2024

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.

akhilravuri1 avatar akhilravuri1 commented on July 17, 2024

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.

prasanthcaibmcom avatar prasanthcaibmcom commented on July 17, 2024

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.

akhilravuri1 avatar akhilravuri1 commented on July 17, 2024

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.

prasanthcaibmcom avatar prasanthcaibmcom commented on July 17, 2024

Thanks. Closing this issue.

from go_ibm_db.

prasanthcaibmcom avatar prasanthcaibmcom commented on July 17, 2024

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.

akhilravuri1 avatar akhilravuri1 commented on July 17, 2024

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.

prasanthcaibmcom avatar prasanthcaibmcom commented on July 17, 2024

So this would mean packaging the clidriver folder that is generated by installer/setup.go for each platform?

from go_ibm_db.

akhilravuri1 avatar akhilravuri1 commented on July 17, 2024

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.

prasanthcaibmcom avatar prasanthcaibmcom commented on July 17, 2024

Ah, I see. Thanks !

from go_ibm_db.

akhilravuri1 avatar akhilravuri1 commented on July 17, 2024

Ah, I see. Thanks !

I will try to reproduce the issue..

Thanks,
Akhil

from go_ibm_db.

prasanthcaibmcom avatar prasanthcaibmcom commented on July 17, 2024

@akhilravuri1 Is the go ibm driver supported on Linux ?

from go_ibm_db.

akhilravuri1 avatar akhilravuri1 commented on July 17, 2024

Yes. go_ibm_db is supported on Linux.

from go_ibm_db.

prasanthcaibmcom avatar prasanthcaibmcom commented on July 17, 2024

@akhilravuri1 Sorry! Dumb question. I meant to ask if it's supported on AIX.

from go_ibm_db.

akhilravuri1 avatar akhilravuri1 commented on July 17, 2024

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.

prasanthcaibmcom avatar prasanthcaibmcom commented on July 17, 2024

@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.

akhilravuri1 avatar akhilravuri1 commented on July 17, 2024

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.

prasanthcaibmcom avatar prasanthcaibmcom commented on July 17, 2024

@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:

https://golang.org/dl/

Is AIX treated as Linux-like for the purpose of installing/compiling Go ?

from go_ibm_db.

akhilravuri1 avatar akhilravuri1 commented on July 17, 2024

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.

akhilravuri1 avatar akhilravuri1 commented on July 17, 2024

Hi @prasanthcaibmcom

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.