m-labs / artiq

A leading-edge control system for quantum information experiments
https://m-labs.hk/artiq
GNU Lesser General Public License v3.0
437 stars 201 forks source link

misoc: raise OSError("BIOS build failed") #3

Closed ghost closed 10 years ago

ghost commented 10 years ago

I encounter an error running $ make.py -X ~/artiq-dev/artiq/soc -t artiq all following the instructions here https://github.com/m-labs/artiq/blob/master/doc/manual/installing.rst


rabi@vboxartiq:~/artiq-dev/misoc$ sudo python3 make.py -X ~/artiq-dev/artiq/soc -t artiq all
[sudo] password for rabi: 
                __  ___  _   ____     _____
               /  |/  / (_) / __/__  / ___/
              / /|_/ / / / _\ \/ _ \/ /__
             /_/  /_/ /_/ /___/\___/\___/

a high performance and small footprint SoC based on Migen

====== Building for: ======
Platform:  papilio_pro
Target:    artiq
Subtarget: ARTIQMiniSoC
CPU type:  or1k
===========================
make: Entering directory `/home/rabi/artiq-dev/misoc/software/libcompiler-rt'
rm -f divsi3.o modsi3.o comparedf2.o negsf2.o negdf2.o addsf3.o subsf3.o mulsf3.o divsf3.o lshrdi3.o muldi3.o divdi3.o ashldi3.o ashrdi3.o udivmoddi4.o floatsisf.o floatunsisf.o fixsfsi.o fixunssfsi.o adddf3.o subdf3.o muldf3.o divdf3.o floatsidf.o floatunsidf.o floatdidf.o fixdfsi.o fixunsdfsi.o clzsi2.o ctzsi2.o udivdi3.o umoddi3.o moddi3.o divsi3.ts modsi3.ts comparedf2.ts negsf2.ts negdf2.ts addsf3.ts subsf3.ts mulsf3.ts divsf3.ts lshrdi3.ts muldi3.ts divdi3.ts ashldi3.ts ashrdi3.ts udivmoddi4.ts floatsisf.ts floatunsisf.ts fixsfsi.ts fixunssfsi.ts adddf3.ts subdf3.ts muldf3.ts divdf3.ts floatsidf.ts floatunsidf.ts floatdidf.ts fixdfsi.ts fixunsdfsi.ts clzsi2.ts ctzsi2.ts udivdi3.ts umoddi3.ts moddi3.ts divsi3.d modsi3.d comparedf2.d negsf2.d negdf2.d addsf3.d subsf3.d mulsf3.d divsf3.d lshrdi3.d muldi3.d divdi3.d ashldi3.d ashrdi3.d udivmoddi4.d floatsisf.d floatunsisf.d fixsfsi.d fixunssfsi.d adddf3.d subdf3.d muldf3.d divdf3.d floatsidf.d floatunsidf.d floatdidf.d fixdfsi.d fixunsdfsi.d clzsi2.d ctzsi2.d udivdi3.d umoddi3.d moddi3.d libcompiler-rt.a .*~ *~
make: Leaving directory `/home/rabi/artiq-dev/misoc/software/libcompiler-rt'
make: Entering directory `/home/rabi/artiq-dev/misoc/software/libbase'
rm -f exception.o libc.o errno.o crc16.o crc32.o console.o system.o id.o uart.o time.o qsort.o strtod.o exception.d libc.d errno.d crc16.d crc32.d console.d system.d id.d uart.d time.d qsort.d strtod.d crt0-or1k.o vsnprintf.o vsnprintf.d vsnprintf-nofloat.o vsnprintf-nofloat.d
rm -f libbase.a libbase-nofloat.a .*~ *~
make: Leaving directory `/home/rabi/artiq-dev/misoc/software/libbase'
make: Entering directory `/home/rabi/artiq-dev/misoc/software/libnet'
rm -f microudp.o tftp.o microudp.ts tftp.ts microudp.d tftp.d libnet.a .*~ *~
make: Leaving directory `/home/rabi/artiq-dev/misoc/software/libnet'
make: Entering directory `/home/rabi/artiq-dev/misoc/software/bios'
rm -f isr.o sdram.o main.o boot-helper-or1k.o boot.o dataflow.o isr.d sdram.d main.d boot-helper-or1k.d boot.d dataflow.d bios.elf bios.bin .*~ *~
make: Leaving directory `/home/rabi/artiq-dev/misoc/software/bios'
make: Entering directory `/home/rabi/artiq-dev/misoc/software/bios'
 CC  isr.o
 CC  sdram.o
 CC  main.o
 CC  boot-helper-or1k.o
 CC  boot.o
 CC  dataflow.o
make -C ../../software/libcompiler-rt
make[1]: Entering directory `/home/rabi/artiq-dev/misoc/software/libcompiler-rt'
make[1]: *** No rule to make target `divsi3.o', needed by `libcompiler-rt.a'.  Stop.
make[1]: Leaving directory `/home/rabi/artiq-dev/misoc/software/libcompiler-rt'
make: *** [libs] Error 2
make: Leaving directory `/home/rabi/artiq-dev/misoc/software/bios'
Traceback (most recent call last):
  File "make.py", line 169, in <module>
    raise OSError("BIOS build failed")
OSError: BIOS build failed

The layout of artiq-dev on my machine is the following.

rabi@vboxartiq:~/artiq-dev$ ls 
artiq       compiler-rt  migen  nist_secureconfigscript  xc3sprog
bitstreams  Drivers      misoc  openrisc
fallen commented 10 years ago

I suspect that you didn't check out the libcompiler-rt. Do so by typing: svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt in ~/artiq-dev/misoc/

ghost commented 10 years ago

Compiler-rt is installed. I put it into ~/artiq-dev and set the environment variable as in the README for MISOC.

$ export CRTDIR=~/artiq-dev/compiler-rt

ghost commented 10 years ago

You were right. It was a simple libcompiler-rt problem. I was using sudo to run make.py but setting the environment variable as user rabi. To fix this I've added the following to /etc/bash.bashrc

CRTDIR=/home/rabi/artiq-dev/compiler-rt MSCDIR=/home/rabi/artiq-dev/misoc