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. Building Qt on Mac: Should I worry about LLVM and Clang clashes?

Building Qt on Mac: Should I worry about LLVM and Clang clashes?

Scheduled Pinned Locked Moved Solved Installation and Deployment
11 Posts 2 Posters 1.4k Views
  • 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.
  • StokestackS Offline
    StokestackS Offline
    Stokestack
    wrote on last edited by
    #1

    Hi all.

    With the offline installers now abolished, I decided to build Qt locally.

    After running the configure script for Qt 5.15, I'm told that "QDoc will not be compiled, probably because libclang could not be located."

    The config-script's output says, "Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation."

    Mac OS doesn't come with llvm-config, so I put this in .zshenv:
    LLVM_INSTALL_DIR=/Library/Developer/CommandLineTools/usr/bin

    The config script still reports the doc problem, most likely because that's not where Clang is. The Xcode-supplied Clang resides in /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/lib/darwin in the form of lots of versions for various target platforms:
    libclang_rt.ios.a
    libclang_rt.osx.a
    libclang_rt.profile_ios.a
    libclang_rt.profile_iossim.a
    libclang_rt.profile_osx.a
    ...

    I guess the workaround would be setting up a symlink to libclang_rt.osx.a and putting it somewhere (in the LLVM dir?), right, but this seems like a can of worms and maintenance nightmare.

    So if I just install another LLVM (and presumably Clang) with Homebrew, do I need to worry about conflicts with the Xcode-supplied tools?

    Thanks!

    jsulmJ 1 Reply Last reply
    0
    • StokestackS Stokestack

      Hi all.

      With the offline installers now abolished, I decided to build Qt locally.

      After running the configure script for Qt 5.15, I'm told that "QDoc will not be compiled, probably because libclang could not be located."

      The config-script's output says, "Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation."

      Mac OS doesn't come with llvm-config, so I put this in .zshenv:
      LLVM_INSTALL_DIR=/Library/Developer/CommandLineTools/usr/bin

      The config script still reports the doc problem, most likely because that's not where Clang is. The Xcode-supplied Clang resides in /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/lib/darwin in the form of lots of versions for various target platforms:
      libclang_rt.ios.a
      libclang_rt.osx.a
      libclang_rt.profile_ios.a
      libclang_rt.profile_iossim.a
      libclang_rt.profile_osx.a
      ...

      I guess the workaround would be setting up a symlink to libclang_rt.osx.a and putting it somewhere (in the LLVM dir?), right, but this seems like a can of worms and maintenance nightmare.

      So if I just install another LLVM (and presumably Clang) with Homebrew, do I need to worry about conflicts with the Xcode-supplied tools?

      Thanks!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Stokestack said in Building Qt on Mac: Should I worry about LLVM and Clang clashes?:

      With the offline installers now abolished

      Any reason you don't want to use online installer?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      StokestackS 1 Reply Last reply
      0
      • jsulmJ jsulm

        @Stokestack said in Building Qt on Mac: Should I worry about LLVM and Clang clashes?:

        With the offline installers now abolished

        Any reason you don't want to use online installer?

        StokestackS Offline
        StokestackS Offline
        Stokestack
        wrote on last edited by Stokestack
        #3

        @jsulm Yes. I have multiple systems to configure. Going forward, I'd like to create an installer.

        Meanwhile: I ran make (with default settings), and after the lengthy build process I don't find the products in /usr/local as described in the documentation.

        I don't see any obvious errors at the end of the build output in the terminal. It looks like it built into the source directory.

        jsulmJ 1 Reply Last reply
        0
        • StokestackS Stokestack

          @jsulm Yes. I have multiple systems to configure. Going forward, I'd like to create an installer.

          Meanwhile: I ran make (with default settings), and after the lengthy build process I don't find the products in /usr/local as described in the documentation.

          I don't see any obvious errors at the end of the build output in the terminal. It looks like it built into the source directory.

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Stokestack said in Building Qt on Mac: Should I worry about LLVM and Clang clashes?:

          I don't find the products in /usr/local

          make install
          

          ?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          StokestackS 1 Reply Last reply
          1
          • jsulmJ jsulm

            @Stokestack said in Building Qt on Mac: Should I worry about LLVM and Clang clashes?:

            I don't find the products in /usr/local

            make install
            

            ?

            StokestackS Offline
            StokestackS Offline
            Stokestack
            wrote on last edited by
            #5

            @jsulm Thanks. I expected to have to do that, but this step is conspicuously missing from the instructions here: https://doc.qt.io/qt-5/macos-building.html

            This only says you do that "If -prefix is outside the build directory," and then it involves an additional option.

            jsulmJ 1 Reply Last reply
            0
            • StokestackS Stokestack

              @jsulm Thanks. I expected to have to do that, but this step is conspicuously missing from the instructions here: https://doc.qt.io/qt-5/macos-building.html

              This only says you do that "If -prefix is outside the build directory," and then it involves an additional option.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Stokestack said in Building Qt on Mac: Should I worry about LLVM and Clang clashes?:

              This only says you do that "If -prefix is outside the build directory

              Which is the case, right? You mentioned /usr/local
              "and then it involves an additional option" - do you mean "-j 1"? It simply instructs make to not spawn more than one process. -j n is usually used to reduce build time by utilising all processors/cores.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              StokestackS 1 Reply Last reply
              0
              • jsulmJ jsulm

                @Stokestack said in Building Qt on Mac: Should I worry about LLVM and Clang clashes?:

                This only says you do that "If -prefix is outside the build directory

                Which is the case, right? You mentioned /usr/local
                "and then it involves an additional option" - do you mean "-j 1"? It simply instructs make to not spawn more than one process. -j n is usually used to reduce build time by utilising all processors/cores.

                StokestackS Offline
                StokestackS Offline
                Stokestack
                wrote on last edited by
                #7

                @jsulm Thanks for the reply.

                Farther up the page, it says:

                By default, Qt is configured for installation in the /usr/local/Qt-%VERSION% directory, but this can be changed by using the -prefix option.

                I didn't use this option, so an instruction that explicitly refers to it does not seem applicable.

                jsulmJ 1 Reply Last reply
                0
                • StokestackS Stokestack

                  @jsulm Thanks for the reply.

                  Farther up the page, it says:

                  By default, Qt is configured for installation in the /usr/local/Qt-%VERSION% directory, but this can be changed by using the -prefix option.

                  I didn't use this option, so an instruction that explicitly refers to it does not seem applicable.

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @Stokestack To my knowledge "/usr/local" is default prefix.
                  "and after the lengthy build process I don't find the products in /usr/local " - why do you expect anything in /usr/local if you did no call "make install"? Why don't you simply try to call "make install"?

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  StokestackS 1 Reply Last reply
                  2
                  • jsulmJ jsulm

                    @Stokestack To my knowledge "/usr/local" is default prefix.
                    "and after the lengthy build process I don't find the products in /usr/local " - why do you expect anything in /usr/local if you did no call "make install"? Why don't you simply try to call "make install"?

                    StokestackS Offline
                    StokestackS Offline
                    Stokestack
                    wrote on last edited by Stokestack
                    #9

                    @jsulm I've already answered this. "make install" is not listed as a required step in the instructions.

                    And I DID do that, which produced the desired result. But this should be included in the documentation.

                    jsulmJ 1 Reply Last reply
                    0
                    • StokestackS Stokestack

                      @jsulm I've already answered this. "make install" is not listed as a required step in the instructions.

                      And I DID do that, which produced the desired result. But this should be included in the documentation.

                      jsulmJ Offline
                      jsulmJ Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on last edited by
                      #10

                      @Stokestack It is documented: "If -prefix is outside the build directory, you need to install the library, examples, and tools in the appropriate place". So, not sure what needs to be documented?

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      StokestackS 1 Reply Last reply
                      0
                      • jsulmJ jsulm

                        @Stokestack It is documented: "If -prefix is outside the build directory, you need to install the library, examples, and tools in the appropriate place". So, not sure what needs to be documented?

                        StokestackS Offline
                        StokestackS Offline
                        Stokestack
                        wrote on last edited by Stokestack
                        #11

                        @jsulm

                        I didn't use -prefix. The documentation only says to use "make install" if you've used -prefix to specify a directory outside the build one. I didn't.

                        Check it out:
                        By default, Qt is configured for installation in the /usr/local/Qt-%VERSION% directory, but this can be changed by using the -prefix option.

                        So if you don't use the -prefix option, it's logical to conclude that this doesn't apply to you:
                        If -prefix is outside the build directory, you need to install the library, examples, and tools in the appropriate place. To do this, type:

                        sudo make -j1 install

                        As it turns out, the default condition here is that you must issue the make install command. So why not say that? Wouldn't it make more sense to say,

                        Unless you've used the -prefix option to specify installation in the build directory, type
                        sudo make -j1 install

                        And does even that make sense? The products are already in the build directory if you don't say make install, right? So maybe it should say,

                        If you wish to install the products outside the build directory (either in the default location or that specified by the -prefix option), type
                        sudo make -j1 install

                        1 Reply Last reply
                        0

                        • Login

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