How can I set ccshared=-fPIC while executing ./configure?

后端 未结 9 706
北荒
北荒 2021-02-02 10:56

I am trying to build Python 2.6 for QGIS on RHEL 5. During the making of QGIS I get the following error:

Linking CXX shared library libqgispython.so
/usr/bin/ld:         


        
相关标签:
9条回答
  • 2021-02-02 11:37

    The following worked for me when I ran into this error:

    make clean
    ./configure CFLAGS=-fPIC CXXFLAGS=-fPIC
    
    0 讨论(0)
  • 2021-02-02 11:37

    I got it working with:

    ./configure --enable-shared --enable-pic
    
    0 讨论(0)
  • 2021-02-02 11:40
    1. Run ./configure --help, possibly piping to grep PIC, to see if there's an option to enable this
    2. Try setting the environment variable before running configure, e.g. CCSHARED="-fPIC" ./configure (as a single command, assuming bash)

    If neither of those work, you need to read the configure code and understand the conditions it tests for better.

    0 讨论(0)
  • 2021-02-02 11:43

    The following has an example of passing fPIC to configure

    0 讨论(0)
  • 2021-02-02 11:48

    I got it working by adding -fPIC after CC= gcc -pthread, i.e CC= gcc -pthread -fPIC in the Makefile.

    0 讨论(0)
  • 2021-02-02 11:49

    Run configure with --enable-shared. Then -fPIC will be included as part of the shared flags.

    0 讨论(0)
提交回复
热议问题