yade -l IMPLIBRARIES

Asked by Klaus Thoeni

Hi guys

is the additional command line option "-l IMPLIBRARIES" supposed to work?

I just tried:

yade -lscipy.interpolate

But there is no function interpolate nor scipy.interpolate available. Is there something I am missing?

Thanks
Klaus

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
matthias
Solved:
Last query:
Last reply:
Revision history for this message
matthias (matthias-frank) said :
#1

hi klaus,

maybe there is a problem with scipy.interpolate, see [1]

[1] https://answers.launchpad.net/yade/+question/229455

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#2

Hi Matthias,

according to [1] it should be fixed with the -l option. But in my case it seems not to work.

Any other idea?

Thanks Klaus

[1] https://bugs.launchpad.net/yade/+bug/1183402

Revision history for this message
Best matthias (matthias-frank) said :
#3

hi klaus,

try start yade and "import scipy.interpolate". this leads to a segmatation fault.
start yade with -lscipy.interpolate, there is no module scipy.
but after this you can "import scipy.interpolate". now you can use scipy as normal.

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#4

Hi Matthias,

that's the trick, you still need "import scipy.interpolate" in your script. I thought by specifying the module it should directly be available.

Something I realised is that "yade -lscipy.interpolate" makes available all modules from scipy. So in the end -lscipy and -lscipy.anymodule have the same effect.

Thanks,
Klaus

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#5

It sounds like a scope issue.
I can't tell now if -l was importing in the right scope in ubuntu 10.04 (which I was using when adding the option).
For 12.04 you are right, the module imported with -l is not available.

A sequence that works correctly is this, maybe this is what I was doing t that time::
yade -l scipy
from scipy import interpolate #would segfault without the -l
interpolate.something()

It would be nice to fix this scope problem. It would be even better to fix the initial bug... since -l is only a workaround.

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#6

Thanks matthias , that solved my question.

Revision history for this message
matthias (matthias-frank) said :
#7

hi guys,

has anybody an idea, how the -l option works in batchmode?
yade-batch uses the -l option for something other.

i tried 'yadedaily-batch --job-threads =8 -j2 --executable="/usr/bin/yadedaily -lscipy.lib.six.moves -j2" batchfile modelfile'.
this uses the -l option of yade, but not the options for parallelism. in this case it uses 8 threads, but i want to use only 2 per yade-instance.

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#8

I did not implement library import for batch (just did not realize it
had to be implemented separately).
Plus, if it was reimplemented for batch, there would be this conflict
between two "-l" options. You can call it a bug.
I would keep -l for libraries and find another name for table lists.

https://bugs.launchpad.net/yade/+bug/1302401

Bruno