Since I'm interested in moving away from gdc, I decided to build the llvm / ldc toolchain and try it with my D programs.
Once I had everything installed, I changed my build.sh to build my small neural network simulator under ldc instead of gdc. I have unittests enabled in my program.
I kept getting undefined references to the module's unittest components in my build script. I assumed it had something to do with how the modules were being passed in the final link stage.
Here was the build script I used:
echo building netgraph
ldc -c -unittest netgraph.d -I~/src/ldc/tango -I.
echo building neuron
ldc -c -unittest neuron.d -I~/src/ldc/tango -I.
echo building neuralNet
ldc -c -unittest neuralNet.d -I~/src/ldc/tango -I.
echo building collectest
ldc collectest.d -unittest -I~/src/ldc/tango -I. netgraph.o neuron.o neuralNet.o
echo done
All of the compiles worked fine, except the last one. It looks liked ldc passed all of the correct arguments to the gcc final link stage (will the release version bypass gcc for link)?
Then I had error messages that said that the linker couldn't resolve the unittests in each module. I tried multiple things to get past this. Eventually I removed the ".o" file extensions in the final ldc build command. Amazingly this worked.
My program ran fine, but the unit tests were run in some strange order and some of them were run multiple times for no apparent reason.
I hope this is just my unfamiliarity with how ldc is setup/runs.
Great project. Good luck. If you CC: me at my gmail account below I'd appreciate it as I don't logon to dsource very often.
Jim Burnes
jvburnes at gmail dot com