Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. How to link Q project to other compilers
Qt 6.11 is out! See what's new in the release blog

How to link Q project to other compilers

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
5 Posts 3 Posters 909 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TE12
    wrote on last edited by TE12
    #1

    For example if planning UI in Qt and processing in ICC(Intel compiler) or NVCC(Nvidia,Cuda,OpenAcc etc).

    Some initial ideas>

    Linking Qt UI to library file built with other compiler?

    Configuring to use 2 compilers and somehow joining to single binary(to build UI part with GCC, Mingw, or msvc and processing part with NVCC)?

    Communication over (socket networking or interprocessor) and doing seperate projects built with dif compilers?

    SGaistS 1 Reply Last reply
    0
    • T TE12

      For example if planning UI in Qt and processing in ICC(Intel compiler) or NVCC(Nvidia,Cuda,OpenAcc etc).

      Some initial ideas>

      Linking Qt UI to library file built with other compiler?

      Configuring to use 2 compilers and somehow joining to single binary(to build UI part with GCC, Mingw, or msvc and processing part with NVCC)?

      Communication over (socket networking or interprocessor) and doing seperate projects built with dif compilers?

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      For CUDA for example, if you are using qmake, check the Adding Compilers topic from qmake's documentation.

      As for mixing compilers, you can't mix and match compilers on Windows for C++ projects.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      T 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        For CUDA for example, if you are using qmake, check the Adding Compilers topic from qmake's documentation.

        As for mixing compilers, you can't mix and match compilers on Windows for C++ projects.

        T Offline
        T Offline
        TE12
        wrote on last edited by TE12
        #3

        @SGaist OS does not have to be windows, Could be Linux or other.

        Goal is easyest solution to implement.

        Not much data back and forth during task.

        For example getting openAcc or Cuda to work with Qt+GCC+Linux was not easy and found very little online support compared to NVCC.

        Not many features supported or documented officialy either.

        SGaistS 1 Reply Last reply
        0
        • T TE12

          @SGaist OS does not have to be windows, Could be Linux or other.

          Goal is easyest solution to implement.

          Not much data back and forth during task.

          For example getting openAcc or Cuda to work with Qt+GCC+Linux was not easy and found very little online support compared to NVCC.

          Not many features supported or documented officialy either.

          SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Well nvcc is the compiler to use when writing CUDA code. You can then use the standard linker.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SimonSchroeder
            wrote on last edited by
            #5

            I am not entirely sure how much you want to mix and match. If you just have a single compiler for C++ and another for CUDA then @SGaist already provides good solutions.

            I have never used any build system to compile different C++ files with different compilers. This is very easy if you use libraries for the different parts and each library only uses a single compiler. (BTW, even on Windows the Intel compiler is compatible with MSVC and I believe all compilers except for MinGW, as well.)

            An ugly solution would be to use different file endings, like .cpp and .cxx, to separate files to different compilers. Then it would be moderately easy to assign one compiler per file endings. (Same way @SGaist suggested for CUDA code.)

            My best bet is to use CMake. You'd be able to have two separate lists of C++ files. I don't have the experience with CMake. But, I would expect that there is a way to assign one compiler per file list. Most likely this is quite close to having two separate libraries and link those.

            I'd also be able to come up with some interesting FASTBuild project where it would be quite easy to build up the dependencies based on two file lists. However, getting started with your first full-blown FASTBuild project is not easy. I took the FASTBuild project for FASTBuild itself as a starting point. We are using FASTBuild to compile a Qt-based project on Windows (more compilers would need to be added for Linux and macOS). A set of scripts to convert a qmake-based project to FASTBuild can be found on GIThub: https://github.com/SimonSchroeder/QMake2Fastbuild
            This is easy to extend for additional compilers with a separate list of files.

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved