How to properly diagnose a cmake GLIBC version error? - cmake
Some background: I'm trying to use easybuild to build different versions of a rather complicated scientific software stack on the same HPC system. I am new to building software like this and could use some guidance on debugging. My current error when running command:
cmake -DCMAKE_INSTALL_PREFIX=/home/user/.local/easybuild/software/libjpeg-turbo/2.1.3-GCCcore-11.3.0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -G"Unix Makefiles" -DWITH_JPEG8=1 /home/user/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0/libjpeg-turbo-2.1.3/
is
cmake: /home/user/.local/easybuild/software/GCCcore/11.3.0/lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/lib/libicuuc.so.72)
I actually saw a similar error before when easybuild was running just cmake --version. This was because (I think), in the easybuild environment, cmake was linked to the c++ library (libstdc++) located in /home/user/.local/easybuild/software/GCCcore/11.3.0/lib64/libstdc++.so.6, but it was running my newer system cmake, which required a more recent version of GBLIC. I solved this by having it use an older version of cmake in the easybuild environment.
EDIT:
full build log output:
== 2022-12-01 12:19:27,264 easyblock.py:304 INFO This is EasyBuild 4.6.2 (framework: 4.6.2, easyblocks: 4.6.2) on host luke-30bgs2s000.
== 2022-12-01 12:19:27,264 easyblock.py:310 INFO This is easyblock CMakeMake from module easybuild.easyblocks.generic.cmakemake (/home/luke/git/easybuild-easyblocks/easybuild/easyblocks/generic/cmakemake.py)
== 2022-12-01 12:19:27,264 easyblock.py:990 INFO Build dir set to /home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0
== 2022-12-01 12:19:27,264 easyblock.py:1047 INFO Software install dir set to /home/luke/.local/easybuild/software/libjpeg-turbo/2.1.3-GCCcore-11.3.0
== 2022-12-01 12:19:27,264 easyblock.py:1052 INFO Module install dir set to /home/luke/.local/easybuild/modules/all
== 2022-12-01 12:19:27,264 easyblock.py:279 INFO Init completed for application name libjpeg-turbo version 2.1.3
== 2022-12-01 12:19:27,264 easyblock.py:4040 INFO Obtained application instance of for libjpeg-turbo (easyblock: CMakeMake)
== 2022-12-01 12:19:27,265 easyconfig.py:1686 INFO Generating template values...
== 2022-12-01 12:19:27,265 easyconfig.py:1705 INFO Template values: arch='x86_64', bitbucket_account='libjpeg-turbo', github_account='libjpeg-turbo', module_name='libjpeg-turbo/2.1.3-GCCcore-11.3.0', name='libjpeg-turbo', nameletter='l', nameletterlower='l', namelower='libjpeg-turbo', toolchain_name='GCCcore', toolchain_version='11.3.0', version='2.1.3', version_major='2', version_major_minor='2.1', version_minor='1', versionprefix='', versionsuffix=''
== 2022-12-01 12:19:27,265 one.py:178 INFO Skipping reformatting value for parameter 'toolchain'
== 2022-12-01 12:19:27,266 one.py:178 INFO Skipping reformatting value for parameter 'toolchainopts'
== 2022-12-01 12:19:27,266 filetools.py:1913 INFO Creating directory /tmp/eb-e_8gs5x5/reprod_20221201121927_27457 (parents: True, set_gid: False, sticky: False)
== 2022-12-01 12:19:27,266 easyblock.py:4294 INFO Dumped easyconfig instance to /tmp/eb-e_8gs5x5/reprod_20221201121927_27457/libjpeg-turbo-2.1.3-GCCcore-11.3.0.eb
== 2022-12-01 12:19:27,266 filetools.py:1913 INFO Creating directory /tmp/eb-e_8gs5x5/reprod_20221201121927_27457/easyblocks (parents: True, set_gid: False, sticky: False)
== 2022-12-01 12:19:27,267 filetools.py:2426 INFO /home/luke/git/easybuild-easyblocks/easybuild/easyblocks/generic/cmakemake.py copied to /tmp/eb-e_8gs5x5/reprod_20221201121927_27457/easyblocks/cmakemake.py
== 2022-12-01 12:19:27,267 easyblock.py:4274 INFO Dumped easyblock cmakemake.py required for reproduction to /tmp/eb-e_8gs5x5/reprod_20221201121927_27457/easyblocks
== 2022-12-01 12:19:27,267 filetools.py:2426 INFO /home/luke/git/easybuild-easyblocks/easybuild/easyblocks/generic/configuremake.py copied to /tmp/eb-e_8gs5x5/reprod_20221201121927_27457/easyblocks/configuremake.py
== 2022-12-01 12:19:27,267 easyblock.py:4274 INFO Dumped easyblock configuremake.py required for reproduction to /tmp/eb-e_8gs5x5/reprod_20221201121927_27457/easyblocks
== 2022-12-01 12:19:27,267 easyblock.py:2125 INFO Number of iterations to perform for central part of installation procedure: 1
== 2022-12-01 12:19:27,267 build_log.py:265 INFO building and installing libjpeg-turbo/2.1.3-GCCcore-11.3.0...
== 2022-12-01 12:19:27,270 filetools.py:2006 INFO Lock /home/luke/.local/easybuild/software/.locks/_home_luke_.local_easybuild_software_libjpeg-turbo_2.1.3-GCCcore-11.3.0.lock does not exist
== 2022-12-01 12:19:27,270 filetools.py:1947 INFO Creating lock at /home/luke/.local/easybuild/software/.locks/_home_luke_.local_easybuild_software_libjpeg-turbo_2.1.3-GCCcore-11.3.0.lock...
== 2022-12-01 12:19:27,270 filetools.py:1913 INFO Creating directory /home/luke/.local/easybuild/software/.locks/_home_luke_.local_easybuild_software_libjpeg-turbo_2.1.3-GCCcore-11.3.0.lock (parents: True, set_gid: False, sticky: False)
== 2022-12-01 12:19:27,270 filetools.py:1956 INFO Lock created: /home/luke/.local/easybuild/software/.locks/_home_luke_.local_easybuild_software_libjpeg-turbo_2.1.3-GCCcore-11.3.0.lock
== 2022-12-01 12:19:27,270 build_log.py:265 INFO fetching files...
== 2022-12-01 12:19:27,273 easyblock.py:3766 INFO Starting fetch step
== 2022-12-01 12:19:27,273 easyconfig.py:1686 INFO Generating template values...
== 2022-12-01 12:19:27,273 easyconfig.py:1705 INFO Template values: arch='x86_64', bitbucket_account='libjpeg-turbo', builddir='/home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0', github_account='libjpeg-turbo', installdir='/home/luke/.local/easybuild/software/libjpeg-turbo/2.1.3-GCCcore-11.3.0', module_name='libjpeg-turbo/2.1.3-GCCcore-11.3.0', name='libjpeg-turbo', nameletter='l', nameletterlower='l', namelower='libjpeg-turbo', toolchain_name='GCCcore', toolchain_version='11.3.0', version='2.1.3', version_major='2', version_major_minor='2.1', version_minor='1', versionprefix='', versionsuffix=''
== 2022-12-01 12:19:27,274 easyblock.py:3774 INFO Running method fetch_step part of step fetch
== 2022-12-01 12:19:27,274 easyblock.py:2247 WARNING Easyconfig does not specify an EasyBuild-version (key 'easybuild_version')! Assuming the latest version
== 2022-12-01 12:19:27,274 easyblock.py:759 INFO Considering directory in which easyconfig file is located when searching for libjpeg-turbo-2.1.3.tar.gz: /home/luke/.local/easybuild/easyconfigs/l/libjpeg-turbo
== 2022-12-01 12:19:27,274 tools.py:274 INFO Found location to 'eb' script via $EB_SCRIPT_PATH: /home/luke/.local/bin/eb
== 2022-12-01 12:19:27,274 tools.py:288 INFO Also considering installation prefix /home/luke/.local (determined via path to 'eb' script)...
== 2022-12-01 12:19:27,274 easyblock.py:801 INFO Found file libjpeg-turbo-2.1.3.tar.gz at /home/luke/.local/easybuild/sources/l/libjpeg-turbo/libjpeg-turbo-2.1.3.tar.gz
== 2022-12-01 12:19:27,275 easyblock.py:454 INFO Added sources: [{'name': 'libjpeg-turbo-2.1.3.tar.gz', 'path': '/home/luke/.local/easybuild/sources/l/libjpeg-turbo/libjpeg-turbo-2.1.3.tar.gz', 'cmd': None, 'checksum': '467b310903832b033fe56cd37720d1b73a6a3bd0171dbf6ff0b620385f4f76d0', 'finalpath': '/home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0'}]
== 2022-12-01 12:19:27,275 easyblock.py:2290 INFO no patches provided
== 2022-12-01 12:19:27,279 easyblock.py:2300 INFO md5 checksum for /home/luke/.local/easybuild/sources/l/libjpeg-turbo/libjpeg-turbo-2.1.3.tar.gz: 85244dedeaf06f636a9e7ddea6d236d8
== 2022-12-01 12:19:27,286 easyblock.py:2300 INFO sha256 checksum for /home/luke/.local/easybuild/sources/l/libjpeg-turbo/libjpeg-turbo-2.1.3.tar.gz: 467b310903832b033fe56cd37720d1b73a6a3bd0171dbf6ff0b620385f4f76d0
== 2022-12-01 12:19:27,287 easyblock.py:2335 INFO Checking dirs that need to be created: ['/home/luke/.local/easybuild/software/libjpeg-turbo/2.1.3-GCCcore-11.3.0', '/home/luke/.local/easybuild/modules/all/libjpeg-turbo', '/home/luke/.local/easybuild/modules/lib/libjpeg-turbo']
== 2022-12-01 12:19:27,287 configuremake.py:94 INFO config.guess version: 2018-08-29 (last updated: 2022-10-25T19:08:19.943320, SHA256 checksum: c02eb9cc55c86cfd1e9a794e548d25db5c9539e7b2154beb649bc6e2cbffc74c)
== 2022-12-01 12:19:27,288 configuremake.py:150 INFO Found config.guess at /home/luke/.local/easybuild/sources/generic/eb_v4.6.2/ConfigureMake/config.guess
== 2022-12-01 12:19:27,288 build_log.py:265 INFO creating build dir, resetting environment...
== 2022-12-01 12:19:27,291 easyblock.py:3766 INFO Starting ready step
== 2022-12-01 12:19:27,291 easyconfig.py:1686 INFO Generating template values...
== 2022-12-01 12:19:27,291 easyconfig.py:1705 INFO Template values: arch='x86_64', bitbucket_account='libjpeg-turbo', builddir='/home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0', github_account='libjpeg-turbo', installdir='/home/luke/.local/easybuild/software/libjpeg-turbo/2.1.3-GCCcore-11.3.0', module_name='libjpeg-turbo/2.1.3-GCCcore-11.3.0', name='libjpeg-turbo', nameletter='l', nameletterlower='l', namelower='libjpeg-turbo', toolchain_name='GCCcore', toolchain_version='11.3.0', version='2.1.3', version_major='2', version_major_minor='2.1', version_minor='1', versionprefix='', versionsuffix=''
== 2022-12-01 12:19:27,291 easyblock.py:3774 INFO Running method check_readiness_step part of step ready
== 2022-12-01 12:19:27,298 run.py:234 INFO running cmd: ulimit -u
== 2022-12-01 12:19:27,304 easyblock.py:2144 INFO Setting parallelism: 8
== 2022-12-01 12:19:27,354 easyblock.py:3774 INFO Running method make_builddir part of step ready
== 2022-12-01 12:19:27,354 easyblock.py:1072 INFO Found old directory /home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0
== 2022-12-01 12:19:27,370 filetools.py:382 INFO Path /home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0 successfully removed.
== 2022-12-01 12:19:27,370 easyblock.py:1080 INFO Removed old directory /home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0
== 2022-12-01 12:19:27,370 filetools.py:1913 INFO Creating directory /home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0 (parents: True, set_gid: False, sticky: False)
== 2022-12-01 12:19:27,370 easyblock.py:3774 INFO Running method reset_env part of step ready
== 2022-12-01 12:19:27,371 easyblock.py:3774 INFO Running method handle_iterate_opts part of step ready
== 2022-12-01 12:19:27,371 easyconfig.py:1686 INFO Generating template values...
== 2022-12-01 12:19:27,371 easyconfig.py:1705 INFO Template values: arch='x86_64', bitbucket_account='libjpeg-turbo', builddir='/home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0', github_account='libjpeg-turbo', installdir='/home/luke/.local/easybuild/software/libjpeg-turbo/2.1.3-GCCcore-11.3.0', module_name='libjpeg-turbo/2.1.3-GCCcore-11.3.0', name='libjpeg-turbo', nameletter='l', nameletterlower='l', namelower='libjpeg-turbo', parallel='8', toolchain_name='GCCcore', toolchain_version='11.3.0', version='2.1.3', version_major='2', version_major_minor='2.1', version_minor='1', versionprefix='', versionsuffix=''
== 2022-12-01 12:19:27,371 build_log.py:265 INFO unpacking...
== 2022-12-01 12:19:27,375 easyblock.py:3766 INFO Starting source step
== 2022-12-01 12:19:27,375 easyconfig.py:1686 INFO Generating template values...
== 2022-12-01 12:19:27,375 easyconfig.py:1705 INFO Template values: arch='x86_64', bitbucket_account='libjpeg-turbo', builddir='/home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0', github_account='libjpeg-turbo', installdir='/home/luke/.local/easybuild/software/libjpeg-turbo/2.1.3-GCCcore-11.3.0', module_name='libjpeg-turbo/2.1.3-GCCcore-11.3.0', name='libjpeg-turbo', nameletter='l', nameletterlower='l', namelower='libjpeg-turbo', parallel='8', toolchain_name='GCCcore', toolchain_version='11.3.0', version='2.1.3', version_major='2', version_major_minor='2.1', version_minor='1', versionprefix='', versionsuffix=''
== 2022-12-01 12:19:27,375 easyblock.py:3774 INFO Running method checksum_step part of step source
== 2022-12-01 12:19:27,385 easyblock.py:2353 INFO Checksum verification for /home/luke/.local/easybuild/sources/l/libjpeg-turbo/libjpeg-turbo-2.1.3.tar.gz using 467b310903832b033fe56cd37720d1b73a6a3bd0171dbf6ff0b620385f4f76d0 passed.
== 2022-12-01 12:19:27,385 easyblock.py:3774 INFO Running method extract_step part of step source
== 2022-12-01 12:19:27,386 easyblock.py:2446 INFO Unpacking source libjpeg-turbo-2.1.3.tar.gz
== 2022-12-01 12:19:27,386 run.py:234 INFO running cmd: tar xzf /home/luke/.local/easybuild/sources/l/libjpeg-turbo/libjpeg-turbo-2.1.3.tar.gz
== 2022-12-01 12:19:27,451 build_log.py:265 INFO patching...
== 2022-12-01 12:19:27,455 easyblock.py:3766 INFO Starting patch step
== 2022-12-01 12:19:27,455 easyconfig.py:1686 INFO Generating template values...
== 2022-12-01 12:19:27,455 easyconfig.py:1705 INFO Template values: arch='x86_64', bitbucket_account='libjpeg-turbo', builddir='/home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0', github_account='libjpeg-turbo', installdir='/home/luke/.local/easybuild/software/libjpeg-turbo/2.1.3-GCCcore-11.3.0', module_name='libjpeg-turbo/2.1.3-GCCcore-11.3.0', name='libjpeg-turbo', nameletter='l', nameletterlower='l', namelower='libjpeg-turbo', parallel='8', toolchain_name='GCCcore', toolchain_version='11.3.0', version='2.1.3', version_major='2', version_major_minor='2.1', version_minor='1', versionprefix='', versionsuffix=''
== 2022-12-01 12:19:27,455 easyblock.py:3774 INFO Running method patch_step part of step patch
== 2022-12-01 12:19:27,456 build_log.py:265 INFO preparing...
== 2022-12-01 12:19:27,459 easyblock.py:3766 INFO Starting prepare step
== 2022-12-01 12:19:27,460 easyconfig.py:1686 INFO Generating template values...
== 2022-12-01 12:19:27,460 easyconfig.py:1705 INFO Template values: arch='x86_64', bitbucket_account='libjpeg-turbo', builddir='/home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0', github_account='libjpeg-turbo', installdir='/home/luke/.local/easybuild/software/libjpeg-turbo/2.1.3-GCCcore-11.3.0', module_name='libjpeg-turbo/2.1.3-GCCcore-11.3.0', name='libjpeg-turbo', nameletter='l', nameletterlower='l', namelower='libjpeg-turbo', parallel='8', toolchain_name='GCCcore', toolchain_version='11.3.0', version='2.1.3', version_major='2', version_major_minor='2.1', version_minor='1', versionprefix='', versionsuffix=''
== 2022-12-01 12:19:27,460 easyblock.py:3774 INFO Running method prepare_step part of step prepare
== 2022-12-01 12:19:27,460 modules.py:626 INFO Checking whether CMake/3.23.1-GCCcore-11.3.0 exists...
== 2022-12-01 12:19:27,460 modules.py:631 INFO Module CMake/3.23.1-GCCcore-11.3.0 exists (found in list of available modules)
== 2022-12-01 12:19:27,461 modules.py:654 INFO Result for existence check of CMake/3.23.1-GCCcore-11.3.0 module: True
== 2022-12-01 12:19:27,461 modules.py:626 INFO Checking whether binutils/2.38-GCCcore-11.3.0 exists...
== 2022-12-01 12:19:27,461 modules.py:631 INFO Module binutils/2.38-GCCcore-11.3.0 exists (found in list of available modules)
== 2022-12-01 12:19:27,461 modules.py:654 INFO Result for existence check of binutils/2.38-GCCcore-11.3.0 module: True
== 2022-12-01 12:19:27,461 modules.py:626 INFO Checking whether NASM/2.15.05-GCCcore-11.3.0 exists...
== 2022-12-01 12:19:27,461 modules.py:631 INFO Module NASM/2.15.05-GCCcore-11.3.0 exists (found in list of available modules)
== 2022-12-01 12:19:27,461 modules.py:654 INFO Result for existence check of NASM/2.15.05-GCCcore-11.3.0 module: True
== 2022-12-01 12:19:27,461 modules.py:626 INFO Checking whether GCCcore/11.3.0 exists...
== 2022-12-01 12:19:27,462 modules.py:633 INFO Module GCCcore/11.3.0 not found in list of available modules, checking via 'module show'...
== 2022-12-01 12:19:27,524 modules.py:654 INFO Result for existence check of GCCcore/11.3.0 module: True
== 2022-12-01 12:19:27,753 environment.py:91 INFO Environment variable LD_LIBRARY_PATH set to /home/luke/.local/easybuild/software/libarchive/3.6.1-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/XZ/5.2.5-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/cURL/7.83.0-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/OpenSSL/1.1/lib:/home/luke/.local/easybuild/software/bzip2/1.0.8-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/zlib/1.2.12-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/ncurses/6.3-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/GCCcore/11.3.0/lib64 (previous value: '/home/luke/.local/easybuild/software/libarchive/3.6.1-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/XZ/5.2.5-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/cURL/7.83.0-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/OpenSSL/1.1/lib:/home/luke/.local/easybuild/software/bzip2/1.0.8-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/zlib/1.2.12-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/ncurses/6.3-GCCcore-11.3.0/lib')
== 2022-12-01 12:19:27,854 environment.py:91 INFO Environment variable LD_LIBRARY_PATH set to /home/luke/.local/easybuild/software/binutils/2.38-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/libarchive/3.6.1-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/XZ/5.2.5-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/cURL/7.83.0-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/OpenSSL/1.1/lib:/home/luke/.local/easybuild/software/bzip2/1.0.8-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/zlib/1.2.12-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/ncurses/6.3-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/GCCcore/11.3.0/lib64 (previous value: '/home/luke/.local/easybuild/software/binutils/2.38-GCCcore-11.3.0/lib')
== 2022-12-01 12:19:27,948 modules.py:626 INFO Checking whether GCCcore/11.3.0 exists...
== 2022-12-01 12:19:27,948 modules.py:633 INFO Module GCCcore/11.3.0 not found in list of available modules, checking via 'module show'...
== 2022-12-01 12:19:27,948 modules.py:654 INFO Result for existence check of GCCcore/11.3.0 module: True
== 2022-12-01 12:19:27,949 toolchain.py:760 INFO List of toolchain dependency modules and toolchain definition match!
== 2022-12-01 12:19:27,950 compiler.py:361 INFO _set_optimal_architecture: using march=native as optarch for x86_64.
== 2022-12-01 12:19:27,952 variables.py:201 WARNING flags_for_subdirs: directory /home/luke/.local/easybuild/software/CMake/3.23.1-GCCcore-11.3.0/include was not found
== 2022-12-01 12:19:27,952 variables.py:201 WARNING flags_for_subdirs: directory /home/luke/.local/easybuild/software/CMake/3.23.1-GCCcore-11.3.0/lib64 was not found
== 2022-12-01 12:19:27,952 variables.py:201 WARNING flags_for_subdirs: directory /home/luke/.local/easybuild/software/CMake/3.23.1-GCCcore-11.3.0/lib was not found
== 2022-12-01 12:19:27,952 variables.py:201 WARNING flags_for_subdirs: directory /home/luke/.local/easybuild/software/NASM/2.15.05-GCCcore-11.3.0/include was not found
== 2022-12-01 12:19:27,952 variables.py:201 WARNING flags_for_subdirs: directory /home/luke/.local/easybuild/software/NASM/2.15.05-GCCcore-11.3.0/lib64 was not found
== 2022-12-01 12:19:27,953 variables.py:201 WARNING flags_for_subdirs: directory /home/luke/.local/easybuild/software/NASM/2.15.05-GCCcore-11.3.0/lib was not found
== 2022-12-01 12:19:27,954 environment.py:91 INFO Environment variable CC set to gcc (previously undefined)
== 2022-12-01 12:19:27,954 environment.py:91 INFO Environment variable EBVARCC set to gcc (previously undefined)
== 2022-12-01 12:19:27,954 environment.py:91 INFO Environment variable CFLAGS set to -O2 -ftree-vectorize -march=native -fno-math-errno -fPIC (previously undefined)
== 2022-12-01 12:19:27,954 environment.py:91 INFO Environment variable EBVARCFLAGS set to -O2 -ftree-vectorize -march=native -fno-math-errno -fPIC (previously undefined)
== 2022-12-01 12:19:27,954 environment.py:91 INFO Environment variable CPPFLAGS set to -I/home/luke/.local/easybuild/software/binutils/2.38-GCCcore-11.3.0/include (previously undefined)
== 2022-12-01 12:19:27,954 environment.py:91 INFO Environment variable EBVARCPPFLAGS set to -I/home/luke/.local/easybuild/software/binutils/2.38-GCCcore-11.3.0/include (previously undefined)
== 2022-12-01 12:19:27,954 environment.py:91 INFO Environment variable CXX set to g++ (previously undefined)
== 2022-12-01 12:19:27,954 environment.py:91 INFO Environment variable EBVARCXX set to g++ (previously undefined)
== 2022-12-01 12:19:27,955 environment.py:91 INFO Environment variable CXXFLAGS set to -O2 -ftree-vectorize -march=native -fno-math-errno -fPIC (previously undefined)
== 2022-12-01 12:19:27,955 environment.py:91 INFO Environment variable EBVARCXXFLAGS set to -O2 -ftree-vectorize -march=native -fno-math-errno -fPIC (previously undefined)
== 2022-12-01 12:19:27,955 environment.py:91 INFO Environment variable F77 set to gfortran (previously undefined)
== 2022-12-01 12:19:27,955 environment.py:91 INFO Environment variable EBVARF77 set to gfortran (previously undefined)
== 2022-12-01 12:19:27,955 environment.py:91 INFO Environment variable F90 set to gfortran (previously undefined)
== 2022-12-01 12:19:27,955 environment.py:91 INFO Environment variable EBVARF90 set to gfortran (previously undefined)
== 2022-12-01 12:19:27,955 environment.py:91 INFO Environment variable F90FLAGS set to -O2 -ftree-vectorize -march=native -fno-math-errno -fPIC (previously undefined)
== 2022-12-01 12:19:27,955 environment.py:91 INFO Environment variable EBVARF90FLAGS set to -O2 -ftree-vectorize -march=native -fno-math-errno -fPIC (previously undefined)
== 2022-12-01 12:19:27,955 environment.py:91 INFO Environment variable FC set to gfortran (previously undefined)
== 2022-12-01 12:19:27,956 environment.py:91 INFO Environment variable EBVARFC set to gfortran (previously undefined)
== 2022-12-01 12:19:27,956 environment.py:91 INFO Environment variable FCFLAGS set to -O2 -ftree-vectorize -march=native -fno-math-errno -fPIC (previously undefined)
== 2022-12-01 12:19:27,956 environment.py:91 INFO Environment variable EBVARFCFLAGS set to -O2 -ftree-vectorize -march=native -fno-math-errno -fPIC (previously undefined)
== 2022-12-01 12:19:27,956 environment.py:91 INFO Environment variable FFLAGS set to -O2 -ftree-vectorize -march=native -fno-math-errno -fPIC (previously undefined)
== 2022-12-01 12:19:27,956 environment.py:91 INFO Environment variable EBVARFFLAGS set to -O2 -ftree-vectorize -march=native -fno-math-errno -fPIC (previously undefined)
== 2022-12-01 12:19:27,956 environment.py:91 INFO Environment variable FLIBS set to -lgfortran (previously undefined)
== 2022-12-01 12:19:27,956 environment.py:91 INFO Environment variable EBVARFLIBS set to -lgfortran (previously undefined)
== 2022-12-01 12:19:27,956 environment.py:91 INFO Environment variable LDFLAGS set to -L/home/luke/.local/easybuild/software/binutils/2.38-GCCcore-11.3.0/lib64 -L/home/luke/.local/easybuild/software/binutils/2.38-GCCcore-11.3.0/lib -L/home/luke/.local/easybuild/software/GCCcore/11.3.0/lib64 -L/home/luke/.local/easybuild/software/GCCcore/11.3.0/lib (previously undefined)
== 2022-12-01 12:19:27,956 environment.py:91 INFO Environment variable EBVARLDFLAGS set to -L/home/luke/.local/easybuild/software/binutils/2.38-GCCcore-11.3.0/lib64 -L/home/luke/.local/easybuild/software/binutils/2.38-GCCcore-11.3.0/lib -L/home/luke/.local/easybuild/software/GCCcore/11.3.0/lib64 -L/home/luke/.local/easybuild/software/GCCcore/11.3.0/lib (previously undefined)
== 2022-12-01 12:19:27,956 environment.py:91 INFO Environment variable LIBS set to -lm -lpthread (previously undefined)
== 2022-12-01 12:19:27,957 environment.py:91 INFO Environment variable EBVARLIBS set to -lm -lpthread (previously undefined)
== 2022-12-01 12:19:27,957 environment.py:91 INFO Environment variable OPTFLAGS set to -O2 -ftree-vectorize -march=native (previously undefined)
== 2022-12-01 12:19:27,957 environment.py:91 INFO Environment variable EBVAROPTFLAGS set to -O2 -ftree-vectorize -march=native (previously undefined)
== 2022-12-01 12:19:27,957 environment.py:91 INFO Environment variable PRECFLAGS set to -fno-math-errno (previously undefined)
== 2022-12-01 12:19:27,957 environment.py:91 INFO Environment variable EBVARPRECFLAGS set to -fno-math-errno (previously undefined)
== 2022-12-01 12:19:27,957 easyblock.py:2028 INFO Using /home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0/libjpeg-turbo-2.1.3/ as start dir
== 2022-12-01 12:19:27,957 build_log.py:265 INFO configuring...
== 2022-12-01 12:19:27,961 easyblock.py:3766 INFO Starting configure step
== 2022-12-01 12:19:27,961 easyconfig.py:1686 INFO Generating template values...
== 2022-12-01 12:19:27,961 easyconfig.py:1705 INFO Template values: arch='x86_64', bitbucket_account='libjpeg-turbo', builddir='/home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0', github_account='libjpeg-turbo', installdir='/home/luke/.local/easybuild/software/libjpeg-turbo/2.1.3-GCCcore-11.3.0', module_name='libjpeg-turbo/2.1.3-GCCcore-11.3.0', name='libjpeg-turbo', nameletter='l', nameletterlower='l', namelower='libjpeg-turbo', parallel='8', toolchain_name='GCCcore', toolchain_version='11.3.0', version='2.1.3', version_major='2', version_major_minor='2.1', version_minor='1', versionprefix='', versionsuffix=''
== 2022-12-01 12:19:27,961 easyblock.py:3774 INFO Running method configure_step part of step configure
== 2022-12-01 12:19:27,961 environment.py:91 INFO Environment variable CMAKE_INCLUDE_PATH set to /home/luke/.local/easybuild/software/binutils/2.38-GCCcore-11.3.0/include:/home/luke/.local/easybuild/software/libarchive/3.6.1-GCCcore-11.3.0/include:/home/luke/.local/easybuild/software/XZ/5.2.5-GCCcore-11.3.0/include:/home/luke/.local/easybuild/software/cURL/7.83.0-GCCcore-11.3.0/include:/home/luke/.local/easybuild/software/OpenSSL/1.1/include:/home/luke/.local/easybuild/software/bzip2/1.0.8-GCCcore-11.3.0/include:/home/luke/.local/easybuild/software/zlib/1.2.12-GCCcore-11.3.0/include:/home/luke/.local/easybuild/software/ncurses/6.3-GCCcore-11.3.0/include (previously undefined)
== 2022-12-01 12:19:27,961 environment.py:91 INFO Environment variable CMAKE_LIBRARY_PATH set to /home/luke/.local/easybuild/software/GCCcore/11.3.0/lib64:/home/luke/.local/easybuild/software/GCCcore/11.3.0/lib:/home/luke/.local/easybuild/software/binutils/2.38-GCCcore-11.3.0/lib64:/home/luke/.local/easybuild/software/binutils/2.38-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/libarchive/3.6.1-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/XZ/5.2.5-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/cURL/7.83.0-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/OpenSSL/1.1/lib:/home/luke/.local/easybuild/software/bzip2/1.0.8-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/zlib/1.2.12-GCCcore-11.3.0/lib:/home/luke/.local/easybuild/software/ncurses/6.3-GCCcore-11.3.0/lib (previous value: '/home/luke/.local/easybuild/software/GCCcore/11.3.0/lib64')
== 2022-12-01 12:19:27,962 environment.py:91 INFO Environment variable FC set to gfortran (previous value: 'gfortran')
== 2022-12-01 12:19:27,962 run.py:234 INFO running cmd: cmake -DCMAKE_INSTALL_PREFIX=/home/luke/.local/easybuild/software/libjpeg-turbo/2.1.3-GCCcore-11.3.0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -G"Unix Makefiles" -DWITH_JPEG8=1 /home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0/libjpeg-turbo-2.1.3/
== 2022-12-01 12:19:28,024 build_log.py:169 ERROR EasyBuild crashed with an error (at easybuild/base/exceptions.py:124 in __init__): cmd " cmake -DCMAKE_INSTALL_PREFIX=/home/luke/.local/easybuild/software/libjpeg-turbo/2.1.3-GCCcore-11.3.0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -G"Unix Makefiles" -DWITH_JPEG8=1 /home/luke/.local/easybuild/build/libjpegturbo/2.1.3/GCCcore-11.3.0/libjpeg-turbo-2.1.3/" exited with exit code 1 and output:
cmake: /home/luke/.local/easybuild/software/GCCcore/11.3.0/lib64/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /usr/lib/libicuuc.so.72)
(at easybuild/tools/run.py:641 in parse_cmd_output)
== 2022-12-01 12:19:28,024 filetools.py:2014 INFO Removing lock /home/luke/.local/easybuild/software/.locks/_home_luke_.local_easybuild_software_libjpeg-turbo_2.1.3-GCCcore-11.3.0.lock...
== 2022-12-01 12:19:28,024 filetools.py:382 INFO Path /home/luke/.local/easybuild/software/.locks/_home_luke_.local_easybuild_software_libjpeg-turbo_2.1.3-GCCcore-11.3.0.lock successfully removed.
== 2022-12-01 12:19:28,024 filetools.py:2018 INFO Lock removed: /home/luke/.local/easybuild/software/.locks/_home_luke_.local_easybuild_software_libjpeg-turbo_2.1.3-GCCcore-11.3.0.lock
== 2022-12-01 12:19:28,025 easyblock.py:4097 WARNING build failed (first 300 chars): cmd " cmake -DCMAKE_INSTALL_PREFIX=/home/luke/.local/easybuild/software/libjpeg-turbo/2.1.3-GCCcore-11.3.0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -G"Unix Makefiles" -DWITH_JPEG8=1 /home/luke/.local/easybuild
== 2022-12-01 12:19:28,025 easyblock.py:319 INFO Closing log for application name libjpeg-turbo version 2.1.3
The above error is telling me that it's /usr/lib/libicuuc.so.72 that needs the newer version.
Correct.
This is located outside of the easybuild environment, which I think is the cause of the issue.
Correct.
Everything within should be built against an older version of cmake.
There is no such thing as "built against version of cmake" -- cmake is a binary, and you haven't built anything with that binary yet.
Once you get this build environment working, anything built by that environment should be built against libraries in the easybuild environment. But you aren't there yet.
How do I figure out what's linked to libcuuc.so.72.
Run this command:
env LD_DEBUG=files ldd $(which cmake)
The output will look like this:
3011146: file=libarchive.so.13 [0]; needed by /usr/bin/cmake [0]
...
3011146: file=libxml2.so.2 [0]; needed by /lib/x86_64-linux-gnu/libarchive.so.13 [0]
...
3011146: file=libicuuc.so.71 [0]; needed by /lib/x86_64-linux-gnu/libxml2.so.2 [0]
This tells you that cmake directly depends on libarchive.so.13, which directly depends on libxml2.so.2, which directly depends on libicuuc.so.71 (on my system).
In your case, one (or more) of these libraries are coming from the system and not from easybuild.
You will probably need to fetch the older versions of these libraries into the easybuild environment.
Related
How can I let CMake find an external package?
I tried to build Qv2ray with CMake and Visual Studio on Windows and got the error: CMake Error at cmake/backend.cmake:9 (message): gRPC Not Found Call Stack (most recent call first): CMakeLists.txt:257 (include) Check backend.cmake: find_program(GRPC_CPP_PLUGIN grpc_cpp_plugin) find_package(gRPC CONFIG QUIET) # Debian, for example, cannot find gRPC in a proper way. # This is used as a fallback searching method if(NOT gRPC_FOUND) if(WIN32) message(FATAL_ERROR "gRPC Not Found") else() ...... I've built gRPC and installed it to C:\gRPC. How can I let CMake find it? If I add SET(gRPC_DIR "C:/gRPC/lib/cmake/grpc") before find_package, I got this error: -- Could NOT find absl (missing: absl_DIR) CMake Error at cmake/backend.cmake:9 (message): gRPC Not Found Call Stack (most recent call first): CMakeLists.txt:257 (include) If I also set absl_DIR, I got another error: Performing C SOURCE FILE Test UV_LINT_NO_UNUSED_PARAMETER failed with the following output: Change Dir: C:/v2ray/qv2ray/build/CMakeFiles/CMakeScratch/TryCompile-ixqh17 Run Build Command(s):C:/ninja/ninja.exe cmTC_cc832 && [1/2] Building C object CMakeFiles\cmTC_cc832.dir\src.c.obj FAILED: CMakeFiles/cmTC_cc832.dir/src.c.obj "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe" /nologo -DUV_LINT_NO_UNUSED_PARAMETER /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 -Wno-unused-parameter /showIncludes /FoCMakeFiles\cmTC_cc832.dir\src.c.obj /FdCMakeFiles\cmTC_cc832.dir\ /FS -c C:\v2ray\qv2ray\build\CMakeFiles\CMakeScratch\TryCompile-ixqh17\src.c cl : Command line error D8021 : invalid numeric argument '/Wno-unused-parameter' ninja: build stopped: subcommand failed. Source file was: int main(void) { return 0; } Performing C SOURCE FILE Test UV_LINT_STRICT_PROTOTYPES failed with the following output: Change Dir: C:/v2ray/qv2ray/build/CMakeFiles/CMakeScratch/TryCompile-ckl2px Run Build Command(s):C:/ninja/ninja.exe cmTC_54f78 && [1/2] Building C object CMakeFiles\cmTC_54f78.dir\src.c.obj FAILED: CMakeFiles/cmTC_54f78.dir/src.c.obj "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe" /nologo -DUV_LINT_STRICT_PROTOTYPES /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 -Wstrict-prototypes /showIncludes /FoCMakeFiles\cmTC_54f78.dir\src.c.obj /FdCMakeFiles\cmTC_54f78.dir\ /FS -c C:\v2ray\qv2ray\build\CMakeFiles\CMakeScratch\TryCompile-ckl2px\src.c cl : Command line error D8021 : invalid numeric argument '/Wstrict-prototypes' ninja: build stopped: subcommand failed. Source file was: int main(void) { return 0; } Performing C SOURCE FILE Test UV_LINT_EXTRA failed with the following output: Change Dir: C:/v2ray/qv2ray/build/CMakeFiles/CMakeScratch/TryCompile-oz29mu Run Build Command(s):C:/ninja/ninja.exe cmTC_c075b && [1/2] Building C object CMakeFiles\cmTC_c075b.dir\src.c.obj FAILED: CMakeFiles/cmTC_c075b.dir/src.c.obj "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe" /nologo -DUV_LINT_EXTRA /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 -Wextra /showIncludes /FoCMakeFiles\cmTC_c075b.dir\src.c.obj /FdCMakeFiles\cmTC_c075b.dir\ /FS -c C:\v2ray\qv2ray\build\CMakeFiles\CMakeScratch\TryCompile-oz29mu\src.c cl : Command line error D8021 : invalid numeric argument '/Wextra' ninja: build stopped: subcommand failed. Source file was: int main(void) { return 0; } Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output: Change Dir: C:/v2ray/qv2ray/build/CMakeFiles/CMakeScratch/TryCompile-d5iufb Run Build Command(s):C:/ninja/ninja.exe cmTC_b1e72 && [1/2] Building C object CMakeFiles\cmTC_b1e72.dir\src.c.obj FAILED: CMakeFiles/cmTC_b1e72.dir/src.c.obj "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe" /nologo -DCMAKE_HAVE_LIBC_PTHREAD /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles\cmTC_b1e72.dir\src.c.obj /FdCMakeFiles\cmTC_b1e72.dir\ /FS -c C:\v2ray\qv2ray\build\CMakeFiles\CMakeScratch\TryCompile-d5iufb\src.c C:\v2ray\qv2ray\build\CMakeFiles\CMakeScratch\TryCompile-d5iufb\src.c(1): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory ninja: build stopped: subcommand failed. Source file was: #include <pthread.h> static void* test_func(void* data) { return data; } int main(void) { pthread_t thread; pthread_create(&thread, NULL, test_func, NULL); pthread_detach(thread); pthread_cancel(thread); pthread_join(thread, NULL); pthread_atfork(NULL, NULL, NULL); pthread_exit(NULL); return 0; } Determining if the function pthread_create exists in the pthreads failed with the following output: Change Dir: C:/v2ray/qv2ray/build/CMakeFiles/CMakeScratch/TryCompile-cyjamz Run Build Command(s):C:/ninja/ninja.exe cmTC_863f5 && [1/2] Building C object CMakeFiles\cmTC_863f5.dir\CheckFunctionExists.c.obj [2/2] Linking C executable cmTC_863f5.exe FAILED: cmTC_863f5.exe cmd.exe /C "cd . && C:\CMake\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_863f5.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests -- "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\link.exe" /nologo CMakeFiles\cmTC_863f5.dir\CheckFunctionExists.c.obj /out:cmTC_863f5.exe /implib:cmTC_863f5.lib /pdb:cmTC_863f5.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console pthreads.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." LINK Pass 1: command "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_863f5.dir\CheckFunctionExists.c.obj /out:cmTC_863f5.exe /implib:cmTC_863f5.lib /pdb:cmTC_863f5.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console pthreads.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_863f5.dir/intermediate.manifest CMakeFiles\cmTC_863f5.dir/manifest.res" failed (exit code 1104) with the following output: LINK : fatal error LNK1104: cannot open file 'pthreads.lib' ninja: build stopped: subcommand failed. Determining if the function pthread_create exists in the pthread failed with the following output: Change Dir: C:/v2ray/qv2ray/build/CMakeFiles/CMakeScratch/TryCompile-ymkre8 Run Build Command(s):C:/ninja/ninja.exe cmTC_2ac36 && [1/2] Building C object CMakeFiles\cmTC_2ac36.dir\CheckFunctionExists.c.obj [2/2] Linking C executable cmTC_2ac36.exe FAILED: cmTC_2ac36.exe cmd.exe /C "cd . && C:\CMake\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_2ac36.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests -- "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\link.exe" /nologo CMakeFiles\cmTC_2ac36.dir\CheckFunctionExists.c.obj /out:cmTC_2ac36.exe /implib:cmTC_2ac36.lib /pdb:cmTC_2ac36.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console pthread.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." LINK Pass 1: command "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_2ac36.dir\CheckFunctionExists.c.obj /out:cmTC_2ac36.exe /implib:cmTC_2ac36.lib /pdb:cmTC_2ac36.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console pthread.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_2ac36.dir/intermediate.manifest CMakeFiles\cmTC_2ac36.dir/manifest.res" failed (exit code 1104) with the following output: LINK : fatal error LNK1104: cannot open file 'pthread.lib' ninja: build stopped: subcommand failed. I downloaded pthread-win32, copied pthreadVC2.lib to pthread.lib and added the following line to CMakeLists.txt, set (CMAKE_EXE_LINKER_FLAGS "/LIBPATH:\"C:\\pthreads-w32-2-9-1-release\\Pre-built.2\\lib\\x64\\\"") then rebuilt but still got the error: Performing C SOURCE FILE Test UV_LINT_NO_UNUSED_PARAMETER failed with the following output: Change Dir: C:/v2ray/qv2ray/build/CMakeFiles/CMakeScratch/TryCompile-wqbrhl Run Build Command(s):C:/ninja/ninja.exe cmTC_7b6af && [1/2] Building C object CMakeFiles\cmTC_7b6af.dir\src.c.obj FAILED: CMakeFiles/cmTC_7b6af.dir/src.c.obj "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe" /nologo -DUV_LINT_NO_UNUSED_PARAMETER /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 -Wno-unused-parameter /showIncludes /FoCMakeFiles\cmTC_7b6af.dir\src.c.obj /FdCMakeFiles\cmTC_7b6af.dir\ /FS -c C:\v2ray\qv2ray\build\CMakeFiles\CMakeScratch\TryCompile-wqbrhl\src.c cl : Command line error D8021 : invalid numeric argument '/Wno-unused-parameter' ninja: build stopped: subcommand failed. Source file was: int main(void) { return 0; } Performing C SOURCE FILE Test UV_LINT_STRICT_PROTOTYPES failed with the following output: Change Dir: C:/v2ray/qv2ray/build/CMakeFiles/CMakeScratch/TryCompile-e8xc9e Run Build Command(s):C:/ninja/ninja.exe cmTC_f19a7 && [1/2] Building C object CMakeFiles\cmTC_f19a7.dir\src.c.obj FAILED: CMakeFiles/cmTC_f19a7.dir/src.c.obj "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe" /nologo -DUV_LINT_STRICT_PROTOTYPES /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 -Wstrict-prototypes /showIncludes /FoCMakeFiles\cmTC_f19a7.dir\src.c.obj /FdCMakeFiles\cmTC_f19a7.dir\ /FS -c C:\v2ray\qv2ray\build\CMakeFiles\CMakeScratch\TryCompile-e8xc9e\src.c cl : Command line error D8021 : invalid numeric argument '/Wstrict-prototypes' ninja: build stopped: subcommand failed. Source file was: int main(void) { return 0; } Performing C SOURCE FILE Test UV_LINT_EXTRA failed with the following output: Change Dir: C:/v2ray/qv2ray/build/CMakeFiles/CMakeScratch/TryCompile-0dci1s Run Build Command(s):C:/ninja/ninja.exe cmTC_33837 && [1/2] Building C object CMakeFiles\cmTC_33837.dir\src.c.obj FAILED: CMakeFiles/cmTC_33837.dir/src.c.obj "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe" /nologo -DUV_LINT_EXTRA /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 -Wextra /showIncludes /FoCMakeFiles\cmTC_33837.dir\src.c.obj /FdCMakeFiles\cmTC_33837.dir\ /FS -c C:\v2ray\qv2ray\build\CMakeFiles\CMakeScratch\TryCompile-0dci1s\src.c cl : Command line error D8021 : invalid numeric argument '/Wextra' ninja: build stopped: subcommand failed. Source file was: int main(void) { return 0; } Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output: Change Dir: C:/v2ray/qv2ray/build/CMakeFiles/CMakeScratch/TryCompile-fxbu04 Run Build Command(s):C:/ninja/ninja.exe cmTC_79d11 && [1/2] Building C object CMakeFiles\cmTC_79d11.dir\src.c.obj FAILED: CMakeFiles/cmTC_79d11.dir/src.c.obj "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe" /nologo -DCMAKE_HAVE_LIBC_PTHREAD /DWIN32 /D_WINDOWS /W3 /MDd /Zi /Ob0 /Od /RTC1 /showIncludes /FoCMakeFiles\cmTC_79d11.dir\src.c.obj /FdCMakeFiles\cmTC_79d11.dir\ /FS -c C:\v2ray\qv2ray\build\CMakeFiles\CMakeScratch\TryCompile-fxbu04\src.c C:\v2ray\qv2ray\build\CMakeFiles\CMakeScratch\TryCompile-fxbu04\src.c(1): fatal error C1083: Cannot open include file: 'pthread.h': No such file or directory ninja: build stopped: subcommand failed. Source file was: #include <pthread.h> static void* test_func(void* data) { return data; } int main(void) { pthread_t thread; pthread_create(&thread, NULL, test_func, NULL); pthread_detach(thread); pthread_cancel(thread); pthread_join(thread, NULL); pthread_atfork(NULL, NULL, NULL); pthread_exit(NULL); return 0; } Determining if the function pthread_create exists in the pthreads failed with the following output: Change Dir: C:/v2ray/qv2ray/build/CMakeFiles/CMakeScratch/TryCompile-nnzju3 Run Build Command(s):C:/ninja/ninja.exe cmTC_1b1f1 && [1/2] Building C object CMakeFiles\cmTC_1b1f1.dir\CheckFunctionExists.c.obj [2/2] Linking C executable cmTC_1b1f1.exe FAILED: cmTC_1b1f1.exe cmd.exe /C "cd . && C:\CMake\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_1b1f1.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests -- "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\link.exe" /nologo CMakeFiles\cmTC_1b1f1.dir\CheckFunctionExists.c.obj /out:cmTC_1b1f1.exe /implib:cmTC_1b1f1.lib /pdb:cmTC_1b1f1.pdb /version:0.0 /LIBPATH:"C:\pthreads-w32-2-9-1-release\Pre-built.2\lib\x64\" /debug /INCREMENTAL /subsystem:console pthreads.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." LINK: command "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_1b1f1.dir\CheckFunctionExists.c.obj /out:cmTC_1b1f1.exe /implib:cmTC_1b1f1.lib /pdb:cmTC_1b1f1.pdb /version:0.0 /LIBPATH:C:\pthreads-w32-2-9-1-release\Pre-built.2\lib\x64" /debug /INCREMENTAL /subsystem:console pthreads.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:cmTC_1b1f1.exe.manifest" failed (exit code 1120) with the following output: CheckFunctionExists.c.obj : error LNK2019: unresolved external symbol pthread_create referenced in function main cmTC_1b1f1.exe : fatal error LNK1120: 1 unresolved externals ninja: build stopped: subcommand failed. Determining if the function pthread_create exists in the pthread failed with the following output: Change Dir: C:/v2ray/qv2ray/build/CMakeFiles/CMakeScratch/TryCompile-4uqkdk Run Build Command(s):C:/ninja/ninja.exe cmTC_12c03 && [1/2] Building C object CMakeFiles\cmTC_12c03.dir\CheckFunctionExists.c.obj [2/2] Linking C executable cmTC_12c03.exe FAILED: cmTC_12c03.exe cmd.exe /C "cd . && C:\CMake\bin\cmake.exe -E vs_link_exe --intdir=CMakeFiles\cmTC_12c03.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100220~1.0\x64\mt.exe --manifests -- "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\link.exe" /nologo CMakeFiles\cmTC_12c03.dir\CheckFunctionExists.c.obj /out:cmTC_12c03.exe /implib:cmTC_12c03.lib /pdb:cmTC_12c03.pdb /version:0.0 /LIBPATH:"C:\pthreads-w32-2-9-1-release\Pre-built.2\lib\x64\" /debug /INCREMENTAL /subsystem:console pthread.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ." LINK: command "C:\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cmTC_12c03.dir\CheckFunctionExists.c.obj /out:cmTC_12c03.exe /implib:cmTC_12c03.lib /pdb:cmTC_12c03.pdb /version:0.0 /LIBPATH:C:\pthreads-w32-2-9-1-release\Pre-built.2\lib\x64" /debug /INCREMENTAL /subsystem:console pthread.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:cmTC_12c03.exe.manifest" failed (exit code 1120) with the following output: CheckFunctionExists.c.obj : error LNK2019: unresolved external symbol pthread_create referenced in function main cmTC_12c03.exe : fatal error LNK1120: 1 unresolved externals ninja: build stopped: subcommand failed. The error messages in cmake build window are: -- Found CURL: C:\curl-7.87.0-win64-mingw\lib (found version "7.87.0") -- Found Protobuf: C:\protobuf-21.12\lib (found version "3.21.12") -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - not found -- Found Threads: TRUE CMake Error at cmake/backend.cmake:16 (message): gRPC Not Found Call Stack (most recent call first): CMakeLists.txt:257 (include) -- Configuring incomplete, errors occurred! See also "C:/v2ray/qv2ray/build/CMakeFiles/CMakeOutput.log". See also "C:/v2ray/qv2ray/build/CMakeFiles/CMakeError.log". Probably, absl_DIR and pthread are both required by gRPC. But I don't think this is the correct way to let CMake find gRPC since I can run the executables in C:\gRPC\bin\ without problem so gRPC should be able to find the components it depends automatically. What is the correct way to let CMake find gRPC?
Compiling cpputest with mingw-w64
I'm trying to compile cpputest with mingw-w64 but can't make it work and I can't find any resources on how to do that. So hopefully this question will help others in the future. I would like to compile cpputest using mingw-w64, preferably without installing MSYS2 or other packages. I have mingw-w64 i686-8.1.0-posix-dwarf-rt_v6-rev0 installed. I've cloned cpputest from here. I tried following Compiling Google test with Mingw-w64 and Compiling and using CppUTest 3.8 under MSYS2/MinGW32 by calling CMake with: cmake ^ -G "MinGW Makefiles" ^ -D CMAKE_C_COMPILER=gcc.exe ^ -D CMAKE_CXX_COMPILER=g++.exe ^ -D CMAKE_MAKE_PROGRAM=mingw32-make.exe ^ -D C++11=ON ^ . Which yields: ------------------------------------------------------- CppUTest Version 3.8 Current compiler options: CC: C:/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/gcc.exe CXX: C:/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/g++.exe CppUTest CFLAGS: -include "C:/git/tdd/cpputest/include/CppUTest/MemoryLeakDetectorMallocMacros.h" -Wall -Wextra -pedantic -Wshadow -Wswitch-default -Wswitch-enum -Wconversion -Wsign-conversion -Wno-padded -Wno-long-long -Wstrict-prototypes CppUTest CXXFLAGS: -include "C:/git/tdd/cpputest/include/CppUTest/MemoryLeakDetectorNewMacros.h" -include "C:/git/tdd/cpputest/include/CppUTest/MemoryLeakDetectorMallocMacros.h" -Wall -Wextra -pedantic -Wshadow -Wswitch-default -Wswitch-enum -Wconversion -Wsign-conversion -Wno-padded -Wno-long-long -Woverloaded-virtual -Wno-old-style-cast -Wno-c++14-compat CppUTest LDFLAGS: Features configured in CppUTest: Memory Leak Detection: ON Compiling Extensions: ON Support Long Long: OFF Use CppUTest flags: ON Using Standard C library: ON Using Standard C++ library: ON Using C++11 library: ON Generating map file: OFF Compiling with coverage: OFF Compile and run self-tests ON Run self-tests separately OFF ------------------------------------------------------- Running make fails with: >mingw32-make.exe Scanning dependencies of target CppUTest [ 1%] Building CXX object src/CppUTest/CMakeFiles/CppUTest.dir/CommandLineArguments.cpp.obj In file included from C:/git/tdd/cpputest/include/CppUTest/Utest.h:34, from C:/git/tdd/cpputest/include/CppUTest/TestHarness.h:39, from C:\git\tdd\cpputest\src\CppUTest\CommandLineArguments.cpp:29: C:/git/tdd/cpputest/include/CppUTest/SimpleString.h:183:31: error: 'nullptr_t' does not name a type SimpleString StringFrom(const nullptr_t value); ^~~~~~~~~ C:/git/tdd/cpputest/include/CppUTest/SimpleString.h:183:31: note: 'nullptr_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'? C:/git/tdd/cpputest/include/CppUTest/SimpleString.h:42:1: +#include <cstddef> C:/git/tdd/cpputest/include/CppUTest/SimpleString.h:183:31: SimpleString StringFrom(const nullptr_t value); ^~~~~~~~~ mingw32-make.exe[2]: *** [src\CppUTest\CMakeFiles\CppUTest.dir\build.make:63: src/CppUTest/CMakeFiles/CppUTest.dir/CommandLineArguments.cpp.obj] Error 1 mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:886: src/CppUTest/CMakeFiles/CppUTest.dir/all] Error 2 mingw32-make.exe: *** [Makefile:140: all] Error 2 I tried the obvious solution of adding cstddef to SimpleString.h: --- a/include/CppUTest/SimpleString.h +++ b/include/CppUTest/SimpleString.h ## -180,6 +180,9 ## SimpleString BracketsFormattedHexString(SimpleString hexString); * Specifically nullptr_t is not officially supported */ #if __cplusplus > 199711L && !defined __arm__ + +#include <cstddef> + SimpleString StringFrom(const nullptr_t value); #endif But that still fails with the same error. So I tried following Build error with CMake and MSYS2 mingw-w64 by installing MSYS2 and then mingw-w64, CMake and Ninja. That gives: ------------------------------------------------------- CppUTest Version 3.8 Current compiler options: CC: C:/msys64/mingw64/bin/cc.exe CXX: C:/msys64/mingw64/bin/c++.exe CppUTest CFLAGS: -include "C:/git/tdd/cpputest/include/CppUTest/MemoryLeakDetectorMallocMacros.h" -Wall -Wextra -pedantic -Wshadow -Wswitch-default -Wswitch-enum -Wconversion -Wsign-conversion -Wno-padded -Wno-long-long -Wstrict-prototypes CppUTest CXXFLAGS: -include "C:/git/tdd/cpputest/include/CppUTest/MemoryLeakDetectorNewMacros.h" -include "C:/git/tdd/cpputest/include/CppUTest/MemoryLeakDetectorMallocMacros.h" -Wall -Wextra -pedantic -Wshadow -Wswitch-default -Wswitch-enum -Wconversion -Wsign-conversion -Wno-padded -Wno-long-long -Woverloaded-virtual -Wno-old-style-cast CppUTest LDFLAGS: Features configured in CppUTest: Memory Leak Detection: ON Compiling Extensions: ON Support Long Long: OFF Use CppUTest flags: ON Using Standard C library: ON Using Standard C++ library: ON Using C++11 library: OFF Generating map file: OFF Compiling with coverage: OFF Compile and run self-tests ON Run self-tests separately OFF ------------------------------------------------------- Compiling with cmake -G Ninja . && ninja fails with: include/CppUTest/SimpleString.h:183:31: SimpleString StringFrom(const nullptr_t value); ^~~~~~~~~ [10/98] Building CXX object src/CppUTest/CMakeFiles/CppUTest.dir/TestMemoryAllocator.cpp.obj FAILED: src/CppUTest/CMakeFiles/CppUTest.dir/TestMemoryAllocator.cpp.obj C:\msys64\mingw64\bin\c++.exe -DCPPUTEST_HAVE_STRDUP=1 -DHAVE_CONFIG_H -D_TIMESPEC_DEFINED=1 -I. -Iinclude -Isrc/CppUTest/../../include -include "C:/git/tdd/cpputest/include/CppUTest/MemoryLeakDetectorNewMacros.h" -include "C:/git/tdd/cpputest/include/CppUTest/MemoryLeakDetectorMallocMacros.h" -Wall -Wextra -pedantic -Wshadow -Wswitch-default -Wswitch-enum -Wconversion -Wsign-conversion -Wno-padded -Wno-long-long -Woverloaded-virtual -Wno-old-style-cast -O2 -g -DNDEBUG -MD -MT src/CppUTest/CMakeFiles/CppUTest.dir/TestMemoryAllocator.cpp.obj -MF src\CppUTest\CMakeFiles\CppUTest.dir\TestMemoryAllocator.cpp.obj.d -o src/CppUTest/CMakeFiles/CppUTest.dir/TestMemoryAllocator.cpp.obj -c src/CppUTest/TestMemoryAllocator.cpp In file included from include/CppUTest/Utest.h:34, from include/CppUTest/TestHarness.h:39, from src/CppUTest/TestMemoryAllocator.cpp:28: include/CppUTest/SimpleString.h:183:31: error: 'nullptr_t' does not name a type SimpleString StringFrom(const nullptr_t value); ^~~~~~~~~ include/CppUTest/SimpleString.h:183:31: note: 'nullptr_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'? include/CppUTest/SimpleString.h:42:1: +#include <cstddef> include/CppUTest/SimpleString.h:183:31: SimpleString StringFrom(const nullptr_t value); ^~~~~~~~~ ninja: build stopped: subcommand failed. Thanks!!
Turns out this was a bug in CppUtest. ## -562,7 +562,7 ## SimpleString BracketsFormattedHexString(SimpleString hexString) * Specifically nullptr_t is not officially supported */ #if __cplusplus > 199711L && !defined __arm__ - SimpleString StringFrom(const nullptr_t value) + SimpleString StringFrom(const std::nullptr_t value) { (void) value; return "(null)"; It's fixed since Dec. 5th, 2019. https://github.com/leonardopsantos/cpputest/commit/cb8c457dda6741ede7009103db99967b5f27c969
Why No ops registered when I try to load frozen model in Android NDK?
I want to use c++ tensorflow API through ndk and cmake, I can create the library but when I load a frozen model a lot of errors like this when I try to load graph: E/native: op_kernel.cc:1148 OpKernel ('op: "PopulationCount" device_type: "CPU" constraint { name: "T" allowed_values { list { type: DT_INT32 } } }') for unknown op: PopulationCount So I understand that my library does not support the operations. Do I need to add another library to support these operations? I based my Cmake script on this Cmakelist and I used the build_android_all.sh script to build the dependencies for armeabi-v7a. This is how my cmake script looks like: cmake_minimum_required(VERSION 3.4.1) include(ExternalProject) SET(PROJECT_NAME tf_native_lib) SET(OpenCV_FOUND true ) SET(PREBUILT_DIR ${TENSORFLOW_ROOT_DIR}/tensorflow/contrib/makefile/gen) SET(TARGET_NSYNC_LIB ${TENSORFLOW_ROOT_DIR}/tensorflow/contrib/makefile /downloads/nsync/builds/${ANDROID_ABI}.android.c++11) FIND_PACKAGE(OpenCV REQUIRED) add_library( # Sets the name of the library. ${PROJECT_NAME} SHARED src/main/cpp/native-lib.h src/main/cpp/native-lib.cpp src/main/cpp/TensorflowInferenceHandler.h src/main/cpp/TensorflowInferenceHandler.cpp ) add_library(lib_proto STATIC IMPORTED ) set_target_properties(lib_proto PROPERTIES IMPORTED_LOCATION ${PREBUILT_DIR}/protobuf_android/${ANDROID_ABI}/lib/libprotobuf.a) add_library(lib_nsync STATIC IMPORTED ) set_target_properties(lib_nsync PROPERTIES IMPORTED_LOCATION ${TARGET_NSYNC_LIB}/libnsync.a) add_library(lib_tf STATIC IMPORTED ) set_target_properties(lib_tf PROPERTIES IMPORTED_LOCATION ${PREBUILT_DIR}/lib/android_${ANDROID_ABI}/libtensorflow-core.a) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DIS_SLIM_BUILD \ -std=c++11 -fno-rtti -fno-exceptions \ -O2 -Wno-narrowing -fomit-frame-pointer \ -mfpu=neon -mfloat-abi=softfp -fPIE -fPIC \ -ftemplate-depth=900 \ -DGOOGLE_PROTOBUF_NO_RTTI \ -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} \ -Wl,--allow-multiple-definition \ -Wl,--whole-archive \ -fPIE -pie -v") # MESSAGE("tensorflow lib dir ${TENSORFLOW_LIB_DIR}") target_link_libraries( # Specifies the target library. ${PROJECT_NAME} ${OpenCV_LIBS} android dl log m z jnigraphics lib_tf lib_proto lib_nsync) include_directories( ${OPENCV_INCLUDE_DIRS} ${PREBUILT_DIR}/proto ${PREBUILT_DIR}/protobuf_android/${ANDROID_ABI}/include ${PREBUILT_DIR}/nsync/public ${TENSORFLOW_ROOT_DIR}/tensorflow/contrib/makefile/downloads/eigen ${TENSORFLOW_ROOT_DIR}/bazel-tensorflow/external/nsync/public ${TENSORFLOW_ROOT_DIR}/bazel-genfiles ${TENSORFLOW_ROOT_DIR} ../../../cpp_utils) If this is not possible, where are the sources to link the tensorflow_inference.so with my Jni Sources? Thanks in advance. Unai.
The PopulationCount and few other Ops are declared in tensorflow/core/ops/bitwise_ops.cc. Add that file to the end of /tensorflow/contrib/makefile/tf_op_files.txt. Then recompile the Tensorflow. That is what worked for me.
bazel build aot with cross tool failed in platform.h fatal error 'mutex' file not found
I am trying aot cross compiling with bazel.But failed in platform.h fatal error 'mutex' file not found.I can build with bazel without cross compile setting, and I can exec the binary in host. My environment is below x86-64 ubuntu14.04 target:arm-linux-gnueabihf tensorflow:Head of maste cd5f3b67fca88217776522182481b0c128db5af9 bazel:0.5.4 installed by apt-get install My test code is below. #define EIGEN_USE_THREADS #define EIGEN_USE_CUSTOM_THREAD_POOL #include <iostream> #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" #include "tensorflow/compiler/aot/tests/test_graph_tfmatmul.h" // generated int main(int argc, char** argv) { Eigen::ThreadPool tp(2); // Size the thread pool as appropriate. Eigen::ThreadPoolDevice device(&tp, tp.NumThreads()); foo::bar::MatMulComp matmul; matmul.set_thread_pool(&device); // Set up args and run the computation. const float args[12] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; std::copy(args + 0, args + 6, matmul.arg0_data()); std::copy(args + 6, args + 12, matmul.arg1_data()); matmul.Run(); // Check result if (matmul.result0(0, 0) == 58) { std::cout << "Success" << std::endl; } else { std::cout << "Failed. Expected value 58 at 0,0. Got:" << matmul.result0(0, 0) << std::endl; } return 0; } I modified the some files to compile. add cross compile setting to WORKSPACE file new_local_repository( name = "linaroLinuxGcc49Repo", build_file = "compilers/linaro_linux_gcc_4.9.BUILD", path = "compilers/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf", ) add build setting in /tensorflow/compiler/aot/tests/BUILD cc_binary( name = "my_binary", srcs = [ "my_code.cc", # include test_graph_tfmatmul.h to access the generated header ], deps = [ ":test_graph_tfmatmul", # link in the generated object file "//third_party/eigen3", ], linkopts = [ "-lpthread", ] ) Below is the build command I did. bazel build --copt=-Wno-c++11-narrowing --cxxopt='-std=c++11' //tensorflow/compiler/aot/tests:my_binary --host_crosstool_top=#bazel_tools//tools/cpp:toolchain --crosstool_top=//tools/arm_compiler:toolchain --cpu=armeabi-v7a --verbose_failures Finally I get the error below. (root) user-name#machine-name:repo [master]$ bazel build --copt=-Wno-c++11-narrowing --cxxopt='-std=c++11' //tensorflow/compiler/aot/tests:my_binary --host_crosstool_top=#bazel_tools//tools/cpp:toolchain --crosstool_top=//tools/arm_compiler:toolchain --cpu=armeabi-v7a --verbose_failures WARNING: /home/user-name/tensorflow/repo/tensorflow/core/BUILD:1772:1: in includes attribute of cc_library rule //tensorflow/core:framework_headers_lib: '../../external/nsync/public' resolves to 'external/nsync/public' not below the relative path of its package 'tensorflow/core'. This will be an error in the future. Since this rule was created by the macro 'cc_header_only_library', the error might have been caused by the macro implementation in /home/user-name/tensorflow/repo/tensorflow/tensorflow.bzl:1029:30 WARNING: /home/user-name/tensorflow/repo/tensorflow/contrib/learn/BUILD:15:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:exporter': No longer supported. Switch to SavedModel immediately. WARNING: /home/user-name/tensorflow/repo/tensorflow/contrib/learn/BUILD:15:1: in py_library rule //tensorflow/contrib/learn:learn: target '//tensorflow/contrib/learn:learn' depends on deprecated target '//tensorflow/contrib/session_bundle:gc': No longer supported. Switch to SavedModel immediately. INFO: Analysed target //tensorflow/compiler/aot/tests:my_binary (0 packages loaded). INFO: Found 1 target... ERROR: /home/user-name/.cache/bazel/_bazel_user-name/6d2eb697f6f4dfadad89ea8a861fded5/external/nsync/BUILD:397:1: C++ compilation of rule '#nsync//:nsync_cpp' failed (Exit 1): clang failed: error executing command (cd /home/user-name/.cache/bazel/_bazel_user-name/6d2eb697f6f4dfadad89ea8a861fded5/execroot/org_tensorflow && \ exec env - \ PWD=/proc/self/cwd \ PYTHON_BIN_PATH=/home/user-name/.pyenv/versions/anaconda3-4.4.0/bin/python \ PYTHON_LIB_PATH=/home/user-name/.pyenv/versions/anaconda3-4.4.0/lib/python3.6/site-packages \ TF_NEED_CUDA=0 \ TF_NEED_OPENCL=0 \ tools/arm_compiler/linaro_linux_gcc/clang_bin/clang -target armv7a-arm-linux-gnueabif '--sysroot=external/linaroLinuxGcc49Repo/arm-linux-gnueabihf/libc' '-mfloat-abi=hard' -nostdinc -isystem /usr/lib/clang/3.6/include -isystem external/linaroLinuxGcc49Repo/lib/gcc/arm-linux-gnueabihf/4.9.4/include -isystem external/linaroLinuxGcc49Repo/arm-linux-gnueabihf/libc/usr/include -isystem external/linaroLinuxGcc49Repo/lib/gcc/arm-linux-gnueabihf/4.9.4/include-fixed -isystem external/linaroLinuxGcc49Repo/arm-linux-gnueabihf/libc/usr/include -isystem external/linaroLinuxGcc49Repo/include/c++/4.9.4 -U_FORTIFY_SOURCE -fstack-protector -fPIE '-fdiagnostics-color=always' -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections -Wno-c++11-narrowing -MD -MF bazel-out/clang_linux_armhf-py3-opt/bin/external/nsync/_objs/nsync_cpp/external/nsync/internal/sem_wait.d -iquote external/nsync -iquote bazel-out/clang_linux_armhf-py3-opt/genfiles/external/nsync -iquote external/bazel_tools -iquote bazel-out/clang_linux_armhf-py3-opt/genfiles/external/bazel_tools -isystem external/nsync/public -isystem bazel-out/clang_linux_armhf-py3-opt/genfiles/external/nsync/public -isystem external/bazel_tools/tools/cpp/gcc3 -x c++ '-std=c++11' -DNSYNC_ATOMIC_CPP11 -DNSYNC_USE_CPP11_TIMEPOINT -I./external/nsync//platform/c++11 -I./external/nsync//platform/gcc -I./external/nsync//platform/arm -I./external/nsync//public -I./external/nsync//internal -I./external/nsync//platform/posix '-D_POSIX_C_SOURCE=200809L' -pthread -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/nsync/internal/sem_wait.c -o bazel-out/clang_linux_armhf-py3-opt/bin/external/nsync/_objs/nsync_cpp/external/nsync/internal/sem_wait.o) warning: unknown warning option '-Wunused-but-set-parameter'; did you mean '-Wunused-parameter'? [-Wunknown-warning-option] warning: unknown warning option '-Wno-free-nonheap-object'; did you mean '-Wno-sequence-point'? [-Wunknown-warning-option] In file included from external/nsync/internal/sem_wait.c:16: ./external/nsync//platform/c++11/platform.h:29:10: fatal error: 'mutex' file not found #include ^ 2 warnings and 1 error generated. Target //tensorflow/compiler/aot/tests:my_binary failed to build INFO: Elapsed time: 0.917s, Critical Path: 0.15s FAILED: Build did NOT complete successfully Error occures in "C++ compilation of rule '#nsync//:nsync_cpp' failed (Exit 1):" . Befause of "./external/nsync//platform/c++11/platform.h:29:10: fatal error: 'mutex' file not found #include " The file mutex is exist in ./compilers/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include/c++/4.9.4/mutex. I think path above is setted in the build output line "-isystem external/linaroLinuxGcc49Repo/include/c++/4.9.4" How could I set the path to mutex? for cross compiling nsync?
I made a mistake when I edit CROSSTOOL file. If you know detail, please refer below. https://github.com/bazelbuild/bazel/issues/3836 thanks!
How to build a "file copy" RPM using cmake?
I want to build a demo rpm package which copies one file to the target system and executes some pre and post script. I managed to create a package. When I run the package on the target system I got the e warning "warning: package xxx intend for yyy plattform". But no file was copied. Any ideas? After goes my code/project: Project tree: myRpm/CMakeLists.txt myRpm/install.txt myRpm/post.py myRpm/post.sh myRpm/pre.py myRpm/pre.sh CMakeLists: cmake_minimum_required (VERSION 2.8) if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") INCLUDE(InstallRequiredSystemLibraries) set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1) set(CPACK_PACKAGE_NAME "my test") set(CPACK_PACKAGE_VENDOR "tets") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "fake rpm") set(CPACK_PACKAGE_VERSION "6.6.6") set(CPACK_PACKAGE_VERSION_MAJOR "6") set(CPACK_PACKAGE_VERSION_MINOR "6") set(CPACK_PACKAGE_VERSION_PATCH "6") set(targetDestDir "myDir") set(CPACK_GENERATOR "RPM") install( FILES "${CMAKE_CURRENT_SOURCE_DIR}/install.txt" "${CMAKE_CURRENT_SOURCE_DIR}/pre.py" "${CMAKE_CURRENT_SOURCE_DIR}/post.py" DESTINATION "${targetDestDir}" ) set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/pre.sh") set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/post.sh") include(CPack) endif()
The value of CPACK_RPM_PACKAGE_ARCHITECTURE is important when building RPMs for other systems/distros. The following code should work: cmake_minimum_required (VERSION 2.8) if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") INCLUDE(InstallRequiredSystemLibraries) set(CMAKE_INSTALL_TMPDIR /tmp CACHE PATH "Output dir for tmp") set(CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE 1) set(CPACK_PACKAGE_NAME "mytest") set(CPACK_PACKAGE_VENDOR "tets") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "fake rpm") set(CPACK_PACKAGE_VERSION "6.6.6") set(CPACK_PACKAGE_VERSION_MAJOR "6") set(CPACK_PACKAGE_VERSION_MINOR "6") set(CPACK_PACKAGE_VERSION_PATCH "6") set(CPACK_GENERATOR "RPM") set(CPACK_RPM_PACKAGE_ARCHITECTURE "noarch") set(targetDestDir ${CMAKE_INSTALL_TMPDIR}) install( FILES "${CMAKE_CURRENT_SOURCE_DIR}/install.txt" "${CMAKE_CURRENT_SOURCE_DIR}/post.py" DESTINATION "${targetDestDir}" ) set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/pre.sh") set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/post.sh") include(CPack) endif() Note: the pre.sh and post.sh are in the root dir of the sources. In the post.sh the post.py is called.