Giter Site home page Giter Site logo

Comments (12)

HaleTom avatar HaleTom commented on July 20, 2024

Actually make also recompiles the binary.

I've never done it myself, but I believe the work-around is to touch a file when the build completes and have that file as a make dependency.

from nixnote2.

robert7 avatar robert7 commented on July 20, 2024

The first line in your quote is not a "compile step", but its is a "link step" (or "assembly of the binary").

But its true, that for some reason the "link step" is executed twice. I did not notice before.

Total build time with "clean" on my machine is 3 minutes.
Just the "2x link" on my machine takes 7 seconds, so eliminating the one duplicate link step would save ~3.5 seconds, which is about 2% of the build time.

So I don't think its critical, but I agree that doing the "link" twice is stupid and I will try to find out why this happens. Thx for reporting.

from nixnote2.

robert7 avatar robert7 commented on July 20, 2024

I marked it as "enhancement" as it is only ~2% of the build time and only affects the users, which want to compile themselves.

from nixnote2.

HaleTom avatar HaleTom commented on July 20, 2024

Awesome :) You've got a nice fast box, I envy you :-P

from nixnote2.

robert7 avatar robert7 commented on July 20, 2024

There is a lot of difference when are you using parallel processing: make vs. e.g. make -j8. Try the "-j" param, maybe it will be also faster on your box.

from nixnote2.

HaleTom avatar HaleTom commented on July 20, 2024

Nice one. I'm running with make -j $(nproc)

from nixnote2.

robert7 avatar robert7 commented on July 20, 2024

The solution to prevent calling "link" twice is just run "make install" not "make && make install".
So I fixed that in my build script and in the travis build script.
Thx for pointing that out.

So I close this. If you still have the problem - then pls comment here.

from nixnote2.

hosiet avatar hosiet commented on July 20, 2024

Frankly speaking that is weird -- a plain call of make should only build binaries and a call of "make install" should not try to build again if it has been built -- I'd say the problem is not solved but only circumvented in a dirty way.

from nixnote2.

HaleTom avatar HaleTom commented on July 20, 2024

I believe this is what we're after:

https://stackoverflow.com/questions/23371141/why-does-gnu-make-always-re-link-my-project

from nixnote2.

robert7 avatar robert7 commented on July 20, 2024

@hosiet:
😄 "dirty" is nickname of this project ...

The truth is, that with the time I have available for this project, if I would try to do it the "correct way" and first try to learn all the technologies needed, then I wouldn't even start coding... It touched "Makefiles" last time like 15 years ago and also that was briefly.

But you are right and you challenged me, so I looked it up and fixed the wrong dependency in the project. Now it works correctly. "make" creates the binaries, "make install" does the install and will not call link again.

(Its not that, I like the project being "dirty"... I try to improve, but... I try to be pragmatic and make it work, with what I have available).

from nixnote2.

robert7 avatar robert7 commented on July 20, 2024

.. so here is the latest Travis build log: https://api.travis-ci.com/v3/job/151309461/log.txt
it did "make && make install" and the "link" was executed once

from nixnote2.

HaleTom avatar HaleTom commented on July 20, 2024

The balance between doing it "correctly" and actually doing it is a a tough one. I probably err on the pedantic side and get less done as a result.

Brilliant - thank you :)

from nixnote2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.