.pc file is not generated

Issue #572 new
Janani T E created an issue

Reported by "slhck" (Werner Robitza) on "2020-09-10T12:24:51.179514+00:00"

Using the latest master branch and Release\_3.4, x265 does not create a .pc file to be used with pkg\_config.

Tested under Ubuntu 20.04.

Installed dependencies:

```
apt-get update -qq && apt-get install -qq -y \
  autoconf \
  automake \
  build-essential \
  cmake \
  libfreetype6-dev \
  libtool \
  pkg-config \
  texinfo \
  wget \
  yasm \
  nasm \
  zlib1g-dev \
  libnuma-dev \
  git
```

Following the guide from the FFmpeg wiki, which usually works fine, I get this output:

```
root@ae4219967a78:~/ffmpeg_sources# rm -rf x265_git/
root@ae4219967a78:~/ffmpeg_sources# git -C x265_git pull 2> /dev/null || git clone --depth 1 https://bitbucket.org/multicoreware/x265_git

  • b Release_3.4

Cloning into 'x265_git'...
remote: Counting objects: 352, done.
remote: Compressing objects: 100% (349/349), done.
remote: Total 352 (delta 20), reused 279 (delta 0)
Receiving objects: 100% (352/352), 1.58 MiB | 1.71 MiB/s, done.
Resolving deltas: 100% (20/20), done.
root@ae4219967a78:~/ffmpeg_sources# cd x265_git/build/linux
root@ae4219967a78:~/ffmpeg_sources/x265_git/build/linux#   PATH="$HOME/bin:$PATH" cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX="$HOME/ffmpeg_build" -DENABLE_SHARED=off ../../source

    • cmake version 3.16.3

CMake Deprecation Warning at CMakeLists.txt:10 (cmake_policy):
  The OLD behavior for policy CMP0025 will be removed from a future version
  of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

CMake Deprecation Warning at CMakeLists.txt:16 (cmake_policy):
  The OLD behavior for policy CMP0054 will be removed from a future version
  of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.

    • The C compiler identification is GNU 9.3.0
    • The CXX compiler identification is GNU 9.3.0
    • Check for working C compiler: /usr/bin/cc
    • Check for working C compiler: /usr/bin/cc -- works
    • Detecting C compiler ABI info
    • Detecting C compiler ABI info - done
    • Detecting C compile features
    • Detecting C compile features - done
    • Check for working CXX compiler: /usr/bin/c++
    • Check for working CXX compiler: /usr/bin/c++ -- works
    • Detecting CXX compiler ABI info
    • Detecting CXX compiler ABI info - done
    • Detecting CXX compile features
    • Detecting CXX compile features - done
    • Detected x86_64 target processor
    • Found NUMA: /usr 
    • Looking for numa_node_of_cpu
    • Looking for numa_node_of_cpu - found
    • libnuma found, building with support for NUMA nodes

CMake Warning (dev) at /usr/share/cmake-3.16/Modules/CheckIncludeFiles.cmake:120 (message):
  Policy CMP0075 is not set: Include file check macros honor
  CMAKE_REQUIRED_LIBRARIES.  Run "cmake --help-policy CMP0075" for policy
  details.  Use the cmake_policy command to set the policy and suppress this
  warning.

CMAKE_REQUIRED_LIBRARIES is set to:

numa

For compatibility with CMake 3.11 and below this check is ignoring it.
Call Stack (most recent call first):
  CMakeLists.txt:175 (check_include_files)
This warning is for project developers.  Use -Wno-dev to suppress it.

    • Looking for include file inttypes.h
    • Looking for include file inttypes.h - found
    • Performing Test CC_HAS_NO_STRICT_OVERFLOW
    • Performing Test CC_HAS_NO_STRICT_OVERFLOW - Success
    • Performing Test CC_HAS_NO_NARROWING
    • Performing Test CC_HAS_NO_NARROWING - Success
    • Performing Test CC_HAS_NO_ARRAY_BOUNDS
    • Performing Test CC_HAS_NO_ARRAY_BOUNDS - Success
    • Performing Test CC_HAS_FAST_MATH
    • Performing Test CC_HAS_FAST_MATH - Success
    • Performing Test CC_HAS_STACK_REALIGN
    • Performing Test CC_HAS_STACK_REALIGN - Success
    • Performing Test CC_HAS_FNO_EXCEPTIONS_FLAG
    • Performing Test CC_HAS_FNO_EXCEPTIONS_FLAG - Success
    • Found nasm: /usr/bin/nasm (found version "2.14.02")
    • Found Nasm 2.14.02 to build assembly primitives
    • x265 version +-g1fd8c13
    • The ASM_NASM compiler identification is NASM
    • Found assembler: /usr/bin/nasm
    • Looking for strtok_r
    • Looking for strtok_r - found
    • Looking for include file getopt.h
    • Looking for include file getopt.h - found
    • Configuring done
    • Generating done
    • Build files have been written to: /root/ffmpeg_sources/x265_git/build/linux

root@ae4219967a78:~/ffmpeg_sources/x265_git/build/linux#   PATH="$HOME/bin:$PATH" make -j 4
Scanning dependencies of target encoder
Scanning dependencies of target common
[  2%] Building CXX object encoder/CMakeFiles/encoder.dir/search.cpp.o
[  2%] Building CXX object encoder/CMakeFiles/encoder.dir/analysis.cpp.o
[  3%] Building CXX object encoder/CMakeFiles/encoder.dir/bitcost.cpp.o
[  4%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/pixel-a.asm.o
[  5%] Building CXX object encoder/CMakeFiles/encoder.dir/motion.cpp.o
[  7%] Building CXX object encoder/CMakeFiles/encoder.dir/slicetype.cpp.o
[  8%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/const-a.asm.o
[  9%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/cpu-a.asm.o
[ 10%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/ssd-a.asm.o
[ 11%] Building CXX object encoder/CMakeFiles/encoder.dir/frameencoder.cpp.o
[ 12%] Building CXX object encoder/CMakeFiles/encoder.dir/framefilter.cpp.o
[ 14%] Building CXX object encoder/CMakeFiles/encoder.dir/level.cpp.o
[ 15%] Building CXX object encoder/CMakeFiles/encoder.dir/nal.cpp.o
[ 16%] Building CXX object encoder/CMakeFiles/encoder.dir/sei.cpp.o
[ 17%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/mc-a.asm.o
[ 18%] Building CXX object encoder/CMakeFiles/encoder.dir/sao.cpp.o
[ 20%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/mc-a2.asm.o
[ 21%] Building CXX object encoder/CMakeFiles/encoder.dir/entropy.cpp.o
[ 22%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/pixel-util8.asm.o
[ 23%] Building CXX object encoder/CMakeFiles/encoder.dir/dpb.cpp.o
[ 24%] Building CXX object encoder/CMakeFiles/encoder.dir/ratecontrol.cpp.o
/root/ffmpeg_sources/x265_git/source/encoder/ratecontrol.cpp: In member function 'int x265::RateControl::writeRateControlFrameStats(x265::Frame*, x265::RateControlEntry*)':
/root/ffmpeg_sources/x265_git/source/encoder/ratecontrol.cpp:2992:21: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
 2992 |             sprintf(deltaPOC, "%s%d~", deltaPOC, rpsWriter->deltaPOC[i]);
      |                     ^~           ~~
/root/ffmpeg_sources/x265_git/source/encoder/ratecontrol.cpp:2993:21: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
 2993 |             sprintf(bUsed, "%s%d~", bUsed, rpsWriter->bUsed[i]);
      |                     ^~~           ~
/root/ffmpeg_sources/x265_git/source/encoder/ratecontrol.cpp:2992:36: warning: '~' directive writing 1 byte into a region of size between 0 and 127 [-Wformat-overflow=]
 2992 |             sprintf(deltaPOC, "%s%d~", deltaPOC, rpsWriter->deltaPOC[i]);
      |                                    ^
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /root/ffmpeg_sources/x265_git/source/common/common.h:33,
                 from /root/ffmpeg_sources/x265_git/source/encoder/ratecontrol.cpp:30:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: '__builtin___sprintf_chk' output between 3 and 140 bytes into a destination of size 128
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |         
~~~~^~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       
~~~~~~~
/root/ffmpeg_sources/x265_git/source/encoder/ratecontrol.cpp:2993:33: warning: '~' directive writing 1 byte into a region of size between 0 and 39 [-Wformat-overflow=]
 2993 |             sprintf(bUsed, "%s%d~", bUsed, rpsWriter->bUsed[i]);
      |                                 ^
In file included from /usr/include/stdio.h:867,
                 from /usr/include/c++/9/cstdio:42,
                 from /root/ffmpeg_sources/x265_git/source/common/common.h:33,
                 from /root/ffmpeg_sources/x265_git/source/encoder/ratecontrol.cpp:30:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: '__builtin___sprintf_chk' output between 3 and 42 bytes into a destination of size 40
   36 |   return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
      |          ~~~~~~^~~~~~
   37 |       __bos (__s), __fmt, __va_arg_pack ());
      |       
~~~~~~~
[ 25%] Building CXX object encoder/CMakeFiles/encoder.dir/reference.cpp.o
[ 27%] Building CXX object encoder/CMakeFiles/encoder.dir/encoder.cpp.o
[ 28%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/blockcopy8.asm.o
[ 29%] Building CXX object encoder/CMakeFiles/encoder.dir/api.cpp.o
[ 30%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/pixeladd8.asm.o
[ 31%] Building CXX object encoder/CMakeFiles/encoder.dir/weightPrediction.cpp.o
[ 31%] Built target encoder
[ 32%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/dct8.asm.o
[ 34%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/seaintegral.asm.o
[ 35%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/sad-a.asm.o
[ 36%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/intrapred8.asm.o
[ 37%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/intrapred8_allangs.asm.o
[ 38%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/v4-ipfilter8.asm.o
[ 40%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/h-ipfilter8.asm.o
[ 41%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/ipfilter8.asm.o
[ 42%] Building ASM_NASM object common/CMakeFiles/common.dir/x86/loopfilter.asm.o
[ 43%] Building CXX object common/CMakeFiles/common.dir/x86/asm-primitives.cpp.o
[ 44%] Building CXX object common/CMakeFiles/common.dir/vec/vec-primitives.cpp.o
[ 45%] Building CXX object common/CMakeFiles/common.dir/vec/dct-sse3.cpp.o
[ 47%] Building CXX object common/CMakeFiles/common.dir/vec/dct-ssse3.cpp.o
[ 48%] Building CXX object common/CMakeFiles/common.dir/vec/dct-sse41.cpp.o
[ 49%] Building CXX object common/CMakeFiles/common.dir/primitives.cpp.o
[ 50%] Building CXX object common/CMakeFiles/common.dir/pixel.cpp.o
[ 51%] Building CXX object common/CMakeFiles/common.dir/dct.cpp.o
[ 52%] Building CXX object common/CMakeFiles/common.dir/lowpassdct.cpp.o
[ 54%] Building CXX object common/CMakeFiles/common.dir/ipfilter.cpp.o
[ 55%] Building CXX object common/CMakeFiles/common.dir/intrapred.cpp.o
[ 56%] Building CXX object common/CMakeFiles/common.dir/loopfilter.cpp.o
[ 57%] Building CXX object common/CMakeFiles/common.dir/constants.cpp.o
[ 58%] Building CXX object common/CMakeFiles/common.dir/cpu.cpp.o
[ 60%] Building CXX object common/CMakeFiles/common.dir/version.cpp.o
[ 61%] Building CXX object common/CMakeFiles/common.dir/threading.cpp.o
[ 62%] Building CXX object common/CMakeFiles/common.dir/threadpool.cpp.o
[ 63%] Building CXX object common/CMakeFiles/common.dir/wavefront.cpp.o
[ 64%] Building CXX object common/CMakeFiles/common.dir/md5.cpp.o
[ 65%] Building CXX object common/CMakeFiles/common.dir/bitstream.cpp.o
[ 67%] Building CXX object common/CMakeFiles/common.dir/yuv.cpp.o
[ 68%] Building CXX object common/CMakeFiles/common.dir/shortyuv.cpp.o
[ 69%] Building CXX object common/CMakeFiles/common.dir/picyuv.cpp.o
[ 70%] Building CXX object common/CMakeFiles/common.dir/common.cpp.o
[ 71%] Building CXX object common/CMakeFiles/common.dir/param.cpp.o
[ 72%] Building CXX object common/CMakeFiles/common.dir/frame.cpp.o
[ 74%] Building CXX object common/CMakeFiles/common.dir/framedata.cpp.o
[ 75%] Building CXX object common/CMakeFiles/common.dir/cudata.cpp.o
[ 76%] Building CXX object common/CMakeFiles/common.dir/slice.cpp.o
[ 77%] Building CXX object common/CMakeFiles/common.dir/lowres.cpp.o
[ 78%] Building CXX object common/CMakeFiles/common.dir/piclist.cpp.o
[ 80%] Building CXX object common/CMakeFiles/common.dir/predict.cpp.o
[ 81%] Building CXX object common/CMakeFiles/common.dir/scalinglist.cpp.o
[ 82%] Building CXX object common/CMakeFiles/common.dir/quant.cpp.o
[ 83%] Building CXX object common/CMakeFiles/common.dir/deblock.cpp.o
[ 84%] Building CXX object common/CMakeFiles/common.dir/scaler.cpp.o
[ 84%] Built target common
Scanning dependencies of target x265-static
[ 85%] Linking CXX static library libx265.a
[ 85%] Built target x265-static
Scanning dependencies of target cli
[ 90%] Building CXX object CMakeFiles/cli.dir/output/output.cpp.o
[ 90%] Building CXX object CMakeFiles/cli.dir/input/y4m.cpp.o
[ 90%] Building CXX object CMakeFiles/cli.dir/input/input.cpp.o
[ 90%] Building CXX object CMakeFiles/cli.dir/input/yuv.cpp.o
[ 91%] Building CXX object CMakeFiles/cli.dir/output/raw.cpp.o
[ 92%] Building CXX object CMakeFiles/cli.dir/output/reconplay.cpp.o
[ 94%] Building CXX object CMakeFiles/cli.dir/output/y4m.cpp.o
[ 95%] Building CXX object CMakeFiles/cli.dir/output/yuv.cpp.o
[ 96%] Building CXX object CMakeFiles/cli.dir/x265.cpp.o
[ 97%] Building CXX object CMakeFiles/cli.dir/x265cli.cpp.o
[ 98%] Building CXX object CMakeFiles/cli.dir/abrEncApp.cpp.o
/root/ffmpeg_sources/x265_git/source/x265.cpp: In function 'bool parseAbrConfig(FILE*, x265::CLIOptions*, uint8_t)':
/root/ffmpeg_sources/x265_git/source/x265.cpp:157:14: warning: ignoring return value of 'char* fgets(char*, int, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
  157 |         fgets(line, sizeof(line), abrConfig);
      |         ~^~~~~~~
[100%] Linking CXX executable x265
[100%] Built target cli
root@ae4219967a78:~/ffmpeg_sources/x265_git/build/linux#   make install
[ 63%] Built target common
[ 84%] Built target encoder
[ 85%] Built target x265-static
[100%] Built target cli
Install the project...

    • Install configuration: "Release"
    • Installing: /root/ffmpeg_build/lib/libx265.a
    • Installing: /root/ffmpeg_build/include/x265.h
    • Installing: /root/ffmpeg_build/include/x265_config.h
    • Installing: /root/ffmpeg_build/bin/x265

root@ae4219967a78:~/ffmpeg_sources/x265_git/build/linux# ls "$HOME/ffmpeg_build/lib/pkgconfig"
```

So it’s looking for the x265.pc file which is not generated.

Anything that changed, or any options that should be modified?

Comments (9)

  1. Janani T E reporter

    @Werner Robitza Please follow up with this new issue for the ticket which you created earlier.

  2. Werner Robitza

    Huh, where is the old issue gone? I see a lot of broken links around here unfortunately.

  3. Janani T E reporter

    I hope you are aware that we migrated all our Hg repos to Git in Bitbucket. Since we had restored the HG issues yesterday, it had overwritten all the Git issues. We have created the Git issues with the respective person who had reported it and notified them the same. Hope this clarifies.

  4. Werner Robitza

    I noticed the switch to another repository, yes, I was just confused about the issues. Thanks for clarifying that they were migrated!

  5. Francisco Boni

    The fix seems simple. ${GIT_EXECUTABLE} describe --abbrev=0 --tags in version.cmake fails because there is no tag associated with the current master branch. The implication is that the .pc file generation fails without the output variable X265_LATEST_TAG being properly defined.

  6. Francisco Boni

    Correction: When you do “git clone --depth=1”, a shallow clone of the repo, the tags are not fetched by design. Do git fetch --tags to get the tags. Now the current master branch will build and install .pc files.

  7. Werner Robitza

    Thanks for investigating this. It does not seem like a real solution to me though, particularly for end users. As there is no apparent error message, it is not obvious to someone installing the library what happened. Also, users may have good reasons to want shallow clones, for example, in order to save network bandwidth.

    The way in which the software is obtained ultimately should not impact the ability to build it correctly.

    Let me suggest a different fix. If it is a requirement for building to know the latest tag, a file containing it could be part of the repository and updated on release. This would make the source code self contained.

  8. Francisco Boni

    I agree with your idea. Building from the lastest master should be compatible with a shallow clone, as the complete clone is over 300MB.

  9. Log in to comment