CyberShadow / DBuildStat

Tools to measure and visualize performance of building D programs
17 stars 1 forks source link

compilation fails with dmd #5

Open wilzbach opened 8 years ago

wilzbach commented 8 years ago

Why is not possible to compile DBuildStat with dmd?

Running it with rdmd works fine ...

dbuildstat.o:dbuildstat.d:function _Dmain: error: undefined reference to '_D2ae3sys3cmd3runFAAyaZv'
dbuildstat.o:dbuildstat.d:function _Dmain: error: undefined reference to '_D2ae3sys3cmd3runFAAyaZv'
dbuildstat.o:dbuildstat.d:function _D10dbuildstat4mainFAAyaZ7getDepsMFAyaZHAyaAya: error: undefined reference to '_D2ae3sys3cmd5queryFAAyaZAya'
dbuildstat.o:dbuildstat.d:_D10dbuildstat12__ModuleInfoZ: error: undefined reference to '_D2ae3sys3cmd12__ModuleInfoZ'
dbuildstat.o:dbuildstat.d:_D10dbuildstat12__ModuleInfoZ: error: undefined reference to '_D2ae5utils4json12__ModuleInfoZ'
dbuildstat.o:dbuildstat.d:_D10dbuildstat12__ModuleInfoZ: error: undefined reference to '_D2ae5utils5regex12__ModuleInfoZ'
dbuildstat.o:dbuildstat.d:_D10dbuildstat12__ModuleInfoZ: error: undefined reference to '_D6common12__ModuleInfoZ'
dbuildstat.o:dbuildstat.d:_D24TypeInfo_S6common6Module6__initZ: error: undefined reference to '_D6common6Module6__initZ'
dbuildstat.o:dbuildstat.d:_D24TypeInfo_S6common6Module6__initZ: error: undefined reference to '_D6common6Module9__xtoHashFNbNeKxS6common6ModuleZm'
dbuildstat.o:dbuildstat.d:_D24TypeInfo_S6common6Module6__initZ: error: undefined reference to '_D6common6Module11__xopEqualsFKxS6common6ModuleKxS6common6ModuleZb'
dbuildstat.o:dbuildstat.d:function _D2ae5utils4json28__T6toJsonTAS6common6ModuleZ6toJsonFAS6common6ModuleZAya: error: undefined reference to '_D2ae5utils8appender21__T12FastAppenderTyaZ12FastAppender3getMFNaNbNiZAya'
dbuildstat.o:dbuildstat.d:function _D2ae5utils4json79__T16CustomJsonWriterTS2ae5utils8appender21__T12FastAppenderTyaZ12FastAppenderZ16CustomJsonWriter25__T3putTAS6common6ModuleZ3putMFAS6common6ModuleZv: error: undefined reference to '_D2ae5utils8appender21__T12FastAppenderTyaZ12FastAppender10__T3putTaZ3putMFNaNbaZv'
dbuildstat.o:dbuildstat.d:function _D2ae5utils4json79__T16CustomJsonWriterTS2ae5utils8appender21__T12FastAppenderTyaZ12FastAppenderZ16CustomJsonWriter25__T3putTAS6common6ModuleZ3putMFAS6common6ModuleZv: error: undefined reference to '_D2ae5utils4json7__arrayZ'
dbuildstat.o:dbuildstat.d:function _D2ae5utils4json79__T16CustomJsonWriterTS2ae5utils8appender21__T12FastAppenderTyaZ12FastAppenderZ16CustomJsonWriter25__T3putTAS6common6ModuleZ3putMFAS6common6ModuleZv: error: undefined reference to '_D2ae5utils4json7__arrayZ'
dbuildstat.o:dbuildstat.d:function _D2ae5utils4json79__T16CustomJsonWriterTS2ae5utils8appender21__T12FastAppenderTyaZ12FastAppenderZ16CustomJsonWriter25__T3putTAS6common6ModuleZ3putMFAS6common6ModuleZv: error: undefined reference to '_D2ae5utils4json7__arrayZ'
dbuildstat.o:dbuildstat.d:function _D2ae5utils4json79__T16CustomJsonWriterTS2ae5utils8appender21__T12FastAppenderTyaZ12FastAppenderZ16CustomJsonWriter25__T3putTAS6common6ModuleZ3putMFAS6common6ModuleZv: error: undefined reference to '_D2ae5utils8appender21__T12FastAppenderTyaZ12FastAppender10__T3putTaZ3putMFNaNbaZv'
dbuildstat.o:dbuildstat.d:function _D2ae5utils4json79__T16CustomJsonWriterTS2ae5utils8appender21__T12FastAppenderTyaZ12FastAppenderZ16CustomJsonWriter25__T3putTAS6common6ModuleZ3putMFAS6common6ModuleZv: error: undefined reference to '_D2ae5utils8appender21__T12FastAppenderTyaZ12FastAppender10__T3putTaZ3putMFNaNbaZv'
dbuildstat.o:dbuildstat.d:function _D2ae5utils4json79__T16CustomJsonWriterTS2ae5utils8appender21__T12FastAppenderTyaZ12FastAppenderZ16CustomJsonWriter24__T3putTS6common6ModuleZ3putMFS6common6ModuleZv: error: undefined reference to '_D2ae5utils8appender21__T12FastAppenderTyaZ12FastAppender10__T3putTaZ3putMFNaNbaZv'
dbuildstat.o:dbuildstat.d:function _D2ae5utils4json79__T16CustomJsonWriterTS2ae5utils8appender21__T12FastAppenderTyaZ12FastAppenderZ16CustomJsonWriter12__T3putTAyaZ3putMFNbAyaZv: error: undefined reference to '_D2ae5utils4json79__T16CustomJsonWriterTS2ae5utils8appender21__T12FastAppenderTyaZ12FastAppenderZ16CustomJsonWriter9putStringMFNbxAaZv'
dbuildstat.o:dbuildstat.d:function _D2ae5utils4json79__T16CustomJsonWriterTS2ae5utils8appender21__T12FastAppenderTyaZ12FastAppenderZ16CustomJsonWriter12__T3putTG3mZ3putMFNaNbG3mZv: error: undefined reference to '_D2ae5utils4json7__arrayZ'
dbuildstat.o:dbuildstat.d:function _D2ae5utils8appender21__T12FastAppenderTyaZ12FastAppender11__T3putTAaZ3putMFNaNbAaZv: error: undefined reference to '_D2ae5utils8appender21__T12FastAppenderTyaZ12FastAppender7reserveMFNaNbmZv'
collect2: error: ld returned 1 exit status
--- errorlevel 1
CyberShadow commented 8 years ago

Because dmd does not compile imported modules by itself. You have to specify ALL modules used in an application to compile and link them. Usually this is done by a build tool, though (rdmd, dub etc.)

You can use rdmd to build programs if you use --build-only.

wilzbach commented 8 years ago

You can use rdmd to build programs if you use --build-only.

Nice! I tried to make an AUR package out of this, here's my inital attempt. Would be nice to have your feedback on it ;-)

https://aur.archlinux.org/packages/dbuildstat-git/

CyberShadow commented 8 years ago

I'll check it out.

CyberShadow commented 8 years ago

I'm pretty new to Arch, but here's what I noticed when comparing the PKGBUILD with some other D packages:

@Dicebot could offer more insight, he seems to have more experience making D packages for Arch.

mihails-strasuns commented 8 years ago

Sure. Some quick suggestions: