Skip to content
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

Set rpath on Linux and Solaris #2

Closed
kubo opened this issue Feb 5, 2017 · 6 comments
Closed

Set rpath on Linux and Solaris #2

kubo opened this issue Feb 5, 2017 · 6 comments
Assignees

Comments

@kubo
Copy link

kubo commented Feb 5, 2017

Could you set -Wl,-rpath,$(OCI_LIB_DIR) to LDFLAGS on Linux and -R,$(OCI_LIB_DIR) on Solaris in addition to macOS?

	UNAME_S := $(shell uname -s)
	ifeq ($(UNAME_S), Linux)
		LDFLAGS += -Wl,-rpath,$(OCI_LIB_DIR)
	endif
	ifeq ($(UNAME_S), SunOS)
		LDFLAGS += -R,$(OCI_LIB_DIR)
	endif

If rpath is set, client programs depending on odpi have no need to use LD_LIBRARY_PATH to know the directory containing Oracle client libraries.

@anthony-tuininga
Copy link
Member

@kubo Thanks. Did you test those changes on Solaris yourself?

@anthony-tuininga anthony-tuininga self-assigned this Feb 7, 2017
@kubo
Copy link
Author

kubo commented Feb 7, 2017

Sorry, I have not tested it on Solaris. I wrote it from my memory. -R,$(OCI_LIB_DIR) should be -R$(OCI_LIB_DIR).

As far as I checked, -Wl,-rpath,$(OCI_LIB) is also okay on recent Solaris, at least Solaris 11.3 I tested. It had not been okay on old Solaris according to my memory.

@anthony-tuininga
Copy link
Member

I suspect the -R$(OCI_LIB_DIR) is required for a different compiler. So I'll wait on that until I can test on a Solaris VM.

@cjbj
Copy link
Member

cjbj commented Feb 7, 2017

I have rpath on Linux on my list - like we do for node-oracledb.

@anthony-tuininga
Copy link
Member

Setting RPATH when compiling ODPI-C or a driver like cx_Oracle and node-oracledb won't help due to the fact that there is no RPATH set on libclntsh.so in Oracle Instant Client. If you have a full client, however, ODPI-C now automatically locates and loads the library.

@kubo
Copy link
Author

kubo commented Aug 9, 2017

Okay, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants