whitews / FlowUtils

FlowUtils is a Python package containing various utility functions related to flow cytometry analysis, primarily focused on compensation and transformation tasks commonly used within the flow community.
https://flowutils.readthedocs.io
BSD 3-Clause "New" or "Revised" License
14 stars 8 forks source link

installation error (implicit declaration invalid) #5

Closed mauricelanghinrichs closed 3 years ago

mauricelanghinrichs commented 3 years ago

Hi,

first, thanks very much for this effort to provide open facs analysis tools! We are in need for some of the transformation functions (e.g., Logicle), offered in the higher-level module flowkit. However I got an error message in the installation process. The error is caused by the flowutils installation. The relevant line might be:

flowutils/logicle_c_ext/_logicle.c:120:5: error: implicit declaration of function 'hyperlog_inverse' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        hyperlog_inverse(t, w, m, a, xc, n);

Do you know what's going on here and can help us out? Thanks a lot in advance. The full error message is below. My system is macOS Catalina, python 3.8.8, numpy 1.19.2.

Collecting flowutils
  Using cached FlowUtils-0.9.1.tar.gz (11 kB)
Requirement already satisfied: numpy>=1.7 in ./opt/anaconda3/envs/sc_env/lib/python3.8/site-packages (from flowutils) (1.19.2)
Building wheels for collected packages: flowutils
  Building wheel for flowutils (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/user/opt/anaconda3/envs/sc_env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/d6/cn_12s513fj8dymm3xy_tdy9mskn84/T/pip-install-4ev728v7/flowutils_c66ffa7ac87d488f9f05705abe9735a0/setup.py'"'"'; __file__='"'"'/private/var/folders/d6/cn_12s513fj8dymm3xy_tdy9mskn84/T/pip-install-4ev728v7/flowutils_c66ffa7ac87d488f9f05705abe9735a0/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/d6/cn_12s513fj8dymm3xy_tdy9mskn84/T/pip-wheel-dpauxvfu
       cwd: /private/var/folders/d6/cn_12s513fj8dymm3xy_tdy9mskn84/T/pip-install-4ev728v7/flowutils_c66ffa7ac87d488f9f05705abe9735a0/
  Complete output (31 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.8
  creating build/lib.macosx-10.9-x86_64-3.8/flowutils
  copying flowutils/transforms.py -> build/lib.macosx-10.9-x86_64-3.8/flowutils
  copying flowutils/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/flowutils
  copying flowutils/compensate.py -> build/lib.macosx-10.9-x86_64-3.8/flowutils
  running build_ext
  building 'flowutils.logicle_c' extension
  creating build/temp.macosx-10.9-x86_64-3.8
  creating build/temp.macosx-10.9-x86_64-3.8/flowutils
  creating build/temp.macosx-10.9-x86_64-3.8/flowutils/logicle_c_ext
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/user/opt/anaconda3/envs/sc_env/include -arch x86_64 -I/Users/user/opt/anaconda3/envs/sc_env/include -arch x86_64 -I/Users/user/opt/anaconda3/envs/sc_env/lib/python3.8/site-packages/numpy/core/include -Iflowutils/logicle_c_ext -I/Users/user/opt/anaconda3/envs/sc_env/include/python3.8 -c flowutils/logicle_c_ext/_logicle.c -o build/temp.macosx-10.9-x86_64-3.8/flowutils/logicle_c_ext/_logicle.o -std=c99
  In file included from flowutils/logicle_c_ext/_logicle.c:2:
  In file included from /Users/user/opt/anaconda3/envs/sc_env/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4:
  In file included from /Users/user/opt/anaconda3/envs/sc_env/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
  In file included from /Users/user/opt/anaconda3/envs/sc_env/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:
  /Users/user/opt/anaconda3/envs/sc_env/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
  #warning "Using deprecated NumPy API, disable it with " \
   ^
  flowutils/logicle_c_ext/_logicle.c:120:5: error: implicit declaration of function 'hyperlog_inverse' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      hyperlog_inverse(t, w, m, a, xc, n);
      ^
  flowutils/logicle_c_ext/_logicle.c:120:5: note: did you mean 'wrap_hyperlog_inverse'?
  flowutils/logicle_c_ext/_logicle.c:95:18: note: 'wrap_hyperlog_inverse' declared here
  static PyObject *wrap_hyperlog_inverse(PyObject *self, PyObject *args) {
                   ^
  1 warning and 1 error generated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for flowutils
  Running setup.py clean for flowutils
Failed to build flowutils
Installing collected packages: flowutils
    Running setup.py install for flowutils ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/user/opt/anaconda3/envs/sc_env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/d6/cn_12s513fj8dymm3xy_tdy9mskn84/T/pip-install-4ev728v7/flowutils_c66ffa7ac87d488f9f05705abe9735a0/setup.py'"'"'; __file__='"'"'/private/var/folders/d6/cn_12s513fj8dymm3xy_tdy9mskn84/T/pip-install-4ev728v7/flowutils_c66ffa7ac87d488f9f05705abe9735a0/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/d6/cn_12s513fj8dymm3xy_tdy9mskn84/T/pip-record-jq9qby7j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/user/opt/anaconda3/envs/sc_env/include/python3.8/flowutils
         cwd: /private/var/folders/d6/cn_12s513fj8dymm3xy_tdy9mskn84/T/pip-install-4ev728v7/flowutils_c66ffa7ac87d488f9f05705abe9735a0/
    Complete output (31 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.9-x86_64-3.8
    creating build/lib.macosx-10.9-x86_64-3.8/flowutils
    copying flowutils/transforms.py -> build/lib.macosx-10.9-x86_64-3.8/flowutils
    copying flowutils/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/flowutils
    copying flowutils/compensate.py -> build/lib.macosx-10.9-x86_64-3.8/flowutils
    running build_ext
    building 'flowutils.logicle_c' extension
    creating build/temp.macosx-10.9-x86_64-3.8
    creating build/temp.macosx-10.9-x86_64-3.8/flowutils
    creating build/temp.macosx-10.9-x86_64-3.8/flowutils/logicle_c_ext
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/user/opt/anaconda3/envs/sc_env/include -arch x86_64 -I/Users/user/opt/anaconda3/envs/sc_env/include -arch x86_64 -I/Users/user/opt/anaconda3/envs/sc_env/lib/python3.8/site-packages/numpy/core/include -Iflowutils/logicle_c_ext -I/Users/user/opt/anaconda3/envs/sc_env/include/python3.8 -c flowutils/logicle_c_ext/_logicle.c -o build/temp.macosx-10.9-x86_64-3.8/flowutils/logicle_c_ext/_logicle.o -std=c99
    In file included from flowutils/logicle_c_ext/_logicle.c:2:
    In file included from /Users/user/opt/anaconda3/envs/sc_env/lib/python3.8/site-packages/numpy/core/include/numpy/arrayobject.h:4:
    In file included from /Users/user/opt/anaconda3/envs/sc_env/lib/python3.8/site-packages/numpy/core/include/numpy/ndarrayobject.h:12:
    In file included from /Users/user/opt/anaconda3/envs/sc_env/lib/python3.8/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822:
    /Users/user/opt/anaconda3/envs/sc_env/lib/python3.8/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with "          "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
    #warning "Using deprecated NumPy API, disable it with " \
     ^
    flowutils/logicle_c_ext/_logicle.c:120:5: error: implicit declaration of function 'hyperlog_inverse' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        hyperlog_inverse(t, w, m, a, xc, n);
        ^
    flowutils/logicle_c_ext/_logicle.c:120:5: note: did you mean 'wrap_hyperlog_inverse'?
    flowutils/logicle_c_ext/_logicle.c:95:18: note: 'wrap_hyperlog_inverse' declared here
    static PyObject *wrap_hyperlog_inverse(PyObject *self, PyObject *args) {
                     ^
    1 warning and 1 error generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/user/opt/anaconda3/envs/sc_env/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/d6/cn_12s513fj8dymm3xy_tdy9mskn84/T/pip-install-4ev728v7/flowutils_c66ffa7ac87d488f9f05705abe9735a0/setup.py'"'"'; __file__='"'"'/private/var/folders/d6/cn_12s513fj8dymm3xy_tdy9mskn84/T/pip-install-4ev728v7/flowutils_c66ffa7ac87d488f9f05705abe9735a0/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/d6/cn_12s513fj8dymm3xy_tdy9mskn84/T/pip-record-jq9qby7j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/user/opt/anaconda3/envs/sc_env/include/python3.8/flowutils Check the logs for full command output.
mauricelanghinrichs commented 3 years ago

ok I think I got it fixed... adding the line

void hyperlog_inverse(double t, double w, double m, double a, double* x, int n);

in the logicle.h file did the job for me. You have already initialised the other functions there, so maybe hyperlog_inverse was just forgotten.

andreas-wilm commented 3 years ago

Same problem here. Fix worked for me as well

lorenzgerber commented 3 years ago

Here too, fixe worked.

whitews commented 3 years ago

Hi all,

Sorry to be late to this thread, I never got a notification from GitHub. Indeed, this was a simple omission on my part. I'll create a new minor release today with this fix.

Thanks for reporting this and submitting the PR fix! All the feedback and contributions are very much appreciated, Scott