Git Product home page Git Product logo

tron-math's Introduction

Tron Math

Description

Tron Math implements some specific methods of JDK8 x86 , which will produce different results in other platform environments. The current java-tron runtime environment is JDK8 x86. To support the upgrade to JDK11 x86, incompatible functions are implemented in C++ inline assembly and package the native libraries used by java-tron.

Using the Dependency

gradle

    dependencies {
        implementation 'io.github.zhang0125:tron-math:0.1.0'
        }

maven

    <dependency>
        <groupId>io.github.zhang0125</groupId>
        <artifactId>tron-math</artifactId>
        <version>0.1.0</version>
    </dependency>

Usage

Recommended Package imports:

import org.tron.math.TronMath;

Loading dynamic library at server startup:

TronMath.loadLib();

Use

double result = TronMath.pow(4. 0.5);

Building

The following Steps work on mac, linux well, other platforms are not verified yet.

Supported Platforms

The following platforms are supported:

  • OS X Mojave with X Code 11 (x86_64)
  • CentOS (x86_64)

Prerequisites

  • GNU compiler toolchain, gcc-c++
  • JAVA(1.11+),make sure the current session $JAVA_HOME is set.
  • cmake2.8+
  • git
  • maven3
  • pkg-configls (linux maybe required)
  • libtool (linux maybe required)

Build Procedure

First,build the native library on both osx64 and linux64

git clone https://github.com/zhang0125/tron-math.git
cd tron-math/cpp
mkdir build && cd build
cmake ..
make

Use the dynamic libraries libtron_math.so and libtron_math.dylib built above to replace the dynamic libraries in src/main/resources/META-INF/native for the corresponding platform.

Then,build TronMath

mvn clean install

Build Results

tron-math/target/tron-math-${version}.jar : The java class file to the library.

tron-math's People

Contributors

zhang0125 avatar

Stargazers

Kristian Aguinaldo avatar

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.