npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

giac

v1.23.69823

Published

Giac, a free computer algebra system

Downloads

1,047

Readme

Giac, a free computer algebra system

This document describes the Node port of Giac. It offers direct use of Giac in JavaScript programs including Electron applications. (See the giac-electron-example project for a minimal example with Electron.)

Example usage

var giac = require('bindings')('giac');
console.log(giac.evaluate("expand((x+y)^3)"));

See also the file nodegiac.js for a minimalist command line version of Giac.

Supported platforms

  • Linux
  • Mac OS X
  • Windows

Prerequisites

Since Giac is C++ library, you need to have a compiler toolchain on your system installed. In addition the GMP and MPFR development libraries need to be present.

The compilation will be performed by node-gyp. In order to install it on your system you may have to accomplish some additional steps. In a doubt, please consult the node-gyp documentation.

Linux

You need a recent gcc. Former versions (like 4.8) may fail.

Python 2.7 is required. On some systems you may have to create a symbolic link to the python2.7 executable (preferably as /usr/local/bin/python).

On a Debian based system GMP and MPFR can be installed by running sudo apt install libgmp-dev libmpfr-dev.

Ubuntu 16.04 and above should work. Currently the amd64, i386 and armhf processors have been tested with success.

You can also compile Giac for a Raspberry Pi 3 under Raspbian Jessie. You may need at least 2 GB RAM by adding some swap space. A newer GCC will also be required, install GCC-6 and then make it default.

Mac OS X

Install MacPorts first. Then sudo port install gmp mpfr will install GMP and MPFR as well.

It will be silently assumed that GMP and MPFR have been installed in /opt/local/lib. If this is not the case, set the environment variable LIBDIR to the correct path.

Mac OS X 10.11.6 with Xcode 8.2.1, GMP 6.1.0 and MPFR 3.1.3 are known to work correctly.

Windows

At the moment only the 32 bit version works correctly. The 64 bit version may fail for some computations.

First you need to have a working node-gyp installation. Please take the time to check it by following Microsoft's NodeJS Guidelines.

You may need Visual Studio 2013 installed, newer versions may result in strange errors on compilation time.

It is recommended to use MPIR instead of GMP. To compile the Node port of Giac the .LIB files (that is, the static libraries) of both MPIR and MPFR will be required. You may either compile them on your own or get the precompiled binaries. (An option to download them is getting from Atelier Web. This may support only Release mode compilation.) Put the .LIB files into the current folder, or set the LIBDIR environment variable to the correct path.

After compilation you will also need the dynamic libraries (the .DLL files). Put them in the current folder (that is, both MPIR.DLL and MPFR.DLL) before testing/running Giac. You may also decide to put the .DLL files in the same folder where the giac.node (the artifact .DLL) file takes place.

Compilation

Enter npm install in the current folder. Alternatively, npm install giac will do the compilation by using the last stable package from the npmjs repository. Use npm install giac@latest to get the latest unstable version.

The compilation may take several minutes. To speed up the compilation process consider entering for example

JOBS=4 npm install giac@latest

which will use 4 cores in parallel. The best value for the number of parallel jobs is usually the number of cores you have, but this may depend on your system as well.

Troubleshooting

It may be useful to download the Node port of Giac to a local machine and fine tune the compilation settings. This can be done as follows:

npm pack giac@latest
tar xzf giac*tgz
cd package
JOBS=4 npm install
npm test

Testing

Go to your node_modules folder, enter cd giac and npm test. (If you are under Windows, you need to copy the external .DLL files into this folder, or directly into the build subfolder.)

To play with Giac, modify the file nodegiac.js and run npm test again.

Authors

Giac was mostly written and is continuously developed by Bernard Parisse [email protected]. The Node port was implemented by Zoltán Kovács [email protected].

Acknowledgments

The Node port of Giac is dedicated to Gábor Ancsin, one of the most prominent JavaScript heroes of the GeoGebra Team.