Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python crashes when writing start.xx #11

Open
srio opened this issue Jan 20, 2016 · 2 comments
Open

python crashes when writing start.xx #11

srio opened this issue Jan 20, 2016 · 2 comments
Labels

Comments

@srio
Copy link
Member

srio commented Jan 20, 2016

chac:~/Oasys/OASYS_VE % python
Python 3.4.0 (default, Jun 19 2015, 14:20:21) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Shadow
>>> oe = Shadow.OE()
>>> oe.FILE_REFL=b'aaaaaaaaaaaaa'
>>> oe.write("tmp.01")
fixing poolOE for Fortran
fixed poolOE for Fortran
>>> oe.load("tmp.01")
...
7ffddc745000-7ffddc747000 r--p 00000000 00:00 0                          [vvar]
7ffddc747000-7ffddc749000 r-xp 00000000 00:00 0                          [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0                  [vsyscall]
Aborted (core dumped)

@srio
Copy link
Member Author

srio commented Jan 20, 2016

Does not happen in Mac.

Same code with old setup.py is OK => Problem of new setup.py...
Check compilation/link flags. This is OK:

chac:~/tmp/shadow3 % make lib
./shadow_version.sh gfortran
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_version.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_globaldefinitions.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c stringio.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c gfile.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_beamio.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_math.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_variables.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_roughness.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_kernel.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_synchrotron.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_pre_sync.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_pre_sync_urgent.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_preprocessors.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_postprocessors.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_bind_f.f90
gfortran -cpp -fPIC -ffree-line-length-none  -static -O2 -fomit-frame-pointer -D_COMPILE4NIX -c shadow_crl.f90
gcc -fPIC    -c -o shadow_bind_c.o shadow_bind_c.c
gfortran -shared -lm  -fPIC  -o libshadow3.so shadow_version.o shadow_globaldefinitions.o stringio.o gfile.o shadow_beamio.o shadow_math.o shadow_variables.o shadow_roughness.o shadow_kernel.o shadow_synchrotron.o shadow_pre_sync.o shadow_pre_sync_urgent.o shadow_preprocessors.o shadow_postprocessors.o shadow_bind_f.o shadow_crl.o
gcc -shared -lm  -fPIC  -o libshadow3c.so shadow_bind_c.o -L. -lshadow3 #shadow_version.o shadow_globaldefinitions.o stringio.o gfile.o shadow_beamio.o shadow_math.o shadow_variables.o shadow_roughness.o shadow_kernel.o shadow_synchrotron.o shadow_pre_sync.o shadow_pre_sync_urgent.o shadow_preprocessors.o shadow_postprocessors.o shadow_bind_f.o shadow_crl.o
chac:~/tmp/shadow3 % 

and now python:

chac:~/tmp/shadow3 % python setup.py build
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.4
creating build/lib.linux-x86_64-3.4/Shadow
copying ./trace3_py.py -> build/lib.linux-x86_64-3.4/Shadow
copying ./ShadowSrw.py -> build/lib.linux-x86_64-3.4/Shadow
copying ./__init__.py -> build/lib.linux-x86_64-3.4/Shadow
copying ./ShadowPreprocessorsXraylib.py -> build/lib.linux-x86_64-3.4/Shadow
copying ./example_tolerances.py -> build/lib.linux-x86_64-3.4/Shadow
copying ./ShadowTools.py -> build/lib.linux-x86_64-3.4/Shadow
copying ./ShadowToolsPrivate.py -> build/lib.linux-x86_64-3.4/Shadow
copying ./ShadowLibExtensions.py -> build/lib.linux-x86_64-3.4/Shadow
copying ./srwlib_fake.py -> build/lib.linux-x86_64-3.4/Shadow
copying ./SRW2SHADOW_Example01.py -> build/lib.linux-x86_64-3.4/Shadow
running build_ext
building 'Shadow.ShadowLib' extension
creating build/temp.linux-x86_64-3.4
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. -I/usr/local/lib/python3.4/dist-packages/numpy/core/include -I/usr/include/python3.4m -I/users/srio/tmp/test1env/include/python3.4m -c shadow_bind_python.c -o build/temp.linux-x86_64-3.4/shadow_bind_python.o -msse -msse2
In file included from /usr/local/lib/python3.4/dist-packages/numpy/core/include/numpy/ndarraytypes.h:1804:0,
                 from /usr/local/lib/python3.4/dist-packages/numpy/core/include/numpy/ndarrayobject.h:17,
                 from /usr/local/lib/python3.4/dist-packages/numpy/core/include/numpy/arrayobject.h:4,
                 from shadow_bind_python.h:25,
                 from shadow_bind_python.c:1:
/usr/local/lib/python3.4/dist-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 " \
  ^
x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.4/shadow_bind_python.o -L. -lshadow3 -lshadow3c -o build/lib.linux-x86_64-3.4/Shadow/ShadowLib.cpython-34m.so -msse -msse2
chac:~/tmp/shadow3 % 

@srio
Copy link
Member Author

srio commented Apr 24, 2024

Problem is still not solved. This script crashes python in Windows:

import Shadow
beam = Shadow.Beam()
source = Shadow.Source()
source.write('foo.txt')
beam.genSource(source)

This problem is probably not going to be solved. Not applicable to new shadow4.

@srio srio reopened this Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant