pymod build failed with HAVE_64BIT_COORD=1

edited August 2018 in KLayout Development

Hi,
I pulled source code of pymod from github.
Pymod building is passed with HAVE_64BIT_COORD=0.
However, it failed with HAVE_64BIT_COORD=1

Error message is,

In file included from ../../../src/pya/pya/pya.cc:28:0:
                    ../../../src/pya/pya/pyaConvert.h:145:12: error: 'test_type' was not declared in this scope
                         return test_type<int> (rval, loose);
                                ^~~~~~~~~
                    ../../../src/pya/pya/pyaConvert.h:145:22: error: expected primary-expression before 'int'
                         return test_type<int> (rval, loose);
                                          ^~~
                    ../../../src/pya/pya/pyaConvert.h:145:22: error: expected ';' before 'int'
                    ../../../src/pya/pya/pyaConvert.h:145:25: error: expected unqualified-id before '>' token
                         return test_type<int> (rval, loose);
                                             ^
                

gcc version 6.3.0 (GCC)

QMake version 3.1
Using Qt version 5.8.0

Thanks,
Dion

Comments

  • Hi Dion,

    thanks for reporting this ... I did not test this combination yet. I'll take a look, but it's not top prio currently. First thing is to get the pymod branch running on MSVC.

    Matthias

  • Hi Matthias,

    I encountered the same problem while trying to build klayout v0.26 on RHEL6.2/7.4, with python module enable and 64bit coordinate options.

    If python module is disabled, it passed with 64bit coordinate enabled.
    If 64bit coordinate is disabled, it passed with python module enabled.

    I tried several building environments and didn't help.
    gcc v5.2.1 / v7.3.1 / v8.2.1
    python v2.6 / v3.6 / v3.6.5

    These building environments could be used to successfully build klayout v0.25.9

    ../../../src/pya/pya/pyaConvert.h: In member function 'bool pya::test_type_func<__int128>::operator()(PyObject*, bool)':
    ../../../src/pya/pya/pyaConvert.h:145:12: error: 'test_type' was not declared in this scope
         return test_type<int> (rval, loose);
            ^
    ../../../src/pya/pya/pyaConvert.h:145:22: error: expected primary-expression before 'int'
         return test_type<int> (rval, loose);
                      ^
    ../../../src/pya/pya/pyaConvert.h:145:22: error: expected ';' before 'int'
    ../../../src/pya/pya/pyaConvert.h:145:25: error: expected unqualified-id before '>' token
         return test_type<int> (rval, loose);
    

    Best Regards,

    chhung

  • Hi chhung,

    thanks for mentioning this. To be honest, this combination is lacking in my build suite.

    I think the problem is solved by patching line 145 of pyaConvert.h from

    return test_type<int> (rval, loose);
    

    to

    return test_type_func<int> (rval, loose);
    

    Let me know if this does the trick. I'll patch this in the sources then.

    Best regards,

    Matthias

  • Hi Matthias,

    I modified the pyaConvert.h and rebuild it, however got the following error, tried to switch python version from v2.6 to v3.6.5 didn't fix.

    ../../../src/pya/pya/pyaConvert.h: In member function 'bool pya::test_type_func<__int128>::operator()(PyObject*, bool)':
    ../../../src/pya/pya/pyaConvert.h:145:44: error: no matching function for call to 'pya::test_type_func<int>::test_type_func(PyObject*&, bool&)'
         return test_type_func<int> (rval, loose);
                                                ^
    

    Best Regards,

    chhung

  • Hi chhung,

    I'm sorry, my mistake. I think the correct patch is:

    return test_type_func<int> () (rval, loose);
    

    (note the additonal "()").

    I'll try to set up a build with 64bit too, but I'm already reaching a limit of manageable builds.

    Thanks,

    Matthias

  • Hi Matthias,

    I modified the code as your comment, the original error was gone, however it shows undefined reference error now. Is it an issue of our building environment ?

    make[1]: Entering directory `/klayout-0.26/build-release/unit_tests'
    g++ -Wl,-O1 -o ../../build-release/ut_runner unit_test_main.o utTestConsole.o    -L/opt/rh/qt48/root/usr/lib64 -lz /usr/lib64/libpython2.6.so /usr/lib64/libruby.so.1.8.7 -L/klayout-0.26/build-release/unit_tests/.. -lklayout_tl -lklayout_gsi -lklayout_db -lklayout_rdb -lklayout_lib -lklayout_lym -lklayout_laybasic -lklayout_lay -lklayout_ant -lklayout_img -lklayout_edt -lklayout_qtbasic -lklayout_QtGui -lklayout_QtCore -lklayout_rba -lklayout_pya -lklayout_drc -lklayout_lvs -ldl -lklayout_gsi_test -lklayout_QtXml -lQtScript -lQtSql -lQtXml -lQtGui -lQtNetwork -lQtCore -lQtDesigner -lpthread 
    /usr/local/gnu/5.2/usr/bin/../libexec/gcc/x86_64-redhat-linux/5.2.1/ld: /lib64/libz.so.1: no version information available (required by /usr/local/gnu/5.2/usr/lib64/libbfd-2.25-10.el6.so)
    /klayout-0.26/build-release/unit_tests/../libklayout_pya.so: undefined reference to `pya::c2python_func<__int128>::operator()(__int128)'
    collect2: error: ld returned 1 exit status
    make[1]: *** [../../build-release/ut_runner] Error 1
    

    Then I switched the Python version from system default v2.6.6 to v3.6.3, however got the same error.

    Really appreciate your replying.

    Best Regards,

    chhung

  • Hi chhung,

    looks like I have to set up a similar environment myself. Sorry for guessing ... I'll keep you posted.

    Matthias

  • Hi chhung,

    I was able to build successfully on Ubuntu-18. For my final patches see https://github.com/KLayout/klayout/pull/373/files

    Kind regards,

    Matthias

  • Hi Matthias,

    With the final patches, I am able to build klayout v0.26 on RHEL6.2 now. :smiley:

    Build environment:

    gcc v5.2.1
    python v2.6.6
    64bit Coordinate on
    

    Really appreciate your kindly help~ :blush:

    Best Regards,

    chhung

  • Very good ... I'll merge the patch and close the ticket!

    Thanks,

    Matthias

Sign In or Register to comment.