how to run the example in the tutorial

Asked by guo

Hi, all,

I am a green hand in Yade, and I try to run the examples in the tutorial, but many errors occur. What I did is type the command line by line or copy the whole code to the terminal after i typed 'yade' there.
https://yade-dem.org/doc/tutorial-examples.html

Thanks a lot.

Guo

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Luc Scholtès
Solved:
Last query:
Last reply:
Revision history for this message
Anton Gladky (gladky-anton) said :
#1

Hi,

could you be more specific? What errors occur? What Yade version do you use?

You can create an empty file, called, for example, example1.py and put
there the code. Then you can just:
./yade example1.py

And it should work.

Anton

On Fri, Apr 15, 2011 at 7:26 AM, hong guo
<email address hidden> wrote:
> New question #152906 on Yade:
> https://answers.launchpad.net/yade/+question/152906
>
> Hi, all,
>
> I am a green hand in Yade, and I try to run the examples in the tutorial, but many errors occur. What I did is type the command line by line or copy the whole code to the terminal after i typed 'yade' there.
> https://yade-dem.org/doc/tutorial-examples.html
>
> Thanks a lot.
>
> Guo
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

Revision history for this message
guo (kwohoo) said :
#2

Thank you very much Anton,

I use yade 0.5 and the following is the errors (example: Periodic simple shear)

Yade [24]: # create "dense" packing by setting friction to zero initially
Yade [25]: O.materials[0].frictionAngle=0
Yade [26]:
Yade [27]: # simulation loop (will be run at every step)
Yade [28]: O.engines=[
     ....: ForceResetter(),
     ....: InsertionSortCollider([Bo1_Sphere_Aabb()]),
     ....: InteractionLoop(
     ....: [Ig2_Sphere_Sphere_L3Geom()],
     ....: [Ip2_FrictMat_FrictMat_FrictPhys()],
     ....: [Law2_L3Geom_FrictPhys_ElPerfPl()]
     ....: ),
     ....: NewtonIntegrator(damping=.4),
     ....: # run checkStress function (defined below) every second
     ....: # the label is arbitrary, and is used later to refer to this engine
     ....: PyRunner(command='checkStress()',realPeriod=1,label='checker'),
     ....: # record data for plotting every 100 steps; addData function is defined below
     ....: PyRunner(command='addData()',iterPeriod=100)
     ....: ]
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)

/usr/lib/yade-0.50/py/yade/__init__.pyc in <module>()
      1
      2
----> 3
      4
      5

RuntimeError: First argument (if given) must be a string.
Yade [29]:
Yade [30]: # set the integration timestep to be 1/2 of the "critical" timestep
Yade [31]: O.dt=.5*utils.PWaveTimeStep()
Yade [32]:
Yade [33]: # prescribe isotropic normal deformation (constant strain rate)
Yade [34]: # of the periodic cell
Yade [35]: O.cell.velGrad=Matrix3(-.1,0,0, 0,-.1,0, 0,0,-.1)
Yade [36]:
Yade [37]: # when to stop the isotropic compression (used inside checkStress)
Yade [38]: limitMeanStress=-5e5
Yade [39]:
Yade [40]: # called every second by the PyRunner engine
Yade [41]: def checkStress():
     ....: # stress tensor as the sum of normal and shear contributions
     ....: # Matrix3.Zero is the intial value for sum(...)
     ....: stress=sum(utils.normalShearStressTensors(),Matrix3.Zero)
     ....: print 'mean stress',stress.trace()/3.
     ....: # if mean stress is below (bigger in absolute value) limitMeanStress, start shearing
     ....: if stress.trace()/3.<limitMeanStress:
     ....: # apply constant-rate distorsion on the periodic cell
     ....: O.cell.velGrad=Matrix3(0,0,.1, 0,0,0, 0,0,0)
     ....: # change the function called by the checker engine
     ....: # (checkStress will not be called anymore)
     ....: checker.command='checkDistorsion()'
     ....: # block rotations of particles to increase tanPhi, if desired
     ....: # disabled by default
     ....: if 0:
     ....: for b in O.bodies:
     ....: # block X,Y,Z rotations, translations are free
     ....: b.state.blockedDOFs='XYZ'
     ....: # stop rotations if any, as blockedDOFs block accelerations really
     ....: b.state.angVel=(0,0,0)
     ....: # set friction angle back to non-zero value
     ....: # tangensOfFrictionAngle is computed by the Ip2_* functor from material
     ....: # for future contacts change material (there is only one material for all particles)
     ....: O.materials[0].frictionAngle=.5 # radians
     ....: # for existing contacts, set contact friction directly
     ....: for i in O.interactions: i.phys.tangensOfFrictionAngle=tan(.5)
     ....:
Yade [42]: # called from the 'checker' engine periodically, during the shear phase
Yade [43]: def checkDistorsion():
     ....: # if the distorsion value is >.3, exit; otherwise do nothing
     ....: if abs(O.cell.trsf[0,2])>.5:
     ....: # save data from addData(...) before exiting into file
     ....: # use O.tags['id'] to distinguish individual runs of the same simulation
     ....: plot.saveDataTxt(O.tags['id']+'.txt')
     ....: # exit the program
     ....: #import sys
     ....: #sys.exit(0) # no error (0)
     ....: O.pause()
     ....:
Yade [44]: # called periodically to store data history
Yade [45]: def addData():
     ....: # get the stress tensor (as 3x3 matrix)
     ....: str
     ....: # give names to values we are interested in and save them
     ....: plot.addData(exz=O.cell.trsf[0,2],szz=stress[2,2],sxz=stress[0,2],tanPhi=stress[0,2]/stress[2,2],i=O.iter)
     ....: # color particles based on rotation amount
     ....: for b in O.bodies:
     ....: # rot() gives rotation vector between reference and current position
     ....: b.shape.color=utils.scalarOnColorScale(b.state.rot().norm(),0,pi/2.)
     ....:
Yade [46]: # define what to plot (3 plots in
Yade [47]: ## exz(i), [left y axis, separate by None:] szz(i), sxz(i)
Yade [48]: ## szz(exz), sxz(exz)
Yade [49]: ## tanPhi(i)
Yade [50]: # note the space in 'i ' so that it does not overwrite the 'i' entry
Yade [51]: plot.plots={'i':('exz',None,'szz','sxz'),'exz':('szz','sxz'),'i ':('tanPhi',)}
Yade [52]:
Yade [53]: # better show rotation of particles
Yade [54]: Gl1_Sphere.stripes=True
Yade [55]:
Yade [56]: # open the plot on the screen
Yade [57]: plot.plot()
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)

/usr/lib/yade-0.50/py/yade/__init__.pyc in <module>()
----> 1
      2
      3
      4
      5

/usr/lib/yade-0.50/py/yade/plot.pyc in plot(noShow)
    101 else: plots_p_y2.append(d)
    102 #plotLines[p]=

--> 103 pylab.plot(*sum([[data[p],data[d[0]],d[1]] for d in plots_p_y1],[]))
    104 pylab.legend([_xlateLabel(_p[0]) for _p in plots_p_y1],loc=('upper left' if len(plots_p_y2)>0 else 'best'))
    105 pylab.ylabel(','.join([_xlateLabel(_p[0]) for _p in plots_p_y1]))

KeyError: 'i'
Yade [58]:
Yade [59]: O.saveTmp()
INFO /build/buildd/yade-0.50-0.50.2/core/Omega.cpp:321 saveSimulation: Saving file :memory:
Yade [60]:

And where should i put the example1.py file? i mean its path. Thanks for your help.

Revision history for this message
Anton Gladky (gladky-anton) said :
#3

No, you just copy the code into the file, called, for example,
test1.py. And then:

./yade test1.py

It is better to attach script here.
Comments are not mandatory for the code.

Yade 0.50 is relatively old and a lot of mistakes were fixed after
that release. We fix there some critical bugs, but it is preferable to
use later versions (better from bzr).

Anton

Revision history for this message
guo (kwohoo) said :
#4

When I do this
the following has happened

Yade [1]: ./yade periodic.py
------------------------------------------------------------
   File "<ipython console>", line 1
     ./yade periodic.py
     ^
SyntaxError: invalid syntax

Yade [2]:

So I need to update the current version?

Revision history for this message
Anton Gladky (gladky-anton) said :
#5

> Yade [1]: ./yade periodic.py
No, you should type "./yade periodic.py" __to start__ it with pointed script

> So I need to update the current version?
It would be better.

Anton

On Fri, Apr 15, 2011 at 8:27 AM, guo
<email address hidden> wrote:
> Question #152906 on Yade changed:
> https://answers.launchpad.net/yade/+question/152906
>
> guo posted a new comment:
>
> When I do this
> the following has happened
>
> Yade [1]: ./yade periodic.py
> ------------------------------------------------------------
>   File "<ipython console>", line 1
>     ./yade periodic.py
>     ^
> SyntaxError: invalid syntax
>
> Yade [2]:
>
> So I need to update the current version?
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

Revision history for this message
Best Luc Scholtès (luc) said :
#6

Hi Guo,

Apparently, you are already in the YADE console when you called ./yade periodic.py. Try again to type ./yade periodic.py, but in the linux console (don't open YADE before). If you open yade before (by typing ./yade in the linux console), try to type execfile('periodic.py',globals()) in the yade console and it should work.

Hope it is clear enough...

Cheers

  Luc

Revision history for this message
guo (kwohoo) said :
#7

I am confused about it. I do type ./yade periodic.py in the terminal after typing 'yade' entering yade mode. what do you mean 'with pointed script'.

Revision history for this message
guo (kwohoo) said :
#8

Hi,Luc

Thanks for your help, it works!

 still errors happen.

Yade [1]: execfile('periodic.py',globals())
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)

/usr/lib/yade-0.50/py/yade/__init__.pyc in <module>()
----> 1
      2
      3
      4
      5

/usr/lib/yade-0.50/py/yade/__init__.pyc in <module>()
     40 O.engines=[
     41 ForceResetter(),
---> 42 InsertionSortCollider([Bo1_Sphere_Aabb()]),
     43 InteractionLoop(
     44 [Ig2_Sphere_Sphere_L3Geom()],

RuntimeError: First argument (if given) must be a string.

Revision history for this message
guo (kwohoo) said :
#9

Thanks Luc Scholtès, that solved my question.

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

If yade is started and you want to execute a script, you can do that (no need to copy/paste or to restart yade each time you try a script):

....
Yade [24]: execfile('script.py')
....

Revision history for this message
Vincia Jackson (vcj2) said :
#11

Hi everyone,
I am trying to run the same example program and I am having the same issues. I am a beginner with using yade and I have tried all the already given assistance. My code looks like the following:

Yade [10]: execfile('vinciabouncingball_1.py')
---------------------------------------------------------------------------
IOError Traceback (most recent call last)

/home/ervin/yade/lib/yade-trunk/py/yade/__init__.pyc in <module>()
----> 1
      2
      3
      4
      5

IOError: [Errno 2] No such file or directory: 'vinciabouncingball_1.py'
Yade [11]: execfile(vinciabouncingball_1.py)

Revision history for this message
Jérôme Duriez (jduriez) said :
#12

Hello Vincia,

I think it is a "Linux" issue, not a Yade one. The error message says Yade does not find your .py file. Because it is surely not where Yade searches !
Your .py script has to be in the directory you were when you launched yade.

Revision history for this message
Vincia Jackson (vcj2) said :
#13

Thank you jduriez, I've been putting my file everywhere and I still am not able to run yade. I have been using the code execfile('name.py') is that the correct syntax for running a program in yade. i've tried execfile('name.py', globals()) as well.

Revision history for this message
Vincia Jackson (vcj2) said :
#14

I put my file in almost every folder and tried this and I continue to get an error:

ervin@ubuntu:~$ ~/yade/bin/yade-trunk 1.py
Welcome to Yade bzr2923
TCP python prompt on localhost:9001, auth cookie `kcsudy'
XMLRPC info provider on http://localhost:21001
Running script 1.py
Traceback (most recent call last):
  File "/home/ervin/yade/bin/yade-trunk", line 183, in runScript
    execfile(script,globals())
IOError: [Errno 2] No such file or directory: '1.py'
[[ ^L clears screen, ^U kills line. F8 plot. ]]
Yade [1]:

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

Hi Vincia,

if you run it like this:

ervin@ubuntu:~$ ~/yade/bin/yade-trunk 1.py

the file 1.py must be located in your home directory (/home/ervin/). Check by
using the command ls in the command line.

ervin@ubuntu:~$ ls

You will get a list with all the files (and directories). Check if your file is
listet.

HTH
Klaus

On Tue, 11 Oct 2011 03:55:38 PM Vincia Jackson wrote:
> Question #152906 on Yade changed:
> https://answers.launchpad.net/yade/+question/152906
>
> Vincia Jackson posted a new comment:
> I put my file in almost every folder and tried this and I continue to
> get an error:
>
> ervin@ubuntu:~$ ~/yade/bin/yade-trunk 1.py
> Welcome to Yade bzr2923
> TCP python prompt on localhost:9001, auth cookie `kcsudy'
> XMLRPC info provider on http://localhost:21001
> Running script 1.py
> Traceback (most recent call last):
> File "/home/ervin/yade/bin/yade-trunk", line 183, in runScript
> execfile(script,globals())
> IOError: [Errno 2] No such file or directory: '1.py'
> [[ ^L clears screen, ^U kills line. F8 plot. ]]
> Yade [1]:

Revision history for this message
Vincia Jackson (vcj2) said :
#16

YES! That gets rid of the error but when I type execfile('1.py') or execfile('1.py',globals()) into yade the script doesn't run. However, there are no more errors.

ervin@ubuntu:~$ ~/yade/bin/yade-trunk 1.py
Welcome to Yade bzr2923
TCP python prompt on localhost:9000, auth cookie `ucakss'
XMLRPC info provider on http://localhost:21000
Running script 1.py
[[ ^L clears screen, ^U kills line. F8 plot. ]]
Yade [1]: execfile('1.py',globals())
Yade [2]:

Revision history for this message
Vincia Jackson (vcj2) said :
#17

I tried running the program like this: Does this following error have any significance?

Yade [4]: run 1.py
---------------------------------------------------------------------------
NameError Traceback (most recent call last)

/home/ervin/1.py in <module>()
      6 # add 2 particles to the simulation

      7 # they the default material (utils.defaultMat)

----> 8 O.bodies.append([
      9 # fixed: particle's position in space will not change (support)

     10 utils.sphere(center=(0,0,0),radius=.5,fixed=True),

NameError: name 'O' is not defined
WARNING: Failure executing file: <1.py>
Yade [5]:

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

execfile('1.py') should work. If you see nothing hapenning, it is maybe because there are no output in the script?

Revision history for this message
Vincia Jackson (vcj2) said :
#19

my script is the yade example of the bouncing sphere on the yade site: I am assuming that I can run the file and immediately I should be able to see the model of the bouncing sphere?

# basic simulation showing sphere falling ball gravity,
# bouncing against another sphere representing the support

# DATA COMPONENTS

# add 2 particles to the simulation
# they the default material (utils.defaultMat)
O.bodies.append([
   # fixed: particle's position in space will not change (support)
   utils.sphere(center=(0,0,0),radius=.5,fixed=True),
   # this particles is free, subject to dynamics
   utils.sphere((0,0,2),.5)
])

# FUNCTIONAL COMPONENTS

# simulation loop -- see presentation for the explanation
O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Sphere_Aabb()]),
   InteractionLoop(
      [Ig2_Sphere_Sphere_L3Geom()], # collision geometry
      [Ip2_FrictMat_FrictMat_FrictPhys()], # collision "physics"
      [Law2_L3Geom_FrictPhys_ElPerfPl()] # contact law -- apply forces
   ),
   # apply gravity force to particles
   GravityEngine(gravity=(0,0,-9.81)),
   # damping: numerical dissipation of energy
   NewtonIntegrator(damping=0.1)
]

# set timestep to a fraction of the critical timestep
# the fraction is very small, so that the simulation is not too fast
# and the motion can be observed
O.dt=.5e-4*utils.PWaveTimeStep()

# save the simulation, so that it can be reloaded later, for experimentation
O.saveTmp()

Revision history for this message
Jérôme Duriez (jduriez) said :
#20

Indeed it is normal that your script did not produce spectacular effects : it "only" defined the numerical model.

If you want start to enjoy yade, you have now to let it run ! (O.run(1) for ex, or with "play" controller)

You will have also surely to execute something in order to let appear the graphical windows showing the model : qt.View() for example

Revision history for this message
Vincia Jackson (vcj2) said :
#21

I'm sorry that I keep posting!! I'm just sooooo close! I got another error and even if i just put view() it still has a name error. What should I do? Everyone's help is really appreciated!

Welcome to Yade bzr2923
TCP python prompt on localhost:9000, auth cookie `uaesyd'
XMLRPC info provider on http://localhost:21000
[[ ^L clears screen, ^U kills line. F8 plot. ]]
Yade [1]: execfile('1.py')
Yade [2]: O.run()
Yade [3]: qt.View()
---------------------------------------------------------------------------
NameError Traceback (most recent call last)

/home/ervin/yade/lib/yade-trunk/py/yade/__init__.pyc in <module>()
----> 1
      2
      3
      4
      5

NameError: name 'qt' is not defined
Yade [4]:

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

> I am assuming that I can run the file and immediately I should be able
> to see the model of the bouncing sphere?
>
No. If you don't open the 3D view (see shortcuts provided when yade
starts), you don't see anything.

Revision history for this message
Emanuele Catalano (catalano) said :
#23

Hi Vincia,
I think that your problem is the version of qt you have installed on your pc. By default yade is compiled as you have qt3 installed, while i guess you have actually qt4 on your pc.
To solve that you have to modify your scons-profile.. file on your yade/ folder and specify as a feature qt4. Just add this line:

features='qt4'

And then recompile and you will have your 3D view.

You can have a look to all the compilation options by typing scons -h on the terminal.

Hth Ema

Revision history for this message
Vincia Jackson (vcj2) said :
#24

I tried the shortcuts yade provides by clicking F8 and the following error shows up, I'm still looking into the qt4 feature because I have two scons-profile files:,one named scons.profile-default and the other scons.current-profile

Yade [1]: import yade.plot; yade.plot.plot();
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)

/home/ervin/yade/lib/yade-trunk/py/yade/__init__.pyc in <module>()
----> 1
      2
      3
      4
      5

/home/ervin/yade/lib/yade-trunk/py/yade/plot.pyc in plot(noShow, subPlots)
    586 global currLineRefs
    587 figs=set([l.line.get_axes().get_figure() for l in currLineRefs])
--> 588 if not hasattr(list(figs)[0],'show') and not noShow:
    589 import warnings
    590 warnings.warn('plot.plot not showing figure (matplotlib using headless backend?)')

IndexError: list index out of range
Yade [2]:

Revision history for this message
Emanuele Catalano (catalano) said :
#25

Vincia,
scons.current-profile contains the name of the scons' profile you want to use.
if empty (your case?) the instructions contained in scons.profile-default will be used for the compilation.
so, you can leave it empty for the moment.

The line

features='qt4'

must be added in the scons.profile-default file. Try it and recompile.

Bye, Ema

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

Emanuele is right. i just see now that you don't have any graphical
interface:
> Welcome to Yade bzr2923
> TCP python prompt on localhost:9000, auth cookie `uaesyd'
> XMLRPC info provider on http://localhost:21000
> [[ ^L clears screen, ^U kills line. F8 plot. ]]
With the graphical interface enabled, the shortcuts list would read:

[[ ^L clears screen, ^U kills line. F12 controller, F11 3d view, F10
both, F9 generator, F8 plot. ]]

p.s. hiting F11 is the same as typing qt.View()

Revision history for this message
Anton Gladky (gladky-anton) said :
#27

If you use Ubuntu, you can try to install pre-built packages from PPA:
https://answers.launchpad.net/yade/+faq/1727

Anton

Revision history for this message
Vincia Jackson (vcj2) said :
#28

I do use Ubuntu and I installed from the link Anton Gladky gave me. This is what happened during installation there is a line that reads OpenGL GLX extension not supported by display ':0.0' , I opened Yade and I did not get the commands for the graphical interface.

ervin@ubuntu:~$ sudo add-apt-repository ppa:yade-pkg/snapshots
[sudo] password for ervin:
Sorry, try again.
[sudo] password for ervin:
Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --secret-keyring /etc/apt/secring.gpg --trustdb-name /etc/apt/trustdb.gpg --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver hkp://keyserver.ubuntu.com:80/ --recv 7241D8E316D8283220948D3CB58448722AFBE6B7
gpg: requesting key 2AFBE6B7 from hkp server keyserver.ubuntu.com
gpg: key 2AFBE6B7: "Launchpad PPA for Yade packagers" not changed
gpg: Total number processed: 1
gpg: unchanged: 1
ervin@ubuntu:~$ yade-daily
Welcome to Yade 1+2924+27~natty1, from 2011-10-06
TCP python prompt on localhost:9000, auth cookie `useycs'
XMLRPC info provider on http://localhost:21000
freeglut OpenGL GLX extension not supported by display ':0.0'
ervin@ubuntu:~$ ~/yade/bin/yade-trunk
Welcome to Yade bzr2923
TCP python prompt on localhost:9000, auth cookie `akedyc'
XMLRPC info provider on http://localhost:21000
[[ ^L clears screen, ^U kills line. F8 plot. ]]
Yade [1]: execfile('1.py')
Yade [2]: O.run()
Yade [3]: qt.View()
---------------------------------------------------------------------------
NameError Traceback (most recent call last)

/home/ervin/yade/lib/yade-trunk/py/yade/__init__.pyc in <module>()
----> 1
      2
      3
      4
      5

NameError: name 'qt' is not defined
Yade [4]:

Revision history for this message
Vincia Jackson (vcj2) said :
#29

My scons.profile-default reads:

PREFIX = '/home/ervin/yade'
optimize = 1
features = 'gts,log4cxx,opengl,openmp,vtk'
version = 'trunk'
CPPPATH = '/usr/include/vtk-5.0:/usr/include/vtk-5.2:/usr/include/vtk-5.4:/usr/include/vtk-5.6:/usr/include/vtk:/usr/include/eigen2'
CXXFLAGS = []
SHCCFLAGS = ['-fPIC']
features='qt4'

nothing changed after adding that line.

Revision history for this message
Anton Gladky (gladky-anton) said :
#30

You just needed to change the following line:
features = 'gts,log4cxx,opengl,openmp,vtk'

on
features = 'gts,log4cxx,opengl,openmp,vtk,qt4'

I am not sure, that adding feature at the end of scons.profile will
have an effect.
Did you recompile yade after adding that feature?

Anton

On Wed, Oct 12, 2011 at 9:10 PM, Vincia Jackson
<email address hidden> wrote:
> Question #152906 on Yade changed:
> https://answers.launchpad.net/yade/+question/152906
>
> Vincia Jackson posted a new comment:
> My scons.profile-default reads:
>
> PREFIX = '/home/ervin/yade'
> optimize = 1
> features = 'gts,log4cxx,opengl,openmp,vtk'
> version = 'trunk'
> CPPPATH = '/usr/include/vtk-5.0:/usr/include/vtk-5.2:/usr/include/vtk-5.4:/usr/include/vtk-5.6:/usr/include/vtk:/usr/include/eigen2'
> CXXFLAGS = []
> SHCCFLAGS = ['-fPIC']
> features='qt4'
>
> nothing changed after adding that line.
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to     : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

Revision history for this message
Anton Gladky (gladky-anton) said :
#31

Try this command:

yade.qt.View()

Anton

Revision history for this message
Vincia Jackson (vcj2) said :
#32

Do you guys know how to recompile yade ?! Is there some link, i'm sorry. I am very new to this. I've been searching and there is only information on the compilation of yade.

Revision history for this message
Jérôme Duriez (jduriez) said :
#33

Compilation (of any code) is something you can do as often as you want, with exactly the same procedure !

 With the only exception that the required packages are no more to be installed once they were installed. Good luck !

Revision history for this message
Emanuele Catalano (catalano) said :
#34

- Go into your yade/ folder. There you'll find the sources you need to compile. All the instructions for the compilation are contained into your scons-profile-.. file, as you already know since you modified it to add the qt4 feature.
- Now open a terminal and be sure you're into the yade folder path. If not, type 'cd ~/yade/'
- Now type scons and the compilation should start.

If you have problems with one of these instructions, post here the error you get.

Emanuele

Revision history for this message
Vincia Jackson (vcj2) said :
#35

here is what i did and the following errors:

method 1:
ervin@ubuntu:~$ ~yade/bin/yade-trunk
bash: ~yade/bin/yade-trunk: No such file or directory
ervin@ubuntu:~$ quit()
>
> ^C
ervin@ubuntu:~$
ervin@ubuntu:~$ clear all
ervin@ubuntu:~$ ~/yade/bin/yade-trunk
Welcome to Yade bzr2923
TCP python prompt on localhost:9000, auth cookie `easdsy'
XMLRPC info provider on http://localhost:21000
[[ ^L clears screen, ^U kills line. F8 plot. ]]
Yade [1]: scons
---------------------------------------------------------------------------
NameError Traceback (most recent call last)

/home/ervin/yade/lib/yade-trunk/py/yade/__init__.pyc in <module>()
----> 1
      2
      3
      4
      5

NameError: name 'scons' is not defined
Yade [2]:

method 2:
ervin@ubuntu:~$ 'cd~/yade/'
bash: cd~/yade/: No such file or directory
ervin@ubuntu:~$

method 3:
ervin@ubuntu:~$ cd~/yade/
bash: cd~/yade/: No such file or directory
ervin@ubuntu:~$

Revision history for this message
Vincia Jackson (vcj2) said :
#36

i aslo tried this:

ervin@ubuntu:~$ ~/yade/bin/yade-trunk scons
Welcome to Yade bzr2923
TCP python prompt on localhost:9000, auth cookie `yesusd'
XMLRPC info provider on http://localhost:21000
[[ ^L clears screen, ^U kills line. F8 plot. ]]
Yade [1]:

Revision history for this message
Emanuele Catalano (catalano) said :
#37

Open the terminal and type only 'scons'

ervin@ubuntu:~$ scons

Revision history for this message
Vincia Jackson (vcj2) said :
#38

ervin@ubuntu:~$ scons

scons: *** No SConstruct file found.
File "/usr/lib/scons/SCons/Script/Main.py", line 834, in _main

Revision history for this message
Emanuele Catalano (catalano) said :
#39

ok..

ervin@ubuntu:~$ cd ~/yade/ (attention there is a blank space between cd
and ~)

then,

ervin@ubuntu:~/yade$ scons

On 10/13/2011 06:01 PM, Vincia Jackson wrote:
> Question #152906 on Yade changed:
> https://answers.launchpad.net/yade/+question/152906
>
> Vincia Jackson posted a new comment:
> ervin@ubuntu:~$ scons
>
> scons: *** No SConstruct file found.
> File "/usr/lib/scons/SCons/Script/Main.py", line 834, in _main
>

--
Emanuele Catalano
Doctorant - Laboratoire Sol, Solides, Structures et Risques
Institut polytechnique de Grenoble

Tel : 04 56 52 86 49

Revision history for this message
Vincia Jackson (vcj2) said :
#40

it recompiled successfully , but now I can't open up yade like I used to and my terminal opens to ervin@ubuntu:~/yade$

when i try to open yade like i used to
ervin@ubuntu:~/yade$ ~/yade/bin/yade-trunk
Welcome to Yade bzr2926
TCP python prompt on localhost:9000, auth cookie `yudase'
XMLRPC info provider on http://localhost:21000
freeglut OpenGL GLX extension not supported by display ':0.0'
Segmentation fault
ervin@ubuntu:~/yade$

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

1/ If you install a pre-built package like yade-daily, you don't have to recompile. Forget about scons and profile and stick with yade-daily.

2/ It seems your problem is not related to yade. Your graphic card is probably not installed properly. Try typing "glxgears" in a terminal (if it tells you this program is part of package X, then install package X). If you don't see rotating gears , then this is your problem.

Revision history for this message
Emanuele Catalano (catalano) said :
#42

Ok..

Which graphic card do you have on your computer?
Have you got any installed driver?

Go to 'System' -> 'hardware drivers' menu. You should be able to see easily if some driver is already installed for your graphic card. If not, install it!

Revision history for this message
Vincia Jackson (vcj2) said :
#43

chareyre when i type glxgears i got:
ervin@ubuntu:~/yade$ glxgears
Xlib: extension "GLX" missing on display ":0.0".
Error: couldn't get an RGB, Double-buffered visual

emanuele, i went to "system" and u could not find the hardware drivers menu so i went to disk utility and I don't think i have a driver for my graphic card but i don't know what driver to install for that

Revision history for this message
Christian Jakob (jakob-ifgt) said :
#44

vincia,

what gives: 'lspci | grep -i vga' ?

Zitat von Vincia Jackson <email address hidden>:

> Question #152906 on Yade changed:
> https://answers.launchpad.net/yade/+question/152906
>
> Vincia Jackson posted a new comment:
> chareyre when i type glxgears i got:
> ervin@ubuntu:~/yade$ glxgears
> Xlib: extension "GLX" missing on display ":0.0".
> Error: couldn't get an RGB, Double-buffered visual
>
> emanuele, i went to "system" and u could not find the hardware drivers
> menu so i went to disk utility and I don't think i have a driver for my
> graphic card but i don't know what driver to install for that
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Vincia Jackson (vcj2) said :
#45

ervin@ubuntu:~/yade$ lspci | grep -i vga
00:02.0 VGA compatible controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03)
ervin@ubuntu:~/yade$

I can't open yade anymore, and I installed yade-daily previously when the link was sent earlier in the thread

Revision history for this message
Vincia Jackson (vcj2) said :
#46

if i open yade-daily it reads:

Welcome to Yade 1+2926+27~natty1, from 2011-10-07
TCP python prompt on localhost:9000, auth cookie `escsda'
XMLRPC info provider on http://localhost:21000
freeglut OpenGL GLX extension not supported by display ':0.0'
ervin@ubuntu:~/yade$

Revision history for this message
Anton Gladky (gladky-anton) said :
#47

You do really have some problems with graphic drivers.
Do other 3D applications are working for you well (paraview, gmsh,
freecad etc.)?

Anton

Revision history for this message
Vincia Jackson (vcj2) said :
#48

It is a graphic issue I have Intel G45/G43 Express Chipset but it is up to date. I am not even able to play any youtube videos or video games. No graphics are working. Yade does not run anymore it displays: Am i better off reinstalling linux and yade? Because I am getting errors with installing any type of graphics driver such as mesa or openGL, they aren't installing

ervin@ubuntu:~$ ~/yade/bin/yade-trunk
Welcome to Yade bzr2926
TCP python prompt on localhost:9000, auth cookie `kcysue'
XMLRPC info provider on http://localhost:21000
freeglut OpenGL GLX extension not supported by display ':0.0'
Segmentation fault

Revision history for this message
Christian Jakob (jakob-ifgt) said :
#49

Vincia,

You have an onboard graphic accelerator. You need to install a driver
to use it. Without this driver you will be unable to use any kind of
graphical things!

I found out, that there is no "official" driver support for your
mainboard for linux, but you can use the poulsbo driver:
https://wiki.ubuntu.com/HardwareSupportComponentsVideoCardsPoulsbo

I hope I could help. You do not have to reinstall anything. If the
driver works, then you can use opengl for your machine.

Christian,

P.S: For watching youtube video you also need flash for your browser.

Zitat von Vincia Jackson <email address hidden>:

> Question #152906 on Yade changed:
> https://answers.launchpad.net/yade/+question/152906
>
> Vincia Jackson posted a new comment:
> It is a graphic issue I have Intel G45/G43 Express Chipset but it is up
> to date. I am not even able to play any youtube videos or video games.
> No graphics are working. Yade does not run anymore it displays: Am i
> better off reinstalling linux and yade? Because I am getting errors
> with installing any type of graphics driver such as mesa or openGL, they
> aren't installing
>
> ervin@ubuntu:~$ ~/yade/bin/yade-trunk
> Welcome to Yade bzr2926
> TCP python prompt on localhost:9000, auth cookie `kcysue'
> XMLRPC info provider on http://localhost:21000
> freeglut OpenGL GLX extension not supported by display ':0.0'
> Segmentation fault
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Vincia Jackson (vcj2) said :
#50

I need to download Nvidia. I am able to do so on my laptop but I don't know what's stopping me from doing so on this particular computer that I am running yade off of. I go to system, administration, then additional drivers but there are no listed drivers that I can click on to install. I tried downloading Nvidia from the site but an error runs when downloading. What's wrong?

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

Sorry to be boring but... it would be nice to close the question when
it's answered, instead of appending more and more questions under the
title "how to run example in the tutorial". It will help users to find
proper answers to proper questions in the future.

For installing nvidia, I'm not one of the graphic-card gurus, but a few
of them may be around if you are lucky... Still, you would help the
gurus by giving your operating system, graphic card type, and error
output (maybe it's somewhere in the 50 posts above?).
Did you try searching your problem in google? This is actually the first
place to check for hardware problems, while yade-users is more dedicated
to questions related to yade.

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

It seems to me that Christian #49 was kind enough to explain your
problem. #49 is answering #50, seems to me.
Why would you download nvidia if you don't have a nvidia card?

Revision history for this message
Hadda (hadda) said :
#53

Hello,

If you are sure that your problem is related to the graphic card driver and you have a latest version of ubuntu installed, re-install ubuntu in a safe mode (so that the graphic card will be installed automatically after ubuntu installation and so it optimizes its installation in the best way).
Nvidia graphical cards displays nvidia logo while starting the machine if it is detected. This is not guaranteed if you proceed as above and Nvidia card may not be installed properly, however you won't have problem with yade graphics normally.

You can try to install your graphic card manually before reinstalling the system using the 'envyng-qt' graphic tool for ATI/NVIDIA drivers, but be carefull because if you don't install the right thing you may loose the graphical interface and you will need to log on to a less upgraded version of your system from the boot loader.

Revision history for this message
Christian Jakob (jakob-ifgt) said :
#54

vincia,

install drivers for using hardware in linux is NOT a yade question!
please close the question and try to get help from another mailinglist or just g**gle your driver problem.

christian.

p.s. you have an INTEL chipset, so dont waste time trying to install NVIDIA-related stuff ;)