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

[OpenImageIO] find_package failed #20522

Closed
xehoth opened this issue Oct 5, 2021 · 15 comments
Closed

[OpenImageIO] find_package failed #20522

xehoth opened this issue Oct 5, 2021 · 15 comments
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support requires:repro The issue is not currently repro-able

Comments

@xehoth
Copy link

xehoth commented Oct 5, 2021

Host Environment

  • OS: Windows10 21H1
  • Compiler: Visual Studio 2019 with MSVC 19.29.30133

To Reproduce
Steps to reproduce the behavior:
./vcpkg install openimageio:x64-windows
Then, use find_package(OpenImageIO CONFIG REQUIRED) in CMakeLists.txt.
When configuring, it gives the following error.

Failure logs

CMake Error at C:/soft/vcpkg/installed/x64-windows/share/ilmbase/IlmBaseConfig.cmake:11 (message):
  File or directory /include referenced by variable OpenImageIO_INCLUDE_DIR
  does not exist !
Call Stack (most recent call first):
  C:/soft/vcpkg/installed/x64-windows/share/OpenImageIO/OpenImageIOConfig.cmake:45 (set_and_check)
  C:/soft/vcpkg/installed/x64-windows/share/OpenImageIO/vcpkg-cmake-wrapper.cmake:4 (_find_package)
  C:/soft/vcpkg/scripts/buildsystems/vcpkg.cmake:740 (include)
  CMakeLists.txt:3 (find_package)
@xehoth xehoth changed the title [OpenImageIO] find_pacakge failed [OpenImageIO] find_package failed Oct 5, 2021
@jmacey
Copy link

jmacey commented Oct 6, 2021

I can report that I am now getting the same issues on Linux (WSL Ubuntu 20 at present),

 Found Threads: TRUE
-- Found ZLIB: optimized;/home/jmacey/vcpkg/installed/x64-linux/lib/libz.a;debug;/home/jmacey/vcpkg/installed/x64-linux/debug/lib/libz.a (found version "1.2.11")
-- Found Libsquish: /home/jmacey/vcpkg/installed/x64-linux/include
-- Found ZLIB: optimized;/home/jmacey/vcpkg/installed/x64-linux/lib/libz.a;debug;/home/jmacey/vcpkg/installed/x64-linux/debug/lib/libz.a (found suitable version "1.2.11", minimum required is "1.2.11")
CMake Error at /home/jmacey/vcpkg/installed/x64-linux/share/ilmbase/IlmBaseConfig.cmake:11 (message):
  File or directory /include referenced by variable OpenImageIO_INCLUDE_DIR
  does not exist !
Call Stack (most recent call first):
  /home/jmacey/vcpkg/installed/x64-linux/share/OpenImageIO/OpenImageIOConfig.cmake:45 (set_and_check)
  /home/jmacey/vcpkg/installed/x64-linux/share/openimageio/vcpkg-cmake-wrapper.cmake:4 (_find_package)
  /home/jmacey/vcpkg/scripts/buildsystems/vcpkg.cmake:740 (include)
  CMakeLists.txt:25 (find_package)

@dg0yt
Copy link
Contributor

dg0yt commented Oct 6, 2021

File or directory /include

This looks like a missing prefix.
Do you have the current version of port vcpkg-cmake-config, including #20380?
If not:

git pull
./vcpkg remove --recurse vcpkg-cmake-config
./vcpkg install openimageio

@jmacey
Copy link

jmacey commented Oct 6, 2021

So on inspection I have commented out the following lines from OpenImageIOConfig.cmake (45 / 46)

#set_and_check (OpenImageIO_INCLUDE_DIR "${_IMPORT_PREFIX}")
#set_and_check (OpenImageIO_INCLUDES    "${_IMPORT_PREFIX}/include")

Also OpenImageIO now seems to need openmp enabling by default.

@dg0yt
Copy link
Contributor

dg0yt commented Oct 6, 2021

Also OpenImageIO now seems to need openmp enabling by default.

Oh. I guess this is from the boost update: #20417.

@jmacey
Copy link

jmacey commented Oct 6, 2021

This is getting very unstable to use. I get my students to install vcpkg for ease but it seems to be breaking every few updates (and then I have to fix the CMake / install for them each time). If only the versioning was better ;-)

@JackBoosY JackBoosY self-assigned this Oct 8, 2021
@JackBoosY
Copy link
Contributor

JackBoosY commented Oct 8, 2021

Will be fixed by #20240.

@JackBoosY JackBoosY added the category:port-bug The issue is with a library, which is something the port should already support label Oct 8, 2021
@JackBoosY
Copy link
Contributor

Now I can't repro this issue, is this isse still exist?

@JackBoosY JackBoosY added the requires:repro The issue is not currently repro-able label Oct 20, 2021
@JackBoosY
Copy link
Contributor

Some cmake configuration file bugs will be fixed by #20439,

@georgelyu
Copy link

I can confirm this still exsits with the latest version of vcpkg. I'm using Windows 11 and MSVC 19.29.30136.

@JackBoosY
Copy link
Contributor

@georgelyu Can you please provide a mininum reproduce cmake code?

@jmacey
Copy link

jmacey commented Oct 23, 2021

I'm still getting errors as well

target links to OpenImageIO::OpenImageIO_Util but the target was no found. There are serious issues with this port.

@manueme
Copy link

manueme commented Oct 23, 2021

@georgelyu Can you please provide a mininum reproduce cmake code?

I don't know how I ended up here but I have an example:

CMakeLists.txt

cmake_minimum_required(VERSION 3.8)

project(oiio-example)

# clone vcpkg
find_package(Git REQUIRED)
set(EXTERNAL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external)
set(VCPKG_SOURCE_DIR ${EXTERNAL_DIR}/vcpkg)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init ${VCPKG_SOURCE_DIR})

# init vcpkg
set(CMAKE_TOOLCHAIN_FILE ${VCPKG_SOURCE_DIR}/scripts/buildsystems/vcpkg.cmake CACHE STRING "")

find_package(OpenImageIO CONFIG REQUIRED)

add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE OpenImageIO::OpenImageIO OpenImageIO::OpenImageIO_Util)

.gitmodules

[submodule "external/vcpkg"]
	path = external/vcpkg
	url = https://github.com/microsoft/vcpkg.git

vcpkg.json

{
  "name": "oiio-example",
  "version-string": "0.0.1",
  "dependencies":  [
    "openimageio"
  ]
}

main.cpp

int main() {
  return 0;
}

@MarkCallow
Copy link

I'm getting this on macOS too. Just a few minutes ago I did

git pull
./vcpkg remove --recurse vcpkg-cmake-config
./vcpkg install openimageio

#20439 isn't merged yet. I don't know enough to be able to tell whether or not it will fix this problem.

If I removeCONFIG from my find_package() call then projects are successfully generated but the link fails because it is missing all the dependent libraries of OIIO. OPENIMAGEIO_LIBRARIES only includes libOpenImageIO.a.

@JackBoosY
Copy link
Contributor

Since #20439 merged, can anyone test whether this issue is resolved?

Thanks.

@xehoth
Copy link
Author

xehoth commented Dec 10, 2021

Since #20439 merged, can anyone test whether this issue is resolved?

Thanks.

The issue is solved. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support requires:repro The issue is not currently repro-able
Projects
None yet
Development

No branches or pull requests

7 participants