-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors when building for Mac #47
Comments
Hi @prasanthcaibmcom 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, |
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. |
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 Thanks |
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 ? |
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, |
Thanks. Closing this issue. |
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 Does the cli driver always have to be bundled with the application using the driver? This is with |
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, |
So this would mean packaging the clidriver folder that is generated by |
Yes!!
This is error occurs when clidriver/lib is not found in the $DYLD_LIBRARY_PATH |
Ah, I see. Thanks ! |
I will try to reproduce the issue.. Thanks, |
@akhilravuri1 Is the go ibm driver supported on Linux ? |
Yes. go_ibm_db is supported on Linux. |
@akhilravuri1 Sorry! Dumb question. I meant to ask if it's supported on AIX. |
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. |
@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? |
Yes, you can follow Linux steps. |
@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 ? |
Hi @prasanthcaibmcom 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, |
I have found this rpm package you can try using this build. Thanks |
Can we cross compile a Mac build of our binary which uses go_ibm_db on a Linux machine?
When running with CGO_ENABLED=1:
Is it possible to cross-compile the package without building the driver into the binary? And allow the appropriate driver to be present at runtime ?
We are importing and using the driver like this:
We would like to use a single Linux environment to build all binaries for Windows, Mac, and Linux.
The text was updated successfully, but these errors were encountered: