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

Unable to compile gdal with --with-python flag enabled #1199

Closed
swiss-knight opened this issue Jan 11, 2019 · 5 comments
Closed

Unable to compile gdal with --with-python flag enabled #1199

swiss-knight opened this issue Jan 11, 2019 · 5 comments
Labels
awaiting_feedback Awaiting feedback from reporter

Comments

@swiss-knight
Copy link
Contributor

I encountered this error when trying to compile gdal from sources on Ubuntu 18.04 (4.15.0-43-generic x86_64 GNU/Linux) :

From my /opt/gdal folder I first ran:
$ git pull

Then:
$ ./configure --with-python=python3

And finally:
$ make

=>ends up on this kind of error message:

make[1]: Entering directory '/opt/gdal/gdal/apps'
/bin/bash /opt/gdal/gdal/libtool --mode=link --silent g++  gdalinfo_bin.lo  /opt/gdal/gdal/libgdal.la  -o gdalinfo
/opt/gdal/gdal/.libs/libgdal.so: undefined reference to `OGR::transcode(char16_t const*, int)'
/opt/gdal/gdal/.libs/libgdal.so: undefined reference to `OGRDestroyXercesInputSource(xercesc_3_2::InputSource*)'
/opt/gdal/gdal/.libs/libgdal.so: undefined reference to `CPLIsMachineForSureGCEInstance()'
/opt/gdal/gdal/.libs/libgdal.so: undefined reference to `OGRCleanupXercesMutex()'
/opt/gdal/gdal/.libs/libgdal.so: undefined reference to `OGR::transcode(char16_t const*, CPLString&, int)'
/opt/gdal/gdal/.libs/libgdal.so: undefined reference to `CPLHaveRuntimeAVX()'
/opt/gdal/gdal/.libs/libgdal.so: undefined reference to `CPLIsMachinePotentiallyGCEInstance()'
/opt/gdal/gdal/.libs/libgdal.so: undefined reference to `OGRCreateXercesInputSource(_IO_FILE*)'
/opt/gdal/gdal/.libs/libgdal.so: undefined reference to `OGRInitializeXerces()'
/opt/gdal/gdal/.libs/libgdal.so: undefined reference to `OGRDeinitializeXerces()'
collect2: error: ld returned 1 exit status
GNUmakefile:82: recipe for target 'gdalinfo' failed
make[1]: *** [gdalinfo] Error 1
make[1]: Leaving directory '/opt/gdal/gdal/apps'
GNUmakefile:109: recipe for target 'apps-target' failed
make: *** [apps-target] Error 2

The same issue arise with other apps, like "gdal_translate", "gdalserver" or "gdaladdo" when using several cores when making the project.

It builds correctly if I do not use the flag --with-python at the ./configure step.

@rouault
Copy link
Member

rouault commented Jan 11, 2019

Can't reproduce the error with a single-process make and --with-python=python3. Is your make a single-process make or a multi-process one ?

@rouault rouault added the awaiting_feedback Awaiting feedback from reporter label Jan 11, 2019
@swiss-knight
Copy link
Contributor Author

Yes it is a single-process make command that I run, i.e. without any -jX option where X = number of cores.

@Daya-Jin
Copy link

same problem.

2019-12-17_22-01-58

@swiss-knight
Copy link
Contributor Author

swiss-knight commented Jan 23, 2020

I figured out that after having upgraded some python3 packages and upgrading the ./configure options as follow, the build process passed without error:

$ pip3 install -U pip
$ pip3 install -U numpy
$ pip3 install -U setuptools
$ pip3 install -U six
$ pip3 install -U matplotlib
$ pip3 install -U pandas
$ pip3 install -U geopandas
$ pip3 install -U fiona
$ pip3 install -U shapely
$ ldconfig

(It was probably setuptools that was not enough up-to-date, but it's only a guess...)

Then ;

$ ./configure --with-proj=/usr/local \
                  --with-python=/usr/bin/python3 \
                  --with-local=/usr/local \
                  --with-cpp14

Finally, it has to be build with make.

$ make -j4

But before, it may be worth cleaning any previous try with:

$ make distclean

If you can confirm that it worked for you?

Note: there is still the same bug with PROJ release 6.3.0 and GDAL <master>,
but it's working with PROJ release 6.3.0 and GDAL release 2.4.0.

@rouault
Copy link
Member

rouault commented Nov 2, 2021

Seems that can be closed

@rouault rouault closed this as completed Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting_feedback Awaiting feedback from reporter
Projects
None yet
Development

No branches or pull requests

3 participants