Installing Modules

Jesse Phillips jessekphillips+D at gmail.com
Wed Mar 28 19:07:23 PDT 2012


On Wednesday, 28 March 2012 at 23:55:38 UTC, TJB wrote:
> All,
>
> I'm very new to D.  I am wanting to install the SciD module 
> (David Simcha's fork), but I don't know how to go about it.  
> Can you guide me?
>
> Where does the code go?  How do I import it?
>
> Thanks,
>
> TJB

There are many ways to go about using modules, I will go over 
installing a module for Linux. Usually the simplest way to get 
started is to pass all files to the compiler (you use an import 
statement to import the modules).

Build SciD as a library.

$ dmd -lib -oflibscid.a all.d files.d for.d SciD.d

Copy lib to /usr/local/lib

Copy sciD source files in the same direcectory structure 
(propably starting with scid/) to /usr/local/src

Installed.

Create a main.d file somewhere:

$ cat main.d
import scid.something;
void main() {}

$ dmd -I/usr/local/src main.d

Windows would be something different, however optlink doesn't 
have a standard set of locations to look for library files. you 
can also pass the library to dmd

$ dmd -I/usr/local/src main.d libscid.a -- If it is in the same 
directory as main.d


More information about the Digitalmars-d-learn mailing list