laurenz / oracle_fdw

PostgreSQL Foreign Data Wrapper for Oracle
http://laurenz.github.io/oracle_fdw/
Other
496 stars 156 forks source link

Building on m1 mac #599

Closed yosefahab closed 1 year ago

yosefahab commented 1 year ago

I'm trying to compile on an m1 mac, of course i couldn't find an arm version of oracle instant client.

Are there any workarounds?

philflorent commented 1 year ago

Hi, You need Oracle libraries to compile oracle_fdw. Those libraries are not open source, hence you can only compile on platforms Oracle provides binaries for. You can open a service request if you have an Oracle support identifier but I had no success when I tried to obtain up-to-date binaries for Linux on Power (little endian). At least they had provided the base 19.3 version but it's still problematic.
Oracle recently claimed they will now be more friendly with developers, perhaps you will be luckier than me. Best regards, Philippe Florent

philflorent commented 1 year ago

As a workaround if you really need to access an Oracle database you can compile on a platform Oracle provides libraries for in order to create a proxy PostgreSQL system you will access via postgres_fdw from your m1 mac.

yosefahab commented 1 year ago

As a workaround if you really need to access an Oracle database you can compile on a platform Oracle provides libraries for in order to create a proxy PostgreSQL system you will access via postgres_fdw from your m1 mac.

That is a good idea, however i want to test it directly without pg_fdw. Someone suggester to cross compile for x86, would that work?

philflorent commented 1 year ago

Perhaps there is no need to compile at all. If your m1 cpu is able to execute amd64 code then you can probably run a postgres docker amd64 image that contains everything you need (postgresql+oracle instantclient+oracle_fdw). There are many posts on the subject , cf https://stackoverflow.com/questions/67458621/how-to-run-amd64-docker-images-on-arm64-host-platform But I never did that and I can't comment further.