Skip to content

Commit

Permalink
doc update for macos arm64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
bimalkjha committed Dec 13, 2024
1 parent c5d823d commit cda39fe
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 59 deletions.
37 changes: 10 additions & 27 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ DEALINGS IN THE SOFTWARE.
2. [ibm_db Installation on z/OS](#inszos)
3. [ibm_db installation on MacOS M1/M2 Chip System](#m1chip)
4. [Troubleshooting Post Install Errors on MacOS](#troubleshooting)
[SQL30081N Error](#sql30081n)
[Symbol not found error or malloc error](#symbolerror)
- [SQL30081N Error](#41-sql30081n-error)
- [Symbol not found error or malloc error](#42-symbol-not-found-error-or-malloc-error)

## <a name="inslnx"></a> 1. Python-ibm_db Installation on Linux, AIX, zLinux, Windows and MacOS.

Expand Down Expand Up @@ -326,15 +326,20 @@ print('ODBC Test end')
## <a name="m1chip"></a> 3. ibm_db installation on MacOS M1/M2 Chip System (arm64 architecture)
**Important:
> [email protected] onwards supports native installation on MacOS ARM64(M* Chip/Apple Silicon Chip) system using clidriver/dsdriver version 12.1.0.
> [email protected] onwards supports native installation on MacOS ARM64(M* Chip/Apple Silicon Chip) system using clidriver/dsdriver version 12.1.0.
> You need **db2connect v12.1 license** to connect to z/OS or iSeries server from M1 Chip system.
### Installation:
Follow same steps as documented for [ibm_db Installation on Linux, AIX, zLinux, Widnows and MacOS.](#inslnx)
## <a name="troubleshooting"></a> 4. Troubleshooting Post Install Errors on MacOS
<a name="sql30081n"></a> 4.1 SQL30081N Error
### 4.1 SQL30081N Error
* If connection fails with SQL30081N error: means `ibm_db` installation is correct and you need to provide correct connection string.
<a name="symbolerror"></a> 4.2 Symbol not found error or malloc error
### 4.2 Symbol not found error or malloc error
* If `import ibm_db` fails with `Symbol not found: ___cxa_throw_bad_array_new_length` error or `malloc` error:
You need to find the correct location of lib/gcc/12 directory and add it to DYLD_LIBRARY_PATH environment variable.
Also, execute below commands from terminal with correct location of `lib/gcc/12/libstdc++.6.dylib` library.
Expand All @@ -352,25 +357,3 @@ install_name_tool -change /usr/local/lib/gcc/8/libstdc++.6.dylib /usr/local/Home
i.e. change current path of `libstdc++.6.dylib` in `libdb2.dylib` library to the corrent path in your system. You can find the path of `libstdc++.6.dylib` in libdb2.dylib using the command : `otool -L libdb2.dylib`. Once you have the path of libstdc++.6.dylib, you need to change it using the commond: `install_name_tool -change <current path in libdb2.dylib> <actual path in your system> libdb2.dylib`
Now run your test program and verify.
# M1 MAC Steps to Install IBM DB and Support Docker RUN
## Installation Steps:
### Install Podman / Docker:
- **Podman:** Follow the instructions provided on the [official Podman website](https://podman.io/getting-started/installation) to install Podman on your M1 Mac.
- **Docker:** Alternatively, you can install Docker using the native Apple Silicon version or the Rosetta-translated Intel version. Choose the method that best fits your requirements.
### Install Intel Version of Python:
1. Download and install the Intel version of Python 3.8 from the [official Python website](https://www.python.org/downloads/release/python-3810/).
2. After installation, ensure that you set the interpreter to Python 3.8 in your development environment.
## Configuration Steps:
### Configure Docker for M1:
- For M1 Macs, ensure compatibility by specifying the platform architecture during Docker build commands:
docker build -t <image_name> . --platform=linux/amd64
Alternatively, if you're using Podman:
podman build -t <image_name> . --platform=linux/amd64
### Build Docker Image (Intel):
- If you're using an Intel Mac or running Docker with Rosetta translation, use the following command to build your Docker image:
docker build -t <image_name> .
## Additional Notes:
- These steps are tailored for M1 Macs to ensure seamless installation and configuration of IBM DB and Docker support.
- Verify that your Dockerfile and any dependencies are compatible with the specified platform architecture.
Follow these steps carefully to set up IBM DB and Docker support on your M1 Mac environment. If you encounter any issues or have further questions, feel free to seek assistance from the community or relevant support channels.
Happy coding!
30 changes: 3 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Please follow detailed installation instructions as documented here: [ibm_db Ins

### For MacOS M1/M2/ Apple Silicon chip system

**MacOS with Silicon Chip** - Supported from next release onwards using v12.x clidriver.
**MacOS with Silicon Chip** - Supported from v3.2.4 onwards using v12.x clidriver.
**MacOS with Intel Chip** - Supported using v11.x clidriver only. By default v11.5.9 clidriver will get downloaded.

### Linux/Unix:
Expand Down Expand Up @@ -188,8 +188,6 @@ conda install -c conda-forge ibm_db
|Windows | x64 | Yes | Latest |
|Windows | x32 | Yes | Latest |

Install Intel/x64 version of python on M1 Chip system. Check [this](INSTALL.md#m1chip) link for detailed instructions.

## <a name="quick example"></a> Quick Example
```python
$ python
Expand Down Expand Up @@ -389,6 +387,8 @@ To suppress this error, Db2 server must be activated with db2connectactivate uti
- Db2connect license can be applied on database server or client side. A **db2connect license of version 11.5** is required for ibm_db.
- For MacOS M1/M2/M3 Chip System (ARM64 processor), **db2connect license of version 12.1** is required.
- For activating server side license, you can purchase either `Db2 Connect Unlimited Edition for System z®` or `Db2 Connect Unlimited Edition for System i®` license from IBM.
- Ask your DBA to run db2connectactivate utility on Server to activate db2connect license.
Expand Down Expand Up @@ -669,34 +669,10 @@ fail on version 8.x of Db2.

If trusted context is not set up, there will be two failures related to trusted context. When thick client has been used then additional three failures related to create, recreate DB.

`ibm_db` do not work with arm64 version of python, use x64 version.


## Known Limitations for the Python wrapper

1. The rowcount for select statements can not be generated.
2. Some warnings from the drivers are not caught by the wrapper.
As such these might go unnoticed.

# M1 MAC Steps to Install IBM DB and Support Docker RUN
## Installation Steps:
### Install Podman / Docker:
- **Podman:** Follow the instructions provided on the [official Podman website](https://podman.io/getting-started/installation) to install Podman on your M1 Mac.
- **Docker:** Alternatively, you can install Docker using the native Apple Silicon version or the Rosetta-translated Intel version. Choose the method that best fits your requirements.
### Install Intel Version of Python:
1. Download and install the Intel version of Python 3.8 from the [official Python website](https://www.python.org/downloads/release/python-3810/).
2. After installation, ensure that you set the interpreter to Python 3.8 in your development environment.
## Configuration Steps:
### Configure Docker for M1:
- For M1 Macs, ensure compatibility by specifying the platform architecture during Docker build commands:
docker build -t <image_name> . --platform=linux/amd64
Alternatively, if you're using Podman:
podman build -t <image_name> . --platform=linux/amd64
### Build Docker Image (Intel):
- If you're using an Intel Mac or running Docker with Rosetta translation, use the following command to build your Docker image:
docker build -t <image_name> .
## Additional Notes:
- These steps are tailored for M1 Macs to ensure seamless installation and configuration of IBM DB and Docker support.
- Verify that your Dockerfile and any dependencies are compatible with the specified platform architecture.
Follow these steps carefully to set up IBM DB and Docker support on your M1 Mac environment. If you encounter any issues or have further questions, feel free to seek assistance from the community or relevant support channels.
Happy coding!
2 changes: 1 addition & 1 deletion ibm_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
+--------------------------------------------------------------------------+
*/

#define MODULE_RELEASE "3.2.3"
#define MODULE_RELEASE "3.2.4"

#include <Python.h>
#include <datetime.h>
Expand Down
11 changes: 7 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from setuptools.command.install import install

PACKAGE = 'ibm_db'
VERSION = '3.2.3'
VERSION = '3.2.4'
LICENSE = 'Apache License 2.0'
readme = os.path.join(os.path.dirname(__file__),'README.md')

Expand Down Expand Up @@ -512,6 +512,7 @@ def print_exception( e, url):
_checkGcc()
_checkPythonHeaderFile()

#'Operating System :: z/OS', pypi upload fails with error - Not a valid classifier
setup( name = PACKAGE,
version = VERSION,
license = LICENSE,
Expand All @@ -525,10 +526,12 @@ def print_exception( e, url):
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Operating System :: Microsoft :: Windows :: Windows 10',
'Operating System :: Microsoft :: Windows :: Windows 11',
'Operating System :: Unix',
'Operating System :: Linux',
'Operating System :: MacOS-x64',
'Operating System :: z/OS',
'Operating System :: POSIX :: AIX',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS',
'Operating System :: MacOS :: MacOS X',
'Programming Language :: Python',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
Expand Down

0 comments on commit cda39fe

Please sign in to comment.