pip install uwsgi failing with "cannot find -lz" - python

I want to install uwsgi but I am unable to do so. It is a Fedora 18 64-bit system. python is version 2.7 and yum install zlib says: Package zlib-1.2.7-9.fc18.x86_64 already installed and latest version
Here is the last chunk of output when installing uwsgi.
*** uWSGI linking ***
gcc -pthread -o /usr/bin/uwsgi -L/usr/lib64 core/utils.o core/protocol.o core/socket.o core/logging.o core/master.o core/master_utils.o core/emperor.o core/notify.o core/mule.o core/subscription.o core/stats.o core/sendfile.o core/async.o core/master_checks.o core/offload.o core/io.o core/static.o core/websockets.o core/spooler.o core/snmp.o core/exceptions.o core/config.o core/setup_utils.o core/clock.o core/init.o core/buffer.o core/reader.o core/writer.o core/alarm.o core/cron.o core/plugins.o core/lock.o core/cache.o core/daemons.o core/errors.o core/hash.o core/master_events.o core/chunked.o core/queue.o core/event.o core/signal.o core/strings.o core/progress.o core/timebomb.o core/ini.o core/fsmon.o core/rpc.o core/gateway.o core/loop.o core/cookie.o core/querystring.o core/rb_timers.o core/transformations.o core/uwsgi.o proto/base.o proto/uwsgi.o proto/http.o proto/fastcgi.o proto/scgi.o lib/linux_ns.o core/zlib.o core/yaml.o core/dot_h.o plugins/python/python_plugin.o plugins/python/pyutils.o plugins/python/pyloader.o plugins/python/wsgi_handlers.o plugins/python/wsgi_headers.o plugins/python/wsgi_subhandler.o plugins/python/web3_subhandler.o plugins/python/pump_subhandler.o plugins/python/gil.o plugins/python/uwsgi_pymodule.o plugins/python/profiler.o plugins/python/symimporter.o plugins/python/tracebacker.o plugins/gevent/gevent.o plugins/gevent/hooks.o plugins/ping/ping_plugin.o plugins/cache/cache.o plugins/nagios/nagios.o plu/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.7.2/../../../libz.so when searching for -lz
/bin/ld: skipping incompatible /lib/libz.so when searching for -lz
/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
gins/rrdtool/rrdtool.o plugins/carbon/carbon.o plugins/rpc/rpc_plugin.o plugins/corerouter/cr_common.o plugins/corerouter/cr_map.o plugins/corerouter/corerouter.o plugins/fastrouter/fastrouter.o plugins/http/http.o plugins/http/keepalive.o plugins/http/https.o plugins/http/spdy3.o plugins/ugreen/ugreen.o plugins/signal/signal_plugin.o plugins/syslog/syslog_plugin.o plugins/rsyslog/rsyslog_plugin.o plugins/logsocket/logsocket_plugin.o plugins/router_uwsgi/router_uwsgi.o plugins/router_redirect/router_redirect.o plugins/router_basicauth/router_basicauth.o plugins/zergpool/zergpool.o plugins/redislog/redislog_plugin.o plugins/mongodblog/mongodblog_plugin.o plugins/router_rewrite/router_rewrite.o plugins/router_http/router_http.o plugins/logfile/logfile.o plugins/router_cache/router_cache.o plugins/rawrouter/rawrouter.o plugins/router_static/router_static.o plugins/sslrouter/sslrouter.o plugins/spooler/spooler_plugin.o plugins/cheaper_busyness/cheaper_busyness.o plugins/symcall/symcall_plugin.o plugins/transformation_tofile/tofile.o plugins/transformation_gzip/gzip.o plugins/transformation_chunked/chunked.o plugins/transformation_offload/offload.o plugins/router_memcached/router_memcached.o plugins/router_redis/router_redis.o plugins/router_hash/router_hash.o plugins/router_expires/expires.o -lpthread -lm -rdynamic -ldl -lz -lpthread -ldl -lutil -lm -lpython2.7 -lcrypt
*** error linking uWSGI ***
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-root/uwsgi/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-QEHDKx-record/install-record.txt --single-version-externally-managed failed with error code 1 in /tmp/pip-build-root/uwsgi
Storing complete log in /root/.pip/pip.log

First up, make sure you installed python-dev.
Next up, install zlib-devel.
yum install -y python-dev zlib-devel

First up, I wouldn't worry about:
/bin/ld: skipping incompatible /lib/libz.so when searching for -lz
/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
They're only showing up because -L adds a directory to the library search path so it's still examining the 32-bit areas as well (and ignoring them).
However, according to the RPM search page for your package, only the following files are provided:
/usr/lib64/libz.so.1
/usr/lib64/libz.so.1.2.7
/usr/share/doc/zlib-1.2.7
/usr/share/doc/zlib-1.2.7/ChangeLog
/usr/share/doc/zlib-1.2.7/FAQ
/usr/share/doc/zlib-1.2.7/README
You may want to examine that directory to see if there is a libz.so soft-linked to the libz.so.1 entry. If not, create one with a command like:
ln -s /usr/lib64/libz.so.1 /usr/lib64/libz.so
(you may need to be root). Looking at the libz stuff in /lib should show you what it should look like, like:
lrwxrwxrwx 1 root root 18 Apr 24 2012 libxyzzy.so -> libxyzzy.so.2.1.0

Related

Makefile:179: recipe for target 'obj/demo.o' failed make: *** [obj/demo.o] Error 1

When I run !make command in yolov4, I face the issue:
chmod +x *.sh
gcc -Iinclude/ -I3rdparty/stb/include -DOPENCV `pkg-config --cflags opencv4 2> /dev/null || pkg-config --cflags opencv` -DGPU -I/usr/local/cuda/include/ -DCUDNN -Wall -Wfatal-errors -Wno-unused-result -Wno-unknown-pragmas -fPIC -Ofast -DOPENCV -DGPU -DCUDNN -I/usr/local/cudnn/include -c demo.c -o obj/demo.o
demo.c:1:10: fatal error: network.h: No such file or directory
#include "network.h"
^~~~~~~~~~~
compilation terminated.
Makefile:179: recipe for target 'obj/demo.o' failed
make: \*\*\* \[obj/demo.o\] Error 1
Firstly it work fine, then I change in the darknet/src/dectector.c file for early save weights after 500 iteration and also change in the cfg/yolov4-custom.cfg file change the max_batches values 500500 to 500.
I don't think so it should create issue during the execution of !make file.
Someone have any suggestion? Anyone face this issue please guide me.
I run training command for yolov4 I face the issue access denied then I again run !make file at this command error came.

Installing Python 3.8.1 --with-openssl --without-root/apt/yum

i need to install Python3 with ssl in a different userdir. I'm working on Debian without root privileges. I'm really trying to find a solution by myself, but after spending serveral hours I'm still not able to get it correctly done.
The Path to install ssl and python is $HOME/.local/
$HOME is always an absolute path like /path/to/install
Logs below
Things I've already tried:
1. Creating installation folders
cd $HOME
mkdir .local
cd .local
mkdir ssl
mkdir python
mkdir src
cd src
2. Downloading latest tar versions of Python and openssl
wget https://www.python.org/ftp/python/3.8.1/Python-3.8.1.tgz
wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz
tar xvfz Python-3.8.1.tgz
tar xvfz openssl-1.1.1d.tar.gz
3. Configure, Make, Install Openssl (in $HOME/.local/ssl)
cd openssl-1.1.1d
./config --prefix=$HOME/.local/ssl
make && make install
4. Edit Modules/Setup, Make, Install Python
cd $HOME/.local/src/Python-3.8.1
cd Modules
vi Setup
Modules/Setup
210 SSL=$HOME/.local/ssl
211 _ssl _ssl.c \
212 -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
213 -L$(SSL)/lib -lssl -lcrypto
configure
cd $HOME/.local/src/Python-3.8.1
./configure --prefix=$Home/.local/python
Log-Snippets
Configure Python
checking for openssl/ssl.h in /usr/local/ssl... no
checking for openssl/ssl.h in /usr/lib/ssl... no
checking for openssl/ssl.h in /usr/ssl... no
checking for openssl/ssl.h in /usr/pkg... no
checking for openssl/ssl.h in /usr/local... no
checking for openssl/ssl.h in /usr... no
checking whether compiling and linking against OpenSSL works... no
Alternative Log: Seems it doesn't look in the right places. Already tried to give a hint while configure
./configure --prefix=$Home/.local/python --with-openssl=$HOME/.local/ssl
Log while Configure Changes in:
checking for openssl/ssl.h in $HOME/.local/ssl... yes
checking whether compiling and linking against OpenSSL works... yes
checking for X509_VERIFY_PARAM_set1_host in libssl... yes
checking for --with-ssl-default-suites... python
But then make throws error
Include/internal -I. -I./Include -DPy_BUILD_CORE \
-DGITVERSION="\"`LC_ALL=C `\"" \
-DGITTAG="\"`LC_ALL=C `\"" \
-DGITBRANCH="\"`LC_ALL=C `\"" \
-o Modules/getbuildinfo.o ./Modules/getbuildinfo.c
gcc -pthread -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I./Include/internal -I. -I./Include -DPy_BUILD_CORE -o Python/frozen.o Python/frozen.c
rm -f libpython3.8.a
ar rcs libpython3.8.a Modules/getbuildinfo.o Parser/acceler.o Parser/grammar1.o Parser/listnode.o Parser/node.o Parser/parser.o Parser/token.o Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o Objects/abstract.o Objects/accu.o Objects/boolobject.o Objects/bytes_methods.o Objects/bytearrayobject.o Objects/bytesobject.o Objects/call.o Objects/capsule.o Objects/cellobject.o Objects/classobject.o Objects/codeobject.o Objects/complexobject.o Objects/descrobject.o Objects/enumobject.o Objects/exceptions.o Objects/genobject.o Objects/fileobject.o Objects/floatobject.o Objects/frameobject.o Objects/funcobject.o Objects/interpreteridobject.o Objects/iterobject.o Objects/listobject.o Objects/longobject.o Objects/dictobject.o Objects/odictobject.o Objects/memoryobject.o Objects/methodobject.o Objects/moduleobject.o Objects/namespaceobject.o Objects/object.o Objects/obmalloc.o Objects/picklebufobject.o Objects/rangeobject.o Objects/setobject.o Objects/sliceobject.o Objects/structseq.o Objects/tupleobject.o Objects/typeobject.o Objects/unicodeobject.o Objects/unicodectype.o Objects/weakrefobject.o Python/_warnings.o Python/Python-ast.o Python/asdl.o Python/ast.o Python/ast_opt.o Python/ast_unparse.o Python/bltinmodule.o Python/ceval.o Python/codecs.o Python/compile.o Python/context.o Python/dynamic_annotations.o Python/errors.o Python/frozenmain.o Python/future.o Python/getargs.o Python/getcompiler.o Python/getcopyright.o Python/getplatform.o Python/getversion.o Python/graminit.o Python/hamt.o Python/import.o Python/importdl.o Python/initconfig.o Python/marshal.o Python/modsupport.o Python/mysnprintf.o Python/mystrtoul.o Python/pathconfig.o Python/peephole.o Python/preconfig.o Python/pyarena.o Python/pyctype.o Python/pyfpe.o Python/pyhash.o Python/pylifecycle.o Python/pymath.o Python/pystate.o Python/pythonrun.o Python/pytime.o Python/bootstrap_hash.o Python/structmember.o Python/symtable.o Python/sysmodule.o Python/thread.o Python/traceback.o Python/getopt.o Python/pystrcmp.o Python/pystrtod.o Python/pystrhex.o Python/dtoa.o Python/formatter_unicode.o Python/fileutils.o Python/dynload_shlib.o Modules/config.o Modules/getpath.o Modules/main.o Modules/gcmodule.o Modules/posixmodule.o Modules/errnomodule.o Modules/pwdmodule.o Modules/_sre.o Modules/_codecsmodule.o Modules/_weakref.o Modules/_functoolsmodule.o Modules/_operator.o Modules/_collectionsmodule.o Modules/_abc.o Modules/itertoolsmodule.o Modules/atexitmodule.o Modules/signalmodule.o Modules/_stat.o Modules/timemodule.o Modules/_threadmodule.o Modules/_localemodule.o Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o Modules/faulthandler.o Modules/_tracemalloc.o Modules/hashtable.o Modules/symtablemodule.o
Modules/_ssl.o Modules/xxsubtype.o Python/frozen.o
gcc -pthread -L$HOME/.local/ssl/lib -L$HOME/htdocs/.local/ssl/lib -Xlinker -export-dynamic -o python Programs/python.o libpython3.8.a -lcrypt -lpthread -ldl -lutil -lm -L$HOME/.local/ssl/lib -lssl -lcrypto -lm
./python -E -S -m sysconfig --generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
./python: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
generate-posix-vars failed
Makefile:592: recipe for target 'pybuilddir.txt' failed
make: *** [pybuilddir.txt] Error 1
Guess the Error occurs because of following line
./python: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Has somebody a clue where libssl.so.1.1 is supposed to be?
Thanks in advance.
Wip
Solved Issue by adding Path to LD_LIBRARY_PATH
Needed Libs can be found in path/to/ssl/lib
For me adding following Line in .profiles or .bashrc fixed the Issue
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/.local/ssl/lib

Issue with GRIB API, Jasper, Pygrib

During the recent days i had problem with GRIB API installation, i was able to install it with disable the --disable-shared flag but the problem is then i got an error while running Pygrib test "python animate.py"
(GRIB_API ERROR : JPEG support not enabled.)
So i had to install the GRIB API again without disable the shared but i got this error:
Linking C shared library ../lib/libgrib_api.so
/usr/bin/ld: /usr/local/lib/libjasper.a(jpc_math.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libjasper.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libgrib_api.so] Error 1
make[1]: *** [src/CMakeFiles/grib_api.dir/all] Error 2
make: *** [all] Error 2
then i started to compile Jasper again with -fPIC flag but i still got the
"recompile with -fPIC" for that i changed the flags in MAKE file as:
CFLAGS = -fPIC
CPP = gcc -E
CPPFLAGS =
CXX = g++
CXXCPP = g++ -E
CXXDEPMODE = depmode=gcc3
CXXFLAGS = -fPIC
FFLAGS = -fPIC
still no resualt ... i searched many but no resualt
Thanks in advance

How to build SVMstruct Python module on Ubuntu

I downloaded the source code from here. When I run make, I get the following error message:
make: Entering directory `/home/christopher/SourceCode/svm-python-v204'
cd svm_light; make svm_learn_hideo_noexe
make[1]: Entering directory `/home/christopher/SourceCode/svm-python-v204/svm_light'
make[1]: Nothing to be done for `svm_learn_hideo_noexe'.
make[1]: Leaving directory `/home/christopher/SourceCode/svm-python-v204/svm_light'
cd svm_struct; make svm_struct_noexe
make[1]: Entering directory `/home/christopher/SourceCode/svm-python-v204/svm_struct'
make[1]: Nothing to be done for `svm_struct_noexe'.
make[1]: Leaving directory `/home/christopher/SourceCode/svm-python-v204/svm_struct'
gcc -g -lm svm_struct/svm_struct_learn.o svm_struct_api.o svm_light/svm_hideo.o svm_light/svm_learn.o svm_light/svm_common.o svm_struct/svm_struct_common.o svm_struct/svm_struct_main.o pyobjs/array.o pyobjs/constraints.o pyobjs/default.o pyobjs/document.o pyobjs/kernelparm.o pyobjs/model.o pyobjs/sample.o pyobjs/sparm.o pyobjs/sparse.o pyobjs/structmodel.o pyobjs/svmapi.o -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -o svm_python_learn
/usr/bin/ld: svm_light/svm_common.o: undefined reference to symbol 'exp##GLIBC_2.2.5'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libm.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [svm_python_learn_hideo] Error 1
make: Leaving directory `/home/christopher/SourceCode/svm-python-v204'
christopher#christopher-laptop:~/SourceCode/svm-python-v204-build$ make -C ./../svm-python-v204
make: Entering directory `/home/christopher/SourceCode/svm-python-v204'
cd svm_light; make svm_learn_hideo_noexe
make[1]: Entering directory `/home/christopher/SourceCode/svm-python-v204/svm_light'
make[1]: Nothing to be done for `svm_learn_hideo_noexe'.
make[1]: Leaving directory `/home/christopher/SourceCode/svm-python-v204/svm_light'
cd svm_struct; make svm_struct_noexe
make[1]: Entering directory `/home/christopher/SourceCode/svm-python-v204/svm_struct'
make[1]: Nothing to be done for `svm_struct_noexe'.
make[1]: Leaving directory `/home/christopher/SourceCode/svm-python-v204/svm_struct'
gcc -g -lm svm_struct/svm_struct_learn.o svm_struct_api.o svm_light/svm_hideo.o svm_light/svm_learn.o svm_light/svm_common.o svm_struct/svm_struct_common.o svm_struct/svm_struct_main.o pyobjs/array.o pyobjs/constraints.o pyobjs/default.o pyobjs/document.o pyobjs/kernelparm.o pyobjs/model.o pyobjs/sample.o pyobjs/sparm.o pyobjs/sparse.o pyobjs/structmodel.o pyobjs/svmapi.o -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/lib/python2.7/config-x86_64-linux-gnu -lpython2.7 -lpthread -ldl -lutil -o svm_python_learn
/usr/bin/ld: svm_light/svm_common.o: undefined reference to symbol 'exp##GLIBC_2.2.5'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libm.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [svm_python_learn_hideo] Error 1
make: Leaving directory `/home/christopher/SourceCode/svm-python-v204'
Everything is fairly 'out of the box' so I suspect this is a Ubuntu problem. In particular, I suspect glibc is out of date from
undefined reference to symbol 'exp##GLIBC_2.2.5'
When I try /lib/x86_64-linux-gnu/libc.so.6, I get
GNU C Library (Ubuntu EGLIBC 2.19-0ubuntu6.6) stable release version 2.19
The latest version is 2.2.5, but eglibc, which seems to be how Ubuntu users get glibc, doesn't have a 2.2 branch. I have already tried apt-get upgrade but I am still at version 2.19. What do I do to solve this?
As of 2014, Debian seems to have moved back to glibc.
Adding LIBS=-lm near the top of the MakeFile to link against the math library solved the problem for me.

Fitsio pip install giving bad register errors, using MacPorts gcc on 64-bit MacBook Pro

I'm trying to install this fitsio python package: https://github.com/esheldon/fitsio.
I have tried
pip install fitsio
and python setup.py install in the fitsio directory and they both give similar 'bad register' errors. Here is the beginning of the output from pip install:
Downloading/unpacking fitsio
Downloading fitsio-0.9.6.tar.gz (5.9MB): 5.9MB downloaded
Running setup.py (path:/private/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pip_build_Christina/fitsio/setup.py) egg_info for package fitsio
checking build system type... x86_64-apple-darwin13.3.0
checking host system type... x86_64-apple-darwin13.3.0
checking target system type... x86_64-apple-darwin13.3.0
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking bzlib.h usability... yes
checking bzlib.h presence... yes
checking for bzlib.h... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking for gfortran... gfortran
checking whether we are using GNU Fortran...
yes
cfitsio: == Adding wrapper support for GNU Fortran...
done
checking for ar... ar
checking for ranlib... ranlib
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking whether gcc accepts -arch i386 -arch x86_64... no
cfitsio: == Using gcc version 4.8.2
checking "whether ftruncate works"... "yes"
checking "whether long long is defined"... "yes"
checking "whether system V style IPC services are supported"... "yes"
checking "do we have flock_t defined in sys/fcntl.h"... "no"
checking "do we have flock_t defined in sys/flock.h"... "no"
checking "do we have union semun defined"... "yes"
checking for library containing gethostbyname... none required
checking for library containing connect... none required
configure: creating ./config.status
config.status: creating Makefile
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cfitsio.pc
Congratulations, Makefile update was successful.
You may want to run "make" now.
gcc -c -o ./buffers.o -g -O2 -Dg77Fortran -fPIC -fno-common -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_BZLIB_H=1 -DHAVE_BZIP2=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MATH_H=1 -DHAVE_LIMITS_H=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DHAVE_FTRUNCATE=1 -DHAVE_LONGLONG=1 -DHAVE_SHMEM_SERVICES=1 -DHAVE_UNION_SEMUN=1 -DHAVE_NET_SERVICES=1 buffers.c
gcc -c -o ./cfileio.o -g -O2 -Dg77Fortran -fPIC -fno-common -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_BZLIB_H=1 -DHAVE_BZIP2=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MATH_H=1 -DHAVE_LIMITS_H=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DHAVE_FTRUNCATE=1 -DHAVE_LONGLONG=1 -DHAVE_SHMEM_SERVICES=1 -DHAVE_UNION_SEMUN=1 -DHAVE_NET_SERVICES=1 cfileio.c`
then lots more lines of gcc then:
ar rv libcfitsio.a buffers.o cfileio.o checksum.o drvrfile.o drvrmem.o drvrnet.o drvrsmem.o drvrgsiftp.o editcol.o edithdu.o eval_l.o eval_y.o eval_f.o fitscore.o getcol.o getcolb.o getcold.o getcole.o getcoli.o getcolj.o getcolk.o getcoll.o getcols.o getcolsb.o getcoluk.o getcolui.o getcoluj.o getkey.o group.o grparser.o histo.o iraffits.o modkey.o putcol.o putcolb.o putcold.o putcole.o putcoli.o putcolj.o putcolk.o putcoluk.o putcoll.o putcols.o putcolsb.o putcolu.o putcolui.o putcoluj.o putkey.o region.o scalnull.o swapproc.o wcssub.o wcsutil.o imcompress.o quantize.o ricecomp.o pliocomp.o fits_hcompress.o fits_hdecompress.o simplerng.o zlib/adler32.o zlib/crc32.o zlib/deflate.o zlib/infback.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o zlib/uncompr.o zlib/zcompress.o zlib/zuncompress.o zlib/zutil.o f77_wrap1.o f77_wrap2.o f77_wrap3.o f77_wrap4.o; \
ranlib libcfitsio.a;
ar: creating archive libcfitsio.a
/opt/local/bin/ranlib: file: libcfitsio.a(drvrgsiftp.o) has no symbols
a - buffers.o
a - cfileio.o
a - checksum.o
a - drvrfile.o
a - drvrmem.o
a - drvrnet.o
a - drvrsmem.o
a - drvrgsiftp.o
a - editcol.o
a - edithdu.o
a - eval_l.o
a - eval_y.o
a - eval_f.o
a - fitscore.o
a - getcol.o
a - getcolb.o
a - getcold.o
a - getcole.o
a - getcoli.o
a - getcolj.o
a - getcolk.o
a - getcoll.o
a - getcols.o
a - getcolsb.o
a - getcoluk.o
a - getcolui.o
a - getcoluj.o
a - getkey.o
a - group.o
a - grparser.o
a - histo.o
a - iraffits.o
a - modkey.o
a - putcol.o
a - putcolb.o
a - putcold.o
a - putcole.o
a - putcoli.o
a - putcolj.o
a - putcolk.o
a - putcoluk.o
a - putcoll.o
a - putcols.o
a - putcolsb.o
a - putcolu.o
a - putcolui.o
a - putcoluj.o
a - putkey.o
a - region.o
a - scalnull.o
a - swapproc.o
a - wcssub.o
a - wcsutil.o
a - imcompress.o
a - quantize.o
a - ricecomp.o
a - pliocomp.o
a - fits_hcompress.o
a - fits_hdecompress.o
a - simplerng.o
a - zlib/adler32.o
a - zlib/crc32.o
a - zlib/deflate.o
a - zlib/infback.o
a - zlib/inffast.o
a - zlib/inflate.o
a - zlib/inftrees.o
a - zlib/trees.o
a - zlib/uncompr.o
a - zlib/zcompress.o
a - zlib/zuncompress.o
a - zlib/zutil.o
a - f77_wrap1.o
a - f77_wrap2.o
a - f77_wrap3.o
a - f77_wrap4.o
ranlib: file: libcfitsio.a(drvrgsiftp.o) has no symbols
Downloading/unpacking numpy from https://pypi.python.org/packages/source/n/numpy/numpy-1.9.2.tar.gz#md5=a1ed53432dbcd256398898d35bc8e645 (from fitsio)
Downloading numpy-1.9.2.tar.gz (4.0MB): 4.0MB downloaded
Running setup.py (path:/private/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pip_build_Christina/numpy/setup.py) egg_info for package numpy
Running from numpy source directory.
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.pyd' found anywhere in distribution
Installing collected packages: fitsio, numpy
Running setup.py install for fitsio
make[1]: Nothing to be done for `stand_alone'.
building 'fitsio._fitsio_wrap' extension
gcc -fno-strict-aliasing -I/Users/Christina/anaconda/include -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Icfitsio3370 -I/Users/Christina/anaconda/lib/python2.7/site-packages/numpy/core/include -I/Users/Christina/anaconda/include/python2.7 -c fitsio/fitsio_pywrap.c -o build/temp.macosx-10.5-x86_64-2.7/fitsio/fitsio_pywrap.o -arch i386 -arch x86_64
In file included from /Users/Christina/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1761:0,
from /Users/Christina/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from /Users/Christina/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from fitsio/fitsio_pywrap.c:28:
/Users/Christina/anaconda/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by " \
^
where the last line about deprecated NumPy API is something else I cannot resolve, but it seems that it can be ignored.
After this there are a LOT of lines that look like these:
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:16:bad register name `%rbp'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:18:bad register name `%rbx'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:20:bad register name `%rdx'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:21:bad register name `%rsp'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:26:`L4(%rip)' is not a valid base/index expression
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:29:`movslq' is only supported in 64-bit mode
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:30:bad register name `%rdx'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:31:bad register name `%rax'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:50:bad register name `%rsi)'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:54:bad register name `%rbx)'
/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T//cckS5jL0.s:58:bad register name `%rsp'
and finally ends with
error: command 'gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Removing temporary dir /private/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pip_build_Christina... Command /Users/Christina/anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pip_build_Christina/f\ itsio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/3p/v45zthb14d1\ d108h9y8xg6cw0000gn/T/pip-ww4Fvd-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/3p/v45zthb1\ 4d1d108h9y8xg6cw0000gn/T/pip_build_Christina/fitsio
Exception information:
Traceback (most recent call last): File "/Users/Christina/anaconda/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Users/Christina/anaconda/lib/python2.7/site-packages/pip/commands/install.py", line 283, in run
requirement_set.install(install_options, global_options, root=options.root_path)
File "/Users/Christina/anaconda/lib/python2.7/site-packages/pip/req.py", line 1435, in install requirement.install(install_options, global_options, *args, **kwargs)
File "/Users/Christina/anaconda/lib/python2.7/site-packages/pip/req.py", line 706, in install cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
File "/Users/Christina/anaconda/lib/python2.7/site-packages/pip/util.py", line 697, in call_subprocess % (command_desc, proc.returncode, cwd))
InstallationError: Command /Users/Christina/anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pi\ p_build_Christina/fitsio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/fol\ ders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pip-ww4Fvd-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/\ folders/3p/v45zthb14d1d108h9y8xg6cw0000gn/T/pip_build_Christina/fitsio
From extensive googling, it seems that the bad register issues come from a confusion in gcc flags over 32-bit vs 64-bit systems. BUT setup.py seems to have figured out that I have a 64-bit and wants to pass -arch i386 -arch x86_64 to gcc but this line:
checking whether gcc accepts -arch i386 -arch x86_64... no
leads me to believe that it can't for some reason. I have no idea why. I am running the MacPorts gcc version 4.8. Here are some checks I did to make sure this was the case:
$port select --list gcc
Available versions for gcc:
llvm-gcc42
mp-gcc48 (active)
none
$which gcc
/opt/local/bin/gcc
Any help/ideas are greatly appreciated.
I figured this out on my own..
I went into setup.py and changed this line:
if platform.system()=='Darwin':
extra_compile_args=['-arch','i386',
'-arch','x86_64']
extra_link_args=['-arch','i386',
'-arch','x86_64']
to remove the i386. Like so:
if platform.system()=='Darwin':
extra_compile_args=['-arch','x86_64']
extra_link_args=['-arch','x86_64']
This removed the bad register errors.

Categories

Resources