Error in linking fftw libraries for pyFFTW installation - python-2.7

I tried to install pyFFTW 0.9.2 to OSX mavericks, but I encounter the following errors:
/usr/bin/clang -bundle -undefined dynamic_lookup
-L//anaconda/lib -arch x86_64 -arch x86_64
build/temp.macosx-10.5-x86_64-2.7/anaconda/lib/python2.7/site-packages/pyFFTW-master/pyfftw/pyfftw.o
-L//anaconda/lib -lfftw3 -lfftw3f -lfftw3l -lfftw3_threads -lfftw3f_threads -lfftw3l_threads
-o build/lib.macosx-10.5-x86_64-2.7/pyfftw/pyfftw.so
ld: library not found for -lfftw3
clang: error: linker command failed with exit code 1 (use -v to see invocation)
As mentioned in pyFFTW installation -> cannot find -lfftw3_threads, I tried to compile and install fftw 3.3.4 for three times. But it is not working for me.
How I did was:
./configure --enable-float --enable-share => make => make install
./configure --enable-long-double --enable-share => make => make install
./configure --enable-threads --enable-share => make => make install
then I run python (2.7) setup files in pyFFTW folder, and I get the error above.
I appreciate your help.

I had the same issue on OSX 10.9.4 Maverick.
Try this:
download FFTW 3.3.4 than open a terminal window and go in the extracted FFTW directory and run these commands:
$ ./configure --enable-long-double --enable-threads
$ make
$ sudo make install
$ ./configure --enable-float --enable-threads
$ make
$ sudo make install
Than install pyFFTW using pip as suggested:
$ sudo pip install pyfftw

I'm using MacOX 10.11.4 and Python 3.5.1 installed through conda and the above answer didn't work for me.
I would still get this error:
ld: library not found for -lfftw3l
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pyfftw
or:
ld: library not found for -lfftw3l_threads
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'gcc' failed with exit status 1
----------------------------------------
Failed building wheel for pyfftw
What did work for me was a slight variation on what I found here:
First install long-double libraries
comp:fftw-3.3.4 user$ ./configure --enable-threads --enable-shared --disable-fortran --enable-long-double CFLAGS="-O3 -fno-common -fomit-frame-pointer -fstrict-aliasing"
comp:fftw-3.3.4 user$ make
comp:fftw-3.3.4 user$ sudo make install
Then install float and double libraries
comp:fftw-3.3.4 user$ ./configure --enable-threads --enable-shared --disable-fortran --enable-sse2 --enable-float CFLAGS="-O3 -fno-common -fomit-frame-pointer -fstrict-aliasing"
comp:fftw-3.3.4 user$ make
comp:fftw-3.3.4 user$ sudo make install
comp:fftw-3.3.4 user$ ./configure --enable-threads --enable-shared --disable-fortran --enable-sse2 CFLAGS="-O3 -fno-common -fomit-frame-pointer -fstrict-aliasing"
comp:fftw-3.3.4 user$ make
comp:fftw-3.3.4 user$ sudo make install
Then install pyfftw
comp:fftw-3.3.4 user$ sudo -H pip install pyfftw
I don't think the --disable-fortran and --enable-sse2 flags are necessary and I'm not sure sudo is necessary for pip but this is what worked for me.
Note that your /usr/local/lib folder should contain the following files when you're done:
libfftw3.3.dylib
libfftw3.a
libfftw3.dylib
libfftw3.la
libfftw3_threads.3.dylib
libfftw3_threads.a
libfftw3_threads.dylib
libfftw3_threads.la
libfftw3f.3.dylib
libfftw3f.a
libfftw3f.dylib
libfftw3f.la
libfftw3f_threads.3.dylib
libfftw3f_threads.a
libfftw3f_threads.dylib
libfftw3f_threads.la
libfftw3l.3.dylib
libfftw3l.a
libfftw3l.dylib
libfftw3l.la
libfftw3l_threads.3.dylib
libfftw3l_threads.a
libfftw3l_threads.dylib
libfftw3l_threads.la

Related

Getting error while installing memsql python library "_mysql.c:44:10: fatal error: 'my_config.h' file not found" on MAC OSx

When am trying to install the memsql python library getting below error
I have tried the below options already:
sudo pip install memsql
sudo pip install memsql --global-option=build_ext --global-option="-I/usr/local/opt/openssl/include" --global-option="-L/usr/local/opt/openssl/lib"
Installing collected packages: MySQL-python, memsql
Running setup.py install for MySQL-python ... error
Complete output from command /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-install-JDxMyP/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" build_ext -I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib install --record /private/tmp/pip-record-azfFw0/install-record.txt --single-version-externally-managed --compile:
running build_ext
building '_mysql' extension
creating build
creating build/temp.macosx-10.14-intel-2.7
cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -Dversion_info=(1,2,5,'final',1) -D__version__=1.2.5 -I/usr/local/Cellar/mysql/8.0.15/include/mysql -I/usr/local/opt/openssl/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _mysql.c -o build/temp.macosx-10.14-intel-2.7/_mysql.o
_mysql.c:44:10: fatal error: 'my_config.h' file not found
#include "my_config.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'cc' failed with exit status 1}
In order to install memsql-python you need to ensure that you have the dependencies already available. Specifically, the dependency that seems to be missing from your environment is libmysqlclient-dev or an equivalent package.
Note - you are overriding the include paths to point at your openssl installation which may be causing this issue due to how the compiler is searching for development headers.
According to the project's readme, use the following steps to get started quickly on Ubuntu:
sudo apt-get update
sudo apt-get install -y mysql-client python-dev libmysqlclient-dev python-pip
sudo pip install memsql
Use the following steps to get started with RHEL based distributions such as Amazon Linux or Centos:
sudo yum update
sudo yum install -y gcc mysql-devel
sudo pip install memsql
-- edit to address question regarding installation on Mac OSX
On a Mac it appears that you can install the mysql-client package from brew which in theory should provide the libmysqlclient-dev package. Once available try installing the memsql-python package without overriding linker flags since memsql-python should build fine without openssl. If you need openssl support then you will need to ensure that both the openssl and libmysqlclient-dev shared objects are available to the linker at compilation time.
This procedure worked for me:
brew remove mysql
brew install mysql#5.7
brew link --force mysql#5.7
I read a post and adjusted the procedure to link things in the /usr/local/bin instead of adding a new route to the PATH variable.
Reference: MacOS: "pip install MySQL-python" returning an error: "_mysql.c:44:10: fatal error: 'my_config.h' file not found"

Trouble building caffe from source

I am trying to install caffe by building it from source
After issuing the following command from the caffe root directory
$ make all -j4
I am getting an error
...
CXX src/caffe/layer_factory.cpp
CXX src/caffe/blob.cpp
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0
/usr/bin/x86_64-linux-gnu-ld: cannot find -lpython3.6
collect2: error: ld returned 1 exit status
Makefile:582: recipe for target '.build_release/lib/libcaffe.so.1.0.0' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1
Dependencies installed
$ sudo apt install python3-opencv
$ sudo apt-get install libatlas-base-dev
$ sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
$ sudo apt-get install --no-install-recommends libboost-all-dev
$ sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev
$ sudo apt-get install the python3-dev
CUDA: CUDA 9 CuDnn 7.4
Ubuntu: Ubuntu 18.04
Makefile.config
I have looked at all the issues in the source Github repository but couldn't find anything useful.
Therefore that your error states cannot find -lpython3.6 you are missing the libpython3.6.so on your system.
Try to:
sudo apt-get install libpython3.6-dev
The issue is resolved, I had to make the following changes in Makefile.config file
From
PYTHON_LIBRARIES := boost_python3 python3.6
PYTHON_INCLUDE := /usr/include/python3.6 \
/usr/lib/python3.6/dist-packages/numpy/core/include
To
PYTHON_LIBRARIES := boost_python3 python3.6m
PYTHON_INCLUDE := /usr/include/python3.6m \
/usr/lib/python3.6/dist-packages/numpy/core/include

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

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.

make not found with Dockerfile and centos:7 image

I have a very basic Dockerfile which uses FROM centos:7, then downloads Python-2.7.9.tar.xz, and attempts to ./configure && make && make altinstall.
I get the following error upon make:
creating Makefile
/bin/sh: make: command not found
The command '/bin/sh -c cd /root/Python-2.7.9 && ./configure -- prefix=/usr/local && make && make altinstall' returned a non-zero code: 127
I've installing the following libs prior to running make
yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel xz-libs gcc g++ build-essential kernel-headers kernel-devel
Yet error still persists. How can I resolve this?
A simple RUN yum -y install make solved the problem

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