{"thread":{"id":"37043","subject":"Compile Error on Git 2.0.1 on Redhat 5.9 with Fix","startedAt":"2014-07-02T15:56:25Z","lastAt":"2014-07-03T20:13:07Z","messageCount":4,"participants":["Eldon Nelson","Matthieu Moy","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"245302","messageId":"CAH5EwqY8D=CGxB+rZvwPH5115r9qmRCBBvJMG_o0962d4Uquxw@mail.gmail.com","threadId":"37043","inReplyTo":null,"subject":"Compile Error on Git 2.0.1 on Redhat 5.9 with Fix","fromName":"Eldon Nelson","fromEmail":"eldon_nelson@ieee.org","sentAt":"2014-07-02T15:56:25Z","receivedAt":"2014-07-02T15:56:25Z","isPatch":false,"sender":{"key":"eldon_nelson@ieee.org","avatar":null},"body":"When compiling Git 2.0.1 on RedHat 5.9 as a non-root user I get the\nfollowing error:\n\nBUILD ERROR\n\n```\nmake prefix=/home/eldon/local all doc info\n...\n    CC zlib.o\n    CC unix-socket.o\n    CC thread-utils.o\n    CC compat/strlcpy.o\n    AR libgit.a\n/bin/sh: gar: command not found\nmake: *** [libgit.a] Error 127\n```\n\nMy fix was to make a symlink below:\n\nSYMLINK\n\n```\ngar -> /usr/bin/ar\n```\n\nLINUX VERSION\n\n```\n> lsb_release -i -r\nDistributor ID: RedHatEnterpriseClient\nRelease:        5.9\n```\n\nI think the fix is to allow the use of \"ar\" if \"gar\" does not exist. I\ndon't know if this exists for every Redhat install but \"gar\" is not\navailable in /usr/bin but \"ar\" does.\n\n```\n> /usr/bin/ar --version\nGNU ar 2.17.50.0.6-20.el5_8.3 20061020\nCopyright 2005 Free Software Foundation, Inc.\n```\n\nIt could just be my corporate install of RedHat that is weird, but\nthought this might be at least a point to describe a fix.\n\n```\ngcc --version\ngcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)\nCopyright (C) 2006 Free Software Foundation, Inc.\n```\n\n~~~~~~~~~~~~\nEldon Nelson\neldon_nelson@ieee.org\nCell: 952-393-3481\n"},{"id":"245304","messageId":"vpqtx6z4tih.fsf@anie.imag.fr","threadId":"37043","inReplyTo":"CAH5EwqY8D=CGxB+rZvwPH5115r9qmRCBBvJMG_o0962d4Uquxw@mail.gmail.com","subject":"Re: Compile Error on Git 2.0.1 on Redhat 5.9 with Fix","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2014-07-02T16:25:58Z","receivedAt":"2014-07-02T16:25:58Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Eldon Nelson <eldon_nelson@ieee.org> writes:\n\n> make prefix=/home/eldon/local all doc info\n> ...\n>     CC zlib.o\n>     CC unix-socket.o\n>     CC thread-utils.o\n>     CC compat/strlcpy.o\n>     AR libgit.a\n> /bin/sh: gar: command not found\n[...]\n> I think the fix is to allow the use of \"ar\" if \"gar\" does not exist.\n\nIt is already the case. The Makefile defaults to \"ar\" and does not even\ncontain any mention of \"gar\". The configure script checks for both:\n\nconfigure.ac:AC_CHECK_TOOLS(AR, [gar ar], :)\n\nMy guess is that you ran the configure script on a machine where gar is\npresent, and then used the result on a machine where it isn't.\n\nNormally, at configure time you should see this:\n\nchecking for ar... ar\n\nYou actually don't need to run the configure script, the Makefile runs\nfine without it. Delete config.mak.autogen to cancel the effect of\n./configure.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"245305","messageId":"20140702162947.GA14404@sigill.intra.peff.net","threadId":"37043","inReplyTo":"CAH5EwqY8D=CGxB+rZvwPH5115r9qmRCBBvJMG_o0962d4Uquxw@mail.gmail.com","subject":"Re: Compile Error on Git 2.0.1 on Redhat 5.9 with Fix","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-07-02T16:29:47Z","receivedAt":"2014-07-02T16:29:47Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jul 02, 2014 at 10:56:25AM -0500, Eldon Nelson wrote:\n\n> When compiling Git 2.0.1 on RedHat 5.9 as a non-root user I get the\n> following error:\n> \n> BUILD ERROR\n> \n> ```\n> make prefix=/home/eldon/local all doc info\n> ...\n>     CC zlib.o\n>     CC unix-socket.o\n>     CC thread-utils.o\n>     CC compat/strlcpy.o\n>     AR libgit.a\n> /bin/sh: gar: command not found\n> make: *** [libgit.a] Error 127\n> ```\n\nThe Makefile defines AR as:\n\n  $ git grep ^AR Makefile\n  Makefile:AR = ar\n\nso it should already do what you want by default.  But that make\nvariable can be overridden. Can you show us the contents of your\nconfig.mak and config.mak.autogen files (if either exists)?\n\nIt's also possible that you have AR set in your environment (show us\n\"echo $AR\"), but that would usually not override the Makefile unless\n\"make -e\" is used (and that is not in your command-line above, but it's\npossible that make is a shell alias or something).\n\n> My fix was to make a symlink below:\n> \n> SYMLINK\n> \n> ```\n> gar -> /usr/bin/ar\n> ```\n\nA simpler workaround is probably:\n\n  make AR=ar ...\n\nbut probably the \"right\" solution is to eliminate whatever is providing\nthe bogus override in the first place.\n\n-Peff\n"},{"id":"245390","messageId":"CAH5EwqbZygNg=Hiv_fTJ1wg5G07n_kUj77XK9eUmqh9+WPS3Dg@mail.gmail.com","threadId":"37043","inReplyTo":"CAH5EwqY8D=CGxB+rZvwPH5115r9qmRCBBvJMG_o0962d4Uquxw@mail.gmail.com","subject":"Re: Compile Error on Git 2.0.1 on Redhat 5.9 with Fix","fromName":"Eldon Nelson","fromEmail":"eldon_nelson@ieee.org","sentAt":"2014-07-03T20:13:07Z","receivedAt":"2014-07-03T20:13:07Z","isPatch":false,"sender":{"key":"eldon_nelson@ieee.org","avatar":null},"body":"Thanks for the tip Jeff.  \"config.mak.autogen\" is created in the git\ncompile only when you do a \"./configure\".  Mine had the bad reference\nto \"gar\" in it due to the following.\n\nIt was caused because my path had a reference to a non-related \"gar\"\nexecutable (some internal command).  I saw the compile trying to\nexecute it and removed it from my path.  Doing a \"make clean\"\nafterwards didn't remove the \"config.mak.autogen\" which had mistakenly\nthought that I was using \"gar\" and not \"ar\".\n\nWhen I fixed my path to not include the company specific \"gar\" and\nstarted with a fresh untar it worked perfectly.  It also didn't make a\n\"config.mak.autogen\" since that isn't what is recommended to do in the\ngit docs for install.\n\nThis is closed due to my own user error.\n\nconfig.mak.autogen\n\n# git Makefile configuration, included in main Makefile\n# config.mak.autogen.  Generated from config.mak.in by configure.\n\nCC = cc\nCFLAGS = -g -O2\nCPPFLAGS =\nLDFLAGS =\nAR = gar\nTAR = gtar\n\n~~~~~~~~~~~~\nEldon Nelson\neldon_nelson@ieee.org\n"}]}