make: *** [port-target] Error 2 When trying to install GDAL for GeoDjango using Ubuntu 18.04 - django

I am trying to install GeoDjango to use in my project. I am using Ubuntu 18.04 through VirtualBox. I am also using the GeoDjango installlation Guide to install Gdal. I have GEOS and PROJ.4 installled.
I have successfully run the below commands :
$ wget http://download.osgeo.org/gdal/1.11.2/gdal-1.11.2.tar.gz #success
$ tar xzf gdal-1.11.2.tar.gz #success
$ cd gdal-1.11.2 #success
Later I am supposed to do the below (according to the documentation):
$ ./configure
$ make # Go get some coffee, this takes a while.
$ sudo make install
$ cd ..
However, when I run these lines:
$ ./configure #success
$ make # Go get some coffee, this takes a while. #ERROR SEE BELOW
I get the below error:
samir#samir-VirtualBox:~/gdal-1.11.2$ make # Go get some coffee, this takes a while.
(cd port; make)
make[1]: Entering directory '/home/samir/gdal-1.11.2/port'
/bin/bash /home/samir/gdal-1.11.2/libtool --mode=compile --tag=CXX g++ -std=c++98 -g -O2 -DHAVE_SSE_AT_COMPILE_TIME -Wall -DOGR_ENABLED -I/home/samir/gdal-1.11.2/port -I../frmts/zlib -DHAVE_LIBZ -c -o cpl_error.lo cpl_error.cpp
libtool: compile: g++ -std=c++98 -g -O2 -DHAVE_SSE_AT_COMPILE_TIME -Wall -DOGR_ENABLED -I/home/samir/gdal-1.11.2/port -I../frmts/zlib -DHAVE_LIBZ -c cpl_error.cpp -fPIC -DPIC -o .libs/cpl_error.o
cpl_error.cpp: In function 'void CPLErrorV(CPLErr, int, const char*, __va_list_tag*)':
cpl_error.cpp:190:20: error: incompatible types in assignment of '__va_list_tag*' to 'va_list {aka __va_list_tag [1]}'
wrk_args = args;
^~~~
cpl_error.cpp:226:24: error: incompatible types in assignment of '__va_list_tag*' to 'va_list {aka __va_list_tag [1]}'
wrk_args = args;
^~~~
../GDALmake.opt:568: recipe for target 'cpl_error.lo' failed
make[1]: *** [cpl_error.lo] Error 1
make[1]: Leaving directory '/home/samir/gdal-1.11.2/port'
GNUmakefile:53: recipe for target 'port-target' failed
make: *** [port-target] Error 2
Below is a Screenshot of the error. so you can see it in color
How can I resolve this error ?

Please make sure you have ubuntu installed on your computer. If you
are using windows, install VirtualBox and download Ubuntu (Its a Linux
OS). You might have to do a basic course on Ubuntu either on YouTube
or Udemy then do
sudo apt install geos
sudo apt install proj4
sudo apt install gdal
sudo-apt install postgressql
sudo-apt install till postgis
that's it.. you are done as simple as that..
then download pgadmin3 (pgadmin4 is not available on ubuntu at the
time of this comment)
make the database on pgadmin3 (its way simpler than psql)
In your Virtual Env do
pip install dj-database-url
pip install psycopg2
pip install pillow
I suffered 2 weeks figuring this out.. Hopefully you don't have to
Trying this on Windows is next to impossible. Don't follow the
GeoDjango documents for installing GeoDjango with make and
make-install as that is very difficult.

Related

Error: unrecognized command line option ‘-Wno-invalid-source-encoding’ [-Werror] within building Mesos

My operating system is Ubuntu 18.10. I follow these steps on three nodes:
To install Mesos I did these steps one by one without any errors, except every node has already had Open JDK 8, so I did not install Open JDK 8 again.
sudo apt-get update
sudo apt-get install -y tar wget git
sudo apt-get install -y openjdk8-jdk (I did not do that)
sudo apt-get install -y autoconf libtool
sudo apt-get -y install build-essential python-dev python-six python-
virtualenv libcurl4-nss-dev libsasl2-dev libsasl2-modules maven
libapr1-dev libsvn-dev zlib1g-dev iputils-ping
The problem is begin when I want to build Mesos. I did these steps for that:
cd mesos-1.7.0
./bootstrap
mkdir build
cd build
../configure
make
My IP addresses are 150.20.11.137,150.20.11.134,150.20.11.157. I downloaded Mesos package on all of them and extracted in the same path.
I did <../configure> on every node without any problems, but when I run "make" I got this error on each node:
third_party/cares/cares/ares_init.c: In function ‘ares_dup’:
third_party/cares/cares/ares_init.c:301:17: error:
argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did
you mean to use the size of the destination? [-Werror=sizeof-pointer-
memaccess]
sizeof(src->local_dev_name));
^
third_party/cares/cares/ares_init.c: At top level:
cc1: error: unrecognized command line option ‘-Wno-invalid-source-
encoding’ [-Werror]
cc1: all warnings being treated as errors
make[4]: *** [Makefile:2635: /home/spark/mesos-
1.7.0/build/3rdparty/grpc-
1.10.0/objs/opt/third_party/cares/cares/ares_init.o] Error 1
make[4]: Leaving directory '/home/spark/mesos-
1.7.0/build/3rdparty/grpc-1.10.0'
make[3]: *** [Makefile:1446: grpc-1.10.0-build-stamp] Error 2
make[3]: Leaving directory '/home/spark/mesos-1.7.0/build/3rdparty'
make 2]: *** [Makefile:1035: all-recursive] Error 1
make[2]: Leaving directory '/home/spark/mesos-1.7.0/build/3rdparty'
make[1]: *** [Makefile:765: all] Error 2
make[1]: Leaving directory '/home/spark/mesos-1.7.0/build/3rdparty'
make: *** [Makefile:768: all-recursive] Error 1
Problem solved. The problem was because of GCC version. GCC version in Ubuntu 18.10 is 8.2.0. I installed gcc-5 and g++-5 with this instruction:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
Then to choose GCC version that I want, I have to install "update-alternatives" for gcc. Therefore, I run these commands:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 500 --slave
/usr/bin/g++ g++ /usr/bin/g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave
/usr/bin/g++ g++ /usr/bin/g++-8
After that I chose gcc-5 with this command :
sudo update-alternatives --config gcc
Moreover, I had an error related to OpenSSL; then I installed it via this command:
sudo apt-get install libssl-dev
After those modifications, I started to install Mesos and it installed without any errors. I hope this illustration was helpful for others.

django channels install error

I am trying to create a one to one real-time messaging system using Django. Upon searching I found out about django-channels. So i created a virtual env with python 3.5 and latest Django but when I do pip install channels I get :
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.5m -I/home/kshitij/Documents/projects/personal/maker/venv/include/python3.5m -c src/twisted/test/raiser.c -o build/temp.linux-x86_64-3.5/src/twisted/test/raiser.o
#include "Python.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
probably because of missing python headers so i did : sudo apt-get install python3-dev but it still shows the same error. What should I do?
pip version: 18
python version: 3.5
django version: 2.1
I tried doing sudo apt-get install python3-dev but getting:
ImportError: cannot import name '_BACKCOMPAT_MAGIC_NUMBER'
Verify your pip is not pip and its pip3.
You may also try installing sudo apt install python3.X-dev.
For you, it's sudo apt install python3.5-dev
Try installing the Linux compiler and python3-dev:
sudo apt install gcc
sudo apt install python3-dev
pip install channels
The last error may indicates you have an issue caused by many python versions installed on your system (see this answer). You should make sure you don't have incomplete or corrupted python installation on your system (did you already compiled Python by yourself?). In addition, make sure the package python3 is correctly installed or sudo apt-get install python3-dev cannot succeed.
In addition, you may try to locate Python.h on your system. Make sure each Python.h on your system correspond to a valid python setup (you may have one for python 2 and one more for python 3).

pip cant install python-ldap into virtualenv [duplicate]

When I sudo pip install pyquery, sudo pip install lxml, and sudo pip install cython, I get very similar output with the same error that says:
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-fstack-protector-strong’
Here's the complete pip output for sudo pip install pyquery:
Requirement already satisfied (use --upgrade to upgrade): pyquery in /usr/local/lib/python2.7/dist-packages
Downloading/unpacking lxml>=2.1 (from pyquery)
Running setup.py egg_info for package lxml
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.1.
Building without Cython.
Using build configuration of libxslt 1.1.28
Requirement already satisfied (use --upgrade to upgrade): cssselect in /usr/local/lib/python2.7/dist-packages/cssselect-0.9.1-py2.7.egg (from pyquery)
Installing collected packages: lxml
Running setup.py install for lxml
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.1.
Building without Cython.
Using build configuration of libxslt 1.1.28
building 'lxml.etree' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/libxml2 -I/root/build/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-fstack-protector-strong’
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;__file__='/root/build/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-gg4SuG-record/install-record.txt:
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'bugtrack_url'
warnings.warn(msg)
Building lxml version 3.4.1.
Building without Cython.
Using build configuration of libxslt 1.1.28
running install
running build
running build_py
copying src/lxml/includes/lxml-version.h -> build/lib.linux-x86_64-2.7/lxml/includes
running build_ext
building 'lxml.etree' extension
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/libxml2 -I/root/build/lxml/src/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-fstack-protector-strong’
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/root/build/lxml/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-gg4SuG-record/install-record.txt failed with error code 1 in /root/build/lxml
Storing complete log in /root/.pip/pip.log
The complete log from /root/.pip/pip.log is here: http://pastebin.com/5R4VZDu8
I've looked at this, this, this, and this for help, but I haven't been able to solve the issue yet.
I've already installed libxml2-dev, libxslt1-dev, and python-dev. I'm running Debian 7.0 x64 on a DigitalOcean droplet.
I'm just trying to install pyquery. Can someone please help me out?
Thanks
I ran into this problem when I attempted to upgrade my pandas version to 0.15.2
If you install gcc-4.9 you are likely to still have an older version of gcc on your system (gcc-4.7 in my case).
I can think of 3 ways to solve this issue:
a) symlink /usr/bin/x86_64-linux-gnu-gcc to
/usr/bin/x86_64-linux-gnu-gcc-4.9
if you want to be more organized about this use update-alternatives, see https://askubuntu.com/questions/26498/choose-gcc-and-g-version
b) figure out how to manually specify which compiler pip uses and set it in some sort of .conf file - I haven't examined where this file lives or if there are CLI options for pip that accomplish the equivalent. In principle, creating/editing a /usr/lib/pythonX.Y/distutils/distutils.cfg should do it. I ran into problems when I tried to use this approach.
c) Edit /usr/lib/python2.7/plat-x86_64-linux-gnu/_sysconfigdata_nd.py to reflect your updated compiler
How to use MinGW's gcc compiler when installing Python package using Pip?
https://docs.python.org/2/install/#distutils-configuration-files
I went with the quick and dirty solution (a) to force everything to work
root#localhost:/home/user1$ rm /usr/bin/x86_64-linux-gnu-gcc
root#localhost:/home/user1$ ln -s /usr/bin/gcc-4.9 /usr/bin/x86_64-linux-gnu-gcc
root#localhost:/home/user1$ pip install pandas --upgrade
. . . pandas compiles with gcc-4.9 here . . .
move things back to how they were
root#localhost:/home/user1$ rm /usr/bin/x86_64-linux-gnu-gcc
root#localhost:/home/user1$ ln -s /usr/bin/gcc-4.7 /usr/bin/x86_64-linux-gnu-gcc
One possible solution would be to use GCC 4.9 or higher, which does support the -fstack-protector-strong flag.
Instead of upgrading to GCC 4.9, I was trying to find where the flag was defined and remove it. On Debian Wheezy, I found it in /usr/lib/python2.7/plat-x86_64-linux-gnu/_sysconfigdata_nd.py which belongs to the libpython2.7-minimal package. My solution was to replace all occurrences of -fstack-protector-strong with -fstack-protector within this file. Then pip install executed the correct build command.

Tell gnu-autotools where my newly installed library is (with PKG_CONFIG?)

Sorry, my gnu-autotools Fu is rusty here . .
Our application uses 'packs' - GBs of data that is downloaded by the user and demand. To test this, I would like to use libifuse to transfer data to/from the iOS device without jail-breaking. So, I'm building libifuse from source, starting with dependencies:
I installed libusbmuxd:
It installed to the following:
.././install-sh -c -d '/usr/local/bin'
/bin/sh ../libtool --mode=install /usr/bin/install -c iproxy '/usr/local/bin'
libtool: install: /usr/bin/install -c .libs/iproxy /usr/local/bin/iproxy
make[2]: Nothing to be done for `install-data-am'.
make[2]: Nothing to be done for `install-exec-am'.
./install-sh -c -d '/usr/local/lib/pkgconfig'
/usr/bin/install -c -m 644 libusbmuxd.pc '/usr/local/lib/pkgconfig'
Can't build libimobiledevice - need to find libusbmuxd:
Now when building libimobiledevice, I get the following error, when running ./configure:
checking for libusbmuxd... no
configure: error: Package requirements (libusbmuxd >= 1.0.8) were not met:
No package 'libusbmuxd' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables libusbmuxd_CFLAGS
My Question:
How do I tell the gnu-autotools where my newly installed library is? What is the best practice here?
Try to install the package pkg-config.
In fact, the autotools use pkg-config to see if the package you need is installed.
Edit:
Try pkg-config --print-variables libusbmuxd to see if you got something.

Problem building Festival (Text to Speech) on Ubuntu

I set up a Ubuntu VM today just to build Festival on Ubuntu (I never ran it before) Then I did the following setups
On the Terminal window I wrote following to install GNU C++ Compiler
sudo apt-get install build-essential
To test the g++ I wrote a sample hello world and compiled it using g++ and run it and it worked as expected.
I downloaded all the files from listed on festival download page
Unpacked all to the home directory(~) using
tar -zxvf *.tar.gz
Then wrote following 3 commands to configure and make speech_tools
cd speech_tools
./configure
make
But make returns with following errors
/lib -leststring -lcurses -ldl -lncurses -lm -lstdc++ -lgcc
/usr/bin/ld: cannot find -lcurses
/usr/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status
make[1]: *** [ch_lab] Error 1
make: *** [main] Error 2
What am I missing? being a newbie to Ubuntu or any other Unix platform I may missed some important configuration, before that I have successfully built festival on my windows machine using Cygwin.
You probably need to install the development packages for libncurses. Try
sudo apt-get install libncurses5-dev