ochubar / SRW

Synchrotron Radiation Workshop
Other
86 stars 70 forks source link

compile the srwlpy.so on ubuntu 14.04 #5

Open tyjisinap opened 8 years ago

tyjisinap commented 8 years ago

I compile the srwlpy.so on ubuntu 14.04, the python is anaconda python 2.7.11. and when I run the example 06 07 08 09 ..., it is crashed with segmentation fault. I don't know why. Thank you!

ochubar commented 8 years ago

Perhaps you linked it with a wrong version of FFTW library(?). It should be fftw-2.1.5 compiled for 32 bit (i.e. with the option --enable-float, see README.txt).

Sent from my T-Mobile 4G LTE Device

-------- Original message -------- From: tyjisinap notifications@github.com Date: 01/12/2016 7:56 PM (GMT-05:00) To: ochubar/SRW SRW@noreply.github.com Subject: [SRW] compile the srwlpy.so on ubuntu 14.04 (#5)

I compile the srwlpyso on ubuntu 1404, the python is anaconda python 2711 and when I run the example 06 07 08 09 , it is crashed with segmentation fault I don't know why

— Reply to this email directly or view it on GitHubhttps://github.com/ochubar/SRW/issues/5.

tyjisinap commented 8 years ago

I compiled the FFTW as the follow, and my os is x86_64 , you mean I need to complied for 32bit? Thank you!

cd fftw-2.1.5
./configure --enable-float --with-pic
Manually (using editor) add -fPIC option to CFLAGS in Makefile
make
make install
cp fftw/.libs/libfftw.a SRW_Dev/ext_lib/
ochubar commented 8 years ago

Sorry I was not precise. The library itself (libfftw.a) should be compiled for 64 bit, but it should be configured to work with single-precision numbers. This is ensured by the --enable-float switch. It looks like you did compile it correctly. However, maybe at linking, another, default library of Ubuntu is used? It may have same name (libfftw.a) yet it may be compiled to operate with double-precision numbers (which is the default case).

Sent from my T-Mobile 4G LTE Device

-------- Original message -------- From: tyjisinap notifications@github.com Date: 01/12/2016 9:41 PM (GMT-05:00) To: ochubar/SRW SRW@noreply.github.com Cc: "Tchoubar, Oleg" chubar@bnl.gov Subject: Re: [SRW] compile the srwlpy.so on ubuntu 14.04 (#5)

I compiled the FFTW as the follow, and my os is x86_64 , you mean I need to complied for 32bit? Thank you!

cd fftw-2.1.5 ./configure --enable-float --with-pic Manually (using editor) add -fPIC option to CFLAGS in Makefile make make install cp fftw/.libs/libfftw.a SRW_Dev/ext_lib/

— Reply to this email directly or view it on GitHubhttps://github.com/ochubar/SRW/issues/5#issuecomment-171139864.

tyjisinap commented 8 years ago

Thank you very much! I replaced all the libfftw.a and removed all the libfftw.so, it works!