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

oslquery: Simplify include and link needs #1787

Merged

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Mar 22, 2024

The (should be) tiny oslquery library was over-including and over-linking beyond its actual needs.

  • Remove#include <OSL/oslconfig.h>, which is a lot of setup, type definitions, and many transitive header includes. Instead, just include the very small number of headers and types actually needed by the OSLQuery class definition.
  • In particular, this removes includes of OpenEXR/Imath headers and references to Imath types, the OIIO TextureSystem (!), and other big things, from what oslquery.h needs to see.
  • liboslquery can link against libOpenImageIO_Util (which it uses primarily for ustring and TypeDesc), it doesn't need the full libOpenImageIO, since it doesn't read or write image files.
  • Remove some link references to Boost which isn't actually needed for this library.
  • This also lightens the load for the Python module for oslquery.

The (should be) tiny oslquery library was over-including and
over-linking beyond its actual needs.

* Remove`#include <OSL/oslconfig.h>`, which is a lot of setup, type
  definitions, and many transitive header includes.  Instead, just
  include the very small number of headers and types actually needed
  by the OSLQuery class definition.
* In particular, this removes includes of OpenEXR/Imath headers and
  references to Imath types, the OIIO TextureSystem (!), and other
  big things, from what oslquery.h needs to see.
* liboslquery can link against libOpenImageIO_Util (which it uses
  primarily for ustring and TypeDesc), it doesn't need the full
  libOpenImageIO, since it doesn't read or write image files.
* Remove some link references to Boost which isn't actually needed for
  this library.
* This also lightens the load for the Python module for oslquery.

Signed-off-by: Larry Gritz <[email protected]>
@lgritz lgritz requested a review from chellmuth April 2, 2024 23:22
Copy link
Collaborator

@chellmuth chellmuth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lgritz lgritz merged commit a987aa9 into AcademySoftwareFoundation:main Apr 3, 2024
22 of 23 checks passed
@lgritz lgritz deleted the lg-oslquery-simplify-header branch April 29, 2024 02:36
chellmuth pushed a commit to chellmuth/OpenShadingLanguage that referenced this pull request Sep 6, 2024
This won't be picked up by the platforms yet, they are still using
1.13.5.x for 2023.10 (as well as still OIIO 2.6.0.x, which is too old
for this OSL release). So really the only client for this build is
likely Arnold.

Highlights:

* Raise OpenImageIO to 2.6.1.0.
* RS::get_texture_info make robust to empty shaderglobals param (AcademySoftwareFoundation#1731)
* LLVM opaque pointers support (AcademySoftwareFoundation#1728)
* LLVM new pass manager support (AcademySoftwareFoundation#1729)
* LLVM 16 and 17 support (AcademySoftwareFoundation#1730)
* fix: SymOverrideInfo bitfields should be the same type (AcademySoftwareFoundation#1745)
* fix: batched pointcloud if "index" is not passed (AcademySoftwareFoundation#1753)
* api: Ustringhash phase 3 (AcademySoftwareFoundation#1732)
* fix: Fix NVPTX TargetMachine leak, etc. (AcademySoftwareFoundation#1763)
* feat(api): Add API for building interpolated getter free functions. (AcademySoftwareFoundation#1765)
* build: add options to use static Cuda libraries (AcademySoftwareFoundation#1772)
* build(deps): Initial support for LLVM-18 (AcademySoftwareFoundation#1773)
* fix: Mute partio error prints (AcademySoftwareFoundation#1774)
* fix: calculatenormal needs fliphandedness (AcademySoftwareFoundation#1783)
* fix: Print closure missing error message at compile time instead of run time.  (AcademySoftwareFoundation#1781)
* fix: GPU interpolated param initialization (AcademySoftwareFoundation#1791)
* oslquery: Simplify include and link needs (AcademySoftwareFoundation#1787)
* Make isconnected() work with downstream renderer "connections." (AcademySoftwareFoundation#1782)

Also along for the ride:

* Remove the `blah-platform/=1.0` preamble, no longer needed.
* Stop building for deprecated Nuke 12 and 13 platforms.
* Raise cmake build version to 3.24

See merge request spi/dev/3rd-party/osl-feedstock!57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants