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

[intel_media_sdk] 2018R2_1 mingw gcc ERROR: Error while initializing settings. Invalid setting 'gcc' is not a valid 'settings.compiler' value. Possible values are ['Visual Studio'] #1075

Open
leyewen opened this issue Dec 19, 2019 · 1 comment
Labels

Comments

@leyewen
Copy link

leyewen commented Dec 19, 2019

Package and Environment Details

  • Package Name/Version: intel_media_sdk/2018R2_1
  • Operating System+version: Windows 10
  • Compiler+version: gcc-mingw-w64-8.1.0
  • Docker image: conanio/gcc8.1
  • Conan version: conan 1.21.0
  • Python version: Python 3.7.5

Conan profile

Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=gcc
compiler.cppstd=14
compiler.exception=seh
compiler.libcxx=libstdc++11
compiler.threads=posix
compiler.version=8.1
os=Windows
os_build=Windows
[options]
[build_requires]
[env]
CONAN_CMAKE_GENERATOR=MinGW Makefiles

Steps to reproduce

When I build opencv/4.1.1@conan/stable with ffmpeg opencv:ffmpeg=True, it fail in build intel_media_sdk/2018R2_1@bincrafters/stable.
It throws:

intel_media_sdk/2018R2_1@bincrafters/stable: Downloaded recipe revision 0
ERROR: Error while initializing settings. Invalid setting 'gcc' is not a valid 'settings.compiler' value.
Possible values are ['Visual Studio']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"

Fixed method

Same issues as conan-community 303 and fixed it.
https://github.com/conan-community/community/issues/303

Please fixed it to project
https://github.com/bincrafters/conan-intel_media_sdk

or

disable ffmpeg:qsv=False intel_media_sdk.

Logs

intel_media_sdk/2018R2_1@bincrafters/stable: Downloaded recipe revision 0
ERROR: Error while initializing settings. Invalid setting 'gcc' is not a valid 'settings.compiler' value.
Possible values are ['Visual Studio']
Read "http://docs.conan.io/en/latest/faq/troubleshooting.html#error-invalid-setting"

@leyewen leyewen added the bug label Dec 19, 2019
leyewen referenced this issue in bincrafters/conan-intel_media_sdk Jan 17, 2020
Merge package for newer VS versions
@leyewen
Copy link
Author

leyewen commented Jan 18, 2020

new conanfile.py file for windows gcc:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4

from conans import ConanFile, tools
from conans.model.version import Version
import os


class IntelMediaSDKConan(ConanFile):
    name = "intel_media_sdk"
    version = "2018R2_1"
    url = "https://github.com/bincrafters/conan-intel_media_sdk"
    description = "Intel® Media SDK provides an API to access hardware-accelerated video decode, encode and " \
                  "filtering on Intel® platforms with integrated graphics."
    license = "MIT"
    exports = ["LICENSE.md"]
    # settings = {"os": ["Windows"], "arch": ["x86", "x86_64"], "compiler": ["Visual Studio"]}
    settings = {"os": ["Windows"], "arch": ["x86", "x86_64"], "compiler": ["Visual Studio", "gcc"]}
    _exe_name = 'MediaSDK%s.exe' % version

    def source(self):
        source_url = "http://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/15303/%s" % self._exe_name
        tools.download(source_url, self._exe_name)

    def build(self):
        for action in ['remove', 'install']:
            self.run('%s '
                     '%s '
                     '--silent '
                     '--installdir=%s '
                     '--eval '
                     '--eula=accept '
                     '--output=out.txt '
                     '--send-data=no '
                     '--update=always' % (self._exe_name, action, os.getcwd()))

    def package(self):
        install_dir = os.path.join('Intel(R) Media SDK 2018 R2', 'Software Development Kit')

        self.copy(pattern="Media_SDK_EULA.rtf", dst="licenses", src=install_dir)
        self.copy(pattern="mediasdk_release_notes.pdf", dst="licenses", src=install_dir)
        self.copy(pattern="redist.txt", dst="licenses", src=install_dir)
        # self.copy(pattern="redist.txt", dst="licenses", src=install_dir)

        self.copy(pattern="*.h", dst=os.path.join('include', 'mfx'), src=os.path.join(install_dir, 'include'))
        if self.settings.arch == 'x86':
            self.copy(pattern="*.dll", dst="bin", src=os.path.join(install_dir, 'bin', 'Win32'),
                      keep_path=True)
            self.copy(pattern="*.lib", dst="lib", src=os.path.join(install_dir, 'lib', 'Win32'),
                      keep_path=True)
        elif self.settings.arch == 'x86_64':
            # self.copy(pattern="*.dll", dst="bin", src=os.path.join(install_dir, 'bin', 'Win32'),
            #           keep_path=True)
            self.copy(pattern="*.dll", dst="bin", src=os.path.join(install_dir, 'bin', 'x64'),
                      keep_path=True)
            self.copy(pattern="*.lib", dst="lib", src=os.path.join(install_dir, 'lib', 'x64'),
                      keep_path=True)

        with tools.chdir(os.path.join(self.package_folder, 'lib')):
            # keep in Visual Studio
            if self.settings.compiler == "Visual Studio":
                if int(str(self.settings.compiler.version)) >= 14:
                    os.unlink('libmfx.lib')
                    os.rename('libmfx_vs2015.lib', 'libmfx.lib')
                else:
                    os.unlink('libmfx_vs2015.lib')

    def package_info(self):
        self.cpp_info.libs = ['libmfx']
        self.cpp_info.includedirs.append(os.path.join(self.package_folder, 'include', 'mfx'))
        # gcc have not runtime
        # if self.settings.compiler.runtime != 'MT':
        if self.settings.compiler != "gcc" and self.settings.compiler.runtime != 'MT':
            # libmfx.lib unfortunately has /DEFAULTLIB:LIBCMT, there is nothing better to be done
            self.cpp_info.exelinkflags.append("-NODEFAULTLIB:LIBCMT")
            self.cpp_info.sharedlinkflags = self.cpp_info.exelinkflags

    def package_id(self):
        v = Version(str(self.settings.compiler.version))
        if self.settings.compiler == "Visual Studio" and (v >= "14"):
            self.info.settings.compiler.version = "VS version >= VS2015"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant