Build failed due to cmake find_python3 module

Open
#29 13 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cmake, cpp, docker, python
Domain
build-system

Research direction

Reproduce the Docker build from the issue, then inspect /app/usd/pxrConfig.cmake and utils/CMakeLists.txt where FindPython3 is invoked. Check why Python 3.10.14 Development, Development.Module, and Development.Embed are not found; done means the configure step completes and cmake --build succeeds with the shown options.

Written by the indexing model from the issue text.

Description

Hi,

I'm building USD-Fileformat-plugins in docker. I used the prebuilt usd artifact from github releases. And I tried to mimicking the way github ci of this repo is setup. However, when I tried to build the docker image, it fails at the find python module part of the cmake file.
Here is the dockerfile:

FROM python:3.10.14-slim-bookworm
WORKDIR /app

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
    ca-certificates \
    git \
    unzip \
    curl \
    cmake \
    build-essential 

#download the prebuilt usd and place it in workdir
ADD http://demo.uality.cn/usd-2405-ubuntu-22.04.zip /app/usd.zip

RUN unzip /app/usd.zip -d /app/usd

ADD https://github.com/adobe/USD-Fileformat-plugins/archive/refs/tags/v1.0.5.zip /app/release.zip

RUN unzip /app/release.zip -d /app/

WORKDIR /app/USD-Fileformat-plugins-1.0.5

RUN apt-get install -y python3-dev

#ADD http://demo.uality.cn/pxrConfig.cmake /app/usd/pxrConfig.cmake

#ADD http://demo.uality.cn/pxrTargets.cmake /app/usd/cmake/pxrTargets.cmake

ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/app/usd/bin:/app/usd/lib:/app/usd/lib64:/app/usd/plugin/usd:/app/USD-Fileformat-plugins-1.0.5/bin/bin:/app/USD-Fileformat-plugins-1.0.5/bin/lib:/app/USD-Fileformat-plugins-1.0.5/bin/plugin/usd:/user/local/lib
ENV USD_BUILD_PATH=/app/usd
ENV PYTHONPATH=$PYTHONPATH:/app/usd/lib/python
ENV PXR_PLUGINPATH_NAME =/app/USD-Fileformat-plugins-1.0.5/bin/plugin/usd:/app/usd/plugin/usd
ENV pythonLocation=/usr/local/bin/python
ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
ENV Python_ROOT_DIR=/usr/local

RUN cmake -S . -B build -DCMAKE_INSTALL_PREFIX=bin -DCMAKE_BUILD_TYPE=Release -Dpxr_ROOT=/app/usd -DUSD_FILEFORMATS_BUILD_TESTS=OFF -DUSD_FILEFORMATS_ENABLE_FBX=OFF -DUSD_FILEFORMATS_ENABLE_GLTF=ON -DUSD_FILEFORMATS_ENABLE_SBSAR=OFF -DUSD_FILEFORMATS_ENABLE_OBJ=OFF -DUSD_FILEFORMATS_ENABLE_PLY=OFF -DUSD_FILEFORMATS_ENABLE_STL=OFF -DUSD_FILEFORMATS_FETCH_GTEST=OFF -DUSD_FILEFORMATS_FETCH_HAPPLY=OFF -DUSD_FILEFORMATS_FETCH_FMT=OFF -DUSD_FILEFORMATS_FETCH_FASTFLOAT=OFF -DUSD_FILEFORMATS_ENABLE_CXX11_ABI=ON -DOpenImageIO_INCLUDE_DIR=/app/usd/include -DOpenImageIO_INCLUDES=/app/usd/include -DOpenImageIO_LIB_DIR=/app/usd/lib -DPython3_INCLUDE_DIR=/usr/local/include/python3.10 -DPython3_LIBRARY=/usr/local/lib

RUN cmake --build build
RUN cmake --install build

ENTRYPOINT [ "/app/usd/bin/usdcat" ]

And this is the terminal output I get when I tried to build the image

0.323 -- The C compiler identification is GNU 12.2.0
0.384 -- The CXX compiler identification is GNU 12.2.0
0.397 -- Detecting C compiler ABI info
0.473 -- Detecting C compiler ABI info - done
0.489 -- Check for working C compiler: /usr/bin/cc - skipped
0.489 -- Detecting C compile features
0.490 -- Detecting C compile features - done
0.496 -- Detecting CXX compiler ABI info
0.581 -- Detecting CXX compiler ABI info - done
0.597 -- Check for working CXX compiler: /usr/bin/c++ - skipped
0.597 -- Detecting CXX compile features
0.598 -- Detecting CXX compile features - done
0.600 -- PROJECT VERSION IS: 1.0.5
0.600 Building without ASM
0.615 CMake Error at /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
0.615   Could NOT find Python3 (missing: Development Development.Module
0.615   Development.Embed) (Required is exact version "3.10.14")
0.615 Call Stack (most recent call first):
0.615   /usr/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
0.615   /usr/share/cmake-3.25/Modules/FindPython/Support.cmake:3240 (find_package_handle_standard_args)
0.615   /usr/share/cmake-3.25/Modules/FindPython3.cmake:490 (include)
0.615   /app/usd/pxrConfig.cmake:44 (find_package)
0.615   utils/CMakeLists.txt:3 (find_package)
0.615
0.615
0.615 -- Configuring incomplete, errors occurred!
0.615 See also "/app/USD-Fileformat-plugins-1.0.5/build/CMakeFiles/CMakeOutput.log".
Dominant language
C++
Stars
396
Forks
42
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from adobe/USD-Fileformat-plugins

All issues in adobe/USD-Fileformat-plugins

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.