Problem installing package 'lxml' on mac m2 - ERROR: Failed building wheel for lxml - error: legacy-install-failure - build

hello i am trying to install lxml package on macbook air m2 with python 3.11 (i also tried to downgrade to 3.9) and pip 22.3.1. but i get errors that i am no able to resolve by myself nor by looking at other's question on stack overflow
Specifically I am getting this error:
Collecting lxml
Using cached lxml-4.9.1.tar.gz (3.4 MB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: lxml
Building wheel for lxml (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [185 lines of output]
Building lxml version 4.9.1.
Building without Cython.
Building against libxml2 2.9.13 and libxslt 1.1.35
Building against libxml2/libxslt in the following directory: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-cpython-310
creating build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/_elementpath.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/sax.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/pyclasslookup.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/builder.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/doctestcompare.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/usedoctest.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/cssselect.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/ElementInclude.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
creating build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
creating build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/html/soupparser.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/html/defs.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/html/_setmixin.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/html/clean.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/html/_diffcommand.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/html/html5parser.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/html/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/html/formfill.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/html/builder.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/html/ElementSoup.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/html/_html5builder.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/html/usedoctest.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/html/diff.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/html
creating build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron
copying src/lxml/isoschematron/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron
copying src/lxml/etree.h -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/etree_api.h -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/lxml.etree.h -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/lxml.etree_api.h -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/includes/xmlerror.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/c14n.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/xmlschema.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/__init__.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/schematron.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/tree.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/uri.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/etreepublic.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/xpath.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/htmlparser.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/xslt.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/config.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/xmlparser.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/xinclude.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/dtdvalid.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/relaxng.pxd -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/lxml-version.h -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/etree_defs.h -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
creating build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources
creating build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/rng
copying src/lxml/isoschematron/resources/rng/iso-schematron.rng -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/rng
creating build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl
copying src/lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl
creating build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build/temp.macosx-10.9-universal2-cpython-310
creating build/temp.macosx-10.9-universal2-cpython-310/src
creating build/temp.macosx-10.9-universal2-cpython-310/src/lxml
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -DCYTHON_CLINE_IN_TRACEBACK=0 -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -Isrc -Isrc/lxml/includes -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c src/lxml/etree.c -o build/temp.macosx-10.9-universal2-cpython-310/src/lxml/etree.o -w -flat_namespace
In file included from src/lxml/etree.c:96:
In file included from /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:11:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/include/limits.h:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h:63:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
#error Unsupported architecture
^
In file included from src/lxml/etree.c:96:
In file included from /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:11:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/include/limits.h:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h:64:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported
#error architecture not supported
^
In file included from src/lxml/etree.c:96:
In file included from /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:71:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:33:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
#error architecture not supported
^
In file included from src/lxml/etree.c:96:
In file included from /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:71:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
typedef __int64_t __darwin_blkcnt_t; /* total blocks */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:56:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
typedef __int32_t __darwin_blksize_t; /* preferred block size */
^
note: '__int128_t' declared here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:57:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
typedef __int32_t __darwin_dev_t; /* dev_t */
^
note: '__int128_t' declared here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:60:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_gid_t; /* [???] process and group IDs */
^
note: '__uint128_t' declared here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:61:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_id_t; /* [XSI] pid_t, uid_t, or gid_t*/
^
note: '__uint128_t' declared here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:62:9: error: unknown type name '__uint64_t'
typedef __uint64_t __darwin_ino64_t; /* [???] Used for 64 bit inodes */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:68:9: error: unknown type name '__darwin_natural_t'
typedef __darwin_natural_t __darwin_mach_port_name_t; /* Used by mach */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:70:9: error: unknown type name '__uint16_t'; did you mean '__uint128_t'?
typedef __uint16_t __darwin_mode_t; /* [???] Some file attributes */
^
note: '__uint128_t' declared here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:71:9: error: unknown type name '__int64_t'
typedef __int64_t __darwin_off_t; /* [???] Used for file sizes */
^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:72:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
typedef __int32_t __darwin_pid_t; /* [???] process and group IDs */
^
note: '__int128_t' declared here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:73:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_sigset_t; /* [???] signal set */
^
note: '__uint128_t' declared here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:74:9: error: unknown type name '__int32_t'; did you mean '__int128_t'?
typedef __int32_t __darwin_suseconds_t; /* [???] microseconds */
^
note: '__int128_t' declared here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:75:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_uid_t; /* [???] user IDs */
^
note: '__uint128_t' declared here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */
^
note: '__uint128_t' declared here
In file included from src/lxml/etree.c:96:
In file included from /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:71:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_wctype_t;
^
note: '__uint128_t' declared here
In file included from src/lxml/etree.c:96:
In file included from /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:75:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h:31:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
#error architecture not supported
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Compile failed: command '/usr/bin/clang' failed with exit code 1
creating var
creating var/folders
creating var/folders/94
creating var/folders/94/39z5_qps5fbf5jl7pck562hc0000gn
creating var/folders/94/39z5_qps5fbf5jl7pck562hc0000gn/T
cc -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/include/libxml2 -c /var/folders/94/39z5_qps5fbf5jl7pck562hc0000gn/T/xmlXPathInitdadwuuwe.c -o var/folders/94/39z5_qps5fbf5jl7pck562hc0000gn/T/xmlXPathInitdadwuuwe.o
cc var/folders/94/39z5_qps5fbf5jl7pck562hc0000gn/T/xmlXPathInitdadwuuwe.o -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lxml2 -o a.out
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lxml
Running setup.py clean for lxml
Failed to build lxml
Installing collected packages: lxml
Running setup.py install for lxml ... error
error: subprocess-exited-with-error
× Running setup.py install for lxml did not run successfully.
│ exit code: 1
╰─> [182 lines of output]
Building lxml version 4.9.1.
Building without Cython.
Building against libxml2 2.9.13 and libxslt 1.1.35
Building against libxml2/libxslt in the following directory: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
running install
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-cpython-310
creating build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/_elementpath.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/sax.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/pyclasslookup.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/builder.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/doctestcompare.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/usedoctest.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/cssselect.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
copying src/lxml/ElementInclude.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml
creating build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
copying src/lxml/includes/__init__.py -> build/lib.macosx-10.9-universal2-cpython-310/lxml/includes
creating build/lib.macosx-10.9-universal2-cpython-310/lxml/html
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
copying src/lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt -> build/lib.macosx-10.9-universal2-cpython-310/lxml/isoschematron/resources/xsl/iso-schematron-xslt1
running build_ext
building 'lxml.etree' extension
creating build/temp.macosx-10.9-universal2-cpython-310
creating build/temp.macosx-10.9-universal2-cpython-310/src
creating build/temp.macosx-10.9-universal2-cpython-310/src/lxml
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -DCYTHON_CLINE_IN_TRACEBACK=0 -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -Isrc -Isrc/lxml/includes -I/Library/Frameworks/Python.framework/Versions/3.10/include/python3.10 -c src/lxml/etree.c -o build/temp.macosx-10.9-universal2-cpython-310/src/lxml/etree.o -w -flat_namespace
In file included from src/lxml/etree.c:96:
In file included from /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:11:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/include/limits.h:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h:63:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
#error Unsupported architecture
^
In file included from src/lxml/etree.c:96:
In file included from /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:11:
In file included from /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/include/limits.h:21:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/limits.h:64:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/limits.h:8:2: error: architecture not supported
#error architecture not supported
^
In file included from src/lxml/etree.c:96:
In file included from /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:71:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:33:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
#error architecture not supported
^
In file included from src/lxml/etree.c:96:
In file included from /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:71:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:27:
note: '__uint128_t' declared here
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types.h:76:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_useconds_t; /* [???] microseconds */
^
note: '__uint128_t' declared here
In file included from src/lxml/etree.c:96:
In file included from /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:71:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_types.h:43:9: error: unknown type name '__uint32_t'; did you mean '__uint128_t'?
typedef __uint32_t __darwin_wctype_t;
^
note: '__uint128_t' declared here
In file included from src/lxml/etree.c:96:
In file included from /Library/Frameworks/Python.framework/Versions/3.10/include/python3.10/Python.h:25:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:75:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_va_list.h:31:
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/machine/types.h:37:2: error: architecture not supported
#error architecture not supported
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
Compile failed: command '/usr/bin/clang' failed with exit code 1
cc -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/include/libxml2 -c /var/folders/94/39z5_qps5fbf5jl7pck562hc0000gn/T/xmlXPathInitp_h0_ggh.c -o var/folders/94/39z5_qps5fbf5jl7pck562hc0000gn/T/xmlXPathInitp_h0_ggh.o
cc var/folders/94/39z5_qps5fbf5jl7pck562hc0000gn/T/xmlXPathInitp_h0_ggh.o -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lxml2 -o a.out
error: command '/usr/bin/clang' 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.
╰─> lxml
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I got a deprectiation warning that i resolved by installing wheel with pip3
Thanks to anyone who can help
The error is not completely printed. this is the link to the full text: https://docs.google.com/document/d/1elw9PAE1k_c3bsY0XRYuPEOQBRv1hd_lHa5aYeRDBvc/edit?usp=sharing

The error repeatedly tells you:
#error architecture not supported
So I don't think it can be installed unfortunately.

Related

The mxnet's cpp package reports error when #include regarding dmlc/base.h

I would like to use the cpp package of mxnet. So what I did was initially to download the mxnet files from the related github repository. Then I did the following:
cd mxnet
mkdir build
cd build
cmake -DUSE_CPP_PACKAGE=1 ..
cmake --build . --target install
Everything ran smoothly without errors etc. I had already installed the related prerequisities. My issue is that when trying to use the cpp package:
#include "mxnet-cpp/MxNetCpp.h"
I receiving three errors and three warnings all related to the dmlc package:
error 1: /usr/local/include/dmlc/base.h:247:1: error: template with C
linkage
template
error 2: /usr/local/include/dmlc/base.h:260:1: error: template with C linkage
template
error 3:/usr/local/include/dmlc/base.h:282:20: error: conflicting
declaration of C function ‘const char* dmlc::BeginPtr(const
string&)’
Since I am new to c++ I would appreciate and related feedback for resolving the issue.
The exact log is:
In file included from /usr/local/include/dmlc/endian.h:9,
from /usr/include/x86_64-linux-gnu/sys/types.h:176,
from /usr/include/stdlib.h:395,
from /usr/include/c++/11/cstdlib:75,
from /usr/include/c++/11/ext/string_conversions.h:41,
from /usr/include/c++/11/bits/basic_string.h:6608,
from /usr/include/c++/11/string:55,
from /usr/local/include/mxnet-cpp/executor.hpp:31,
from /usr/local/include/mxnet-cpp/MxNetCpp.h:29,
from /home/stathis/Documents/Documents/Documents/Untitled.cpp:1:
/usr/local/include/dmlc/base.h:247:1: error: template with C linkage
247 | template<typename T>
| ^~~~~~~~
In file included from /usr/include/features.h:486,
from /usr/include/x86_64-linux-gnu/c++/11/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:586,
from /usr/include/c++/11/bits/stl_algobase.h:59,
from /usr/include/c++/11/vector:60,
from /usr/local/include/mxnet-cpp/executor.hpp:29,
from /usr/local/include/mxnet-cpp/MxNetCpp.h:29,
from /home/stathis/Documents/Documents/Documents/Untitled.cpp:1:
/usr/include/x86_64-linux-gnu/sys/types.h:27:1: note: 'extern "C"' linkage started here
27 | __BEGIN_DECLS
| ^~~~~~~~~~~~~
In file included from /usr/local/include/dmlc/endian.h:9,
from /usr/include/x86_64-linux-gnu/sys/types.h:176,
from /usr/include/stdlib.h:395,
from /usr/include/c++/11/cstdlib:75,
from /usr/include/c++/11/ext/string_conversions.h:41,
from /usr/include/c++/11/bits/basic_string.h:6608,
from /usr/include/c++/11/string:55,
from /usr/local/include/mxnet-cpp/executor.hpp:31,
from /usr/local/include/mxnet-cpp/MxNetCpp.h:29,
from /home/stathis/Documents/Documents/Documents/Untitled.cpp:1:
/usr/local/include/dmlc/base.h:260:1: error: template with C linkage
260 | template<typename T>
| ^~~~~~~~
In file included from /usr/include/features.h:486,
from /usr/include/x86_64-linux-gnu/c++/11/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:586,
from /usr/include/c++/11/bits/stl_algobase.h:59,
from /usr/include/c++/11/vector:60,
from /usr/local/include/mxnet-cpp/executor.hpp:29,
from /usr/local/include/mxnet-cpp/MxNetCpp.h:29,
from /home/stathis/Documents/Documents/Documents/Untitled.cpp:1:
/usr/include/x86_64-linux-gnu/sys/types.h:27:1: note: 'extern "C"' linkage started here
27 | __BEGIN_DECLS
| ^~~~~~~~~~~~~
In file included from /usr/local/include/dmlc/endian.h:9,
from /usr/include/x86_64-linux-gnu/sys/types.h:176,
from /usr/include/stdlib.h:395,
from /usr/include/c++/11/cstdlib:75,
from /usr/include/c++/11/ext/string_conversions.h:41,
from /usr/include/c++/11/bits/basic_string.h:6608,
from /usr/include/c++/11/string:55,
from /usr/local/include/mxnet-cpp/executor.hpp:31,
from /usr/local/include/mxnet-cpp/MxNetCpp.h:29,
from /home/stathis/Documents/Documents/Documents/Untitled.cpp:1:
/usr/local/include/dmlc/base.h:282:20: error: conflicting declaration of C function 'const char* dmlc::BeginPtr(const string&)'
282 | inline const char* BeginPtr(const std::string &str) {
| ^~~~~~~~
/usr/local/include/dmlc/base.h:273:14: note: previous declaration 'char* dmlc::BeginPtr(std::string&)'
273 | inline char* BeginPtr(std::string &str) { // NOLINT(*)
| ^~~~~~~~
make[1]: *** [Documents.mk:97: ../build-Debug/Documents/Untitled.cpp.o] Error 1
make[1]: Leaving directory '/home/stathis/Documents/Documents/Documents'
make: *** [Makefile:5: All] Error 2
==== build ended with errors (3 errors, 3 warnings) ===
mxnet-cpp does not depend on dmlc. It has the file base.h, dmlc has its own base.h at the same time. So you mix several base.h between independent projects. You have many errors in your include directories.
-I/usr/include/
-I/usr/local/include/
-I/usr/local/include/mxnet-cpp/
-I/usr/local/include/mshadow/
-I/usr/local/include/dmlc/
-I/usr/local/include/mkl/
Remove all these directories. The first two are default and should not be added explicitly. Other are reachable in the default locations.

C++ Compile Fix

I'm trying to compile this tool https://github.com/Meltedd/HVNC
but when I do g++ Server.cpp I get the error
In file included from Server.h:1,
from Server.cpp:1:
Common.h:1: warning: `#pragma once' is obsolete
Server.cpp:5: `NTAPI' was not declared in this scope
Server.cpp:5: `T_RtlDecompressBuffer' was not declared in this scope
Server.cpp:13: warning: ANSI C++ forbids typedef which does not specify a type
Server.cpp:13: typedef declaration includes an initializer
[main] C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\..\lib\gcc-lib\i586-cygwin32\egcs-2.91.57\cc1plus.exe 1002 (0) handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
[main] cc1plus 1002 (0) handle_exceptions: Dumping stack trace to cc1plus.exe.core
when I try g++ HiddenDesktop.cpp I get the error
In file included from HiddenDesktop.cpp:1:
HiddenDesktop.h:1: warning: `#pragma once' is obsolete
In file included from HiddenDesktop.h:2,
from HiddenDesktop.cpp:1:
../common/Common.h:1: warning: `#pragma once' is obsolete
In file included from HiddenDesktop.h:2,
from HiddenDesktop.cpp:1:
../common/Common.h:9: Security.h: No such file or directory
../common/Common.h:10: Sddl.h: No such file or directory
../common/Common.h:11: Shlwapi.h: No such file or directory
../common/Common.h:12: Shlobj.h: No such file or directory
../common/Common.h:13: TlHelp32.h: No such file or directory
../common/Common.h:14: Psapi.h: No such file or directory
../common/Common.h:15: Wininet.h: No such file or directory
../common/Common.h:16: Urlmon.h: No such file or directory
In file included from ../common/Common.h:17,
from HiddenDesktop.h:2,
from HiddenDesktop.cpp:1:
../common/Api.h:1: warning: `#pragma once' is obsolete
In file included from ../common/Common.h:18,
from HiddenDesktop.h:2,
from HiddenDesktop.cpp:1:
../common/Utils.h:1: warning: `#pragma once' is obsolete
In file included from ../common/Common.h:19,
from HiddenDesktop.h:2,
from HiddenDesktop.cpp:1:
../common/Inject.h:1: warning: `#pragma once' is obsolete
In file included from ../common/Common.h:20,
from HiddenDesktop.h:2,
from HiddenDesktop.cpp:1:
../common/HTTP.h:1: warning: `#pragma once' is obsolete
HiddenDesktop.cpp:5: Tlhelp32.h: No such file or directory
HiddenDesktop.cpp:8: gdiplus.h: No such file or directory
and Finally when I try g++ Server.cpp I get the error
In file included from Server.h:1,
from Server.cpp:1:
Common.h:1: warning: `#pragma once' is obsolete
Server.cpp:5: `NTAPI' was not declared in this scope
Server.cpp:5: `T_RtlDecompressBuffer' was not declared in this scope
Server.cpp:13: warning: ANSI C++ forbids typedef which does not specify a type
Server.cpp:13: typedef declaration includes an initializer
[main] C:\cygnus\cygwin-b20\H-i586-cygwin32\bin\..\lib\gcc-lib\i586-cygwin32\egcs-2.91.57\cc1plus.exe 1002 (0) handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
[main] cc1plus 1002 (0) handle_exceptions: Dumping stack trace to cc1plus.exe.core
I have also tried the sln file bu there I get the error
Not possible to iniciate the program '...\Win32\Server.exe' systeam could not locate the specified path
I'm using VS2022
I don't know what can I be doing wron or what can be missing here
I have tried compiling with g++ and vs2022

How do I build a .so file in f2py without errors?

I am trying to build an extension module for the following FORTRAN module:
module mod
integer i
integer :: x(4)
real, dimension(2,3) :: a
real, allocatable, dimension(:,:) :: b
contains
subroutine foo
integer k
print*, "i=",i
print*, "x=[",x,"]"
print*, "a=["
print*, "[",a(1,1),",",a(1,2),",",a(1,3),"]"
print*, "[",a(2,1),",",a(2,2),",",a(2,3),"]"
print*, "]"
print*, "Setting a(1,2)=a(1,2)+3"
a(1,2) = a(1,2)+3
end subroutine foo
end module mod
I ran the following in Windows Powershell:
f2py -c -m moddata moddata.f90
But I got the following output, with many errors:
call "C:\Anaconda2\Scripts\\..\python.exe" "C:\Anaconda2\Scripts\\f2py.py" -c -m moddata moddata.f90
running build
running config_cc
unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running config_fc
unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running build_src
build_src
building extension "moddata" sources
f2py options: []
f2py:> c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c
creating c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7
Reading fortran codes...
Reading file 'moddata.f90' (format:free)
Post-processing...
Block: moddata
Block: mod
Block: foo
Post-processing (stage 2)...
Block: moddata
Block: unknown_interface
Block: mod
Block: foo
Building modules...
Building module "moddata"...
Constructing F90 module support for "mod"...
Variables: i x b a
getarrdims:warning: assumed shape array, using 0 instead of ':'
getarrdims:warning: assumed shape array, using 0 instead of ':'
Constructing wrapper function "mod.foo"...
foo()
Wrote C/API module "moddata" to file "c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c"
Fortran 90 wrappers are saved to "c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddata-f2pywrappers2.f90"
adding 'c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\fortranobject.c' to sources.
adding 'c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7' to include_dirs.
copying C:\Anaconda2\lib\site-packages\numpy\f2py\src\fortranobject.c -> c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7
copying C:\Anaconda2\lib\site-packages\numpy\f2py\src\fortranobject.h -> c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7
adding 'c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddata-f2pywrappers2.f90' to sources.
build_src: building npy-pkg config files
running build_ext
Cannot build msvcr library: "msvcr90d.dll" not found
customize Mingw32CCompiler
customize Mingw32CCompiler using build_ext
customize GnuFCompiler
Could not locate executable g77
Could not locate executable f77
customize IntelVisualFCompiler
Could not locate executable ifort
Could not locate executable ifl
customize AbsoftFCompiler
Could not locate executable f90
customize CompaqVisualFCompiler
Found executable C:\cygwin64\bin\DF.exe
customize IntelItaniumVisualFCompiler
Could not locate executable efl
customize Gnu95FCompiler
Found executable C:\cygwin64\bin\gfortran.exe
customize Gnu95FCompiler
customize Gnu95FCompiler using build_ext
building 'moddata' extension
compiling C sources
C compiler: gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes
creating c:\users\brian\appdata\local\temp\tmpokkt7l\Release
creating c:\users\brian\appdata\local\temp\tmpokkt7l\Release\users
creating c:\users\brian\appdata\local\temp\tmpokkt7l\Release\users\brian
creating c:\users\brian\appdata\local\temp\tmpokkt7l\Release\users\brian\appdata
creating c:\users\brian\appdata\local\temp\tmpokkt7l\Release\users\brian\appdata\local
creating c:\users\brian\appdata\local\temp\tmpokkt7l\Release\users\brian\appdata\local\temp
creating c:\users\brian\appdata\local\temp\tmpokkt7l\Release\users\brian\appdata\local\temp\tmpokkt7l
creating c:\users\brian\appdata\local\temp\tmpokkt7l\Release\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7
compile options: '-DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x1500 -Ic:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7 -IC:\Anaconda2\lib\site-packages\numpy\core\include -IC:\Anaconda2\include -IC:\Anaconda2\PC -c'
gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x1500 -Ic:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7 -IC:\Anaconda2\lib\site-packages\numpy\core\include -IC:\Anaconda2\include -IC:\Anaconda2\PC -c c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c -o c:\users\brian\appdata\local\temp\tmpokkt7l\Release\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.o
In file included from C:\Anaconda2\include/Python.h:58:0,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c:17:
C:\Anaconda2\include/pyport.h:171:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Py_uintptr_t'
typedef unsigned PY_LONG_LONG Py_uintptr_t;
^~~~~~~~~~~~
In file included from C:\Anaconda2\include/Python.h:8:0,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c:17:
C:\Anaconda2\include/pyconfig.h:314:23: error: unknown type name '__int64'
# define PY_LONG_LONG __int64
^
C:\Anaconda2\include/pyport.h:172:9: note: in expansion of macro 'PY_LONG_LONG'
typedef PY_LONG_LONG Py_intptr_t;
^~~~~~~~~~~~
In file included from C:\Anaconda2\include/Python.h:58:0,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c:17:
C:\Anaconda2\include/pyport.h:895:2: error: #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
^~~~~
In file included from C:\Anaconda2\include/Python.h:86:0,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c:17:
C:\Anaconda2\include/intobject.h:46:35: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PyInt_AsUnsignedLongLongMask'
PyAPI_FUNC(unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Anaconda2\include/Python.h:88:0,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c:17:
C:\Anaconda2\include/longobject.h:50:1: warning: parameter names (without types) in function declaration
PyAPI_FUNC(PyObject *) PyLong_FromLongLong(PY_LONG_LONG);
^~~~~~~~~~
In file included from C:\Anaconda2\include/Python.h:58:0,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c:17:
C:\Anaconda2\include/pyconfig.h:314:23: error: unknown type name '__int64'
# define PY_LONG_LONG __int64
^
C:\Anaconda2\include/pyport.h:802:34: note: in definition of macro 'PyAPI_FUNC'
# define PyAPI_FUNC(RTYPE) RTYPE
^~~~~
C:\Anaconda2\include/longobject.h:52:12: note: in expansion of macro 'PY_LONG_LONG'
PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLong(PyObject *);
^~~~~~~~~~~~
In file included from C:\Anaconda2\include/Python.h:88:0,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c:17:
C:\Anaconda2\include/longobject.h:53:35: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PyLong_AsUnsignedLongLong'
PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLong(PyObject *);
^~~~~~~~~~~~~~~~~~~~~~~~~
C:\Anaconda2\include/longobject.h:54:35: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PyLong_AsUnsignedLongLongMask'
PyAPI_FUNC(unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Anaconda2\include/Python.h:58:0,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c:17:
C:\Anaconda2\include/pyconfig.h:314:23: error: unknown type name '__int64'
# define PY_LONG_LONG __int64
^
C:\Anaconda2\include/pyport.h:802:34: note: in definition of macro 'PyAPI_FUNC'
# define PyAPI_FUNC(RTYPE) RTYPE
^~~~~
C:\Anaconda2\include/longobject.h:55:12: note: in expansion of macro 'PY_LONG_LONG'
PyAPI_FUNC(PY_LONG_LONG) PyLong_AsLongLongAndOverflow(PyObject *, int *);
^~~~~~~~~~~~
In file included from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:4:0,
from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:18,
from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/arrayobject.h:4,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\fortranobject.h:13,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c:18:
C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/npy_common.h:221:9: error: unknown type name 'Py_uintptr_t'
typedef Py_uintptr_t npy_uintp;
^~~~~~~~~~~~
In file included from C:\Anaconda2\include/Python.h:8:0,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c:17:
C:\Anaconda2\include/pyconfig.h:314:23: error: unknown type name '__int64'
# define PY_LONG_LONG __int64
^
C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/npy_common.h:311:9: note: in expansion of macro 'PY_LONG_LONG'
typedef PY_LONG_LONG npy_longlong;
^~~~~~~~~~~~
In file included from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:4:0,
from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:18,
from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/arrayobject.h:4,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\fortranobject.h:13,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c:18:
C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/npy_common.h:312:31: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'npy_ulonglong'
typedef unsigned PY_LONG_LONG npy_ulonglong;
^~~~~~~~~~~~~
In file included from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:4:0,
from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:18,
from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/arrayobject.h:4,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\fortranobject.h:13,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c:18:
C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/npy_common.h:614:17: error: unknown type name 'npy_ulonglong'
typedef npy_ulonglong npy_uint64;
^~~~~~~~~~~~~
In file included from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/ndarraytypes.h:1809:0,
from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/ndarrayobject.h:18,
from C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/arrayobject.h:4,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\fortranobject.h:13,
from c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c:18:
C:\Anaconda2\lib\site-packages\numpy\core\include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by " \
^~~~~~~
error: Command "gcc -g -DDEBUG -DMS_WIN64 -O0 -Wall -Wstrict-prototypes -DNPY_MINGW_USE_CUSTOM_MSVCR -D__MSVCRT_VERSION__=0x1500 -Ic:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7 -IC:\Anaconda2\lib\site-packages\numpy\core\include -IC:\Anaconda2\include -IC:\Anaconda2\PC -c c:\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.c -o c:\users\brian\appdata\local\temp\tmpokkt7l\Release\users\brian\appdata\local\temp\tmpokkt7l\src.win-amd64-2.7\moddatamodule.o" failed with exit status 1
My FORTRAN compiler is GNU Fortran (GCC) 6.4.0.
My C compiler is gcc (GCC) 6.4.0.
I am using Numpy V1.13.3.
I am using f2py V2.
Could you let me know how to resolve the errors?
Thank you!

rtai no such file or directory error compiling

I trying to compile a .cpp program from Debian 6. I have a working makefile, which only works with .c archives, but I need to compile my program on .cpp. So here its the makefile:
#
# Build the examples.
#
# The great thing about GNU Make is that it knows so much about your lifestyle, you don't need to
# tell it the obvious things. This file is a minimal makefile.
# You run this makefile by typing `make' in the directory with the makefile
# You can find out more about make by typing `info make'.
# This tells Make that we need to link everything with the robot code:
LDLIBS=/usr/lib/robot.a
CC=gcc
# This variable has a handy copy of all the things we aim to produce
EXEC= read_sensor turn_on_and_off control_joint cerrar_mano
# Thses are all the things we need to compile:
all: ${EXEC}
CFLAGS=-I/usr/realtime/include/ -D_ISOC99_SOURCE -D_GNU_SOURCE - rtai_types -rtai_lxrt
# Make now looks around the directory, finds the read_sensor.c and
# turn_on_and_off.c files, works out it can compile them into the
# read_sensor and turn_on_and_off executables, and does so!
# However, for the kernel modules, we need to do a bit more.
rt_control: rt_control.o
ld -E -O2 -r -o $# $^
# This is an example of making a binary from several object files, as an example only!
fred: bert.o jim.o
ld -E -O2 -o $# $^
# We need to tell the compiler quite a lot about where to find the right header files
rt_control.o: control.c
$(CC) -c -O2 -DREALTIME -DRTAI_3 -I./include/ -I. -I../ -isystem /usr/realtime/include/ -isystem /usr/src/linux/include -o $# $^
# We put some housekeeping in here:
# This target is used to remove intermediate files Make produces.
clean:; rm -f *.o
# This target is used to remove output files Make produces as well.
realclean: clean
rm -f ${EXEC}
So when I write on terminal make myprogramname.cpp This is what i get:
In file included from /usr/include/robot/robot.h:38,
from Programa_Hand2.cpp:4:
/usr/include/robot/sensor.h:24:44: error: rtai_types.h: No such file or directory
/usr/include/robot/sensor.h:38:23: error: rtai_lxrt.h: No such file or directory
In file included from /usr/include/robot/robot.h:38,
from Programa_Hand2.cpp:4:
/usr/include/robot/sensor.h:168: error: 'RTIME' does not name a type
In file included from /usr/include/robot/robot.h:38,
from Programa_Hand2.cpp:4:
/usr/include/robot/sensor.h:178: error: 'RTIME' does not name a type
In file included from Programa_Hand2.cpp:4:
/usr/include/robot/robot.h:194: error: 'RTIME' does not name a type
/usr/include/robot/robot.h:244: error: 'RTIME' does not name a type
Programa_Hand2.cpp: In function 'int main()':
Programa_Hand2.cpp:18: error: expected initializer before 'printf'
Programa_Hand2.cpp:19: error: 'f' was not declared in this scope
hand#hand-cartagena:~/Desktop/Joaquin/examples$ make Programa_Hand2
g++ Programa_Hand2.cpp /usr/lib/robot.a -o Programa_Hand2
In file included from /usr/include/robot/robot.h:38,
from Programa_Hand2.cpp:4:
/usr/include/robot/sensor.h:24:44: error: rtai_types.h: No such file or directory
/usr/include/robot/sensor.h:38:23: error: rtai_lxrt.h: No such file or directory
In file included from /usr/include/robot/robot.h:38,
from Programa_Hand2.cpp:4:
/usr/include/robot/sensor.h:168: error: 'RTIME' does not name a type
In file included from /usr/include/robot/robot.h:38,
from Programa_Hand2.cpp:4:
/usr/include/robot/sensor.h:178: error: 'RTIME' does not name a type
In file included from Programa_Hand2.cpp:4:
/usr/include/robot/robot.h:194: error: 'RTIME' does not name a type
/usr/include/robot/robot.h:244: error: 'RTIME' does not name a type
Programa_Hand2.cpp: In function 'int main()':
Programa_Hand2.cpp:18: error: expected initializer before 'printf'
Programa_Hand2.cpp:19: error: 'f' was not declared in this scope
make: *** [Programa_Hand2] Error 1
Also tried with gcc -o Programa_Hand2 Programa_Hand2.cpp and getting the same error, I think its something I have to change with the makefile but dont know what its wrong there
Any ideas? Im new to programming and linux, so Im getting a bit mad with this, because I need the program to be compiled on c++, and I compiled it and works properly on c. Thanks for your help!
Edit: doing some research from the internet, seems to be that RTAI doesnt support C++; so there is any way to compile it in C++? Also, my #includes are:
#include <stdio.h>
#include <robot/robot.h>
#include <unistd.h>
#include <error.h>
#include <iostream>
#include "RobotConfig.h"
Thanks again!
In short you need to use the command g++ not gcc for C++ files.
You need to compile C++ files with a C++ compiler not a C compiler and there are differences.
The command for GNU C++ Compiler is g++ assuming you have it installed. That is likely since you seem to have a C compiler.
Add a variable to your Makefile named CXX and set it equal to g++. Then compile your C++ code using the CXX variable as the command instead of the CC variable.
$(CXX) -o <.output file name> <.cpp files go here>

Cygwin 32 and Python 2.7.5: psycopg2 installation error

In my previous question I described our situation: our developers are to use python in a cygwin environment over windows 7 - 64 bit however the tests are automaticaly executed during build as well on linux. We experienced some trouble with cygwin64 so now we tried to use python over cygwin32.
Regrettably it seems that using both the 64 and 32 bit versions of PostgreSQL 9.2 makes a gcc compilation error during the installation of psycopg2. The 32 bit version install log:
$ pip install psycopg2
...
Downloading/unpacking psycopg2
Downloading psycopg2-2.5.1.tar.gz (684kB): 684kB downloaded
Running setup.py egg_info for package psycopg2
Installing collected packages: psycopg2
Running setup.py install for psycopg2
building 'psycopg2._psycopg' extension
gcc -fno-strict-aliasing -ggdb -O2 -pipe -fdebug-prefix-map=/home/jt/rel/python-2.7.3-1/python-2.7.3-1/build=/usr/src/debug/python-2.7.3-1 -fdebug-prefix-map=/home/jt/rel/python-2.7.3-1/python-2.7.3-1/src/Python-2.7.3=/usr/src/debug/python-2.7.3-1 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.5.1 (dt dec pq3 ext)" -DPG_VERSION_HEX=0x090204 -DPSYCOPG_EXTENSIONS=1 -DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -I/usr/include/python2.7 -I. -IC:/PROGRA~2/POSTGR~1/9.2/include -IC:/PROGRA~2/POSTGR~1/9.2/include/server -c psycopg/psycopgmodule.c -o build/temp.cygwin-1.7.24-i686-2.7/psycopg/psycopgmodule.o
In file included from ./psycopg/config.h:120:0,
from ./psycopg/psycopg.h:33,
from psycopg/psycopgmodule.c:27:
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:307:8: error: redefinition of ‘struct timespec’
In file included from /usr/include/stdio.h:47:0,
from /usr/include/python2.7/Python.h:33,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/sys/types.h:130:8: note: originally defined here
In file included from ./psycopg/config.h:120:0,
from ./psycopg/psycopg.h:33,
from psycopg/psycopgmodule.c:27:
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:571:24: error: conflicting types for ‘pthread_t’
In file included from /usr/include/sys/types.h:473:0,
from /usr/include/stdio.h:47,
from /usr/include/python2.7/Python.h:33,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/cygwin/types.h:178:45: note: previous declaration of ‘pthread_t’ was here
In file included from ./psycopg/config.h:120:0,
from ./psycopg/psycopg.h:33,
from psycopg/psycopgmodule.c:27:
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:572:34: error: conflicting types for ‘pthread_attr_t’
In file included from /usr/include/sys/types.h:473:0,
from /usr/include/stdio.h:47,
from /usr/include/python2.7/Python.h:33,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/cygwin/types.h:182:50: note: previous declaration of ‘pthread_attr_t’ was here
In file included from ./psycopg/config.h:120:0,
from ./psycopg/psycopg.h:33,
from psycopg/psycopgmodule.c:27:
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:573:32: error: conflicting types for ‘pthread_once_t’
In file included from /usr/include/sys/types.h:473:0,
from /usr/include/stdio.h:47,
from /usr/include/python2.7/Python.h:33,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/cygwin/types.h:193:1: note: previous declaration of ‘pthread_once_t’ was here
In file included from ./psycopg/config.h:120:0,
from ./psycopg/psycopg.h:33,
from psycopg/psycopgmodule.c:27:
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:574:33: error: conflicting types for ‘pthread_key_t’
In file included from /usr/include/sys/types.h:473:0,
from /usr/include/stdio.h:47,
from /usr/include/python2.7/Python.h:33,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/cygwin/types.h:181:49: note: previous declaration of ‘pthread_key_t’ was here
In file included from ./psycopg/config.h:120:0,
from ./psycopg/psycopg.h:33,
from psycopg/psycopgmodule.c:27:
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:575:35: error: conflicting types for ‘pthread_mutex_t’
In file included from /usr/include/sys/types.h:473:0,
from /usr/include/stdio.h:47,
from /usr/include/python2.7/Python.h:33,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/cygwin/types.h:179:51: note: previous declaration of ‘pthread_mutex_t’ was here
In file included from ./psycopg/config.h:120:0,
from ./psycopg/psycopg.h:33,
from psycopg/psycopgmodule.c:27:
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:576:39: error: conflicting types for ‘pthread_mutexattr_t’
In file included from /usr/include/sys/types.h:473:0,
from /usr/include/stdio.h:47,
from /usr/include/python2.7/Python.h:33,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/cygwin/types.h:183:55: note: previous declaration of ‘pthread_mutexattr_t’ was here
In file included from ./psycopg/config.h:120:0,
from ./psycopg/psycopg.h:33,
from psycopg/psycopgmodule.c:27:
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:577:34: error: conflicting types for ‘pthread_cond_t’
In file included from /usr/include/sys/types.h:473:0,
from /usr/include/stdio.h:47,
from /usr/include/python2.7/Python.h:33,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/cygwin/types.h:185:50: note: previous declaration of ‘pthread_cond_t’ was here
In file included from ./psycopg/config.h:120:0,
from ./psycopg/psycopg.h:33,
from psycopg/psycopgmodule.c:27:
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:578:38: error: conflicting types for ‘pthread_condattr_t’
In file included from /usr/include/sys/types.h:473:0,
from /usr/include/stdio.h:47,
from /usr/include/python2.7/Python.h:33,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/cygwin/types.h:184:54: note: previous declaration of ‘pthread_condattr_t’ was here
In file included from ./psycopg/config.h:120:0,
from ./psycopg/psycopg.h:33,
from psycopg/psycopgmodule.c:27:
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:580:36: error: conflicting types for ‘pthread_rwlock_t’
In file included from /usr/include/sys/types.h:473:0,
from /usr/include/stdio.h:47,
from /usr/include/python2.7/Python.h:33,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/cygwin/types.h:195:52: note: previous declaration of ‘pthread_rwlock_t’ was here
In file included from ./psycopg/config.h:120:0,
from ./psycopg/psycopg.h:33,
from psycopg/psycopgmodule.c:27:
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:581:40: error: conflicting types for ‘pthread_rwlockattr_t’
In file included from /usr/include/sys/types.h:473:0,
from /usr/include/stdio.h:47,
from /usr/include/python2.7/Python.h:33,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/cygwin/types.h:196:56: note: previous declaration of ‘pthread_rwlockattr_t’ was here
In file included from ./psycopg/config.h:120:0,
from ./psycopg/psycopg.h:33,
from psycopg/psycopgmodule.c:27:
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:582:38: error: conflicting types for ‘pthread_spinlock_t’
In file included from /usr/include/sys/types.h:473:0,
from /usr/include/stdio.h:47,
from /usr/include/python2.7/Python.h:33,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/cygwin/types.h:194:54: note: previous declaration of ‘pthread_spinlock_t’ was here
In file included from ./psycopg/config.h:120:0,
from ./psycopg/psycopg.h:33,
from psycopg/psycopgmodule.c:27:
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:1131:31: error: conflicting types for ‘pthread_kill’
In file included from /usr/include/signal.h:5:0,
from /usr/include/time.h:138,
from /usr/include/sys/select.h:24,
from /usr/include/cygwin/sys_time.h:13,
from /usr/include/sys/time.h:61,
from /usr/include/python2.7/pyport.h:319,
from /usr/include/python2.7/Python.h:58,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/sys/signal.h:170:5: note: previous declaration of ‘pthread_kill’ was here
error: command 'gcc' failed with exit status 1
...
C:/PROGRA~2/POSTGR~1/9.2/include/pthread.h:1131:31: error: conflicting types for ‘pthread_kill’
In file included from /usr/include/signal.h:5:0,
from /usr/include/time.h:138,
from /usr/include/sys/select.h:24,
from /usr/include/cygwin/sys_time.h:13,
from /usr/include/sys/time.h:61,
from /usr/include/python2.7/pyport.h:319,
from /usr/include/python2.7/Python.h:58,
from ./psycopg/psycopg.h:30,
from psycopg/psycopgmodule.c:27:
/usr/include/sys/signal.h:170:5: note: previous declaration of ‘pthread_kill’ was here
error: command 'gcc' failed with exit status 1
...
We installed the standard Gcc and PostgreSQL libraries that come with the cygwin installation package. What to do next?
Thank you very much in advance:
Joe, the public
The libpq bundled with the PostgreSQL installer was compiled with Microsoft Visual Studio as a native Windows binary.
If linking to it from Cygwin happens to work, that's mostly luck. It's not a good idea. You really need to use libpq built for Cygwin with a Cygwin program.
Frankly, I think you're much better off just working with native Windows these days and avoiding Cygwin entirely. You can use the mingw compiler with msys when you need a unix-like build system, and properly written Windows-compatible code deals with mixing mingw and msvc compiled binaries well.
In your case I'd just install ActivePython or I'd install the stock Python build and then add psycopg2 myself.