Developers: fast build, without recompiling dependencies?

61 views
Skip to first unread message

Rustam

unread,
Aug 25, 2016, 9:44:35 AM8/25/16
to cp2k
CP2K developers,

Is the any way to build exe without recompiling ALL dependencies?

A couple of years ago the standard make target did not recompile all dependencies. As a result minor code modifications recompiled fast. Now, make carefully creates a list of all dependencies and recompiles all of them. Nice safety feature but recompiling minor local changes seems to take forever, debugging becomes a major pain.

Is there any make TARGET that can build exe by recompiling only the modified files and their corresponding libraries?

Thanks,
Rustam

Jörg Saßmannshausen

unread,
Aug 25, 2016, 9:49:49 AM8/25/16
to cp...@googlegroups.com
Hi Rustam,

can you not go into the sub-directory and do a make there and then just re-
link? I would have thought that is possible.
If you have modified only a few files it might be even quicker to manually
execute the building command and then re-link.

Not sure whether that works with cp2k as well as I have not tried it but other
code certainly has that feature.

All the best from London

Jörg
--
*************************************************************
Dr. Jörg Saßmannshausen, MRSC
University College London
Department of Chemistry
20 Gordon Street
London
WC1H 0AJ

email: j.sassma...@ucl.ac.uk
web: http://sassy.formativ.net

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html
signature.asc

Rustam

unread,
Aug 25, 2016, 12:41:12 PM8/25/16
to cp2k
Hi Jörg,

Yes, it is possible to manually recompile individual files and re-link. But I would like to do as little manual work as possible. Ideally, I would just call make and specify a make target (e.g. nodepend) to ignore dependencies. 

I know that most makefiles are written with this option in mind (e.g. fast or fastbuild). Is there any way to do this in CP2K?

Cheers,
Rustam

hut...@chem.uzh.ch

unread,
Aug 26, 2016, 3:55:49 AM8/26/16
to cp...@googlegroups.com
Hi Rustam

this works for me rather reliably. Most of the time I have only
minimal rebuilds.
I am using the standard makefile and gfortran 5.3

regards

Juerg
--------------------------------------------------------------
Juerg Hutter                         Phone : ++41 44 635 4491
Institut für Chemie C                FAX   : ++41 44 635 6838
Universität Zürich                   E-mail: hut...@chem.uzh.ch
Winterthurerstrasse 190
CH-8057 Zürich, Switzerland
---------------------------------------------------------------

-----cp...@googlegroups.com wrote: -----To: cp2k <cp...@googlegroups.com>
From: Rustam
Sent by: cp...@googlegroups.com
Date: 08/25/2016 06:41PM
Subject: Re: [CP2K:8101] Developers: fast build, without recompiling dependencies?
--

You received this message because you are subscribed to the Google Groups "cp2k" group.

To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+uns...@googlegroups.com.

To post to this group, send email to cp...@googlegroups.com.

Visit this group at https://groups.google.com/group/cp2k.

For more options, visit https://groups.google.com/d/optout.


Sergey Chulkov

unread,
Aug 29, 2016, 8:01:40 AM8/29/16
to cp2k
Hi Rustam,

this problem may be caused by your Fortran compiler.

The current rebuild strategy is to recompile all source files that depend on a modified module (.mod) file. Each Fortran module file contains public API that the corresponding source file exports and ideally should be updated only when you change such API (e.g. prototype of public functions, structure of public derived types, public generic interfaces, etc.). If the only thing you do is to tweak the body of a public function without changing its prototype, the compiler should only update the relevant object (.o) file, so no dependent files will be recompiled. At least the latest gfortran acts this way.

Best wishes,

Sergey
Reply all
Reply to author
Forward
0 new messages