Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-1361

Build with C++11

    Details

    • Team:
      Alert Production

      Description

      This ticket is for changes to our build system so that C++11 is used by default, rather than as an option

      Necessary changes include:

      • boost must be built with C++11
      • sconsUtils must always build with C++11 (right now it is an option)

      This ticket allows us to make the necessary changes and test them, then merge to master. A fancier alternative is to create a way to tell the whole build system which C++ standard we want to use (one that would apply to packages built using bjam and perhaps make) and then modify sconsUtils to use that. However, I suspect that's too much work and would likely be fragile unless we could figure out a way to enforce a rebuild of all necessary packages when the setting was changed.

      A centralized way to get the desired CXXFLAGS for the user's compiler would be helpful.

        Attachments

          Issue Links

            Activity

            Hide
            rowen Russell Owen added a comment -

            Two similar possibilities:

            • Have our build system set CXXFLAGS to any options (such as -std=c++11) that we want to use when building all packages. This would work for make, if it didn't work for bjam we'd have to modify the boost eupspkg.cfg.sh, and we could modify our scons building to pay attention to that flag.
            • If we don't like sharing CXXFLAGS between LSST and the rest of the user's system then we could set an LSST-specific version of it, such as LSST_CXXFLAGS, and modify our builders to use that to set CXXFLAGS. That would be a bit safer, but more work.
            Show
            rowen Russell Owen added a comment - Two similar possibilities: Have our build system set CXXFLAGS to any options (such as -std=c++11) that we want to use when building all packages. This would work for make, if it didn't work for bjam we'd have to modify the boost eupspkg.cfg.sh, and we could modify our scons building to pay attention to that flag. If we don't like sharing CXXFLAGS between LSST and the rest of the user's system then we could set an LSST-specific version of it, such as LSST_CXXFLAGS, and modify our builders to use that to set CXXFLAGS. That would be a bit safer, but more work.
            Hide
            rowen Russell Owen added a comment -

            I chose to just build in the boost test directly. This makes sense as long as we only have the one package that needs tweaking (and because I could not find a package that looked like the right place to put in a central bit of code).

            One subtlety: I gave up on passing in -Wno-deprecated-register to boost; it's easy enough to reliably determine if it's wanted; the hard part is quoting the argument in such a way that bjam will accept it, but not pass it along go the C++ compiler with extra quotes. The result is noise in the boost build logs, but not in our scons-built packages. I personally think this is entirely acceptable.

            Show
            rowen Russell Owen added a comment - I chose to just build in the boost test directly. This makes sense as long as we only have the one package that needs tweaking (and because I could not find a package that looked like the right place to put in a central bit of code). One subtlety: I gave up on passing in -Wno-deprecated-register to boost; it's easy enough to reliably determine if it's wanted; the hard part is quoting the argument in such a way that bjam will accept it, but not pass it along go the C++ compiler with extra quotes. The result is noise in the boost build logs, but not in our scons-built packages. I personally think this is entirely acceptable.
            Hide
            rowen Russell Owen added a comment -

            Small changes to our boost and sconsUtils packages.

            Show
            rowen Russell Owen added a comment - Small changes to our boost and sconsUtils packages.
            Hide
            ktl Kian-Tat Lim added a comment -

            Commit cb7e93 (tip of tickets/DM-1361) should be rebased onto master instead of commit e0e63f, where it currently is.

            Seems like it would be easy to check -std=c++0x instead of just assuming that it will work, but I'm not sure that the fatal error that you would have to issue is much better than just having the fatal error occur during the boost build itself.

            Shouldn't the clang code below in the warnings section be removed?

                    if False:                       # requires you to rebuild boost; not worth it (yet).
                        env.Append(CCFLAGS = ['-stdlib=libc++'])
                        env.Append(LINKFLAGS = ['-stdlib=libc++'])

            Show
            ktl Kian-Tat Lim added a comment - Commit cb7e93 (tip of tickets/ DM-1361 ) should be rebased onto master instead of commit e0e63f, where it currently is. Seems like it would be easy to check -std=c++0x instead of just assuming that it will work, but I'm not sure that the fatal error that you would have to issue is much better than just having the fatal error occur during the boost build itself. Shouldn't the clang code below in the warnings section be removed? if False: # requires you to rebuild boost; not worth it (yet). env.Append(CCFLAGS = [ '-stdlib=libc++' ]) env.Append(LINKFLAGS = [ '-stdlib=libc++' ])
            Hide
            rowen Russell Owen added a comment -

            I've redone boost based on Mario's work on eups.

            I will try to redo sconsUtils to test builds instead of parsing version numbers.

            Show
            rowen Russell Owen added a comment - I've redone boost based on Mario's work on eups. I will try to redo sconsUtils to test builds instead of parsing version numbers.
            Hide
            rowen Russell Owen added a comment -

            I redid sconsUtils to test the compiler directly to find out what -std=c++XX flag should be used. Unfortunately there's a cosmetic bug I've not been able to resolve: scons prints "error: no result" after running the test.

            Show
            rowen Russell Owen added a comment - I redid sconsUtils to test the compiler directly to find out what -std=c++XX flag should be used. Unfortunately there's a cosmetic bug I've not been able to resolve: scons prints "error: no result" after running the test.

              People

              • Assignee:
                rowen Russell Owen
                Reporter:
                rowen Russell Owen
                Reviewers:
                Kian-Tat Lim
                Watchers:
                Jim Bosch, Kian-Tat Lim, Mario Juric, Robert Lupton, Russell Owen
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel