Git Product home page Git Product logo

evoapproxlib's People

Contributors

michalwiglasz avatar mrazekv avatar zvasicek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

evoapproxlib's Issues

Errors during installation

Hi, I was attempting a vanilla install of your library and observed several problems which are described below

Environment:

Ubuntu 22.04 WSL
Python: 3.9.12
Cython: 0.29.28

Commands:

git clone https://github.com/ehw-fit/evoapproxlib.git
git checkout v2022
cd evapproxlib
python3 make_cython.py
cd cython
python3 setup.py build_ext
python3 setup.py install --user

Expected Behavior:

Successful Install

Actual Behavior:

There are several problems occuring

1. Warnings in all Cython files

/home/.../miniconda3/lib/python3.9/site-packages/Cython/Compiler/Main.py:369: FutureWarning:
Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release!
File: /home/.../approx_libs/evoapproxlib/cython/adders_16_unsigned_add16u_0UV.pyx  

2. Compilation errors in some Cython files

Several Cython files produce errors when passed to the Cython compiler.

cythoning multipliers_8x7_unsigned_mul8x7u_31P.pyx to multipliers_8x7_unsigned_mul8x7u_31P.c                                                                                                                                                                                                                                                                                                                                                                                              Error compiling Cython file:                                                                                                                                                                                                                 ------------------------------------------------------------                                                                                                                                                                                 ...                                                                                                                                                                                                                                          # from multiplers/8x7_unsigned/pareto_pwr_wce/mul8x7u_31P.c
from libc.stdint cimport *
cdef extern:
uint64_t c_mul8x7u_31P "mul8x7u_31P" (const uint64_t A /* 8-bit unsigned operand */, const uint64_t B /* 7-bit unsigned operand */)
------------------------------------------------------------
multipliers_8x7_unsigned_mul8x7u_31P.pyx:6:59: Expected ')', found '/'

The problem is that the parser does not correctly handle the inline comments that state the respective datatypes

3. Error during C compilation

Due to the incorrect parsing, the build step fails for several submodules.

building 'evoapproxlib.add8s_7EL' extension 
wrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c ../adders/8_signed/pareto_pwr_mae/add8s_7EL.c -o build/temp.linux-x86_64-3.8/../adders/8_signed/pareto_pwr_mae/add8s_7EL.o
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c adders_8_signed_add8s_7EL.c -o build/temp.linux-x86_64-3.8/adders_8_signed_add8s_7EL.o
adders_8_signed_add8s_7EL.c:1:2: error: #error Do not use this file, it is the result of a failed Cython compilation.

Solutions

Both issues are easy fixes.

  1. The warning can be fixed by setting the language_level directive in each generated .pyx file: https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#globally. This can be added in the file generation
  2. I have used this additional RegEx: re.sub(r'\/\*[\w\d -]*\*\/', '', m) in the generation of the function header to remove the inline comments altogether

With these changes, compilation works without issues for me.
If you want to upstream these fixes, I can open a PR.

Certain 8-bit signed multipliers use unsigned inputs/output

Hello,

C-files for 1L2J, 1L2L and 1L2N 8-bit signed multipliers in MAE vs power set have uint8_t inputs and uint16_t outputs, which leads to incorrect results when values <0 are passed to them. Every other C-file has int8_t and int16_t and works completely fine. Looks like, that simply changing output and O to int16_t and inputs to int8_t, fixes the issue.

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.