Coder Social home page Coder Social logo

jjqcat / geode Goto Github PK

View Code? Open in Web Editor NEW

This project forked from otherlab/geode

0.0 1.0 1.0 4.21 MB

A computational geometry library for C++ and Python

License: Other

Python 7.67% C++ 85.21% C 3.48% Mathematica 2.83% Shell 0.13% CMake 0.67%

geode's Introduction

Geode: The Otherlab computational geometry library

Geode is an open source library of computational geometry and associated mathematical utilities together with a fast, lightweight python binding layer. The license is standard three-clause BSD (see the included LICENSE file or LICENSE).

For questions or discussion, email [email protected].

Dependencies

For C++:

For Python:

  • python >= 2.7: A scripting language (Python Software Foundation (PSF) license)
  • numpy >= 1.5: Efficient multidimensional arrays for Python (BSD license)
  • setuptools >= 0.6: A packaging system for Python (PSF license)

Optional dependencies (see below for how to disable these):

  • py.test >= 2.1: Simple python testing (MIT license)
  • scipy: Scientific computation for Python (BSD license)
  • openexr: High dynamic range floating point image format (BSD license)
  • libpng: Lossless image format (Custom noncopyleft license)
  • libjpeg: Lossy image format (Custom noncopyleft license)

Geode makes extensive use of C++11 features, so a relatively recent C++ compiler is necessary.

Windows

This has been built and run successfully with the Visual Studio 2015 preview. We are working to make this more streamlined and robust (as well as fixing the hundreds of compiler warnings), but the following worked for me:

Install the following dependencies:

  • WinPython 64bit version 2.7.9.2 (This includes numpy and scipy)
  • CMake
  • MPIR (commit 3a9dd527a2f87e6eff8cab8b54b0b1f31e0826fa but tweaked for VS2015) ** This will require installing vsyasm ** Remove definition of snprintf from /build.vc12/cfg.h ** You may need to set Tools->Options->Projects and Solutions->Build and Run->"Maximum number of parallel project builds" to 1 to avoid parallel builds clobbering config headers

Create a config.py and point gmp to installation of mpir: gmp_libpath = '#/../mpir/build.vc12/x64/Debug' gmp_include='#/../mpir' gmp_publiclibs='mpir.lib'

Setup Command Prompt environment: Python from: ...\WinPython-64bit-2.7.9.2\scripts\env.bat VS dev tools using: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" Select x64 tools using: "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

Create a build directory separate from the sources (optional, but recommended): mkdir build

Build with: cmake ../ make

If you wish to install geode to a different location (such as a python virtualenv), add -DCMAKE_BUILD_PREFIX=/path/to/wherever to the cmake command.

Install with: make install

To use geode outside of project directory or for test_worker to pass you must add geode to your PYTHONPATH: set PYTHONPATH=<path_to_dir_outside_repo>\geode;%PYTHONPATH%

Installation

If necessary, dependencies can be installed via one of

# Debian/Ubuntu
sudo apt install cmake g++ python-dev python-pip python-numpy pkg-config libjpeg-dev libpng-dev zlib1g-dev libgmp-dev
sudo apt-get install python-scipy python-pytest libpng-dev libjpeg-dev libopenexr-dev # optional
pip install numpy

# Homebrew (recommended)
brew install cmake openexr gfortran python #Note: gfortran brew is now part of gcc, so although previous versions can still be accessed, brew install gcc is the preferred method
sudo pip install --upgrade pip setuptools numpy scipy pytest #numpy and scipy can be

# MacPorts (not recommended).  If you have python 2.7, replace py26 with py27.
sudo port -v install python26 py26-numpy cmake
sudo port -v install py26-scipy py26-py libpng jpeg openexr # optional
sudo port -v install gcc47 # If clang is unavailable

Geode can then be installed from source via

git clone https://github.com/otherlab/geode.git
cd geode

# Install c++ headers and libraries to /usr/local
cmake . && make && make install

At this point, you have a choice of either developer mode or install mode

Install mode

sudo make install

This will also install python bindings if enabled.

Developer mode

The libraries are built into geode if you want to use them without installing. To point python imports to your development tree, run one of

sudo python setup.py develop
python setup.py develop --prefix=$HOME

To link against this built version of geode, add this to your project's own CMakeLists.txt:

include(path/to/geode/CMakeLists.txt)
target_link_libraries(foo geode)

If you've installed geode, you can instead use:

find_package(Geode REQUIRED)
target_link_libraries(foo geode)

which will allow you to develop with geode in C++ as if it was installed.

Post install

On linux you may have to update the shared library cache via ldconfig if this is the first time you've installed. Make sure /usr/local/lib (or wherever you installed libgeode.so) is included in the cache's search path.

Testing

Unit tests can be run via

cd geode
py.test

Extra configuration

If additional build configuration is necessary, run ccmake instead of cmake. CMake includes documentation generated from the geode build system.

For developers wishing to use without installing, see more options in Developer mode section below

These options can also be passed via command line to cmake. Run ccmake for a complete list. Use CMAKE_BUILD_TYPE=Debug for a much slower build with many more assertions:

cmake -DCMAKE_BUILD_TYPE=Debug

Acknowledgements

Parts of geode come from the PhysBAM simulation library developed by Ron Fedkiw et al. at Stanford University.

For random numbers, we use the Random123 library of John Salmon et al. at D. E. Shaw Research. Random123 is included inline in core/random/random123.

The interval arithmetic in exact/Interval is based on code by Robert Bridson and Tyson Brochu.

geode's People

Contributors

girving avatar martinwicke avatar fgreen avatar kpasko avatar organfactory avatar mcbride avatar tdfischer avatar bsergeevautodesk avatar notlion avatar o8ruza8o avatar sethallen-zz avatar stappon avatar jsbeckma avatar mikest avatar ahk avatar erikstrand avatar tomfallen avatar ashanoski avatar jakeread avatar

Watchers

James Cloos avatar

Forkers

fixedchaos

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.