krischer / mtspec

Python library for multitaper spectral estimations
http://krischer.github.io/mtspec/
GNU General Public License v3.0
69 stars 44 forks source link

Problem compiling mtspec - File in wrong format #13

Closed sboltz closed 8 years ago

sboltz commented 8 years ago

Hello,

I am trying to install mtspec on a CentOS 6.7 machine and am encountering errors when it tries to compile the mtspec extension. The specific error message that I am getting is:

build/temp.linux-x86_64-2.7/mtspec/src/src/spectra.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1

Do you have any idea what the problem may be?

Thanks, Shawn

krischer commented 8 years ago

Heyhey,

did you use the latest master or install from pypi? It looks to me like the object files (*.o) were compiled with a compiler that is not compatible with the linker?

Please try a clean installation from the latest master and send the full install log.

Cheers!

Lion

sboltz commented 8 years ago

I was using the latest master. Here is the full log.

I'm trying to install this for use with Anaconda (64-bit) (Python 2.7.11).

Thanks, Shawn install_log.txt

krischer commented 8 years ago

Hmm...looks like your gcc and gfortran are not compatible with each other. What does

$ which gcc
$ which gfortran

return for you? It might be, that one of the compilers comes from anaconda and the other from the system?

sboltz commented 8 years ago

Here is what they return.

[isti_ew mtspec-master]$ which gcc
/usr/bin/gcc
[isti_ew mtspec-master]$ which gfortran
/usr/bin/gfortran

gfortran -v and gcc -v both return

Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-16) (GCC) 
krischer commented 8 years ago

I think I know what happens - the setup script forces a compliation for the the same architecture as Python. It did not yet force it for the linking stage. I just pushed a commit to the master that should force the architecture also for the linking stage. Can you check if it works?

sboltz commented 8 years ago

That looks like it worked.

Thank you!

krischer commented 8 years ago

Good to hear :-) For future reference: 951260ae395aedf5f66beef87563926c99422d49 fixed it.