www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DUB Build Linker Library Search Path

reply =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
My DUB building of dstep on Ubuntu 15.04 fails because it can't 
find the libclang which is placed in

     /usr/lib/llvm3-6/lib/libclang.so.1

How do I tell `dub build` where to find libraries in non-standard 
directories?
Jul 10 2015
next sibling parent =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
On Friday, 10 July 2015 at 09:27:19 UTC, Nordlöw wrote:
 How do I tell `dub build` where to find libraries in 
 non-standard directories?
From the command line that is...
Jul 10 2015
prev sibling parent reply "Martin Nowak" <code dawg.eu> writes:
On Friday, 10 July 2015 at 09:27:19 UTC, Nordlöw wrote:
 How do I tell `dub build` where to find libraries in 
 non-standard directories?
You're missing the development package libclang-dev, which should come with a pkg-config.
Jul 10 2015
parent reply =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
On Friday, 10 July 2015 at 09:29:49 UTC, Martin Nowak wrote:
 On Friday, 10 July 2015 at 09:27:19 UTC, Nordlöw wrote:
 How do I tell `dub build` where to find libraries in 
 non-standard directories?
You're missing the development package libclang-dev, which should come with a pkg-config.
I've already installed libclang-dev. The problem is that I can't find a way (from the command line) (by reading the DUB docs) to tell DUB that it's placed in /usr/lib/llvm-3.6/lib/libclang.so.1 I don't what to have to modify the dub.json (lflags variable) as I want automation. Aren't all DUB the variables somehow modifiable in shell call?! Further `pkg-config --list-all |grep clang` shows nothing.
Jul 10 2015
parent reply Rikki Cattermole <alphaglosined gmail.com> writes:
On 10/07/2015 9:34 p.m., "Nordlöw" wrote:
 On Friday, 10 July 2015 at 09:29:49 UTC, Martin Nowak wrote:
 On Friday, 10 July 2015 at 09:27:19 UTC, Nordlöw wrote:
 How do I tell `dub build` where to find libraries in non-standard
 directories?
You're missing the development package libclang-dev, which should come with a pkg-config.
I've already installed libclang-dev. The problem is that I can't find a way (from the command line) (by reading the DUB docs) to tell DUB that it's placed in /usr/lib/llvm-3.6/lib/libclang.so.1 I don't what to have to modify the dub.json (lflags variable) as I want automation. Aren't all DUB the variables somehow modifiable in shell call?! Further `pkg-config --list-all |grep clang` shows nothing.
LFLAGS="..." dub build
Jul 10 2015
parent reply =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
On Friday, 10 July 2015 at 09:37:42 UTC, Rikki Cattermole wrote:
 On 10/07/2015 9:34 p.m., "Nordlöw" wrote:
 On Friday, 10 July 2015 at 09:29:49 UTC, Martin Nowak wrote:
 On Friday, 10 July 2015 at 09:27:19 UTC, Nordlöw wrote:
 How do I tell `dub build` where to find libraries in 
 non-standard
 directories?
You're missing the development package libclang-dev, which should come with a pkg-config.
I've already installed libclang-dev. The problem is that I can't find a way (from the command line) (by reading the DUB docs) to tell DUB that it's placed in /usr/lib/llvm-3.6/lib/libclang.so.1 I don't what to have to modify the dub.json (lflags variable) as I want automation. Aren't all DUB the variables somehow modifiable in shell call?! Further `pkg-config --list-all |grep clang` shows nothing.
LFLAGS="..." dub build
LDFLAGS="-L/usr/lib/llvm-3.6/lib" dub build --compiler="/usr/bin/dmd" -v has not effect: /usr/bin/dmd -of.dub/build/default-debug-linux.posix-x86_64-dmd_2067-0E9173B3A2F7330291 4DC3F174B9E99/dstep -debug -g -version=Have_dstep -version=Have_dstack -version=Have_mambo -version=Have_tango -Idstep -Iclang -I../../.dub/packages/dstack-0.0.3 -I../../.dub/packages/mambo-0.0.4 -I../../.dub/packages/tango-1.0.1_2.067 -Jresources clang/Compiler.d clang/Cursor.d clang/Diagnostic.d clang/File.d clang/Index.d clang/SourceLocation.d clang/TranslationUnit.d clang/Type.d clang/Util.d clang/Visitor.d clang/c/CXErrorCode.d clang/c/CXString.d clang/c/Index.d dstep/config/Configuration.d dstep/core/Exceptions.d dstep/driver/Application.d dstep/driver/DStep.d dstep/translator/Declaration.d dstep/translator/Enum.d dstep/translator/IncludeHandler.d dstep/translator/Output.d dstep/translator/Record.d dstep/translator/Translator.d dstep/translator/Type.d dstep/translator/objc/Category.d dstep/translator/objc/ObjcInterface.d ../../.dub/packages/dstack-0.0.3/libdstack.a ../../.dub/packages/mambo-0.0.4/libmambo.a ../../.dub/packages/tango-1.0.1_2.067/libtango.a -L-lclang -L-rpath -L. -L-L. -L-lbz2 -vcolumns ../../.dub/packages/mambo-0.0.4/mambo/util/Traits.d(154,39): Deprecation: typedef is removed ../../.dub/packages/mambo-0.0.4/mambo/util/Traits.d(182,30): Deprecation: typedef is removed /usr/bin/ld: error: cannot find -lclang Using export as export LDFLAGS="-L/usr/lib/llvm-3.6/lib"; dub build --compiler=/usr/bin/dmd doesn't work either. Adding "-L-L/usr/lib/llvm3-6/lib" to the call to dmd works. What's wrong with my call to DUB? I'm sitting on DUB git master.
Jul 10 2015
next sibling parent reply Rikki Cattermole <alphaglosined gmail.com> writes:
On 10/07/2015 11:02 p.m., "Nordlöw" wrote:
 On Friday, 10 July 2015 at 09:37:42 UTC, Rikki Cattermole wrote:
 On 10/07/2015 9:34 p.m., "Nordlöw" wrote:
 On Friday, 10 July 2015 at 09:29:49 UTC, Martin Nowak wrote:
 On Friday, 10 July 2015 at 09:27:19 UTC, Nordlöw wrote:
 How do I tell `dub build` where to find libraries in non-standard
 directories?
You're missing the development package libclang-dev, which should come with a pkg-config.
I've already installed libclang-dev. The problem is that I can't find a way (from the command line) (by reading the DUB docs) to tell DUB that it's placed in /usr/lib/llvm-3.6/lib/libclang.so.1 I don't what to have to modify the dub.json (lflags variable) as I want automation. Aren't all DUB the variables somehow modifiable in shell call?! Further `pkg-config --list-all |grep clang` shows nothing.
LFLAGS="..." dub build
LDFLAGS="-L/usr/lib/llvm-3.6/lib" dub build --compiler="/usr/bin/dmd" -v has not effect: /usr/bin/dmd -of.dub/build/default-debug-linux.posix-x86_64-dmd_2067-0E9173B3A2F733029144DC3F174B9E99/dstep -debug -g -version=Have_dstep -version=Have_dstack -version=Have_mambo -version=Have_tango -Idstep -Iclang -I../../.dub/packages/dstack-0.0.3 -I../../.dub/packages/mambo-0.0.4 -I../../.dub/packages/tango-1.0.1_2.067 -Jresources clang/Compiler.d clang/Cursor.d clang/Diagnostic.d clang/File.d clang/Index.d clang/SourceLocation.d clang/TranslationUnit.d clang/Type.d clang/Util.d clang/Visitor.d clang/c/CXErrorCode.d clang/c/CXString.d clang/c/Index.d dstep/config/Configuration.d dstep/core/Exceptions.d dstep/driver/Application.d dstep/driver/DStep.d dstep/translator/Declaration.d dstep/translator/Enum.d dstep/translator/IncludeHandler.d dstep/translator/Output.d dstep/translator/Record.d dstep/translator/Translator.d dstep/translator/Type.d dstep/translator/objc/Category.d dstep/translator/objc/ObjcInterface.d ../../.dub/packages/dstack-0.0.3/libdstack.a ../../.dub/packages/mambo-0.0.4/libmambo.a ../../.dub/packages/tango-1.0.1_2.067/libtango.a -L-lclang -L-rpath -L. -L-L. -L-lbz2 -vcolumns ../../.dub/packages/mambo-0.0.4/mambo/util/Traits.d(154,39): Deprecation: typedef is removed ../../.dub/packages/mambo-0.0.4/mambo/util/Traits.d(182,30): Deprecation: typedef is removed /usr/bin/ld: error: cannot find -lclang Using export as export LDFLAGS="-L/usr/lib/llvm-3.6/lib"; dub build --compiler=/usr/bin/dmd doesn't work either. Adding "-L-L/usr/lib/llvm3-6/lib" to the call to dmd works. What's wrong with my call to DUB? I'm sitting on DUB git master.
No no, LFLAGS not LDFLAGS. It's basically lflags from dub file but in environment args.
Jul 10 2015
parent reply =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
On Friday, 10 July 2015 at 11:21:34 UTC, Rikki Cattermole wrote:
 No no, LFLAGS not LDFLAGS. It's basically lflags from dub file 
 but in environment args.
No, doesn't work: LFLAGS="-L-L/usr/lib/llvm-3.6/lib" dub build --compiler=/usr/bin/dmd fails aswell: Target tango 1.0.1+2.067 is up to date. Use --force to rebuild. Target mambo 0.0.4 is up to date. Use --force to rebuild. Target dstack 0.0.3 is up to date. Use --force to rebuild. Building dstep ~master configuration "default", build type debug. Running /usr/bin/dmd... ../../.dub/packages/mambo-0.0.4/mambo/util/Traits.d(154,39): Deprecation: typedef is removed ../../.dub/packages/mambo-0.0.4/mambo/util/Traits.d(182,30): Deprecation: typedef is removed /usr/bin/ld: error: cannot find -lclang
Jul 10 2015
parent reply =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
On Friday, 10 July 2015 at 11:56:23 UTC, Nordlöw wrote:
 fails aswell:
Should be LFLAGS="-L/usr/lib/llvm-3.6/lib" dub build --compiler=/usr/bin/dmd but still fails
Jul 10 2015
parent reply "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> writes:
On Friday, 10 July 2015 at 12:04:53 UTC, Nordlöw wrote:
 Should be

     LFLAGS="-L/usr/lib/llvm-3.6/lib" dub build 
 --compiler=/usr/bin/dmd

 but still fails
I can't find any place in the DUB sources that reads `LFLAGS` from the environment. Only one place when `DFLAGS` is read. A regression? Do you want me to add this?
Jul 10 2015
parent "Joakim =?UTF-8?B?QnLDpG5uc3Ryw7ZtIg==?= <notfornow dev.null.com> writes:
On Friday, 10 July 2015 at 12:26:02 UTC, Per Nordlöw wrote:
 On Friday, 10 July 2015 at 12:04:53 UTC, Nordlöw wrote:
 Should be

     LFLAGS="-L/usr/lib/llvm-3.6/lib" dub build 
 --compiler=/usr/bin/dmd

 but still fails
I can't find any place in the DUB sources that reads `LFLAGS` from the environment. Only one place when `DFLAGS` is read. A regression? Do you want me to add this?
Hmm, an observation related to this topic. I've started using dub-0.9.24-beta.2 with the intention of converting to the new SDLang format. When reading the documentation I noticed that it is possible to specify environment flags in the .sdl-file. "Can I use this to pass a -L linker flag?..." dub.sdl: .. lflags "-lclang" "$LFLAGS" bash$ LFLAGS="/..." dub build -c release It works :)
Jul 11 2015
prev sibling parent =?UTF-8?B?Ik5vcmRsw7Z3Ig==?= <per.nordlow gmail.com> writes:
On Friday, 10 July 2015 at 11:02:16 UTC, Nordlöw wrote:
 What's wrong with my call to DUB?

 I'm sitting on DUB git master.
Found DFLAGS="-L-L/usr/lib/llvm-3.6/lib" dub build --compiler=/usr/bin/dmd to work but that's a bit ugly.
Jul 10 2015