dfeneyrou / palanteer

Visual Python and C++ nanosecond profiler, logger, tests enabler
Other
2.1k stars 88 forks source link

pip install palanteer fails #40

Open tejus26 opened 2 years ago

tejus26 commented 2 years ago

Hello, I am trying to install palanteer package but im hitting the below issue. Any pointers would be greatly appreciated.

Installing collected packages: palanteer
  Running setup.py install for palanteer ... error
  error: subprocess-exited-with-error

  × Running setup.py install for palanteer did not run successfully.
  │ exit code: 1
  ╰─> [35 lines of output]
      running install
      /proj/xsjsswstaff/tejuss/miniconda3/lib/python3.7/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        setuptools.SetuptoolsDeprecationWarning,
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.7
      creating build/lib.linux-x86_64-3.7/palanteer
      copying palanteer/__main__.py -> build/lib.linux-x86_64-3.7/palanteer
      copying palanteer/__init__.py -> build/lib.linux-x86_64-3.7/palanteer
      running build_ext
      building 'palanteer._cextension' extension
      creating build/temp.linux-x86_64-3.7
      creating build/temp.linux-x86_64-3.7/palanteer
      creating build/temp.linux-x86_64-3.7/palanteer/_cextension
      /proj/xsjsswstaff/tejuss/miniconda3/bin/x86_64-conda_cos6-linux-gnu-cc -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -ffunction-sections -pipe -isystem /proj/xsjsswstaff/tejuss/miniconda3/include -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem /proj/xsjsswstaff/tejuss/miniconda3/include -fPIC -I/proj/xsjsswstaff/tejuss/miniconda3/include/python3.7m -c palanteer/_cextension/pyPalanteerInstrumentation.cpp -o build/temp.linux-x86_64-3.7/palanteer/_cextension/pyPalanteerInstrumentation.o -I palanteer/_cextension
      cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++
      In file included from palanteer/_cextension/pyPalanteerInstrumentation.cpp:46:0:
      palanteer/_cextension/palanteer.h: In member function 'void plPriv::CliManager::registerCli(plCliHandler_t, const char*, const char*, const char*, plPriv::hashStr_t, plPriv::hashStr_t, plPriv::hashStr_t)':
      palanteer/_cextension/palanteer.h:2440:55: error: expected ')' before 'PRId64'
                               int readQty = sscanf(s, "[[%" PRId64 "]]", &p.defaultValue);
                                                             ^~~~~~
      palanteer/_cextension/palanteer.h:2440:83: warning: spurious trailing '%' in format [-Wformat=]
                               int readQty = sscanf(s, "[[%" PRId64 "]]", &p.defaultValue);
                                                                                         ^
      palanteer/_cextension/palanteer.h:2440:83: warning: too many arguments for format [-Wformat-extra-args]
      palanteer/_cextension/palanteer.h: In member function 'const char* plPriv::CliManager::execute(const char*, plPriv::plRemoteStatus&)':
      palanteer/_cextension/palanteer.h:2537:42: error: expected ')' before 'PRId64'
                               if(sscanf(s, "%" PRId64, &_cio._paramValues[paramIdx])!=1 || !skipValue(s))
                                                ^~~~~~
      palanteer/_cextension/palanteer.h:2537:78: warning: spurious trailing '%' in format [-Wformat=]
                               if(sscanf(s, "%" PRId64, &_cio._paramValues[paramIdx])!=1 || !skipValue(s))
                                                                                    ^
      palanteer/_cextension/palanteer.h:2537:78: warning: too many arguments for format [-Wformat-extra-args]
      error: command '/proj/xsjsswstaff/tejuss/miniconda3/bin/x86_64-conda_cos6-linux-gnu-cc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> palanteer

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure. 
tejus26 commented 2 years ago

I am trying to install this with python3.7 on a Ubuntu 20.04 machine.

dfeneyrou commented 2 years ago

I never tried to build the python packages with conda, what we can see in your log is that the C++ header cinttype does not contains the macros PRIx64, which are defined from C++11. The hypothesis is then that the used compiler x86_64-conda_cos6-linux-gnu-cc uses a defaut C++ standard before 11. The commit above is explicitely stating the C++ version to use. If you used the source from github, can you give it a try?

tejus26 commented 2 years ago

I still the same issue ? I tried to install it using this command: python -m pip install 'palanteer @ git+https://github.com/dfeneyrou/palanteer#subdirectory=python'

I see std=c++11 being passed correctly though.

dfeneyrou commented 2 months ago

I had to revert the previous tentative because it was creating other issues (the flag was passed also to C compilation units...). I do not understand your environment, the "PRI" macros should be present in the compiler inttypes.h header...