mckib2 / pygrappa

Python implementations of GRAPPA-like algorithms.
https://pygrappa.readthedocs.io/en/latest/
MIT License
64 stars 13 forks source link

PyGrappa Setup Barfs on CentOS 7 #29

Closed ellestad closed 5 years ago

ellestad commented 5 years ago

PyGrappa Setup Barfs on CentOS 7, python36.

Installing collected packages: pygrappa
  Running setup.py install for pygrappa ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python36 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sm_cp7o2/pygrappa/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sm_cp7o2/pygrappa/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-vyb4bb48/install-record.txt --single-version-externally-managed --compile --user --prefix=
         cwd: /tmp/pip-install-sm_cp7o2/pygrappa/
    Complete output (47 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/tests
    copying tests/test_basic_recon.py -> build/lib.linux-x86_64-3.6/tests
    copying tests/benchmark.py -> build/lib.linux-x86_64-3.6/tests
    copying tests/__init__.py -> build/lib.linux-x86_64-3.6/tests
    copying tests/test_validP_issue.py -> build/lib.linux-x86_64-3.6/tests
    creating build/lib.linux-x86_64-3.6/utils
    copying utils/disjoint_csm.py -> build/lib.linux-x86_64-3.6/utils
    copying utils/__init__.py -> build/lib.linux-x86_64-3.6/utils
    copying utils/gaussian_csm.py -> build/lib.linux-x86_64-3.6/utils
    creating build/lib.linux-x86_64-3.6/pygrappa
    copying pygrappa/tgrappa.py -> build/lib.linux-x86_64-3.6/pygrappa
    copying pygrappa/grappaop.py -> build/lib.linux-x86_64-3.6/pygrappa
    copying pygrappa/slicegrappa.py -> build/lib.linux-x86_64-3.6/pygrappa
    copying pygrappa/vcgrappa.py -> build/lib.linux-x86_64-3.6/pygrappa
    copying pygrappa/igrappa.py -> build/lib.linux-x86_64-3.6/pygrappa
    copying pygrappa/splitslicegrappa.py -> build/lib.linux-x86_64-3.6/pygrappa
    copying pygrappa/grappa.py -> build/lib.linux-x86_64-3.6/pygrappa
    copying pygrappa/seggrappa.py -> build/lib.linux-x86_64-3.6/pygrappa
    copying pygrappa/hpgrappa.py -> build/lib.linux-x86_64-3.6/pygrappa
    copying pygrappa/__init__.py -> build/lib.linux-x86_64-3.6/pygrappa
    copying pygrappa/lustig_grappa.py -> build/lib.linux-x86_64-3.6/pygrappa
    running build_ext
    building 'pygrappa.cgrappa' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Isrc/ -I/usr/include/python3.6m -I/xxx/xxx/.local/lib/python3.6/site-packages/numpy/core/include -c src/cgrappa.cpp -o build/temp.linux-x86_64-3.6/src/cgrappa.o
    In file included from /xxx/xxx/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1830:0,
                     from /xxx/xxx/.local/lib/python3.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                     from /xxx/xxx/.local/lib/python3.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from src/cgrappa.cpp:636:
    /xxx/xxx/.local/lib/python3.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     #warning "Using deprecated NumPy API, disable it with " \
      ^
    gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Isrc/ -I/usr/include/python3.6m -I/xxx/xxx/.local/lib/python3.6/site-packages/numpy/core/include -c src/get_sampling_patterns.cpp -o build/temp.linux-x86_64-3.6/src/get_sampling_patterns.o
    src/get_sampling_patterns.cpp: In function ‘std::map<long long unsigned int, std::vector<unsigned int> > get_sampling_patterns(int*, unsigned int, unsigned int, unsigned int, unsigned int)’:
    src/get_sampling_patterns.cpp:45:17: error: ‘stderr’ was not declared in this scope
             fprintf(stderr, "Something wild is happening with kernel size, choosing (ksx, ksy) = (5, 5).\n");
                     ^
    src/get_sampling_patterns.cpp:45:104: error: ‘fprintf’ was not declared in this scope
             fprintf(stderr, "Something wild is happening with kernel size, choosing (ksx, ksy) = (5, 5).\n");
                                                                                                            ^
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python36 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sm_cp7o2/pygrappa/setup.py'"'"'; __file__='"'"'/tmp/pip-install-sm_cp7o2/pygrappa/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-vyb4bb48/install-record.txt --single-version-externally-managed --compile --user --prefix= Check the logs for full command output.
mckib2 commented 5 years ago

I think I found the issue: missing header stdio.h in get_sampling_patterns.cpp. Starting up a CentOS 7 docker image now to verify fix

mckib2 commented 5 years ago

Test steps:

Seems to be working with bug fix found in pygrappa version 0.11.1.

Please let me know if the new release resolves this issue.

mckib2 commented 5 years ago

Encoding issues fixed with version 0.11.2.

ellestad commented 5 years ago

Thanks! With your added suggestions I was able to get pygrappa to install in python36 on CentOS 7.