Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: set toolset for MSBuild in case of Intel C++ #6809

Merged
merged 1 commit into from Jun 28, 2020

Conversation

SSE4
Copy link
Contributor

@SSE4 SSE4 commented Apr 6, 2020

/cc @danimtb @ohanar

related: #5699
WIP as I can't get it working (yet)
running build from conan:
TRACKER : : error TRK0005: Failed to locate: "icl.exe". The system cannot find the file specified.

running plain msbuild.exe from the x86 Native Tools Command Prompt builds the project successfully.
I am currently testing on the modified lcms/2.9 recipe, which uses MSBuild helper.
probably, there is some difference in environment.
if you can check locally as well, would be great.

Changelog: Fix: Set toolset for MSBuild in case of Intel C++.
Docs: omit

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

@SSE4
Copy link
Contributor Author

@SSE4 SSE4 commented Apr 8, 2020

okay, found out what causes the difference: UseEnv.
was added in #4583

@SSE4
Copy link
Contributor Author

@SSE4 SSE4 commented Apr 8, 2020

okay, this depends on #6735 to call intelvars.bat so icl.exe could be found.
reference: https://software.intel.com/en-us/forums/intel-c-compiler/topic/281537

1. Launch Parallel Studio 2011->Command prompt->Intel 64 Visual Studio 2010 mode from the Start Menu
2. In the command prompt window type:

devenv /UseEnv

This command will launch Visual Studio instance which will inherit environment variables from the command prompt.

3. Load your solution and build it in x64 mode.

@danimtb
Copy link
Member

@danimtb danimtb commented May 12, 2020

I got the same result. I used the changes in #6735 as well and the same lcms recipe.

(py37-conan_sources) λ conan create all\ lcms/2.9@ -pr intel -ks
Exporting package recipe
lcms/2.9 exports: File 'conandata.yml' found. Exporting it...
lcms/2.9 exports: Copied 1 '.yml' file: conandata.yml
lcms/2.9: The stored package has not changed
lcms/2.9: Using the exported files summary hash as the recipe revision: cfe35f4246b17615822480148153e2c6
lcms/2.9: Exported revision: cfe35f4246b17615822480148153e2c6
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=intel
compiler.base=Visual Studio
compiler.base.runtime=MD
compiler.base.version=16
compiler.version=19.1
os=Windows
os_build=Windows
[options]
[build_requires]
[env]

lcms/2.9: Forced build from source
lcms/2.9 (test package): Installing package
Requirements
    lcms/2.9 from local cache - Cache
Packages
    lcms/2.9:c9deffaa89fde9011a2c606d4fbc91776e2c9453 - Build

Installing (downloading, building) binaries...
lcms/2.9: Copying sources to build folder
lcms/2.9: Building your package in C:\Users\danimtb\.conan\data\lcms\2.9\_\_\build\c9deffaa89fde9011a2c606d4fbc91776e2c9453
lcms/2.9: Generator cmake created conanbuildinfo.cmake
lcms/2.9: Calling build()
C:\Users\danimtb\.conan\data\lcms\2.9\_\_\build\c9deffaa89fde9011a2c606d4fbc91776e2c9453\source_subfolder\Projects\VC2013
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.5.4
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

Microsoft Visual Studio 2019 Version 16.5.4.
Copyright (C) Microsoft Corp. All rights reserved.
Upgrading project 'testbed'...
        Configuration 'Debug|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Debug|x64': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|x64': changing Platform Toolset to 'v142' (was 'v120').
Upgrading project 'tifficc'...
        Configuration 'Debug|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Debug|x64': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|x64': changing Platform Toolset to 'v142' (was 'v120').
Upgrading project 'lcms2_DLL'...
        Configuration 'Debug|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Debug|x64': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|x64': changing Platform Toolset to 'v142' (was 'v120').
Upgrading project 'linkicc'...
        Configuration 'Debug|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Debug|x64': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|x64': changing Platform Toolset to 'v142' (was 'v120').
Upgrading project 'transicc'...
        Configuration 'Debug|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Debug|x64': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|x64': changing Platform Toolset to 'v142' (was 'v120').
Upgrading project 'jpegicc'...
        Configuration 'Debug|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Debug|x64': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|x64': changing Platform Toolset to 'v142' (was 'v120').
Upgrading project 'tiffdiff'...
        Configuration 'Debug|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Debug|x64': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|x64': changing Platform Toolset to 'v142' (was 'v120').
Upgrading project 'lcms2_static'...
        Configuration 'Debug|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Debug|x64': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|x64': changing Platform Toolset to 'v142' (was 'v120').
Upgrading project 'psicc'...
        Configuration 'Debug|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Debug|x64': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|Win32': changing Platform Toolset to 'v142' (was 'v120').
        Configuration 'Release|x64': changing Platform Toolset to 'v142' (was 'v120').

Migration completed successfully, but some warnings were detected during migration.
For more information, see the migration report:
C:\Users\danimtb\.conan\data\lcms\2.9\_\_\build\c9deffaa89fde9011a2c606d4fbc91776e2c9453\source_subfolder\Projects\VC2013\UpgradeLog.htm
Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

TRACKER : : error TRK0005: Failed to locate: "icl.exe". The system cannot find the file specified. [C:\Users\danimtb\.conan\data\lcms\2.9\_\_\build\c9deffaa89fde9011a2c606d4fbc91776e2c9453\source_subfolder\Projects\VC2013\lcms2_static\lcms2_static.vcxproj]


lcms/2.9:
lcms/2.9: ERROR: Package 'c9deffaa89fde9011a2c606d4fbc91776e2c9453' build failed
lcms/2.9: WARN: Build folder C:\Users\danimtb\.conan\data\lcms\2.9\_\_\build\c9deffaa89fde9011a2c606d4fbc91776e2c9453
ERROR: lcms/2.9: Error in build() method, line 74
        self._build_visual_studio()
while calling '_build_visual_studio', line 52
        msbuild.build("lcms2.sln", targets=[target], platforms={"x86": "Win32"}, upgrade_project=upgrade_project)
        ConanException: Error 1 while executing set "VSCMD_START_DIR=%CD%" && call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC/Auxiliary/Build/vcvarsall.bat" amd64 && devenv "lcms2.sln" /upgrade && msbuild "lcms2.sln" /p:Configuration="Release" /p:UseEnv=true /p:Platform="x64" /m:8 /target:lcms2_static /p:PlatformToolset="Intel C++ Compiler 19.1" /verbosity:minimal /p:ForceImportBeforeCppTargets="C:\Users\danimtb\.conan\data\lcms\2.9\_\_\build\c9deffaa89fde9011a2c606d4fbc91776e2c9453\source_subfolder\Projects\VC2013\conan_build.props"

@SSE4
Copy link
Contributor Author

@SSE4 SSE4 commented May 12, 2020

@danimtb okay, we need to try two things then:

  1. use compiler_vars inside MSBuild helper
  2. disable use_env for Intel

@SSE4
Copy link
Contributor Author

@SSE4 SSE4 commented May 12, 2020

@danimtb if you could try this branch would be nice: https://github.com/SSE4/conan/tree/intel_msbuild_plus_compilervars

@SSE4 SSE4 marked this pull request as ready for review May 21, 2020
@SSE4 SSE4 changed the title WIP: set toolset for MSBuild in case of Intel C++ Fix: set toolset for MSBuild in case of Intel C++ May 21, 2020
@SSE4
Copy link
Contributor Author

@SSE4 SSE4 commented May 21, 2020

rebased as #6735 has been merged, should be ready for the review now

@SSE4 SSE4 closed this May 21, 2020
@SSE4 SSE4 reopened this May 21, 2020
@SSE4 SSE4 closed this May 21, 2020
@SSE4 SSE4 reopened this May 21, 2020
@SSE4
Copy link
Contributor Author

@SSE4 SSE4 commented May 21, 2020

@danimtb the CI errors is strange, and appears to be unrelated to changes:

FAIL: pkg_config_dirs_test (disabled_revisions.conans.test.functional.generators.pkg_config_test.PkgGeneratorTest)

----------------------------------------------------------------------

Traceback (most recent call last):

  File "/tmp/source/12c5/py27/disabled_revisions/conans/test/functional/generators/pkg_config_test.py", line 58, in pkg_config_dirs_test

    self.assertEqual("\n".join(pc_content.splitlines()[1:]), expected_content)

AssertionError: u'libdir=/my_absoulte_path/fake/mylib/lib\nlibdir2=${prefix}/lib2\nincludedir=/my_absoulte_path/fake/mylib/include\n\nName: MyLib\nDescription: Conan package: MyLib\nVersion: 0.1\nLibs: -L${libdir} -L${libdir2} -Wl,-rpath="${libdir}" -Wl,-rpath="${libdir2}"\nCflags: -I${includedir}' != 'libdir=/my_absoulte_path/fake/mylib/lib\nlibdir2=${prefix}/lib2\nincludedir=/my_absoulte_path/fake/mylib/include\n\nName: MyLib\nDescription: Conan package: MyLib\nVersion: 0.1\nLibs: -L${libdir} -L${libdir2} -Wl,-rpath="${libdir}" -Wl,-rpath="${libdir3}"\nCflags: -I${includedir}'

first, strings look identical, am I missing something here?
second, locally test passes for me...

@SSE4 SSE4 mentioned this pull request May 21, 2020
5 tasks
@SSE4 SSE4 closed this May 25, 2020
@SSE4 SSE4 reopened this May 25, 2020
Signed-off-by: SSE4 <tomskside@gmail.com>
@danimtb danimtb added this to the 1.27 milestone Jun 8, 2020
danimtb
danimtb approved these changes Jun 8, 2020
@memsharded memsharded merged commit ef83f84 into conan-io:develop Jun 28, 2020
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants