Skip to content

add python linking dependency only when USE_PYTHON=on #5602

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nihui
Copy link
Contributor

@nihui nihui commented Mar 13, 2022

No description provided.

@facebook-github-bot
Copy link

facebook-github-bot commented Mar 13, 2022

💊 CI failures summary and remediations

As of commit fb771ef (more details on the Dr. CI page):


  • 3/3 failures introduced in this PR

🕵️ 2 new failures recognized by patterns

The following CI failures do not appear to be due to upstream breakages:

See CircleCI build cmake_linux_cpu (1/2)

Step: "packaging/build_cmake.sh" (full log | diagnosis details | 🔁 rerun)

./hello-world: error while loading shared libra...open shared object file: No such file or directory
-- Configuring done
-- Generating done
-- Build files have been written to: /root/project/examples/cpp/hello_world/build
+ [[ linux-gnu == \m\s\y\s ]]
+ make -j8
Scanning dependencies of target hello-world
[ 50%] Building CXX object CMakeFiles/hello-world.dir/main.cpp.o
[100%] Linking CXX executable hello-world
[100%] Built target hello-world
+ ./hello-world
./hello-world: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory


Exited with code exit status 127

See CircleCI build cmake_linux_gpu (2/2)

Step: "Build torchvision C++ distribution and test" (full log | diagnosis details | 🔁 rerun)

./hello-world: error while loading shared libra...open shared object file: No such file or directory
-- Configuring done

-- Generating done

-- Build files have been written to: /home/circleci/project/examples/cpp/hello_world/build

+ [[ linux-gnu == \m\s\y\s ]]

+ make -j8

�[35m�[1mScanning dependencies of target hello-world�[0m

[ 50%] �[32mBuilding CXX object CMakeFiles/hello-world.dir/main.cpp.o�[0m

[100%] �[32m�[1mLinking CXX executable hello-world�[0m

[100%] Built target hello-world

+ ./hello-world

./hello-world: error while loading shared libraries: libpng16.so.16: cannot open shared object file: No such file or directory



Exited with code exit status 127


1 failure not recognized by patterns:

Job Step Action
CircleCI cmake_macos_cpu curl -o conda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
sh conda.sh -b
source $HOME/miniconda3/bin/activate
conda install -yq conda-build cmake
packaging/build_cmake.sh
🔁 rerun

This comment was automatically generated by Dr. CI (expand for details).

Please report bugs/suggestions to the (internal) Dr. CI Users group.

Click here to manually regenerate this comment.

@de-vri-es
Copy link

Without this, if the project is built without -DUSE_PYTHON=ON, anyone doing find_package(TorchVision) will get this error:

-- Configuring done
CMake Error at /usr/share/cmake/TorchVision/TorchVisionConfig.cmake:61 (set_target_properties):
  The link interface of target "TorchVision::TorchVision" contains:
    Python3::Python
  but the target was not found.  Possible reasons include:
    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

@YosuaMichael
Copy link
Contributor

This seems to be related to #5863
cc @datumbox, Do you know who can review this PR?

@datumbox
Copy link
Contributor

Right now our CI is still broken due to PyTorch upstream issues, so it's not a good time to test it. Let's wait until they are resolved (tracked at #5881) and then check what the CI things about them.

@mthrok Would you be OK to provide input on this as you have good knowledge of cmake?

@nihui nihui changed the title add python linking dependency when USE_PYTHON=on add python linking dependency only when USE_PYTHON=on May 21, 2022
@de-vri-es
Copy link

I was disappointed to see 0.13 released without this fix :(

Is there anything needed to get this moving?

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

Successfully merging this pull request may close these issues.

7 participants