pytorch / pytorch/cppdocs

linker error in building a minimal C++ application

Open
#8 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
255
Forks
37
PR merge metrics
No merged PRs in 30d

Description

Hi there,
I tried to build a minimal C++ based on the latest nightly build of libtorch but got the following errors. Can someone help?
/lib/../lib64/crt1.o: In function _start': (.text+0x20): undefined reference to main'
.../libtorch_nightly/lib/libtorch.so: undefined reference to lgammaf@GLIBC_2.23' .../libtorch_nightly/lib/libtorch.so: undefined reference to lgamma@GLIBC_2.23'
collect2: error: ld returned 1 exit status
gmake[3]: *** [stylegan] Error 1
gmake[2]: *** [CMakeFiles/mymodel.dir/all] Error 2
gmake[1]: *** [CMakeFiles/mymodel.dir/rule] Error 2
gmake: *** [mymodel] Error 2

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by reproducing the minimal C++ application build with the nightly libtorch package and inspect the linker command for CMakeFiles/mymodel.dir/all. Review the supplied libtorch.so references and the reported entry point; done means the application links without these errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.