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?
Forum Updated to NodeBB v4.3 + New Features

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.5k Views 1 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.
  • S Offline
    S Offline
    Stokestack
    wrote on 4 Jun 2020, 00:12 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!

    J 1 Reply Last reply 4 Jun 2020, 06:08
    0
    • S Stokestack
      4 Jun 2020, 00:12

      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!

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 4 Jun 2020, 06:08 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

      S 1 Reply Last reply 4 Jun 2020, 08:52
      0
      • J jsulm
        4 Jun 2020, 06:08

        @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?

        S Offline
        S Offline
        Stokestack
        wrote on 4 Jun 2020, 08:52 last edited by Stokestack 6 Apr 2020, 08:53
        #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.

        J 1 Reply Last reply 4 Jun 2020, 08:54
        0
        • S Stokestack
          4 Jun 2020, 08:52

          @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.

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 4 Jun 2020, 08:54 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

          S 1 Reply Last reply 4 Jun 2020, 09:00
          1
          • J jsulm
            4 Jun 2020, 08:54

            @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
            

            ?

            S Offline
            S Offline
            Stokestack
            wrote on 4 Jun 2020, 09:00 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.

            J 1 Reply Last reply 4 Jun 2020, 10:14
            0
            • S Stokestack
              4 Jun 2020, 09:00

              @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.

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 4 Jun 2020, 10:14 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

              S 1 Reply Last reply 4 Jun 2020, 20:02
              0
              • J jsulm
                4 Jun 2020, 10:14

                @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.

                S Offline
                S Offline
                Stokestack
                wrote on 4 Jun 2020, 20:02 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.

                J 1 Reply Last reply 5 Jun 2020, 05:09
                0
                • S Stokestack
                  4 Jun 2020, 20:02

                  @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.

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 5 Jun 2020, 05:09 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

                  S 1 Reply Last reply 5 Jun 2020, 08:05
                  2
                  • J jsulm
                    5 Jun 2020, 05:09

                    @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"?

                    S Offline
                    S Offline
                    Stokestack
                    wrote on 5 Jun 2020, 08:05 last edited by Stokestack 6 May 2020, 08:06
                    #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.

                    J 1 Reply Last reply 5 Jun 2020, 08:11
                    0
                    • S Stokestack
                      5 Jun 2020, 08:05

                      @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.

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 5 Jun 2020, 08:11 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

                      S 1 Reply Last reply 5 Jun 2020, 08:14
                      0
                      • J jsulm
                        5 Jun 2020, 08:11

                        @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?

                        S Offline
                        S Offline
                        Stokestack
                        wrote on 5 Jun 2020, 08:14 last edited by Stokestack 6 May 2020, 08:34
                        #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

                        3/11

                        4 Jun 2020, 08:52

                        topic:navigator.unread, 8
                        • Login

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