Uwsgi resolve errors caused by the installation version

Error message:

Building wheels for collected packages: uWSGI
  Running setup.py bdist_wheel for uWSGI ... error
  Complete output from command /home/zoli/work/app-env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-WD5K_N/uWSGI/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 /tmp/tmpUZCgPFpip-wheel- --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-2.7
  copying uwsgidecorators.py -> build/lib.linux-x86_64-2.7
  installing to build/bdist.linux-x86_64/wheel
  running install
  using profile: buildconf/default.this
  detected include path: ['/usr/lib/gcc/x86_64-linux-gnu/7/include', '/usr/local/include', '/usr/lib/gcc/x86_64-linux-gnu/7/include-fixed', '/usr/include/x86_64-linux-gnu', '/usr/include']
  Patching "bin_name" to properly install_scripts dir
  detected CPU cores: 8
  configured CFLAGS: -O2 -I. -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -DUWSGI_HAS_IFADDRS -DUWSGI_ZLIB -DUWSGI_LOCK_USE_MUTEX -DUWSGI_EVENT_USE_EPOLL -DUWSGI_EVENT_TIMER_USE_TIMERFD -DUWSGI_EVENT_FILEMONITOR_USE_INOTIFY -DUWSGI_VERSION="\"2.0.13.1\"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="13" -DUWSGI_VERSION_REVISION="1" -DUWSGI_VERSION_CUSTOM="\"\"" -DUWSGI_YAML -DUWSGI_SSL -DUWSGI_XML -DUWSGI_XML_EXPAT -DUWSGI_PLUGIN_DIR="\".\"" -DUWSGI_DECLARE_EMBEDDED_PLUGINS="UDEP(python);UDEP(gevent);UDEP(ping);UDEP(cache);UDEP(nagios);UDEP(rrdtool);UDEP(carbon);UDEP(rpc);UDEP(corerouter);UDEP(fastrouter);UDEP(http);Udep (ugreen); udep (signal); udep (syslog); udep (rsyslog); udep (logsocket); udep (router_uwsgi); udep (router_redirect); udep (router_basicauth); udep (zergpool); udep (redislog); udep (mongodblog); udep (router_rewrite); udep (router_http); udep (logfile); udep (router_cache); udep (rawrouter); udep (router_static); udep (sslrouter); udep (spooler); udep (cheaper_busyness); udep (symcall); udep (transformation_tofile); udep (transformation_gzip); udep (transformation_chunked); udep (transformation_offload); udep (router_memcached); udep (router_redis); udep (router_hash); udep (router_expires); udep (router_metrics); udep (transformation_template); udep (stats_pusher_socket); "-DUWSGI_LOAD_EMBEDDED_PLUGINS =" ULEP (python); ULEP (gevent); ULEP (ping); ULEP (cache); ULEP (Nagios); ULEP (rrdtool); ULEP (carbon); ULEP (RPC); ULEP (corerouter); ULEP (fastrouter); ULEP (http); ULEP (ugreen); ULEP (signal); ULEP (syslog);ULEP(rsyslog);ULEP(logsocket);ULEP(router_uwsgi);ULEP(router_redirect);ULEP(router_basicauth);ULEP(zergpool);ULEP(redislog);ULEP(mongodblog);ULEP(router_rewrite);ULEP(router_http);ULEP(logfile);ULEP(router_cache);ULEP(rawrouter);ULEP(router_static);ULEP(sslrouter);ULEP(spooler);ULEP(cheaper_busyness);ULEP(symcall);ULEP(transformation_tofile);ULEP(transformation_gzip);ULEP(transformation_chunked);ULEP(transformation_offload);ULEP(router_memcached);ULEP(router_redis);ULEP(router_hash);ULEP(router_expires);ULEP(router_metrics);ULEP(transformation_template);ULEP(stats_pusher_socket);"ULEP(spooler);ULEP(cheaper_busyness);ULEP(symcall);ULEP(transformation_tofile);ULEP(transformation_gzip);ULEP(transformation_chunked);ULEP(transformation_offload);ULEP(router_memcached);ULEP(router_redis);ULEP(router_hash);ULEP(router_expires);ULEP(router_metrics);ULEP(transformation_template);ULEP(stats_pusher_socket);"ULEP(spooler);ULEP(cheaper_busyness);ULEP(symcall);ULEP(transformation_tofile);ULEP(transformation_gzip);ULEP(transformation_chunked);ULEP(transformation_offload);ULEP(router_memcached);ULEP(router_redis);ULEP(router_hash);ULEP(router_expires);ULEP(router_metrics);ULEP(transformation_template);ULEP(stats_pusher_socket);"
  *** uWSGI compiling server core ***
  [thread 0][x86_64-linux-gnu-gcc -pthread] core/utils.o
  [thread 2][x86_64-linux-gnu-gcc -pthread] core/protocol.o
  [thread 3][x86_64-linux-gnu-gcc -pthread] core/socket.o
  [thread 5][x86_64-linux-gnu-gcc -pthread] core/logging.o
  [thread 6][x86_64-linux-gnu-gcc -pthread] core/master.o
  [thread 4][x86_64-linux-gnu-gcc -pthread] core/master_utils.o
  [thread 1][x86_64-linux-gnu-gcc -pthread] core/emperor.o
  [thread 7][x86_64-linux-gnu-gcc -pthread] core/notify.o
  [thread 7][x86_64-linux-gnu-gcc -pthread] core/mule.o
  [thread 2][x86_64-linux-gnu-gcc -pthread] core/subscription.o
  [thread 6][x86_64-linux-gnu-gcc -pthread] core/stats.o
  [thread 7][x86_64-linux-gnu-gcc -pthread] core/sendfile.o
  [thread 4][x86_64-linux-gnu-gcc -pthread] core/async.o
  [thread 7][x86_64-linux-gnu-gcc -pthread] core/master_checks.o
  [thread 5][x86_64-linux-gnu-gcc -pthread] core/fifo.o
  [thread 3][x86_64-linux-gnu-gcc -pthread] core/offload.o
  [thread 6][x86_64-linux-gnu-gcc -pthread] core/io.o
  [thread 1][x86_64-linux-gnu-gcc -pthread] core/static.o
  [thread 2][x86_64-linux-gnu-gcc -pthread] core/websockets.o
  [thread 5][x86_64-linux-gnu-gcc -pthread] core/spooler.o
  [thread 4][x86_64-linux-gnu-gcc -pthread] core/snmp.o
  [thread 7][x86_64-linux-gnu-gcc -pthread] core/exceptions.o
  [thread 3][x86_64-linux-gnu-gcc -pthread] core/config.o
  [thread 1][x86_64-linux-gnu-gcc -pthread] core/setup_utils.o
  [thread 2][x86_64-linux-gnu-gcc -pthread] core/clock.o
  [thread 4][x86_64-linux-gnu-gcc -pthread] core/init.o
  [thread 5][x86_64-linux-gnu-gcc -pthread] core/buffer.o
  [thread 7][x86_64-linux-gnu-gcc -pthread] core/reader.o
  [thread 2][x86_64-linux-gnu-gcc -pthread] core/writer.o
  [thread 1][x86_64-linux-gnu-gcc -pthread] core/alarm.o
  [thread 0][x86_64-linux-gnu-gcc -pthread] core/cron.o
  [thread 6][x86_64-linux-gnu-gcc -pthread] core/hooks.o
  [thread 3][x86_64-linux-gnu-gcc -pthread] core/plugins.o
  [thread 4][x86_64-linux-gnu-gcc -pthread] core/lock.o
  [thread 5][x86_64-linux-gnu-gcc -pthread] core/cache.o
  [thread 0][x86_64-linux-gnu-gcc -pthread] core/daemons.o
  [thread 7][x86_64-linux-gnu-gcc -pthread] core/errors.o
  [thread 1][x86_64-linux-gnu-gcc -pthread] core/hash.o
  [thread 3][x86_64-linux-gnu-gcc -pthread] core/master_events.o
  [thread 6][x86_64-linux-gnu-gcc -pthread] core/chunked.o
  [thread 2][x86_64-linux-gnu-gcc -pthread] core/queue.o
  core/hash.c: In function ‘murmur2_hash’:
  core/hash.c:44:13: error: this statement may fall through [-Werror=implicit-fallthrough=]
             h ^= key[2] << 16;
             ~~^~~~~~~~~~~~~~~
  core/hash.c:45:7: note: here
         case 2:
         ^~~~
  core/hash.c:46:13: error: this statement may fall through [-Werror=implicit-fallthrough=]
             h ^= key[1] << 8;
             ~~^~~~~~~~~~~~~~
  core/hash.c:47:7: note: here
         case 1:
         ^~~~
  [thread 4][x86_64-linux-gnu-gcc -pthread] core/event.o
  [thread 7][x86_64-linux-gnu-gcc -pthread] core/signal.o
  cc1: all warnings being treated as errors
  
  ----------------------------------------
  Failed building wheel for uWSGI
  Running setup.py clean for uWSGI
Failed to build uWSGI
解决方法:
错误是由于默认安装时CFLAGS是开启的状态,需要在安装前将改选项关闭,采用如下安装方式
CFLAGS=-Wno-error pip install uWSGI==2.0.11.2

 




Guess you like

Origin www.cnblogs.com/fxm1/p/11250306.html