ehw-fit / evoapproxlib Goto Github PK
View Code? Open in Web Editor NEWLibrary of approximate arithmetic circuits
Home Page: https://ehw.fit.vutbr.cz/evoapprox
License: MIT License
Library of approximate arithmetic circuits
Home Page: https://ehw.fit.vutbr.cz/evoapprox
License: MIT License
Hi, I was attempting a vanilla install of your library and observed several problems which are described below
Ubuntu 22.04 WSL
Python: 3.9.12
Cython: 0.29.28
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
Successful Install
There are several problems occuring
/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
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
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.
Both issues are easy fixes.
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 generationre.sub(r'\/\*[\w\d -]*\*\/', '', m)
in the generation of the function header to remove the inline comments altogetherWith these changes, compilation works without issues for me.
If you want to upstream these fixes, I can open a PR.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.