Any plan to update?
zhaopuming opened this issue · 6 comments
Hi Moritz,
I'd like to use your library to learn about LLVM and make a small language of my own. I tried llvm-d on dub but failed: the new dub system requires that a library needs to have a release tag.
Do you plan to update this library to make it work in the newest version of dub/dmd?
Hi zhaopuming,
could you please post the error message(s), because according to [1] you should still be able to track the master branch as a dependency, since that feature is only deprecated, not unsupported.
The reason llvm-d has no tags is because I could not think of a sensible way to version it, considering it only contains wrappers around c as of now. The least nonsensical versioning I could think of right now would be according to the latest supported Llvm version. That, however might interfere in the future with the possible d api should I get the time to finish it.
Sorry I was wrong, it seems not to be the problem with "~master" which is just a deprecation warning.
Here is the errors I get:
ARNING: A deprecated branch based version specification is used for the dependency llvm-d. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
Configuration 'library' of package llvm-d contains no source files. Please add {"targetType": "none"} to it's package description to avoid building it.
Building hello-llvm ~master configuration "application", build type debug.
Compiling using dmd...
Linking...
Undefined symbols for architecture x86_64:
"_D4llvm1c12__ModuleInfoZ", referenced from:
_D3app12__ModuleInfoZ in hello-llvm.o
"_D4llvm1c9functions26LLVMInitializeNativeTargetFNbZi", referenced from:
__Dmain in hello-llvm.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--- errorlevel 1
FAIL .dub/build/application-debug-posix.osx-x86_64-dmd_2066-2038BCD60C1BC78715663637A81ACE7B/ hello-llvm executable
My sourcecode, in source/app.d
import llvm.c;
void main(string[] args)
{
LLVMInitializeNativeTarget();
}
Seems like I can't link to or build llvm-d in my system.
I've cloned your llvm-d library and try to build it with dub, but got
zhaopuming@visus-macbook~/C/d/llvm-d [i]> dub build
WARNING: A deprecated branch based version specification is used for the dependency llvm-d:c-api. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
WARNING: A deprecated branch based version specification is used for the dependency llvm-d:d-api. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
Configuration 'library' of package llvm-d contains no source files. Please add {"targetType": "none"} to it's package description to avoid building it.
Error executing command build: Main package must have a binary target type, not none. Cannot build.
So maybe it's due to newer versions of dub not compatible with older versions.
You should not invoke build for llvm-d, as it is a source library. You need to include the dependency on llvm-d:c-api the way it is shown for the fibonacci sample in the package.json file. I'll cite it here:
{
"name": "fibonacci",
"targetName": "fibonacci",
"description": "Shows howto create a function calculating the Fibonacci series, jit-compile it, and execute it in-memory with llvm-d:c-api",
"targetType": "executable",
"importPaths": ["."],
"sourceFiles": ["samples/fibonacci.d"],
"dependencies": {
"llvm-d:c-api": "~master"
},
}
That way works fine for me using dub 9.22 and dmd 2.066.1 (You can test the fibonacci sample by invoking dub run llvm-d:fibonacci
Thanks, it works now :-)
Closing now