How do I enable ccache?












1















I am completely noob at this. I don't know what the make file is, and I don't know what bashrc is.



But I do know where to download source code and use source somebash.sh then make file (as was told by someone to run those commands).



I did some research and found out ccache can speed up sequential build speed, but I have no idea what am I supposed to do when reading those online instructions (include ccache in path, what path, where and how, and gcc, colorgcc, and bashrc. What are these?)



What is a step-by-step instruction?










share|improve this question

























  • If you don't know what you are doing, why are you concerned with increasing efficiency? Shouldn't you be more focused on figuring out the very basics? You should figure out what your end goal is, then figure out how to get there. Ask questions here about specific things you are trying to figure out that get you to that goal. If you don't know what a path is, then forget about ccache.

    – Paul
    May 15 '14 at 1:26











  • so what's a PATH (in Linux definition, I know what path is in windows environment)

    – user97662
    May 15 '14 at 1:32











  • See askubuntu.com/questions/141718/…

    – Seth
    May 15 '14 at 1:40
















1















I am completely noob at this. I don't know what the make file is, and I don't know what bashrc is.



But I do know where to download source code and use source somebash.sh then make file (as was told by someone to run those commands).



I did some research and found out ccache can speed up sequential build speed, but I have no idea what am I supposed to do when reading those online instructions (include ccache in path, what path, where and how, and gcc, colorgcc, and bashrc. What are these?)



What is a step-by-step instruction?










share|improve this question

























  • If you don't know what you are doing, why are you concerned with increasing efficiency? Shouldn't you be more focused on figuring out the very basics? You should figure out what your end goal is, then figure out how to get there. Ask questions here about specific things you are trying to figure out that get you to that goal. If you don't know what a path is, then forget about ccache.

    – Paul
    May 15 '14 at 1:26











  • so what's a PATH (in Linux definition, I know what path is in windows environment)

    – user97662
    May 15 '14 at 1:32











  • See askubuntu.com/questions/141718/…

    – Seth
    May 15 '14 at 1:40














1












1








1


3






I am completely noob at this. I don't know what the make file is, and I don't know what bashrc is.



But I do know where to download source code and use source somebash.sh then make file (as was told by someone to run those commands).



I did some research and found out ccache can speed up sequential build speed, but I have no idea what am I supposed to do when reading those online instructions (include ccache in path, what path, where and how, and gcc, colorgcc, and bashrc. What are these?)



What is a step-by-step instruction?










share|improve this question
















I am completely noob at this. I don't know what the make file is, and I don't know what bashrc is.



But I do know where to download source code and use source somebash.sh then make file (as was told by someone to run those commands).



I did some research and found out ccache can speed up sequential build speed, but I have no idea what am I supposed to do when reading those online instructions (include ccache in path, what path, where and how, and gcc, colorgcc, and bashrc. What are these?)



What is a step-by-step instruction?







bash bashrc






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 22 at 22:11









Peter Mortensen

1,03721016




1,03721016










asked May 15 '14 at 1:13









user97662user97662

11614




11614













  • If you don't know what you are doing, why are you concerned with increasing efficiency? Shouldn't you be more focused on figuring out the very basics? You should figure out what your end goal is, then figure out how to get there. Ask questions here about specific things you are trying to figure out that get you to that goal. If you don't know what a path is, then forget about ccache.

    – Paul
    May 15 '14 at 1:26











  • so what's a PATH (in Linux definition, I know what path is in windows environment)

    – user97662
    May 15 '14 at 1:32











  • See askubuntu.com/questions/141718/…

    – Seth
    May 15 '14 at 1:40



















  • If you don't know what you are doing, why are you concerned with increasing efficiency? Shouldn't you be more focused on figuring out the very basics? You should figure out what your end goal is, then figure out how to get there. Ask questions here about specific things you are trying to figure out that get you to that goal. If you don't know what a path is, then forget about ccache.

    – Paul
    May 15 '14 at 1:26











  • so what's a PATH (in Linux definition, I know what path is in windows environment)

    – user97662
    May 15 '14 at 1:32











  • See askubuntu.com/questions/141718/…

    – Seth
    May 15 '14 at 1:40

















If you don't know what you are doing, why are you concerned with increasing efficiency? Shouldn't you be more focused on figuring out the very basics? You should figure out what your end goal is, then figure out how to get there. Ask questions here about specific things you are trying to figure out that get you to that goal. If you don't know what a path is, then forget about ccache.

– Paul
May 15 '14 at 1:26





If you don't know what you are doing, why are you concerned with increasing efficiency? Shouldn't you be more focused on figuring out the very basics? You should figure out what your end goal is, then figure out how to get there. Ask questions here about specific things you are trying to figure out that get you to that goal. If you don't know what a path is, then forget about ccache.

– Paul
May 15 '14 at 1:26













so what's a PATH (in Linux definition, I know what path is in windows environment)

– user97662
May 15 '14 at 1:32





so what's a PATH (in Linux definition, I know what path is in windows environment)

– user97662
May 15 '14 at 1:32













See askubuntu.com/questions/141718/…

– Seth
May 15 '14 at 1:40





See askubuntu.com/questions/141718/…

– Seth
May 15 '14 at 1:40










3 Answers
3






active

oldest

votes


















3














I would read this documentation, and then





  1. sudo apt-get install ccache

  2. Assuming you're build a "standard" source package,




export CC="ccache gcc"
export CXX="ccache g++"
./configure


If you really want to "override" the standard gcc and g++ you could then



ln -s $(which ccache) /usr/local/bin/gcc
ln -s $(which ccache) /usr/local/bin/g++
ln -s $(which ccache) /usr/local/bin/cc





share|improve this answer































    2














    You can look into this documentation, for example. Briefly:




    1. Install the ccache package -- you know, sudo apt-get install ccache

    2. Put the following line into your ~/.bashrc:


    export PATH="/usr/lib/ccache/bin/:$PATH"



    Of course, please check if /usr/lib/ccache/bin really exists, it might be installed elsewhere.






    share|improve this answer
























    • nope, ccache doesnot exisst in /usr/lib, if not, how can i find out where the program is installed?

      – user97662
      May 15 '14 at 15:38











    • Try dpkg-query -L ccache

      – thiagowfx
      May 15 '14 at 17:08



















    0














    Make install from source. It's working for me.



    Download:



    wget https://www.samba.org/ftp/ccache/ccache-3.3.3.tar.gz


    Uncompress:



    tar -zxvf ccache-3.3.3.tar.gz


    Enter folder:



    cd ccache-3.3.3


    To compile and install ccache, run these commands:



    ./configure
    make
    make install


    Create a symbolic link for ccache:



    cp ccache /usr/local/bin/
    cd /usr/local/bin/
    ln -s ccache /usr/local/bin/gcc
    ln -s ccache /usr/local/bin/g++
    ln -s ccache /usr/local/bin/cc
    ln -s ccache /usr/local/bin/c++





    share|improve this answer

























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f466059%2fhow-do-i-enable-ccache%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      3














      I would read this documentation, and then





      1. sudo apt-get install ccache

      2. Assuming you're build a "standard" source package,




      export CC="ccache gcc"
      export CXX="ccache g++"
      ./configure


      If you really want to "override" the standard gcc and g++ you could then



      ln -s $(which ccache) /usr/local/bin/gcc
      ln -s $(which ccache) /usr/local/bin/g++
      ln -s $(which ccache) /usr/local/bin/cc





      share|improve this answer




























        3














        I would read this documentation, and then





        1. sudo apt-get install ccache

        2. Assuming you're build a "standard" source package,




        export CC="ccache gcc"
        export CXX="ccache g++"
        ./configure


        If you really want to "override" the standard gcc and g++ you could then



        ln -s $(which ccache) /usr/local/bin/gcc
        ln -s $(which ccache) /usr/local/bin/g++
        ln -s $(which ccache) /usr/local/bin/cc





        share|improve this answer


























          3












          3








          3







          I would read this documentation, and then





          1. sudo apt-get install ccache

          2. Assuming you're build a "standard" source package,




          export CC="ccache gcc"
          export CXX="ccache g++"
          ./configure


          If you really want to "override" the standard gcc and g++ you could then



          ln -s $(which ccache) /usr/local/bin/gcc
          ln -s $(which ccache) /usr/local/bin/g++
          ln -s $(which ccache) /usr/local/bin/cc





          share|improve this answer













          I would read this documentation, and then





          1. sudo apt-get install ccache

          2. Assuming you're build a "standard" source package,




          export CC="ccache gcc"
          export CXX="ccache g++"
          ./configure


          If you really want to "override" the standard gcc and g++ you could then



          ln -s $(which ccache) /usr/local/bin/gcc
          ln -s $(which ccache) /usr/local/bin/g++
          ln -s $(which ccache) /usr/local/bin/cc






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 15 '14 at 3:22









          Elliott FrischElliott Frisch

          2,17311117




          2,17311117

























              2














              You can look into this documentation, for example. Briefly:




              1. Install the ccache package -- you know, sudo apt-get install ccache

              2. Put the following line into your ~/.bashrc:


              export PATH="/usr/lib/ccache/bin/:$PATH"



              Of course, please check if /usr/lib/ccache/bin really exists, it might be installed elsewhere.






              share|improve this answer
























              • nope, ccache doesnot exisst in /usr/lib, if not, how can i find out where the program is installed?

                – user97662
                May 15 '14 at 15:38











              • Try dpkg-query -L ccache

                – thiagowfx
                May 15 '14 at 17:08
















              2














              You can look into this documentation, for example. Briefly:




              1. Install the ccache package -- you know, sudo apt-get install ccache

              2. Put the following line into your ~/.bashrc:


              export PATH="/usr/lib/ccache/bin/:$PATH"



              Of course, please check if /usr/lib/ccache/bin really exists, it might be installed elsewhere.






              share|improve this answer
























              • nope, ccache doesnot exisst in /usr/lib, if not, how can i find out where the program is installed?

                – user97662
                May 15 '14 at 15:38











              • Try dpkg-query -L ccache

                – thiagowfx
                May 15 '14 at 17:08














              2












              2








              2







              You can look into this documentation, for example. Briefly:




              1. Install the ccache package -- you know, sudo apt-get install ccache

              2. Put the following line into your ~/.bashrc:


              export PATH="/usr/lib/ccache/bin/:$PATH"



              Of course, please check if /usr/lib/ccache/bin really exists, it might be installed elsewhere.






              share|improve this answer













              You can look into this documentation, for example. Briefly:




              1. Install the ccache package -- you know, sudo apt-get install ccache

              2. Put the following line into your ~/.bashrc:


              export PATH="/usr/lib/ccache/bin/:$PATH"



              Of course, please check if /usr/lib/ccache/bin really exists, it might be installed elsewhere.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered May 15 '14 at 2:18









              thiagowfxthiagowfx

              57549




              57549













              • nope, ccache doesnot exisst in /usr/lib, if not, how can i find out where the program is installed?

                – user97662
                May 15 '14 at 15:38











              • Try dpkg-query -L ccache

                – thiagowfx
                May 15 '14 at 17:08



















              • nope, ccache doesnot exisst in /usr/lib, if not, how can i find out where the program is installed?

                – user97662
                May 15 '14 at 15:38











              • Try dpkg-query -L ccache

                – thiagowfx
                May 15 '14 at 17:08

















              nope, ccache doesnot exisst in /usr/lib, if not, how can i find out where the program is installed?

              – user97662
              May 15 '14 at 15:38





              nope, ccache doesnot exisst in /usr/lib, if not, how can i find out where the program is installed?

              – user97662
              May 15 '14 at 15:38













              Try dpkg-query -L ccache

              – thiagowfx
              May 15 '14 at 17:08





              Try dpkg-query -L ccache

              – thiagowfx
              May 15 '14 at 17:08











              0














              Make install from source. It's working for me.



              Download:



              wget https://www.samba.org/ftp/ccache/ccache-3.3.3.tar.gz


              Uncompress:



              tar -zxvf ccache-3.3.3.tar.gz


              Enter folder:



              cd ccache-3.3.3


              To compile and install ccache, run these commands:



              ./configure
              make
              make install


              Create a symbolic link for ccache:



              cp ccache /usr/local/bin/
              cd /usr/local/bin/
              ln -s ccache /usr/local/bin/gcc
              ln -s ccache /usr/local/bin/g++
              ln -s ccache /usr/local/bin/cc
              ln -s ccache /usr/local/bin/c++





              share|improve this answer






























                0














                Make install from source. It's working for me.



                Download:



                wget https://www.samba.org/ftp/ccache/ccache-3.3.3.tar.gz


                Uncompress:



                tar -zxvf ccache-3.3.3.tar.gz


                Enter folder:



                cd ccache-3.3.3


                To compile and install ccache, run these commands:



                ./configure
                make
                make install


                Create a symbolic link for ccache:



                cp ccache /usr/local/bin/
                cd /usr/local/bin/
                ln -s ccache /usr/local/bin/gcc
                ln -s ccache /usr/local/bin/g++
                ln -s ccache /usr/local/bin/cc
                ln -s ccache /usr/local/bin/c++





                share|improve this answer




























                  0












                  0








                  0







                  Make install from source. It's working for me.



                  Download:



                  wget https://www.samba.org/ftp/ccache/ccache-3.3.3.tar.gz


                  Uncompress:



                  tar -zxvf ccache-3.3.3.tar.gz


                  Enter folder:



                  cd ccache-3.3.3


                  To compile and install ccache, run these commands:



                  ./configure
                  make
                  make install


                  Create a symbolic link for ccache:



                  cp ccache /usr/local/bin/
                  cd /usr/local/bin/
                  ln -s ccache /usr/local/bin/gcc
                  ln -s ccache /usr/local/bin/g++
                  ln -s ccache /usr/local/bin/cc
                  ln -s ccache /usr/local/bin/c++





                  share|improve this answer















                  Make install from source. It's working for me.



                  Download:



                  wget https://www.samba.org/ftp/ccache/ccache-3.3.3.tar.gz


                  Uncompress:



                  tar -zxvf ccache-3.3.3.tar.gz


                  Enter folder:



                  cd ccache-3.3.3


                  To compile and install ccache, run these commands:



                  ./configure
                  make
                  make install


                  Create a symbolic link for ccache:



                  cp ccache /usr/local/bin/
                  cd /usr/local/bin/
                  ln -s ccache /usr/local/bin/gcc
                  ln -s ccache /usr/local/bin/g++
                  ln -s ccache /usr/local/bin/cc
                  ln -s ccache /usr/local/bin/c++






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jan 22 at 22:09









                  Peter Mortensen

                  1,03721016




                  1,03721016










                  answered Dec 2 '16 at 18:07









                  Bleno SilvaBleno Silva

                  1012




                  1012






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f466059%2fhow-do-i-enable-ccache%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Human spaceflight

                      Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

                      張江高科駅