ehowton (ehowton) wrote,
ehowton
ehowton

  • Location:
  • Music:

Compiling


Officially (and by that I mean paraphrased from Wikipedia) A compiler is a computer program that transforms source code written in a computer language into another computer language to [most commonly] create an executable program via lexical analysis, preprocessing, parsing, semantic analysis, code generation, and code optimization.

Unofficially, its a huge pain in the ass.

We've come light-years since compiling (and to a greater degree patching) unix systems, as "back in the day" we were required to read every release note of every new patch bundle, and their dependencies, compare them to which patches were currently on our systems, and the impact the patch would have before individually applying them in the correct order. This was your father's 'apt-get update all'

Just because you installed ubuntu on your desktop doesn't make you a sysadmin.

Silicon Graphics (SGI) was head-and-shoulders above the rest by providing an in-browser, auto-extracting patch (and software) hyperlink with required dependencies listed. But even then, that was providing pre-compiled binaries, and assuming you were on a system with a head (monitor & input device). Compiling source code before GNU's (recursive acronym - "GNU's Not Unix") C-compiler was readily available heterogeneously was also very expensive, with gcc being free and (as an example) Sun's compiler being thousands of dollars.

What's the atheist version of an Evangelist?

Now-a-days, for various reasons (higher threat of security, notably) mass-patching is the preferred execution, and with whole repositories of online, pre-compiled binaries able to intelligently calculate and install auto-dependencies, everything I've just said has mostly been pushed aside for the daily system administrator. Mostly.

The mostly come at night.

And while I wasn't an early-adopter of GNU or linux spending my time instead on big-iron operating systems, but since drax0r, resident genius is gone, linux support has fallen more or less to me. And we had a user who, as root (don't get me started) removed 'elfutils' that is to say, the operating system's primary understanding of how to make executables work for its architecture, as well as all its dependencies. All 126 of them. Including the installer software itself. Undaunted, I set about compiling, from scratch, a new installer in which to quickly bring the system back up to install other software.

And now, compiling for you, the layman:
*Download means - aquire, xfer, move, decompress & inflate.
*configure (Look at the environment/architecture you're in and prep code for compilation)
*make (Compile the executable binary for this system based on your information above)
*make install (Move everything into place and link it)



  • Download [primary installation program]

    • ./configure [primary installation program]

      • HA HA! No way! You need [dependency #1]

        • Download [dependency #1]

          • ./configure [dependency #1]

            • HA HA! No way! You need [dependency #2,3,4...ad nauseum]

            • ...

            • ...

              • make [dependency #1,2,3...]

              • ...

              • ...

                • make install [dependency #1,2,3...]

                • ...

                • ...

    • ./configure [primary installation program]

      • make [primary installation program]

        • HA HA! No way! Your shit is broke somehow.

          • (symbolically link random files while truncating names)

        • make [primary installation program]

          • HA HA! No way! Other shit is broken now.

            • Download [some random library]

              • ./configure [some random library]

                • HA HA! No way! You need [some archaic library]

                  • Download [some archaic library]

                    • ./configure [some archaic library]

                      • make [some archaic library]

                        • make install [some archaic library]

              • ./configure [some random library]

                • make [some random library]

                  • make install [some random library]

        • make [primary installation program]

          • WTF? Who wrote this crap? Illegal request - Bye!



I worked on this 10-hours a day for 2-days until I ran across this on the SUSE Enterprise site (Novell):

WARNING: Do not experiment with system components (glibc, rpm, sysvinit, etc.), as this endangers the operability of your system.

/FAIL

We rebuilt the system and restored from backups.
Tags: linux, unix, work
Subscribe
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 41 comments