Uploaded image for project: 'Daffodil'
  1. Daffodil
  2. DAFFODIL-2507

Unable to build/stage daffodil-cli with gcc version 4.8.2 on CentOS 7

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1.0
    • 3.1.0
    • Back End C-Generator
    • None

    Description

      Unable to build/stage daffodil-cli with gcc version 4.8.2 on CentOS 7 on Runtime2 commit c095446be17b604bb5494e08462cc2210f58c8e6.

      Running CentOS 7

      Pulled specified commit.

      Installed gcc (used yum installed version 4.8.2) and mxml (per Build Requirements page).
      Note: gcc-4.8.2 should support c99.

       

      ******

      Executed sbt command sbt daffodil-cli/stage and got the following error:

      [dfdl@localhost daffodil]$ sbt daffodil-cli/stage

      [info] welcome to sbt 1.5.0 (Red Hat, Inc. Java 11.0.10)

      [info] loading settings for project daffodil-build from plugins.sbt ...

      [info] loading project definition from /home/dfdl/daffodil/project

      [info] loading settings for project daffodil from build.sbt ...

      [info] loading settings for project daffodil-japi from build.sbt ...

      [info] loading settings for project daffodil-cli from build.sbt ...

      [info] resolving key references (24156 settings) ...

      [info] set current project to daffodil (in build file:/home/dfdl/daffodil/)

      [info] Wrote /home/dfdl/daffodil/daffodil-cli/target/scala-2.12/daffodil-cli_2.12-3.1.0-SNAPSHOT.pom

      [info] [cc, -c, /home/dfdl/daffodil/daffodil-runtime2/src/main/resources/org/apache/daffodil/runtime2/c/libruntime/errors.c, -o, /home/dfdl/daffodil/daffodil-runtime2/target/streams/compile/ccSourceObjectMap/_global/streams/compile/libruntime2.a/src/main/resources/org/apache/daffodil/runtime2/c/libruntime/errors.c.o, -I/home/dfdl/daffodil/daffodil-runtime2/src/main/resources/org/apache/daffodil/runtime2/c/libcli, -I/home/dfdl/daffodil/daffodil-runtime2/src/main/resources/org/apache/daffodil/runtime2/c/libruntime, -I/home/dfdl/daffodil/daffodil-runtime2/src/main/resources/org/apache/daffodil/runtime2/examples, -Wall, -Wextra]

      /home/dfdl/daffodil/daffodil-runtime2/src/main/resources/org/apache/daffodil/runtime2/c/libruntime/errors.c: In function ‘print_diagnostics’:

      /home/dfdl/daffodil/daffodil-runtime2/src/main/resources/org/apache/daffodil/runtime2/c/libruntime/errors.c:165:9: error: ‘for’ loop initial declarations are only allowed in C99 mode

               for (size_t i = 0; i < diagnostics->length; i++)

               ^

      /home/dfdl/daffodil/daffodil-runtime2/src/main/resources/org/apache/daffodil/runtime2/c/libruntime/errors.c:165:9: note: use option -std=c99 or -std=gnu99 to compile your code

      [info] compiling 11 Scala sources to /home/dfdl/daffodil/daffodil-runtime2/target/scala-2.12/classes ...

      [error] java.lang.RuntimeException: Nonzero exit value: 1

      [error]   at scala.sys.package$.error(package.scala:30)

      [error]   at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.slurp(ProcessBuilderImpl.scala:138)

      [error]   at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang$bang(ProcessBuilderImpl.scala:108)

      [error]   at sbtcc.CcPlugin$.$anonfun$cccompile$3(CcPlugin.scala:128)

      [error]   at sbtcc.CcPlugin$.$anonfun$cccompile$3$adapted(CcPlugin.scala:117)

      [error]   at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)

      [error]   at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)

      [error]   at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)

      [error]   at sbtcc.CcPlugin$.$anonfun$cccompile$1(CcPlugin.scala:117)

      [error]   at sbtcc.CcPlugin$.$anonfun$cccompile$1$adapted(CcPlugin.scala:116)

      [error]   at scala.collection.Iterator.foreach(Iterator.scala:943)

      [error]   at scala.collection.Iterator.foreach$(Iterator.scala:943)

      [error]   at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)

      [error]   at scala.collection.IterableLike.foreach(IterableLike.scala:74)

      [error]   at scala.collection.IterableLike.foreach$(IterableLike.scala:73)

      [error]   at scala.collection.AbstractIterable.foreach(Iterable.scala:56)

      [error]   at sbtcc.CcPlugin$.cccompile(CcPlugin.scala:116)

      [error]   at sbtcc.CcPlugin$.$anonfun$baseCcSettings$25(CcPlugin.scala:223)

      [error]   at scala.Function1.$anonfun$compose$1(Function1.scala:49)

      [error]   at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)

      [error]   at sbt.std.Transform$$anon$4.work(Transform.scala:68)

      [error]   at sbt.Execute.$anonfun$submit$2(Execute.scala:282)

      [error]   at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)

      [error]   at sbt.Execute.work(Execute.scala:291)

      [error]   at sbt.Execute.$anonfun$submit$1(Execute.scala:282)

      [error]   at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)

      [error]   at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)

      [error]   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

      [error]   at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)

      [error]   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

      [error]   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

      [error]   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

      [error]   at java.base/java.lang.Thread.run(Thread.java:834)

      [error] (daffodil-runtime2 / Compile / cCompile) Nonzero exit value: 1

       

      ******

      Added “std=c99” to the build.sbt file and executed sbt command sbt daffodil-cli/stage and got the following error:

       

      [dfdl@localhost daffodil]$ sbt daffodil-cli/stage

      [info] welcome to sbt 1.5.0 (Red Hat, Inc. Java 11.0.10)

      [info] loading settings for project daffodil-build from plugins.sbt ...

      [info] loading project definition from /home/dfdl/daffodil/project

      [info] loading settings for project daffodil from build.sbt ...

      [info] loading settings for project daffodil-japi from build.sbt ...

      [info] loading settings for project daffodil-cli from build.sbt ...

      [info] resolving key references (24156 settings) ...

      [info] set current project to daffodil (in build file:/home/dfdl/daffodil/)

      [info] Wrote /home/dfdl/daffodil/daffodil-cli/target/scala-2.12/daffodil-cli_2.12-3.1.0-SNAPSHOT.pom

      [info] [cc, -c, /home/dfdl/daffodil/daffodil-runtime2/src/main/resources/org/apache/daffodil/runtime2/c/libruntime/errors.c, -o, /home/dfdl/daffodil/daffodil-runtime2/target/streams/compile/ccSourceObjectMap/_global/streams/compile/libruntime2.a/src/main/resources/org/apache/daffodil/runtime2/c/libruntime/errors.c.o, -I/home/dfdl/daffodil/daffodil-runtime2/src/main/resources/org/apache/daffodil/runtime2/c/libcli, -I/home/dfdl/daffodil/daffodil-runtime2/src/main/resources/org/apache/daffodil/runtime2/c/libruntime, -I/home/dfdl/daffodil/daffodil-runtime2/src/main/resources/org/apache/daffodil/runtime2/examples, -Wall, -Wextra, std=c99]

      cc: error: std=c99: No such file or directory

      [info] compiling 11 Scala sources to /home/dfdl/daffodil/daffodil-runtime2/target/scala-2.12/classes ...

      [error] java.lang.RuntimeException: Nonzero exit value: 1

      [error]   at scala.sys.package$.error(package.scala:30)

      [error]   at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.slurp(ProcessBuilderImpl.scala:138)

      [error]   at scala.sys.process.ProcessBuilderImpl$AbstractBuilder.$bang$bang(ProcessBuilderImpl.scala:108)

      [error]   at sbtcc.CcPlugin$.$anonfun$cccompile$3(CcPlugin.scala:128)

      [error]   at sbtcc.CcPlugin$.$anonfun$cccompile$3$adapted(CcPlugin.scala:117)

      [error]   at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)

      [error]   at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)

      [error]   at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)

      [error]   at sbtcc.CcPlugin$.$anonfun$cccompile$1(CcPlugin.scala:117)

      [error]   at sbtcc.CcPlugin$.$anonfun$cccompile$1$adapted(CcPlugin.scala:116)

      [error]   at scala.collection.Iterator.foreach(Iterator.scala:943)

      [error]   at scala.collection.Iterator.foreach$(Iterator.scala:943)

      [error]   at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)

      [error]   at scala.collection.IterableLike.foreach(IterableLike.scala:74)

      [error]   at scala.collection.IterableLike.foreach$(IterableLike.scala:73)

      [error]   at scala.collection.AbstractIterable.foreach(Iterable.scala:56)

      [error]   at sbtcc.CcPlugin$.cccompile(CcPlugin.scala:116)

      [error]   at sbtcc.CcPlugin$.$anonfun$baseCcSettings$25(CcPlugin.scala:223)

      [error]   at scala.Function1.$anonfun$compose$1(Function1.scala:49)

      [error]   at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)

      [error]   at sbt.std.Transform$$anon$4.work(Transform.scala:68)

      [error]   at sbt.Execute.$anonfun$submit$2(Execute.scala:282)

      [error]   at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)

      [error]   at sbt.Execute.work(Execute.scala:291)

      [error]   at sbt.Execute.$anonfun$submit$1(Execute.scala:282)

      [error]   at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)

      [error]   at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)

      [error]   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

      [error]   at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)

      [error]   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

      [error]   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

      [error]   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

      [error]   at java.base/java.lang.Thread.run(Thread.java:834)

      [error] (daffodil-runtime2 / Compile / cCompile) Nonzero exit value: 1

       

       

      My resolution:

      After installing gcc version 10.3.0 I was able to build/stage daffodil-cli when “std=c99” included in the build.sbt file.

       

      Attachments

        1. daffodil-test_runtime2-failures.txt
          262 kB
          Dave Thompson
        2. daffodil-test_runtime2-failures-2.txt
          32 kB
          Dave Thompson

        Activity

          People

            Unassigned Unassigned
            dfthompson Dave Thompson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: