Comments (11)
I agree, the build script is pretty limited right now. Keep in mind, when I wrote it, the other D2 compilers weren't even close to being up-to-date with the language. I am currently working on a better build system, which will allow the use of any compiler, provide full flexibility in setting compiler options, and so on. This is going a bit slowly, though, so don't hold your breath. ;-)
Note that the library itself is straightforwardly compiled by hand. There are no quirks or special considerations that I am aware of. Using DMD (any other compiler should be similar), just issue the following command in the root directory of the repository:
dmd -lib -oflibscid.a `find scid | grep '\.d$'`
The main benefit of using the build script is auto-generation of headers (which aren't really necessary; just use the full source code) and CandyDoc documentation.
from scid.
Not intended as a deep critique, just to make sure the question was raised :-)
Re using the full source code: I think this is actually what's done also with Phobos packages in Linux distro repositories, at least for Debian/Ubuntu; there's no compiled libphobos at all.
from scid.
Re using the full source code: I think this is actually what's done also with Phobos [...]
The main reason for this is that header generation has historically been very buggy in DMD. I believe many (maybe all?) of the problems have been fixed in recent releases, however.
from scid.
Back to the build script: forgetting the choice of compiler called within the script, there's some problem related to running it as a script with gdmd.
gdmd -run build.d
generates an error: Unknown command: -I/usr/include/d/dmd/phobos
. Using gdmd -run build.d lib
(or headers
) works fine for those options, so it's a failure of the opening if
statement.
In fact, if you include a couple of lines at the beginning of the main
function,
writeln("Number of arguments: ",args.length);
foreach(string a; args)
writeln("\t",a);
... you find that gdmd translates to a rather extensively-optioned form that clearly causes that if
statement to choke:
Number of arguments: 7
/home/joseph/code/SciD/build
-I/usr/include/d/dmd/phobos
-I/usr/include/d/dmd/druntime/import
-L-L/usr/lib
-L-L/usr/lib32
-L--no-warn-search-mismatch
-L--export-dynamic
Using std.getopt with --lib, --headers, etc. is probably a better way to determine what to build. If you think it'll be useful I'll try and prepare a patch to that end.
from scid.
I disagree. To me it seems that the problem is with gdmd, and not the build script. Does the following work for you?
gdmd build.d && ./build
If so, I'll add a notice to that effect in the README and on the wiki.
from scid.
Yes, it runs fine if you compile it first. Adding those instructions to README and wiki is probably a good idea.
Agree that gdmd has a problem here, but still think that the way you handle build arguments is problematic.
from scid.
I've added a bug report for GDC on this point: https://bitbucket.org/goshawk/gdc/issue/335/gdmd-run-interferes-with-program-arguments
from scid.
Agree that gdmd has a problem here, but still think that the way you handle build arguments is problematic.
Could you explain why it is problematic? It looks at the first command line argument for a build target, and builds that target. If no target is specified, it assumes the user wants to build the library file and the headers. If you pass it an argument it doesn't recognise, it terminates gracefully with an error message. I don't think a simple build script should be expected to recover from invalid user input.
One simple improvement that could be made, however, is to pass anything past that first argument, i.e. args[2..$]
, straight on to the compiler. That would be a temporary solution for your request for being able to specify optimisation flags, because then you could do e.g.
./build lib -release -inline -O
I've added a bug report for GDC on this point
Great, thanks!
from scid.
Done: kyllingstad@45569e9
from scid.
Agree, I was being harsh on what is a simple build script. Put simply my thought was for the bigger picture and a build script that would carefully check all arguments. Anyway, your fix looks nice :-)
from scid.
Fixed a long time ago, just forgot to close it then.
from scid.
Related Issues (20)
- scid deb packages HOT 23
- build.d able to build as sharedlib with ldc 2
- build.d able to build as sharedlib with ldc 2
- Add examples
- [LDC][OS X] lapack linking error
- [Travis] master state is not represented HOT 2
- [LDC][DUB] test failed HOT 3
- readme is outdated HOT 2
- modern D array indexing/slicing HOT 7
- installation / usage issues HOT 8
- multidimensional minimization is missing HOT 3
- scid.nonlinear.findRoot() fails when user function does not take buffer HOT 1
- Change licence to MPL 2.0 HOT 1
- Remove `scid.core.memory`, use new allocators package in Phobos instead HOT 1
- building docs makes complaints HOT 1
- There is probably a case for the lapack bindings to exist independently of this package HOT 4
- Allow for inverting a complex matrix HOT 1
- Extend MatrixView API with overloaded operators
- Publish new release for DMD's CI HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scid.