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 8654175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:43:18+00:00 2026-06-12T14:43:18+00:00

I have been doing some testing on a project that I recently started building

  • 0

I have been doing some testing on a project that I recently started building with CMake. Before moving to CMake I noticed significant improvements in build time when using the -j option for make with my handwritten Makefile.

Now with CMake I do the same thing and there isn’t any noticeable increase in speed. Whether I run with -j or not, I get four processes for make.exe, though only one of them is clocking CPU time and never uses more the 25% of the CPU.

In general, The CMake generated Makefile is much slower than my handwritten Makefile. A quick test shows build times for both CMake and handwritten makefiles with and without the -j flag:

CMake: "make -j all" = 7min
CMake: "make all" = 7min
Handwritten: "make -j all" = 2min
Handwritten: "make all" = 4min

In general, CMake is much slower and doesn’t seem to utilize parallel jobs.

Can anyone explain why I’m not seeing any improvements?

(Building a Fortran program with gfortran and using CMake’s auto-detect dependency feature…though I don’t know if that’s relevant to what I’m seeing).

Here’s my CMakeLists.txt file:

## CMake Version
cmake_minimum_required(VERSION 2.8)

## Project Name
project(PROJECT)

## Use FORTRAN
enable_language(Fortran)

## Release compiler options
set (CMAKE_Fortran_FLAGS_RELEASE "-O3 -cpp -ffree-line-length-none -fimplicit-none")

## Debug compiler options
set (CMAKE_Fortran_FLAGS_DEBUG "-g -cpp -ffree-line-length-none -fimplicit-none")

## Set directory for FORTRAN modules
set (CMAKE_Fortran_MODULE_DIRECTORY "${PROJECT_BINARY_DIR}/modules")

## Build Executable
add_executable(EXE 
           Source1.f90 
           Source2.f90         
           .
           .
           . 
           Source219.f90
           Source220.f90)

And here’s my original Makefile:

PROG = PROGRAM.exe

SRCS = Source1.f90 Source2.f90 ... Source219.o Source220.o

OBJS = Source1.o Source2.o ... Source219.o Source220.o

LIBS =  

VPATH = src
BUILDDIR = debug
F90 = gfortran
F90FLAGS = -g -cpp -ffree-line-length-none -fimplicit-none

all: $(PROG)

$(PROG): $(OBJS)
    $(F90) -o $@ $(OBJS) $(LIBS)


clean:
    erase -f $(BUILDDIR)$(PROG) $(BUILDDIR)\$(OBJS) $(BUILDDIR)\*.mod

.SUFFIXES: $(SUFFIXES) .f90

.f90.o:
     $(F90) $(F90FLAGS) -c $<

Source1.o: Dependency1.o Dependency2.o ... DependencyN.o

Source2.o: Dependency1.o Dependency2.o ... DependencyN.o

.
.
.

Source219.o: Dependency1.o Dependency2.o ... DependencyN.o

Source220.o: Dependency1.o Dependency2.o ... DependencyN.o
  • 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-12T14:43:19+00:00Added an answer on June 12, 2026 at 2:43 pm

    Is this on windows? If so it is because the windows version of gmake does not have a job server and recursive makefiles are not parallel. I am assuming that when you wrote make.exe that means windows. I think CVS gmake has a jobs server now. The cygwin gmake also supports the job server.

    This link might help you:

    http://lists.gnu.org/archive/html/make-w32/2011-07/msg00002.html

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

Sidebar

Related Questions

I have been doing some mobile web app testing and have noticed that the
I have been doing some testing with the following code to try and work
I have been doing some testing whilst using Jquery UI datepicker and have found
I have been doing some testing with the differences between JavaScript and PHP regular
I have been doing some testing with ObjectiveResource (iOS->Rails bridge). Things seem to work,
I have been doing some unsafe bitmap operations and have found out that increasing
I have been doing some testing on the Random class and I have used
I have been doing some searching for a regex that can be used as
I have been doing some testing with CSV.table . I have two small and
I have been doing a bit of testing with images today and found that

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.