On 09/10/2018 07:54 PM, Jim Diamond via SlackBuilds-users wrote:
I am trying to build Atlas.  On my system (S64-14.2) the procedure it
goes through to pick a compiler comes up with
         /usr/bin/g++-gcc-5.5.0
rather than
         /usr/bin/gcc-5.5.0
or
         /usr/bin/gcc
...

Hello,

this is an issue I know about. I'm pretty sure I proposed a patch to upstream but never got an answer. One reason is that find is called and find doesn't guarantee the ordering of found items. If you are brave, apply the attached patch, if not, temporarily rename irrelevant executables containing gcc in their names to something that doesn't contain gcc, but not as simply as g++, example: g++-gcc-5.5.0 to g++-bbc-5.5.0.

Regarding the other issue, as much as I know it's harmless.

Best regards,
Serban Udrea
diff -rupN ATLAS/CONFIG/src/probe_comp.c ATLAS_MOD/CONFIG/src/probe_comp.c
--- ATLAS/CONFIG/src/probe_comp.c	2017-01-06 16:44:40.014095139 +0100
+++ ATLAS_MOD/CONFIG/src/probe_comp.c	2017-01-06 16:50:42.784559884 +0100
@@ -1270,6 +1270,10 @@ char *FindGoodGcc(enum OSTYPE OS, enum M
 {
    char *OSpaths=NULL, *sp, **gccs=NULL;
    char *ln;
+   char *ospathfind =  "find %s -maxdepth 1 -name '*gcc*' '!' -name '*g++*' '!' -name '*gccgo*' -exec ./xisgcc '{}' \\;";
+   char *envfind = "find %s -maxdepth 1 -name '*gcc*' '!' -name '*g++*' '!' -name '*gccgo*' -exec ./xisgcc '{}' \\;";
+   char *homefind = "find $HOME/local -name '*gcc*' '!' -name '*g++*' '!' -name '*gccgo*' -exec ./xisgcc '{}' \\;";
+   char *stdpathfind = "find %s -name '*gcc*' '!' -name '*g++*' '!' -name '*gccgo*' -exec ./xisgcc '{}' \\;";
    FILE *fp;
    int i, lnlen=1024;
    int GMAJOR, GMINOR, GPATCH;
@@ -1289,10 +1293,9 @@ char *FindGoodGcc(enum OSTYPE OS, enum M
  */
    if (OSpaths)
    {
-      i = 64 + strlen(OSpaths);
+      i = strlen(OSpaths) + strlen(ospathfind); /* Since "%s" gets substituted by the OSpaths string we could even substract a 1 */
       ln = CheckStrLen(ln, &lnlen, i);
-      sprintf(ln, "find %s -maxdepth 1 -name '*gcc*' -exec ./xisgcc '{}' \\;",
-              OSpaths);
+      sprintf(ln, ospathfind, OSpaths);
       gccs = GetLinesFromFile(atlsys(NULL, ln, verb, 1), gccs);
       i = SelectBestGcc(verb, targ, GMAJOR, GMINOR, gccs, USEMINGW);
       if (i > 1)
@@ -1315,10 +1318,9 @@ char *FindGoodGcc(enum OSTYPE OS, enum M
    sp = GetPathEnvVar();
    if (sp)
    {
-      i = 64 + strlen(sp);
+      i = strlen(sp) + strlen(envfind);
       ln = CheckStrLen(ln, &lnlen, i);
-      sprintf(ln, "find %s -maxdepth 1 -name '*gcc*' -exec ./xisgcc '{}' \\;",
-              sp);
+      sprintf(ln, envfind, sp);
       free(sp);
       fp = atlsys(NULL, ln, verb, 1);
       if (fp)
@@ -1342,8 +1344,8 @@ char *FindGoodGcc(enum OSTYPE OS, enum M
 /*
  * Try searching in $HOME/local, including all subdirs
  */
-   ln = CheckStrLen(ln, &lnlen, 64);
-   sprintf(ln, "find $HOME/local -name '*gcc*' -exec ./xisgcc '{}' \\;");
+   ln = CheckStrLen(ln, &lnlen, strlen(homefind) + 1);
+   sprintf(ln, homefind);
    fp = atlsys(NULL, ln, verb, 1);
    if (fp)
    {
@@ -1369,10 +1371,9 @@ char *FindGoodGcc(enum OSTYPE OS, enum M
       char *stdpaths =
          "/usr/local /bin /sbin /usr/bin /usr/sbin /opt/bin /opt/sbin";
 
-      i = 64 + strlen(stdpaths);
+      i = strlen(stdpathfind) + strlen(stdpaths);
       ln = CheckStrLen(ln, &lnlen, i);
-      i = sprintf(ln, "find %s -name '*gcc*' -exec ./xisgcc '{}' \\;",
-                  stdpaths);
+      i = sprintf(ln, stdpathfind, stdpaths);
       gccs = GetLinesFromFile(atlsys(NULL, ln, verb, 1), gccs);
       i = SelectBestGcc(verb, targ, GMAJOR, GMINOR, gccs, USEMINGW);
       if (i > 1)
_______________________________________________
SlackBuilds-users mailing list
SlackBuilds-users@slackbuilds.org
https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
FAQ - https://slackbuilds.org/faq/

Reply via email to