mod-wsgi install時に「error: command ‘gcc’ failed with exit status 1」
今回はpipを使ってmod-wsgiをインストールしようとしたときに下記のエラーが出たときの対処法についてお伝えいたします。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 |
Building wheels for collected packages: coreschema, django-rest-auth, jaconv, mod-wsgi Building wheel for coreschema (setup.py) ... done Created wheel for coreschema: filename=coreschema-0.0.4-py3-none-any.whl size=15032 sha256=dc78b339c1acff79387b13790fad9e6bfdc74172cdc01f940d4b7597a340dcc8 Stored in directory: /root/.cache/pip/wheels/37/21/45/2ce3dd0189e3d2fb7a325b9d3e6491acb7882c8275466d5401 Building wheel for django-rest-auth (setup.py) ... done Created wheel for django-rest-auth: filename=django_rest_auth-0.9.5-py2.py3-none-any.whl size=86822 sha256=10378969f1112cdf92c325b0ac7479fb2d65a2425712cf3e1d882ca2d48dce54 Stored in directory: /root/.cache/pip/wheels/59/4e/ce/ccf0412a363df17968daedd4275064dfbace4e947f75780f80 Building wheel for jaconv (setup.py) ... done Created wheel for jaconv: filename=jaconv-0.3-py3-none-any.whl size=15550 sha256=9b7dc17a5c3b40e06b84ff24f089d4fd8296d68b63c752250e1e0885fec100a4 Stored in directory: /root/.cache/pip/wheels/73/e8/fb/b4ad8117719f79ac73bc05406d1768f845688cdbeed7aad87e Building wheel for mod-wsgi (setup.py) ... error error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [189 lines of output] WARNING: The Python installation you are using does not appear to have been installed with a shared library, or in the case of MacOS X, as a framework. Where these are not present, the compilation of mod_wsgi may fail, or if it does succeed, will result in extra memory being used by all processes at run time as a result of the static library needing to be loaded in its entirety to every process. It is highly recommended that you reinstall the Python installation being used from source code, supplying the '--enable-shared' option to the 'configure' script when configuring the source code prior to building and installing it. running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.8 creating build/lib.linux-x86_64-3.8/mod_wsgi copying src/__init__.py -> build/lib.linux-x86_64-3.8/mod_wsgi creating build/lib.linux-x86_64-3.8/mod_wsgi/server copying src/server/apxs_config.py -> build/lib.linux-x86_64-3.8/mod_wsgi/server copying src/server/__init__.py -> build/lib.linux-x86_64-3.8/mod_wsgi/server copying src/server/environ.py -> build/lib.linux-x86_64-3.8/mod_wsgi/server creating build/lib.linux-x86_64-3.8/mod_wsgi/server/management copying src/server/management/__init__.py -> build/lib.linux-x86_64-3.8/mod_wsgi/server/management creating build/lib.linux-x86_64-3.8/mod_wsgi/server/management/commands copying src/server/management/commands/__init__.py -> build/lib.linux-x86_64-3.8/mod_wsgi/server/management/commands copying src/server/management/commands/runmodwsgi.py -> build/lib.linux-x86_64-3.8/mod_wsgi/server/management/commands creating build/lib.linux-x86_64-3.8/mod_wsgi/docs copying docs/_build/html/__init__.py -> build/lib.linux-x86_64-3.8/mod_wsgi/docs creating build/lib.linux-x86_64-3.8/mod_wsgi/images copying images/__init__.py -> build/lib.linux-x86_64-3.8/mod_wsgi/images copying images/snake-whiskey.jpg -> build/lib.linux-x86_64-3.8/mod_wsgi/images running build_ext building 'mod_wsgi.server.mod_wsgi-py38' extension creating build/temp.linux-x86_64-3.8 creating build/temp.linux-x86_64-3.8/src creating build/temp.linux-x86_64-3.8/src/server gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/wsgi_convert.c -o build/temp.linux-x86_64-3.8/src/server/wsgi_convert.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/wsgi_buckets.c -o build/temp.linux-x86_64-3.8/src/server/wsgi_buckets.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/wsgi_memory.c -o build/temp.linux-x86_64-3.8/src/server/wsgi_memory.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/wsgi_daemon.c -o build/temp.linux-x86_64-3.8/src/server/wsgi_daemon.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/wsgi_apache.c -o build/temp.linux-x86_64-3.8/src/server/wsgi_apache.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/wsgi_stream.c -o build/temp.linux-x86_64-3.8/src/server/wsgi_stream.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/wsgi_server.c -o build/temp.linux-x86_64-3.8/src/server/wsgi_server.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/wsgi_restrict.c -o build/temp.linux-x86_64-3.8/src/server/wsgi_restrict.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/wsgi_validate.c -o build/temp.linux-x86_64-3.8/src/server/wsgi_validate.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/wsgi_interp.c -o build/temp.linux-x86_64-3.8/src/server/wsgi_interp.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/mod_wsgi.c -o build/temp.linux-x86_64-3.8/src/server/mod_wsgi.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 src/server/mod_wsgi.c: In function ‘wsgi_socket_sendv’: src/server/mod_wsgi.c:11063:46: warning: operand of ‘?:’ changes signedness from ‘int’ to ‘size_t’ {aka ‘long unsigned int’} due to unsignedness of other operand [-Wsign-compare] 11063 | (nvec < iov_max ? nvec : (int)iov_max)); | ^~~~~~~~~~~~ src/server/mod_wsgi.c: In function ‘wsgi_scan_headers’: src/server/mod_wsgi.c:11222:23: warning: operand of ‘?:’ changes signedness from ‘int’ to ‘long unsigned int’ due to unsignedness of other operand [-Wsign-compare] 11222 | buflen = buffer ? buflen : sizeof(x); | ^~~~~~ gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/wsgi_metrics.c -o build/temp.linux-x86_64-3.8/src/server/wsgi_metrics.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/wsgi_logger.c -o build/temp.linux-x86_64-3.8/src/server/wsgi_logger.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/opt/python3/include/python3.8 -c src/server/wsgi_thread.c -o build/temp.linux-x86_64-3.8/src/server/wsgi_thread.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -Wall -I/usr/include/apr-1 -I/usr/include/apr-1 gcc -shared build/temp.linux-x86_64-3.8/src/server/wsgi_convert.o build/temp.linux-x86_64-3.8/src/server/wsgi_buckets.o build/temp.linux-x86_64-3.8/src/server/wsgi_memory.o build/temp.linux-x86_64-3.8/src/server/wsgi_daemon.o build/temp.linux-x86_64-3.8/src/server/wsgi_apache.o build/temp.linux-x86_64-3.8/src/server/wsgi_stream.o build/temp.linux-x86_64-3.8/src/server/wsgi_server.o build/temp.linux-x86_64-3.8/src/server/wsgi_restrict.o build/temp.linux-x86_64-3.8/src/server/wsgi_validate.o build/temp.linux-x86_64-3.8/src/server/wsgi_interp.o build/temp.linux-x86_64-3.8/src/server/mod_wsgi.o build/temp.linux-x86_64-3.8/src/server/wsgi_metrics.o build/temp.linux-x86_64-3.8/src/server/wsgi_logger.o build/temp.linux-x86_64-3.8/src/server/wsgi_thread.o -Wl,--enable-new-dtags,-R/opt/python3/lib -Wl,--enable-new-dtags,-R/opt/python3/lib/python3.8/config -o build/lib.linux-x86_64-3.8/mod_wsgi/server/mod_wsgi-py38.cpython-38-x86_64-linux-gnu.so -L/opt/python3/lib -L/opt/python3/lib/python3.8/config -lpython3.8 /usr/bin/ld: /opt/python3/lib/libpython3.8.a(abstract.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(boolobject.o): relocation R_X86_64_32S against symbol `_Py_FalseStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(bytearrayobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(bytesobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(call.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(capsule.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(codeobject.o): relocation R_X86_64_32S against symbol `PyUnicode_Type' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(complexobject.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(exceptions.o): relocation R_X86_64_32S against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(fileobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(floatobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(frameobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(iterobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(listobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(longobject.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(dictobject.o): relocation R_X86_64_32S against `.text.hot' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(memoryobject.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(methodobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(moduleobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(object.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(obmalloc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(picklebufobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(rangeobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(setobject.o): relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(sliceobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(structseq.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(tupleobject.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(typeobject.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(unicodeobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(unicodectype.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(weakrefobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(_warnings.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(ceval.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(codecs.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(compile.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(errors.o): relocation R_X86_64_32S against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(future.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(getargs.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(getversion.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(import.o): relocation R_X86_64_32S against symbol `PyModule_Type' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(importdl.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(initconfig.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(marshal.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(modsupport.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(mystrtoul.o): relocation R_X86_64_32S against symbol `_Py_ctype_table' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(pathconfig.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(peephole.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(preconfig.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(pyhash.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(pylifecycle.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(pystate.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(pythonrun.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(pytime.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(bootstrap_hash.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(symtable.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(sysmodule.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(thread.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(traceback.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(getopt.o): relocation R_X86_64_32S against `.rodata.str4.4' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(pystrtod.o): relocation R_X86_64_32S against `.LC1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(pystrhex.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(dtoa.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(formatter_unicode.o): relocation R_X86_64_32S against symbol `_Py_ctype_table' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(fileutils.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(dynload_shlib.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(getpath.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(gcmodule.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(posixmodule.o): relocation R_X86_64_32S against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(errnomodule.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(pwdmodule.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(_sre.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(_codecsmodule.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(_weakref.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(_functoolsmodule.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(_operator.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(_collectionsmodule.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(_abc.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(itertoolsmodule.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(atexitmodule.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(signalmodule.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(_stat.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(timemodule.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(_threadmodule.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(_localemodule.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(_iomodule.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(iobase.o): relocation R_X86_64_32 against symbol `_Py_FalseStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(fileio.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(bytesio.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(bufferedio.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(textio.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(stringio.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(faulthandler.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(_tracemalloc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(hashtable.o): relocation R_X86_64_32 against symbol `PyMem_RawFree' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(symtablemodule.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(xxsubtype.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(getbuildinfo.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(acceler.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(grammar1.o): relocation R_X86_64_32S against symbol `_PyParser_TokenNames' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(token.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(parsetok.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(tokenizer.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(accu.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(bytes_methods.o): relocation R_X86_64_32S against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(cellobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(classobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(descrobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(enumobject.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(genobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(funcobject.o): relocation R_X86_64_32S against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(interpreteridobject.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(odictobject.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(namespaceobject.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(Python-ast.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(ast.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(ast_opt.o): relocation R_X86_64_32S against symbol `PyFrozenSet_Type' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(ast_unparse.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(bltinmodule.o): relocation R_X86_64_32S against symbol `PyFilter_Type' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(context.o): relocation R_X86_64_32 against symbol `PyContext_Type' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(getcompiler.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(getcopyright.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(getplatform.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(hamt.o): relocation R_X86_64_32S against symbol `_PyHamt_BitmapNode_Type' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(structmember.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(parser.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(myreadline.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /opt/python3/lib/libpython3.8.a(frozen.o): warning: relocation in read-only section `.rodata' collect2: error: ld returned 1 exit status error: command 'gcc' failed with exit status 1 [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for mod-wsgi Running setup.py clean for mod-wsgi Successfully built coreschema django-rest-auth jaconv Failed to build mod-wsgi ERROR: Could not build wheels for mod-wsgi, which is required to install pyproject.toml-based projects |
動作環境はPython3.8.13で、RHEL系のLinuxディストリビューションであるAlmaLinux9.3を使用しております。
mod-wsgi install時に「error: command 'gcc’ failed with exit status 1」
結論から言うと私はPython3.9の環境にPython3.8をインストールして書き換えようとしておりましたが、
./configure --prefix=/opt/python3
を使ってPythonを展開するときに
./configure --prefix=/opt/python3 --enable-shared
を使ってenable-sharedというオプションをつけるとうまくいきました。
しかしenable-sharedを使うに当たっては、その後の工程でpipを紐づけるときなどにエラーが起きたりするのでご注意ください。
enable-shared時にpython get-pip.py –userで「cannot open shared object file: No such file or directory」
終わりに
今回はpipを使ってmod-wsgiをインストールしようとしたときに冒頭のエラーが出たときの対処法についてお伝えいたしました。
ディスカッション
コメント一覧
まだ、コメントがありません