"make verilog" throws java memory error

Hi all, I just pulled the freedom github repo and ran “make -f Makefile.e300artydevkit verilog”. It chugs along for a bit and now won’t progress past a java memory error:

[info] 'compiler-interface' not yet compiled for Scala 2.11.7. Compiling...
sbt appears to be exiting abnormally.
  The log file for this session is at /tmp/sbt8497818078338583763.log
java.lang.OutOfMemoryError: PermGen space
Error during sbt execution: java.lang.OutOfMemoryError: PermGen space

I don’t think my system is actually out of memory; top shows about 2.5GB free right now. Is there a specific version of java I need to run this makefile?

I’m not an expert at the JVM, but you could attempt to increase the amount of Perm space allocated. Try increasing the value of MaxPermSize in this line of the Makefile: https://github.com/sifive/freedom/blob/f4375c22662f82b1b4f94e88b1aba6998b1f34ba/common.mk#L23

Actually, I read your error message more carefully and now see that this is happening when you run sbt, so modify this line of the Makefile to add in the same memory-related flags from the FIRRTL command:

-Xmx2G -Xss8M -XX:MaxPermSize=256M 

OK, that gets me past the first error! Now I’ve got more java hiccups. Java is really not my forte so I don’t even know where to start to fix these, but am I missing some files?

[info] Compiling 55 Scala sources and 4 Java sources to /home/aa/grad/db/freedom/rocket-chip/firrtl/target/scala-2.11/classes...
[error] /home/aa/grad/db/freedom/rocket-chip/firrtl/src/main/scala/firrtl/Emitter.scala:31: object file is not a member of package java.nio
[error] import java.nio.file.{Paths, Files}
[error]                 ^
[error] /home/aa/grad/db/freedom/rocket-chip/firrtl/src/main/scala/firrtl/StringLit.scala:32: object StandardCharsets is not a member of package java.nio.charset
[error] import java.nio.charset.StandardCharsets.UTF_8
[error]                         ^
[error] /home/aa/grad/db/freedom/rocket-chip/firrtl/src/main/scala/firrtl/StringLit.scala:50: not found: value UTF_8
[error]             if (c >= 0x20 && c <= 0x7e) new String(Array(c), UTF_8)
[error]                                                              ^
[error] /home/aa/grad/db/freedom/rocket-chip/firrtl/src/main/scala/firrtl/StringLit.scala:94: object StandardCharsets is not a member of package java.nio.charset
[error]     val byteArray = raw.getBytes(java.nio.charset.StandardCharsets.UTF_8)
[error]                                                   ^
[error] four errors found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 26 s, completed Feb 8, 2017 2:49:47 PM
1 Like

What version of Java are you running? I believe java.nio.file was introduced in Java 7.

That was the problem – my path was pointed to java 1.6. Switched to 1.8 and everything works now. Thanks!

Thanks Richard,

I have tried your advice, but failed ! can you tell another?

Thank you,

I met that trouble also,if you solved it, please tell me ! Thanks very much~

Hi Pengnainqi, I assume you also posted this question in GitHub shortly afterwards: https://github.com/sifive/freedom/issues/28

Let me know if my response doesn’t solve your problem.