ginsh on ReactOS

ginsh running on ReactOS.

GiNaC for woe32

Here is experimental woe32 build of GiNaC version 1.4.4, CLN version 1.2.2, and GMP version 4.2.4. The tarball (signed with this GPG key) contains the headers, DLLs, import libraries, documentation (in PDF format), and utilities (ginsh, viewgar, and pi).

Note: these packages can be used only with GNU toolchain (compiler, assembler, linker).

Using with MinGW

First of all, install MinGW and msys from MinGW download page.

Compiling and running a simple program.

Suppose we want to compile a simple program mycode.cpp which uses GiNaC. This can be done in several ways.

Using msys environment.

Start the msys shell, unpack the tarball somewhere (e.g. into root directory), this will create opt/ginac directory and quite a number of files inside it.

Compile the program:

export CPPFLAGS="-I/opt/ginac/include"
export LIBS="-L/opt/ginac/lib -lginac -lcln -lgmp"
g++ -o mycode.exe $CPPFLAGS mycode.cpp $LIBS

Append the directory which holds libginac-x-y-z.dll to the PATH environment variable, so Windows can find GiNaC, CLN, and other necessary DLLs, and run mycode.exe:

export PATH=$PATH:/opt/ginac/bin

Using Cygwin.

It is almost the same as described previous paragraph. The only difference is -mno-cygwin compiler flag. It tells the compiler to build native woe32 binary (as opposed to one using Cygwin DLL):

export CPPFLAGS="-I/opt/ginac/include"
export PATH=$PATH:/opt/ginac/bin
export LIBS="-L/opt/ginac/lib -lginac -lcln -lgmp"
g++ -mno-cygwin $CPPFLAGS mycode.cpp $LIBS

Other ways.

It is possible to use these libraries with IDEs based on the GNU Compiler Collection, such as Code::Blocks. Sorry, I can't give more details, since I don't use any IDEs myself.

Reporting problems

Send bug reports, success stories, feature requests, etc. to Alexei Sheplyakov (please read notes on sending email to get the reply faster).

Known issues


Q: How do I use these libraries with Visual C++?
A: You don't. These packages can be used only with GNU C++ compiler. In general, it's impossible to link C++ libraries compiled by different compilers (see e.g. this explanation).

Q: How do I compile GiNaC with Visual C++?
A: I can't give a definitive answer, since I don't use that compiler myself. Anyway, there's (at least) two things you should do. First of all, the CLN library contains a bit of GCC specific code. You need to identify compiler specific code, and rewrite it in a (reasonably) portable manner. You might want to send patches to the CLN mailing list, so you don't need to do this boring work whenever a new version of CLN is released. Please note: patches adding even more compiler specific code (i.e. replacing GCC-specific code with Visual C++ specific one) will be rejected. Secondly, you need to write build scripts for Visual C++ (or "project files", or whatever m$ calls them) for GiNaC and CLN. Please note: don't ask developers (in particular, me) to do this work for you. Also, please refrain from asking to replace auto tools based build system with something else. Such requests don't get anything to be done and only make people angry. Patches which add support for other build system(s) are welcome, though.