Closed aasmune closed 8 hours ago
I would recommend this fix since TBB_ENABLE_IPO
option doesn't exist before 2021.06.0:
if self.options.get_safe("interprocedural_optimization") is not None:
toolchain.variables["TBB_ENABLE_IPO"] = self.options.interprocedural_optimization
Closed by https://github.com/conan-io/conan-center-index/pull/25687, thanks again for your contribution!
Description
When installing onetbb with
interprocedural_optimization=False
the option isn't propagated correctly, resulting inTBB_ENABLE_IPO
not being set to false.This is because of the following lines: https://github.com/conan-io/conan-center-index/blob/bbabcf6309bf35a59e0a2043d2ae7be18b863bf8/recipes/onetbb/all/conanfile.py#L119-L120
With
interprocedural_optimization=False
theTBB_ENABLE_IPO
variable is never updated sinceself.options.get_safe("interprocedural_optimization")
return false.See the following output where IPO is reported as enabled when building onetbb:
Suggested fix
Remove the if-statement and always set
TBB_ENABLE_IPO
with the option value:Output with the suggested fix applied. Note how IPO enabled is not present anymore:
Click to expand log
``` $ conan create ~/src/conan-center-index/recipes/onetbb/all/conanfile.py --version 2021.10.0 -o:h interprocedural_optimization=False -o:h tbbbind=False ======== Exporting recipe to the cache ======== onetbb/2021.10.0: Exporting package recipe: /home/aeek/src/conan-center-index/recipes/onetbb/all/conanfile.py onetbb/2021.10.0: exports: File 'conandata.yml' found. Exporting it... onetbb/2021.10.0: Calling export_sources() onetbb/2021.10.0: Copied 1 '.py' file: conanfile.py onetbb/2021.10.0: Copied 1 '.yml' file: conandata.yml onetbb/2021.10.0: Exported to cache folder: /home/aeek/.conan2/p/onetb448b63698d3b9/e onetbb/2021.10.0: Exported: onetbb/2021.10.0#cf15c6c82d8fb1e3337c830dd9d09ad1 (2024-10-08 10:17:24 UTC) ======== Input profiles ======== Profile host: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu14 compiler.libcxx=libstdc++11 compiler.version=9 os=Linux [options] interprocedural_optimization=False tbbbind=False [conf] tools.system.package_manager:mode=install tools.system.package_manager:sudo=True Profile build: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu14 compiler.libcxx=libstdc++11 compiler.version=9 os=Linux [conf] tools.system.package_manager:mode=install tools.system.package_manager:sudo=True ======== Computing dependency graph ======== Graph root cli Requirements onetbb/2021.10.0#cf15c6c82d8fb1e3337c830dd9d09ad1 - Cache ======== Computing necessary packages ======== onetbb/2021.10.0: Forced build from source Requirements onetbb/2021.10.0#cf15c6c82d8fb1e3337c830dd9d09ad1:cc078e2bc16e8c4c5abc6e90a084a0e2b4048204 - Build ======== Installing packages ======== onetbb/2021.10.0: Calling source() in /home/aeek/.conan2/p/onetb448b63698d3b9/s/src -------- Installing package onetbb/2021.10.0 (1 of 1) -------- onetbb/2021.10.0: Building from source onetbb/2021.10.0: Package onetbb/2021.10.0:cc078e2bc16e8c4c5abc6e90a084a0e2b4048204 onetbb/2021.10.0: Copying sources to build folder onetbb/2021.10.0: Building your package in /home/aeek/.conan2/p/b/onetbaf1e71ed9930d/b onetbb/2021.10.0: Calling generate() onetbb/2021.10.0: Generators folder: /home/aeek/.conan2/p/b/onetbaf1e71ed9930d/b/build/Release/generators ERROR: onetbb/2021.10.0: Error in generate() method, line 120 variables["TBB_ENABLE_IPO"] = self.options.get_safe("interprocedural_optimization", True) NameError: name 'variables' is not defined [12:17:25@HVA-L00007 ~]$ conan create ~/src/conan-center-index/recipes/onetbb/all/conanfile.py --version 2021.10.0 -o:h interprocedural_optimization=False -o:h tbbbind=False ======== Exporting recipe to the cache ======== onetbb/2021.10.0: Exporting package recipe: /home/aeek/src/conan-center-index/recipes/onetbb/all/conanfile.py onetbb/2021.10.0: exports: File 'conandata.yml' found. Exporting it... onetbb/2021.10.0: Calling export_sources() onetbb/2021.10.0: Copied 1 '.py' file: conanfile.py onetbb/2021.10.0: Copied 1 '.yml' file: conandata.yml onetbb/2021.10.0: Exported to cache folder: /home/aeek/.conan2/p/onetb141eb73cfb2af/e onetbb/2021.10.0: Exported: onetbb/2021.10.0#069bab43021a091186df843fb1304d94 (2024-10-08 10:18:27 UTC) ======== Input profiles ======== Profile host: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu14 compiler.libcxx=libstdc++11 compiler.version=9 os=Linux [options] interprocedural_optimization=False tbbbind=False [conf] tools.system.package_manager:mode=install tools.system.package_manager:sudo=True Profile build: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu14 compiler.libcxx=libstdc++11 compiler.version=9 os=Linux [conf] tools.system.package_manager:mode=install tools.system.package_manager:sudo=True ======== Computing dependency graph ======== Graph root cli Requirements onetbb/2021.10.0#069bab43021a091186df843fb1304d94 - Cache ======== Computing necessary packages ======== onetbb/2021.10.0: Forced build from source Requirements onetbb/2021.10.0#069bab43021a091186df843fb1304d94:cc078e2bc16e8c4c5abc6e90a084a0e2b4048204 - Build ======== Installing packages ======== -------- Installing package onetbb/2021.10.0 (1 of 1) -------- onetbb/2021.10.0: Building from source onetbb/2021.10.0: Package onetbb/2021.10.0:cc078e2bc16e8c4c5abc6e90a084a0e2b4048204 onetbb/2021.10.0: Copying sources to build folder onetbb/2021.10.0: Building your package in /home/aeek/.conan2/p/b/onetbd94ba8db19e58/b onetbb/2021.10.0: Calling generate() onetbb/2021.10.0: Generators folder: /home/aeek/.conan2/p/b/onetbd94ba8db19e58/b/build/Release/generators onetbb/2021.10.0: CMakeToolchain generated: conan_toolchain.cmake onetbb/2021.10.0: CMakeToolchain generated: CMakePresets.json onetbb/2021.10.0: CMakeToolchain generated: ../../../src/CMakeUserPresets.json onetbb/2021.10.0: Generating aggregated env files onetbb/2021.10.0: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh'] onetbb/2021.10.0: Calling build() onetbb/2021.10.0: Running CMake.configure() onetbb/2021.10.0: RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/home/aeek/.conan2/p/b/onetbd94ba8db19e58/b/build/Release/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/aeek/.conan2/p/b/onetbd94ba8db19e58/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/home/aeek/.conan2/p/b/onetbd94ba8db19e58/b/src" CMake Deprecation Warning at CMakeLists.txt:15 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argumentI'm happy to submit a pull request if you agree with my suggested fix!
Package and Environment Details
Conan profile
Steps to reproduce
conan create ~/src/conan-center-index/recipes/onetbb/all/conanfile.py --version 2021.10.0 -o:h interprocedural_optimization=False -o:h tbbbind=False
Logs
Click to expand log
``` $ conan create ~/src/conan-center-index/recipes/onetbb/all/conanfile.py --version 2021.10.0 -o:h interprocedural_optimization=False -o:h tbbbind=False ======== Exporting recipe to the cache ======== onetbb/2021.10.0: Exporting package recipe: /home/aeek/src/conan-center-index/recipes/onetbb/all/conanfile.py onetbb/2021.10.0: exports: File 'conandata.yml' found. Exporting it... onetbb/2021.10.0: Calling export_sources() onetbb/2021.10.0: Copied 1 '.py' file: conanfile.py onetbb/2021.10.0: Copied 1 '.yml' file: conandata.yml onetbb/2021.10.0: Exported to cache folder: /home/aeek/.conan2/p/onetbd5798e52d2b39/e onetbb/2021.10.0: Exported: onetbb/2021.10.0#c27b1edfd192aa115f57f8962397e928 (2024-10-08 09:13:46 UTC) ======== Input profiles ======== Profile host: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu14 compiler.libcxx=libstdc++11 compiler.version=9 os=Linux [options] interprocedural_optimization=False tbbbind=False [conf] tools.system.package_manager:mode=install tools.system.package_manager:sudo=True Profile build: [settings] arch=x86_64 build_type=Release compiler=gcc compiler.cppstd=gnu14 compiler.libcxx=libstdc++11 compiler.version=9 os=Linux [conf] tools.system.package_manager:mode=install tools.system.package_manager:sudo=True ======== Computing dependency graph ======== Graph root cli Requirements onetbb/2021.10.0#c27b1edfd192aa115f57f8962397e928 - Cache ======== Computing necessary packages ======== onetbb/2021.10.0: Forced build from source Requirements onetbb/2021.10.0#c27b1edfd192aa115f57f8962397e928:cc078e2bc16e8c4c5abc6e90a084a0e2b4048204 - Build ======== Installing packages ======== onetbb/2021.10.0: Calling source() in /home/aeek/.conan2/p/onetbd5798e52d2b39/s/src -------- Installing package onetbb/2021.10.0 (1 of 1) -------- onetbb/2021.10.0: Building from source onetbb/2021.10.0: Package onetbb/2021.10.0:cc078e2bc16e8c4c5abc6e90a084a0e2b4048204 onetbb/2021.10.0: Copying sources to build folder onetbb/2021.10.0: Building your package in /home/aeek/.conan2/p/b/onetb185f34f341f7c/b onetbb/2021.10.0: Calling generate() onetbb/2021.10.0: Generators folder: /home/aeek/.conan2/p/b/onetb185f34f341f7c/b/build/Release/generators onetbb/2021.10.0: CMakeToolchain generated: conan_toolchain.cmake onetbb/2021.10.0: CMakeToolchain generated: CMakePresets.json onetbb/2021.10.0: CMakeToolchain generated: ../../../src/CMakeUserPresets.json onetbb/2021.10.0: Generating aggregated env files onetbb/2021.10.0: Generated aggregated env files: ['conanbuild.sh', 'conanrun.sh'] onetbb/2021.10.0: Calling build() onetbb/2021.10.0: Running CMake.configure() onetbb/2021.10.0: RUN: cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="/home/aeek/.conan2/p/b/onetb185f34f341f7c/b/build/Release/generators/conan_toolchain.cmake" -DCMAKE_INSTALL_PREFIX="/home/aeek/.conan2/p/b/onetb185f34f341f7c/p" -DCMAKE_POLICY_DEFAULT_CMP0091="NEW" -DCMAKE_BUILD_TYPE="Release" "/home/aeek/.conan2/p/b/onetb185f34f341f7c/b/src" CMake Deprecation Warning at CMakeLists.txt:15 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argument