This repo is an attempt to compile Go with CGO application on IBM I AIX. I used lot of analysis and research done by other people like
and every one involved in the discussion on the following git issue (specially the user rfx77)
Special thanks to Norman Koller (RZKH GmbH) to provide required infrastructure and support !!!
- IBM I 7.4 +
- I have tested the compiled binary on 7.4 and 7.5
- Compiled binary might work on lower versions but I have not tried and so I am not sure.
 
- GCC 10
- GCC 10 is not available for version 7.2 or lower
- use command gcc --version
- There is a possibility that gcc points to older version and gcc-10 points to the newer version
- In that case we will need gcc-10
- If gcc is installed but not found, use following command to include open source packages to your path
- export PATH=$PATH:/QOpenSys/pkgs/bin
 
 
- Required yum packages for ODBC (if you want to use ODBC)
- unixODBC.ppc64
- yum install unixODBC
 
- unixODBC-devel.ppc64
- yum install unixODBC-devel
 
- libodbc2.ppc64
- yum install libodbc2
 
- ibm-iaccess.ppc64
- yum install ibm-iaccess
 
 
- unixODBC.ppc64
- clone this repo on IBM I
- Setup PATH env variable
- export PATH=$PATH:{GIT_REPO_CLONE_DIRECTORY}/ibmigo/go/bin
- export GOROOT={GIT_REPO_CLONE_DIRECTORY}/ibmigo/go
- export PATH=$PATH:/QOpenSys/pkgs/bin
 
- Create a tmp directoy in your home dir(remove old one if needed)
- rm -r /home/{USER}/tmp
- mkdir /home/{USER}/tmp
 
- GOTMPDIR="/home/{USER}/tmp" CC="/QOpenSys/pkgs/bin/{gcc-10-location}" go build {required parameters} {path to go main package}