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

Add --with-cg-libdir option to support arch dependant Cg library paths #353

Closed
waebbl opened this issue Oct 18, 2018 · 1 comment
Closed
Labels
Build A problem with building or installing the library. Feature Request A suggested change or addition of functionality to the library.

Comments

@waebbl
Copy link
Contributor

waebbl commented Oct 18, 2018

On Gentoo, we had an issue when compiling OpenEXR_Viewers with support for Cg. The Cg libraries are installed in arch dependant directories, i.e. in /opt/nvidia-cg-toolkit/lib for 32-bit and /opt/nvidia-cg-toolkit/lib64 for 64-bit platforms.

I developed this patch to add an optional --with-cg-libdir option to configure, alongside the already available --with-cg-prefix option to support different installation locations for those libraries.

diff --git a/m4/path.cb.m4 b/m4/path.cb.m4
index 7e38708..b5675b1 100644
--- a/m4/path.cb.m4
+++ b/m4/path.cb.m4
@@ -10,9 +10,17 @@ dnl
 AC_ARG_WITH(cg-prefix,[  --with-cg-prefix=PFX  Prefix where Cg is installed (optional)],
 	    cg_prefix="$withval", cg_prefix="")
 
+AC_ARG_WITH(cg-libdir, [  --with-cg-libdir=PATH Directory where Cg libraries are installed (optional)],
+	    cg_libdir="$withval", cg_libdir="")
+
   if test x$cg_prefix != x ; then
     CG_CXXFLAGS="-I$cg_prefix/include"
-    CG_LDFLAGS="-L$cg_prefix/lib -lGL -lCg -lCgGL -lGLU -lpthread -lglut"
+    if test x$cg_libdir != x; then
+       CG_LDFLAGS="-L$cg_libdir"
+    else
+       CG_LDFLAGS="-L$cg_prefix/lib"
+    fi
+    CG_LDFLAGS="$CG_LDFLAGS -lGL -lCg -lCgGL -lGLU -lpthread -lglut"
   else
     case $host_os in
       darwin*)

You can also get the patch at https://github.com/waebbl/waebbl-gentoo/blob/master/media-gfx/openexr_viewers/files/openexr_viewers-2.3.0--with-cg-libdir.patch

Feel free to grab this patch if it's useful for general purpose.

@cary-ilm cary-ilm added the Build A problem with building or installing the library. label Jun 11, 2019
@cary-ilm cary-ilm added the Feature Request A suggested change or addition of functionality to the library. label Jun 26, 2019
kdt3rd added a commit to kdt3rd/openexr that referenced this issue Jul 22, 2019
to handle systems where it isn't lib, but lib64, as needed

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
@kdt3rd kdt3rd closed this as completed in 63924fd Aug 2, 2019
@waebbl
Copy link
Contributor Author

waebbl commented Aug 3, 2019

Thanks for including this!

DominicJacksonBFX pushed a commit to boris-fx/mocha-openexr that referenced this issue Jun 22, 2022
to handle systems where it isn't lib, but lib64, as needed

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build A problem with building or installing the library. Feature Request A suggested change or addition of functionality to the library.
Projects
None yet
Development

No branches or pull requests

2 participants