Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Greenlet 2.0.2/3.0.1 installation is failing on AIX 7.2 platform #386

Open
Chandana2296 opened this issue Nov 27, 2023 · 7 comments
Open
Labels

Comments

@Chandana2296
Copy link

Chandana2296 commented Nov 27, 2023

Encountered an error when trying to install greenlet 2.0.2/3.0.1 on AIX 7.2 platform with the below error:

command: pip install greenlet==3.01 / pip install greenlet==2.0.2

Error:

/opt/pyenv/versions/3.11.3/lib/python3.11/config-3.11/ld_so_aix /opt/freeware/bin/g++ -pthread -bI:/opt/pyenv/versions/3.11.3/lib/python3.11/config-3.11/python.exp -L/opt/pyenv/versions/3.11.3/lib -maix64 -L/opt/openssl111n/aixpower/lib -L/opt/freeware/lib64 -L/opt/pyenv/versions/3.11.3/lib -maix64 -L/opt/openssl111n/aixpower/lib -L/opt/freeware/lib64 -maix64 -pthread build/temp.aix-7204-9988-64-cpython-311/src/greenlet/tests/_test_extension_cpp.o -L/opt/pyenv/versions/3.11.3/lib -o build/lib.aix-7204-9988-64-cpython-311/greenlet/tests/_test_extension_cpp.cpython-311.so

  ld: 0711-418 ERROR: Import or export file _test_extension_cpp.cpython-311.exp at line 11:
          A symbol name may only be followed by an export attribute
          or an address. The line is being ignored.

  ld: 0711-418 ERROR: Import or export file _test_extension_cpp.cpython-311.exp at line 12:
          A symbol name may only be followed by an export attribute
          or an address. The line is being ignored.

  collect2: error: ld returned 8 exit status
  error: command '/opt/pyenv/versions/3.11.3/lib/python3.11/config-3.11/ld_so_aix' failed with exit code 1
  [end of output]

Environment Details:
OS: AIX 7.2
Python Version: 3.11.3
Exported Flags:

    export CC="/opt/freeware/bin/gcc -fPIC"
    export CXX="/opt/freeware/bin/g++"
    export CFLAGS="-pthread"
    export CXXFLAGS="-std=c++11"
    export LDFLAGS="-maix64 "
    export AR="ar -X64 "

please help me to solve this error..

Also let me know is there any flag which can skip the cpp test extensions like earlier GREENLET_TEST_CPP.

Thanks,
Chandana

@Chandana2296
Copy link
Author

Chandana2296 commented Nov 27, 2023

Also I am getting the below error :

Error :

  /opt/freeware/bin/gcc -fPIC -Wsign-compare -DNDEBUG -O3 -Wall -maix64 -I/opt/openssl111n/aixpower/include -I/opt/freeware/include -maix64 -I/opt/openssl111n/aixpower/include -I/opt/freeware/include -maix64 -I/opt/pyenv/versions/3.11.3/include/python3.11 -c src/greenlet/greenlet.cpp -o build/temp.aix-7204-9988-64-cpython-311/src/greenlet/greenlet.o
  In file included from /opt/pyenv/versions/3.11.3/include/python3.11/Python.h:29,
                   from src/greenlet/greenlet.cpp:16:
  /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/unistd.h:210:16: error: conflicting declaration of C function 'off64_t lseek64(int, off64_t, int)'
   extern off64_t lseek64(int, off64_t, int);
                  ^~~~~~~
  /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/unistd.h:208:14: note: previous declaration 'off_t lseek64(int, off_t, int)'
   extern off_t lseek(int, off_t, int);
                ^~~~~
  In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/unistd.h:866,
                   from /opt/pyenv/versions/3.11.3/include/python3.11/Python.h:29,
                   from src/greenlet/greenlet.cpp:16:
  /usr/include/sys/lockf.h:64:13: error: conflicting declaration of C function 'int lockf64(int, int, off64_t)'
    extern int lockf64 (int, int, off64_t);
               ^~~~~~~
  /usr/include/sys/lockf.h:62:13: note: previous declaration 'int lockf64(int, int, off_t)'
    extern int lockf (int, int, off_t);
               ^~~~~
  In file included from /opt/pyenv/versions/3.11.3/include/python3.11/Python.h:29,
                   from src/greenlet/greenlet.cpp:16:
  /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/unistd.h:939:14: error: conflicting declaration of C function 'int ftruncate64(int, off64_t)'
    extern int  ftruncate64(int, off64_t);
                ^~~~~~~~~~~
  In file included from /opt/pyenv/versions/3.11.3/include/python3.11/Python.h:29,
                   from src/greenlet/greenlet.cpp:16:
  /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8/include-fixed/unistd.h:937:14: note: previous declaration 'int ftruncate64(int, off_t)'
    extern int  ftruncate(int, off_t);

If I export the below Flags:


    export CC="/opt/freeware/bin/gcc -fPIC"
    export CXX="/opt/freeware/bin/g++"
    export CFLAGS="-maix64"
    export CXXFLAGS="-std=c++11"
    export LDFLAGS="-maix64 -lstdc++"
    export AR="ar -X64 "
    export OBJECT_MODE=64

@jamadden
Copy link
Contributor

jamadden commented Dec 8, 2023

I'm afraid I can't help you. The only thing I know about compilation on AIX comes from reading the porting guide for AIX 5L for fun; I've never had access to an AIX system. I have no idea where _test_extension_cpp.cpython-311.exp is coming from --- it's certainly not something that ships with greenlet, so I have no idea what's creating it or how to debug it.

No, you can't disable the C++ tests --- greenlet is written in C++ so it's important that they pass.

The other errors about redefined functions suggest conflicting C preprocessor definitions. This can be caused by many things; sometimes it is the result of compiling Python with one set of flags, and then compiling extensions with a different set of flags.

@jamadden jamadden added Help Wanted User Support Helping end users labels Dec 8, 2023
@Chandana2296
Copy link
Author

Greenlet is exporting the C++ name symbols to this file _test_extension_cpp.cpython-311.exp, while exporting the c++ name symbols getting the error mentioned in the issue.

@Chandana2296
Copy link
Author

Chandana2296 commented Dec 13, 2023

Content of the file _test_extension_cpp.cpython-311.exp

+1 #!build/lib.aix-7204-1937-64-3.10/greenlet/tests/_test_extension_cpp.cpython-310.so
+2 *
+3 * Generated automatically by makexp_aix (Sat Aug 26 05:16:35 UTC 2023)
+4 *
+5 * Base Directory: /disks/drm_lonestar/abbigs/greenlet-2.0.2
+6 * Input File(s) : build/temp.aix-7204-1937-64-3.10/src/greenlet/tests/_test_extension_cpp.o
+7 *
+8 * NOTE: lists all global symbols defined in the above file(s).
+9 *
+10 PyInit__test_extension_cpp
+11 typeinfo for exception_t
+12 typeinfo name for exception_t

The last two lines(11 and 12) have the method names with spaces leading to this error.

@jamadden
Copy link
Contributor

It's hard to tell because you pasted a PICTURE instead of the ACTUAL TEXT (never do that!) but

  1. I don't see any spaces in the names on line 11 or 12
  2. Those aren't methods, they're a type.

@Chandana2296
Copy link
Author

Edited the above comment with actual text.

In line No 11, here I can see the spaces in between typeinfo for exception_t , the symbols (complete line) should be without space, you can see line no 10, there the symbol is without spaces PyInit__test_extension_cpp, so no error from line 10.

@jamadden
Copy link
Contributor

I interpret that to mean that this is the symbol of kind typeinfo for the class exception_t, in the same way that the line 12 is the name for that typeinfo. That's something the compiler generates automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants