simulavr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Simulavr-devel] Trouble building simulavrxx on Darwin


From: David Linker
Subject: Re: [Simulavr-devel] Trouble building simulavrxx on Darwin
Date: Thu, 14 Oct 2004 20:38:05 -0700

See answers below. A lot of progress! As before, I am giving the full explanation of what I have done, since I am such a beginner I don't want to leave out something that may be of use to those with more knowledge.

On Oct 13, 2004, at 11:20 PM, Klaus Rudolph wrote:
[snip]


Sorry, I have no idea in the moment. If you could give me a user account
on your machine I maybe could watch out for the problem?


The computer I am using for this development is a laptop, and travels with me from home to work. At work, it is not hooked up to the internet, and at home, the internet connection is behind a firewall from the ISP, so I think that this would be difficult or impossible. On the other hand, I am learning a lot, and believe that I have made a lot of progress, see below.

[snip]

:-))) Hey, you build a pc application not an avr application. So you should
link against your system libc not against the avr-libc :-)))

[snip]
Have you tried manually linking the system libc?


This was very helpful information. I looked for a system libc, and was unable to find it! Searching the web, I found that the functionality was placed in libSystem.dylib. I tried linking this in manually to solve the missing _dcgettext problem, but it didn't help. Further research revealed that libintl.a might have the missing _dcgettext, so I tried linking that in as well. It worked! But I got other errors about missing references in libiconv. I did a find to see where that was, and then linked it in. First, I got an error about multiple definitions, but by changing the order, I was able to get it to compile! The full compile command is as follows:

$ g++ -O2 -g -O2 -o .libs/simulavr main.o -L../src/.libs -lavrsim_pp /Users/dtlinker/Desktop/AVR-GCC/binutils-2.15/bfd/libbfd.a /libiberty.a /usr/lib/libiconv.dylib /usr/local/lib/libintl.a

I then tried to use make, but for some reason it insisted on recompiling this file, and then failed as before. I solved that by adding:
/usr/lib/libiconv.dylib /usr/local/lib/libintl.a
to simulavr_LDADD in the makefile.

It compiled, and went a lot further!

It then hung on running swig:

creating simulavr
swig -c++ -o simulavr_wrap.cpp simulavr.i
make[2]: swig: Command not found
make[2]: *** [simulavr_wrap.cpp] Error 127
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

I realized that it couldn't find swig. I looked around using find and I couldn't either! It turns out that there is a version for Mac OS X available at Darwinports. I installed it, which happens to end up at /opt/local/bin. This still didn't work with make, so I ran that line manually. It ran, but with a lot of warnings: pin.h:88: Warning(319): No access specifier given for base class ExternalType (ignored). pin.h:101: Warning(319): No access specifier given for base class ExternalType (ignored). avrdevice.h:47: Warning(401): Nothing known about class 'SimulationMember'. Ignored. systemclock.h:30: Warning(401): Nothing known about class 'multimap<unsigned long,SimulationMember * >'. Ignored. systemclock.h:30: Warning(401): Maybe you forgot to instantiate 'multimap<unsigned long,SimulationMember * >' using %template. ui.h:34: Warning(401): Nothing known about class 'SimulationMember'. Ignored.
ui.h:34: Warning(401): Nothing known about class 'Socket'. Ignored.
ui.h:34: Warning(401): Nothing known about class 'ExternalType'. Ignored. net.h:38: Warning(401): Nothing known about class 'vector<Pin * >'. Ignored. net.h:38: Warning(401): Maybe you forgot to instantiate 'vector<Pin * >' using %template. avrdevice.h:88: Warning(503): Can't wrap 'operator ->*' unless renamed to a valid identifier. pin.h:70: Warning(503): Can't wrap 'operator unsigned char' unless renamed to a valid identifier. pin.h:72: Warning(503): Can't wrap 'operator bool' unless renamed to a valid identifier. pin.h:74: Warning(503): Can't wrap 'operator +=' unless renamed to a valid identifier. pin.h:120: Warning(503): Can't wrap 'operator bool' unless renamed to a valid identifier. pin.h:122: Warning(503): Can't wrap 'operator +=' unless renamed to a valid identifier.

I then did another make, and it progress a lot further, ending with the following messages:

g++ -I. simulavr_wrap.o application.o decoder_trace.o printable.o at4433.o at8515.o at8515special.o atmega128.o avrdevice.o avrerror.o avrmalloc.o decoder.o flash.o gdbserver.o hardware.o helper.o hwad.o hwacomp.o hweeprom.o hwextirq.o hwmegaextirq.o hwmegatimer.o hwmegatimer0123irq.o hwport.o hwspi.o hwsreg.o hwstack.o hwtimer.o hwtimer01irq.o hwuart.o hwwado.o ioregs.o irqsystem.o keyboard.o lcd.o memory.o mysocket.o net.o pin.o pinatport.o rwmem.o scope.o systemclock.o trace.o ui.o -ltcl /Users/dtlinker/Desktop/AVR-GCC/binutils-2.15/bfd/libbfd.a /libiberty.a -lc -lm -lncurses -shared -o simulavr.so
g++: unrecognized option `-shared'
ld: Undefined symbols:
_main
_systemClock
_dcgettext
make[2]: *** [simulavr.so] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

I think I know how to solve the _dcgettext problem, but why is _main missing, and where would I find _systemClock? I also am not sure what to do about the lack of the -shared option.

Another question: Which gcc you use for compilation? We prefer >=3.4.1.

it is version 3.3 20030304

Thanks,
 Klaus

Thank you, for providing this resource, and the support to port it to a different platform!

DTL





reply via email to

[Prev in Thread] Current Thread [Next in Thread]