-
Notifications
You must be signed in to change notification settings - Fork 35
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
No kmc_module.so generated after compiling with no errors ... errors when running kmos view #43
Comments
In your directory If yes, could you fire up
and paste the response here? Thanks. |
In your directory myfirst_kmc_local_smart does it have a file named kmc_settings.py and kmc_model.so? No If no, could you paste the log of the kmos export ... command? Most likely numpy/f2py did not find a Fortran compiler. mac95467:kmc_test g5q$ ls If yes, could you fire up python in that directory and run import kmos.run mac95467:myfirst_kmc_local_smart g5q$ python
Error No module named kmc_settings
|
Is the first output you paste all that it says? If numpy/f2py cannot find a fortran compiler, trying to go further is futil. If I remember correctly |
Yes, that is all it prints. I typed f2py to see what compilers it can find. Here is the output of that. mac95467:myfirst_kmc_local_smart g5q$ f2py-2.7 -c --help-fcompiler |
Ok, silent output is definitely a bumper. For further triage: you describe that you saw a subfolder named |
If I do 'kmos build' inside the src/ dir., then I get the kmc_model.so file. But this time, running 'kmos view' gives a different error. It says matplotlib is not available. This is strange because I have matplotlib with the installed python version. Is there another path I need to specify? mac95467:src g5q$ kmos view ** (process:64318): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags' ** (process:64318): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags' ** (process:64318): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags' |
I would go with the first "real" error message. And they have less and less to do with kmos. Ignore the warnings and it says that it cannot find "backend_gdk". So matplotlib seems to work it just cannot find the GTK backend. How you get there depends a little on your specific setup. I remember that doing so with MacPorts was not terribly difficult but I am sure there are other ways |
Not sure about that. I can access all the backends in matplotlib if I import it in ipython (see below). I also see the backend_gdk.py file in the proper /path/to/python/site-package/matplotlib/backends/ directory. What else can the above error be due to? Thanks. In [1]: import matplotlib as plt In [2]: plt.rcsetup.all_backends |
Good point. For any run/view/simulation to work you need kmc_model.so and kmc_settings.py in the current directory. Sometimes these |
I found the problem. choosing a specific backend somehow causes a problem, because it then looks for the _backend_whatever file for whatever I am looking for. It is not necessary because the backends are already available as a python file, so we don't need its c-extensions. So commenting these lines below (see below) gives no error anymore and I can fire up the GUI. Now, to the next step.... Thanks. Comment out the lines as shown below in /home/Library/Python/2.7/lib/python/site-packages/kmos/view.py: try: if os.name == 'posix':matplotlib.use('GTKAgg')elif os.name == 'nt':matplotlib.use('wxagg')else:matplotlib.use('GTKAgg')
|
Can you tell me a bit more about your setup? From your previous message I gather that you are using Mac OS. Can you tell me a bit more about version and how you installed python/numpy/matplotlib. Maybe we can change in a way to behave more gracefully for your setup without breaking other setups. Those lines do serve a purpose for platform independence. I remember installing kmos on Windoze once which comes with a different set of backend and automatic selection did not work properly. Maybe this has changed with more recent version of matplotlib. But even then I would think it is wrong to assume that everyone has the most recent matplotlib version installed. Tip: the markdown syntax plays you a trick for commented out lines, turning them into H1 headers (the large ones). If you put code in between three "`" (acute) it will look nicer. |
I have OS X v 10.9.5. All packages (python/matplotlib/numpy...) were installed via macports in its default location following the recipe in your installation section of the Doc. If we have a way of getting the c-extensions of the backend files for gtkgg and wxagg, and putting them in the appropriate folder, then these lines that involve matlab.use() will work without any problem. |
I followed the instructions to start my_first KMC model. While I can generate the .xml file by running the python script from ipython, that looks OK, when I compile it by typing in the command line "kmos export myfirst_kmc.xml", I see a new directory 'myfirst_kmc_local_smart/' generated, that has a 'src' directory.
The 'src' has files:
assert.ppc kind_values.f90 lattice.f90 proclist.f90
base.f90 kmc_settings.py main.f90
I do not see a kmc_model.so file anywhere. So, when I run the 'kmos view' command from directory 'myfirst_kmc_local_smart/', I get errors such as this:
** (process:47145): WARNING **: Trying to register gtype 'GMountMountFlags' as enum when in fact it is of type 'GFlags'
** (process:47145): WARNING **: Trying to register gtype 'GDriveStartFlags' as enum when in fact it is of type 'GFlags'
** (process:47145): WARNING **: Trying to register gtype 'GSocketMsgFlags' as enum when in fact it is of type 'GFlags'
Could not import matplotlib frontend for real-time plotting
No module named _backend_gdk
Error: No module named kmc_model
Could not find the kmc module. The kmc implements the actual
kmc model. This can be created from a kmos xml file using
kmos export
Hint: are you in a directory containing a compiled kMC model?
Error No module named kmc_settings
Could import settings file
The kmc_settings.py contains all changeable model parameters
and descriptions for the representation on screen.
Hint: are you in a directory containing a compiled kMC model?
Traceback (most recent call last):
File "/Users/g5q/Library/Python/2.7/bin/kmos", line 21, in
main()
File "/Users/g5q/Library/Python/2.7/lib/python/site-packages/kmos/cli.py", line 426, in main
view.main(steps_per_frame=options.steps_per_frame)
File "/Users/g5q/Library/Python/2.7/lib/python/site-packages/kmos/view.py", line 452, in main
viewer = KMC_Viewer(model, steps_per_frame=steps_per_frame)
File "/Users/g5q/Library/Python/2.7/lib/python/site-packages/kmos/view.py", line 398, in init
self.vbox, self.window)
File "/Users/g5q/Library/Python/2.7/lib/python/site-packages/kmos/view.py", line 190, in init
self.tofs = get_tof_names()
File "/Users/g5q/Library/Python/2.7/lib/python/site-packages/kmos/run.py", line 1996, in get_tof_names
for process, tof_count in settings.tof_count.iteritems():
AttributeError: 'NoneType' object has no attribute 'tof_count'
The text was updated successfully, but these errors were encountered: