Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7746585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:18:59+00:00 2026-06-01T10:18:59+00:00

I am using GCC 4.7 and compiling my C++ code-project. The code consists of

  • 0

I am using GCC 4.7 and compiling my C++ code-project. The code consists of files distributed in directories.

On RHEL server I use, there are 16 cores, still the compilation speed is quite slow. Can you suggest possible alternatives or options of makefile, which may help in compiling fast. I have tried -j but it only compiles some folders and stops; does not compile the main binary.

I will be grateful for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:19:00+00:00Added an answer on June 1, 2026 at 10:19 am

    if your makefile fails when you compile with -j but works fine without, then you may need to fix your makefile to work properly with parallel compilation. Otherwise, those other 15 cores are of no use to you.

    It’s not uncommon for less experienced makefile writers to write something like:

    final: step1 step2 step3
    

    to mean “to build final, first build step1, then step2, then step3”. This works fine when you are running with the default setup of -j 1 because make happens to build each of the dependencies in left-to-right order. But if you use -j 20 (say) then it will attempt to build them in parallel. It will attempt to start building all 3 steps at once, without first waiting until each successive step is complete.

    The correct way to write this is:

    final: step3
    step3: step2
    step2: step1
    

    This tells make exactly what’s happening: to build final you first need to build step3, for which you need step2, for which you need step1.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings, SO. I have some code which I've made attempts at compiling using gcc,
I'm using Ubuntu 8.10 (Intrepid Ibex) and compiling C++ files with GCC, but when
Using gcc on Ubuntu, should there be a (speed) performance difference if compiling the
I'm compiling code using gcc that comes from Visual C++ 2008. The code is
I'm currently using GCC 4.5.3, compiled for PowerPC 440, and am compiling some code
I am compiling my code using following command: gcc -O3 -ftree-vectorizer-verbose=6 -msse4.1 -ffast-math With
I am using gcc -MM to generate prerequisites of dependencies rules for compiling source
I'm having problems compiling the following program. I'm using gcc -framework Foundation inherit8.1m and
I'm using gcc 4.3.2. I have the following code (simplified): #include <cstdlib> template<int SIZE>
Compiling on linux using gcc. I would like to convert this to hex. 10

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.