Skip to content

Conda support #21

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

Closed
bchen290 opened this issue Jun 17, 2022 · 21 comments
Closed

Conda support #21

bchen290 opened this issue Jun 17, 2022 · 21 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@bchen290
Copy link

The original cx_Oracle had conda packages built for it. Will there eventually be conda packages built for this package? Thank you!

@bchen290 bchen290 added the enhancement New feature or request label Jun 17, 2022
@cjbj
Copy link
Member

cjbj commented Jun 19, 2022

This would a great idea for a community contribution. https://conda-forge.org/docs/maintainer/adding_pkgs.html

Oracle wasn't involved in adding the conda recipe for cx_Oracle.

@cjbj cjbj added the help wanted Extra attention is needed label Jun 19, 2022
@xylar
Copy link

xylar commented Jun 23, 2022

I'm working on this: conda-forge/staged-recipes#19367

However, I'm not having any luck getting oracledb to build with clang on OSX:

  x86_64-apple-darwin13.4.0-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/runner/mambaforge/conda-bld/oracledb_1655972733475/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/include -fPIC -O2 -isystem /Users/runner/mambaforge/conda-bld/oracledb_1655972733475/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/include -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/runner/mambaforge/conda-bld/oracledb_1655972733475/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/include -fdebug-prefix-map=/Users/runner/mambaforge/conda-bld/oracledb_1655972733475/work=/usr/local/src/conda/oracledb-1.0.1 -fdebug-prefix-map=/Users/runner/mambaforge/conda-bld/oracledb_1655972733475/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_=/usr/local/src/conda-prefix -D_FORTIFY_SOURCE=2 -isystem /Users/runner/mambaforge/conda-bld/oracledb_1655972733475/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/include -mmacosx-version-min=10.9 -I/Users/runner/mambaforge/conda-bld/oracledb_1655972733475/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_/include/python3.8 -c src/oracledb/base_impl.c -o build/temp.macosx-10.9-x86_64-cpython-38/src/oracledb/base_impl.o -target arm64-apple-macos
  clang-13: error: the clang compiler does not support '-march=core2'

Suggestions in my PR would be welcome. Otherwise, I can open another issue.

@cjbj
Copy link
Member

cjbj commented Jun 23, 2022

Excellent!

On macOS we are building with Universal2 Python binaries, and also doing a Python 3.7 build on Intel where there isn't a Universal 2 binary. The latter currently needs export ARCHFLAGS="-arch x86_64" before the build (as noted in the install doc). Try something like that.

You could also try this patch which will be landing on GitHub soon. With this patch we won't need to explicitly set ARCHFLAGS.

---
 setup.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/setup.py b/setup.py
index 7a37a6d..b4eaaed 100644
--- a/setup.py
+++ b/setup.py
@@ -25,6 +25,7 @@
 import os
 import platform
 import sys
+import sysconfig
 from setuptools import setup, Extension
 
 # base source directory
@@ -61,11 +62,10 @@ thin_depends = [os.path.join(impl_dir, n) \
 thin_depends.append(base_pxd)
 
 # if the platform is macOS, add arguments required for cross-compilation for
-# both x86_64 and arm64 architectures.
-# Use a Universal 2 Python binary to build, or set an archtecture
-# before building, e.g. export ARCHFLAGS="-arch x86_64"
+# both x86_64 and arm64 architectures if the python interpreter is a
+# universal2 version.
 extra_compile_args = []
-if sys.platform == "darwin":
+if sys.platform == "darwin" and "universal2" in sysconfig.get_platform():
     if platform.machine() == "x86_64":
         target = "arm64-apple-macos"
     else:
-- 
2.36.1

@xylar
Copy link

xylar commented Jun 23, 2022

Great, thanks! I'll add that patch.

@xylar
Copy link

xylar commented Jun 23, 2022

@cjbj, that worked like a charm!

@xylar
Copy link

xylar commented Jun 23, 2022

conda-forge/staged-recipes#19367 has now been merged. A conda-forge package for oracledb should be available in a couple of hours.

@bchen290
Copy link
Author

Thank you!

@xylar
Copy link

xylar commented Jun 23, 2022

Okay, I think this issue can be closed. The following worked for me:

conda config --add channels conda-forge
conda config --set channel_priority strict
conda create -y -n test oracledb
conda activate test
python -c "import oracledb"

@anthony-tuininga
Copy link
Member

Great! Thanks, @xylar!

@anthony-tuininga
Copy link
Member

anthony-tuininga commented Jun 23, 2022

Note that the patch that Chris mentioned and you included in your recipe is already on GitHub -- and will be included in the next release. :-)

@cjbj
Copy link
Member

cjbj commented Jun 24, 2022

@xylar Thank you - that's greatly appreciated.

As a 'heads up' we will probably also create Linux ARM wheels in that next release Anthony mentioned

@xylar
Copy link

xylar commented Jun 24, 2022

Okay, we'll also plan for arm builds soon, then.

I see that we're not able to build for PyPy: conda-forge/oracledb-feedstock#2 (comment)
Is PyPy something you want to support?

@cjbj
Copy link
Member

cjbj commented Jun 24, 2022

We have a lot to add to the thin driver, and PyPy isn't something we've discussed. Even for cx_Oracle, PyPy wasn't a project of ours. Of course if you have the skills to help, I'm sure the community would be grateful.

@xylar
Copy link

xylar commented Jun 24, 2022

@cjbj, that's fine. I don't have the skills to help on that. I'll just put conda-forge/oracledb-feedstock#2 (comment) in draft mode and that will indicate that support for PyPy isn't expected anytime soon.

@cjbj
Copy link
Member

cjbj commented Jun 24, 2022

@xylar no problems. You've taken the project a long way already - thank you

emeryberger added a commit to plasma-umass/scalene that referenced this issue Aug 7, 2022
@eudinaesis
Copy link

Sorry, newbie question here @xylar . I'm a little confused -- reading this, it looks like there should be universal architecture support, but at I only see osx-64 -- that's Intel, right? When I forced an install with conda install -c conda-forge/osx-64 oracledb it replaced my openssl with an Intel version. Am I doing something wrong, or is there only an Intel build in Conda-forge now?

@xylar
Copy link

xylar commented Jan 21, 2023

@eudinaesis, you are right, we haven't build for ARM64 yet. I don't know why not. Usually, a bot brings in those new architectures automatically but it obviously hasn't happened. I can do my best to migrate over to them manually.

@xylar
Copy link

xylar commented Jan 21, 2023

@eudinaesis, please feel free to follow along at
conda-forge/oracledb-feedstock#11

@eudinaesis
Copy link

@eudinaesis, you are right, we haven't build for ARM64 yet. I don't know why not. Usually, a bot brings in those new architectures automatically but it obviously hasn't happened. I can do my best to migrate over to them manually.

Wow, thanks so much for the quick response!

@xylar
Copy link

xylar commented Jan 21, 2023

It's looking good. Try in an hour or 2 and the osx-arm64 package should be there.

@eudinaesis
Copy link

It's looking good. Try in an hour or 2 and the osx-arm64 package should be there.

It's there, and I successfully installed it and connected to a database. You are a hero! Thanks so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants