Packages and Source code possible simultaneously?

Asked by janaka kumara on 2011-10-17

Hi,

I use now Yade 0.60 package version and want to check source code too. Is it possible to have both versions at the same time? If so, how to install source code, say, yade-0.60.3 release version? What all I have to do is to uncompresse yade-0.60.3.tar.bz2 and then compile tying scons PREFIX=/home/kumara/YADE?

If I compile properly, how to run source code version (how to type on terminal)?

Thank you,

Kumara

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Christian Jakob
Solved:
2011-10-21
Last query:
2011-10-21
Last reply:
2011-10-18
Christian Jakob (jakob-ifgt) said : #1

Yes, you can compile as much yade versions as you want!
This is simply done by compiling into different folders.
Example:

download YADE version x to folder /home/kumara/yade-source-x
download YADE version y to folder /home/kumara/yade-source-y

cd /home/kumara/yade-source-x
scons PREFIX=/home/kumara/YADE-X

cd /home/kumara/yade-source-y
scons PREFIX=/home/kumara/YADE-Y

After this you should have two executables
(/home/kumara/YADE-X/bin/yade-x and /home/kumara/YADE-Y/bin/yade-y).
If you want to run one of these you can execute in terminal by typing:

~/YADE-X/bin/yade-x

If you do not want to use such a long command, you can alias it in
your /home/kumura/.bashrc

Simply add this lines at the end of your .bashrc:

alias yade-x='/home/kumura/YADE-X/bin/yade-x'
alias yade-y='/home/kumura/YADE-Y/bin/yade-y'

Then restart your bash with . ~/.bashrc and then you can use these commands:

yade-x
yade-y

Regards,

Christian.

Zitat von janaka kumara <email address hidden>:

> New question #174861 on Yade:
> https://answers.launchpad.net/yade/+question/174861
>
> Hi,
>
> I use now Yade 0.60 package version and want to check source code
> too. Is it possible to have both versions at the same time? If so,
> how to install source code, say, yade-0.60.3 release version? What
> all I have to do is to uncompresse yade-0.60.3.tar.bz2 and then
> compile tying scons PREFIX=/home/kumara/YADE?
>
> If I compile properly, how to run source code version (how to type
> on terminal)?
>
> Thank you,
>
> Kumara
>
> --
> 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
>

janaka kumara (janaka-eng) said : #2

Thanks Christian,

This is what happened when I tried

kumara@kumara-Latitude-E5510:/$ cd /home/kumara/yade-source-0.60.3
kumara@kumara-Latitude-E5510:~/yade-source-0.60.3$ scons PREFIX=/home/kumara/YADE-0.60.3
scons: Reading SConscript files ...
@@@ Using profile default (scons.profile-default) @@@
Yade version is `0.60.3' (0.60.3), installed files will be suffixed with `-0.60.3'.
All intermediary files will be in `/home/kumara/build-0.60.3'.
Mkdir("/home/kumara/build-0.60.3")
Checking whether c++ compiler "g++" works...no

Your compiler is broken, no point in continuing. See `/home/kumara/build-0.60.3/config.log' for what went wrong and use the CXX/CXXFLAGS parameters to change your compiler.
kumara@kumara-Latitude-E5510:~/yade-source-0.60.3$

This is what you can see in `/home/kumara/build-0.60.3/config.log'

file /home/kumara/yade-source-0.60.3/SConstruct,line 336:
 Configure(confdir = /home/kumara/build-0.60.3/.sconf_temp)
scons: Configure: Checking whether c++ compiler "g++" works...
/home/kumara/build-0.60.3/.sconf_temp/conftest_0.cpp <-
  |#include<iostream>
  |int main(int argc, char**argv){std::cerr<<std::endl;return 0;}
  |
g++ -o /home/kumara/build-0.60.3/.sconf_temp/conftest_0.o -c -I/usr/include/vtk-5.0 -I/usr/include/vtk-5.2 -I/usr/include/vtk-5.4 -I/usr/include/vtk-5.6 -I/usr/include/eigen2 -I/usr/include/vtk -I/home/kumara/build-0.60.3/include /home/kumara/build-0.60.3/.sconf_temp/conftest_0.cpp
sh: g++: not found
scons: Configure: no

Any helps are really appreciated.

Note: I use Ubuntu

Janaka

Read error messages carefully, they are usefull in general. I see in
your output:

"Checking whether c++ compiler "g++" works...no
Your compiler is broken, no point in continuing.
sh: g++: not found "

You need a c++ compiler in order to compile some c++ code...
See installation instructions in the documentation, and especially
prerequisites: https://yade-dem.org/doc/installation.html#prerequisities

Bruno

Christian Jakob (jakob-ifgt) said : #4

It seems, that a compiler is not installed.

> Your compiler is broken, no point in continuing.

I am not sure, but I think you need gcc for compiling...
If it is not installed, install it with: 'aptitude install gcc' or
'apt-get install gcc'

janaka kumara (janaka-eng) said : #5

Thanks Jakob and Bruno,

Jakob, I think I got gcc installed properly (sudo apt-get install gcc) but there is no folder named "bin" as you said in /home/kumara/YADE-X/bin/yade-x. However, there is a folder named build-0.60.3 in /home/kumara (but not "bin" folder there as well). Do you think I need to do something else?

Bruno, since I already use Yade package (0.60) and I didn't have any problems with gcc, though I read that error message I didn't want to risk loosing exiting yade without knowing it well (I am not comfortable installing yade even after I use it for some times). In fact, that just now happened. Now, I cannot use yade 0.60 (which I used for few months).

Previously when I typed yade on terminal, I got it but today (after installed gcc), this is what i got

kumara@kumara-Latitude-E5510:~$ yade
Welcome to Yade 0.60
Traceback (most recent call last):
  File "/usr/bin/yade", line 105, in <module>
    import yade
  File "/usr/lib/yade-0.60/py/yade/__init__.py", line 34, in <module>
    ctypes.cdll.LoadLibrary(libstdcxx)
  File "/usr/lib/python2.6/ctypes/__init__.py", line 431, in LoadLibrary
    return self._dlltype(name)
  File "/usr/lib/python2.6/ctypes/__init__.py", line 353, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: /usr/lib/libstdc++.so.6: cannot open shared object file: No such file or directory

Even I typed Yade 0.60 but nothing work. Do you think something wrong happened with gcc installation (you can see below)? Thanks much for your comments.

Janaka
......................................................................................................................................................................................................
This is what happened when I installed gcc

kumara@kumara-Latitude-E5510:~$ sudo apt-get install gcc
[sudo] password for kumara:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libqglviewer-qt3-2 libqt3-mt
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  cpp cpp-4.5 gcc-4.5 gcc-4.5-base libc-bin libc-dev-bin libc6 libc6-dev
  libcloog-ppl0 libelfg0 libgcc1 libgfortran3 libgmpxx4ldbl libgomp1 libmpc2
  libnih-dbus1 libnih1 libppl-c2 libppl7 libstdc++6 multiarch-support
Suggested packages:
  cpp-doc gcc-4.5-locales gcc-multilib autoconf automake1.9 libtool flex bison
  gcc-doc gcc-4.5-multilib libmudflap0-4.5-dev gcc-4.5-doc libgcc1-dbg
  libgomp1-dbg libmudflap0-dbg binutils-gold glibc-doc
The following NEW packages will be installed:
  cpp-4.5 gcc-4.5 libcloog-ppl0 libelfg0 libgmpxx4ldbl libmpc2 libppl-c2
  libppl7 multiarch-support
The following packages will be upgraded:
  cpp gcc gcc-4.5-base libc-bin libc-dev-bin libc6 libc6-dev libgcc1
  libgfortran3 libgomp1 libnih-dbus1 libnih1 libstdc++6
13 upgraded, 9 newly installed, 0 to remove and 1178 not upgraded.
Need to get 23.1MB of archives.
After this operation, 31.4MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://jp.archive.ubuntu.com/ubuntu/ natty/main libnih-dbus1 i386 1.0.3-1ubuntu1 [13.1kB]
Get:2 http://jp.archive.ubuntu.com/ubuntu/ natty/main libnih1 i386 1.0.3-1ubuntu1 [45.8kB]
Get:3 http://jp.archive.ubuntu.com/ubuntu/ natty/main libc6-dev i386 2.13-0ubuntu13 [4,836kB]
Get:4 http://jp.archive.ubuntu.com/ubuntu/ natty/main libc-dev-bin i386 2.13-0ubuntu13 [75.5kB]
Get:5 http://jp.archive.ubuntu.com/ubuntu/ natty/main libc-bin i386 2.13-0ubuntu13 [906kB]
Get:6 http://jp.archive.ubuntu.com/ubuntu/ natty/main libc6 i386 2.13-0ubuntu13 [3,765kB]
Get:7 http://jp.archive.ubuntu.com/ubuntu/ natty/main multiarch-support i386 2.13-0ubuntu13 [8,132B]
Get:8 http://jp.archive.ubuntu.com/ubuntu/ natty/main libgomp1 i386 4.5.2-8ubuntu4 [24.0kB]
Get:9 http://jp.archive.ubuntu.com/ubuntu/ natty/main gcc-4.5-base i386 4.5.2-8ubuntu4 [13.9kB]
Get:10 http://jp.archive.ubuntu.com/ubuntu/ natty/main libstdc++6 i386 4.5.2-8ubuntu4 [333kB]
Get:11 http://jp.archive.ubuntu.com/ubuntu/ natty/main libgfortran3 i386 4.5.2-8ubuntu4 [236kB]
Get:12 http://jp.archive.ubuntu.com/ubuntu/ natty/main libgcc1 i386 1:4.5.2-8ubuntu4 [51.5kB]
Get:13 http://jp.archive.ubuntu.com/ubuntu/ natty/main libgmpxx4ldbl i386 2:4.3.2+dfsg-1ubuntu3 [10.3kB]
Get:14 http://jp.archive.ubuntu.com/ubuntu/ natty/main libppl7 i386 0.10.2-10ubuntu1 [358kB]
Get:15 http://jp.archive.ubuntu.com/ubuntu/ natty/main libppl-c2 i386 0.10.2-10ubuntu1 [1,203kB]
Get:16 http://jp.archive.ubuntu.com/ubuntu/ natty/main libcloog-ppl0 i386 0.15.9-2 [58.4kB]
Get:17 http://jp.archive.ubuntu.com/ubuntu/ natty/main libelfg0 i386 0.8.13-1 [54.8kB]
Get:18 http://jp.archive.ubuntu.com/ubuntu/ natty/main libmpc2 i386 0.9-1 [37.4kB]
Get:19 http://jp.archive.ubuntu.com/ubuntu/ natty/main cpp-4.5 i386 4.5.2-8ubuntu4 [4,154kB]
Get:20 http://jp.archive.ubuntu.com/ubuntu/ natty/main cpp i386 4:4.5.2-1ubuntu3 [28.0kB]
Get:21 http://jp.archive.ubuntu.com/ubuntu/ natty/main gcc-4.5 i386 4.5.2-8ubuntu4 [6,882kB]
Get:22 http://jp.archive.ubuntu.com/ubuntu/ natty/main gcc i386 4:4.5.2-1ubuntu3 [5,068B]
Fetched 23.1MB in 3s (6,467kB/s)
Preconfiguring packages ...
(Reading database ... 129837 files and directories currently installed.)
Preparing to replace libnih-dbus1 1.0.2-1ubuntu2 (using .../libnih-dbus1_1.0.3-1ubuntu1_i386.deb) ...
Unpacking replacement libnih-dbus1 ...
Preparing to replace libnih1 1.0.2-1ubuntu2 (using .../libnih1_1.0.3-1ubuntu1_i386.deb) ...
Unpacking replacement libnih1 ...
Preparing to replace libc6-dev 2.12.1-0ubuntu6 (using .../libc6-dev_2.13-0ubuntu13_i386.deb) ...
Unpacking replacement libc6-dev ...
Preparing to replace libc-dev-bin 2.12.1-0ubuntu6 (using .../libc-dev-bin_2.13-0ubuntu13_i386.deb) ...
Unpacking replacement libc-dev-bin ...
Preparing to replace libc-bin 2.12.1-0ubuntu6 (using .../libc-bin_2.13-0ubuntu13_i386.deb) ...
Unpacking replacement libc-bin ...
Processing triggers for man-db ...
Setting up libc-bin (2.13-0ubuntu13) ...
(Reading database ... 129857 files and directories currently installed.)
Preparing to replace libc6 2.12.1-0ubuntu6 (using .../libc6_2.13-0ubuntu13_i386.deb) ...
Checking for services that may need to be restarted...
Checking init scripts...
Unpacking replacement libc6 ...
Setting up libc6 (2.13-0ubuntu13) ...
Installing new version of config file /etc/ld.so.conf.d/i686-linux-gnu.conf ...
Generating locales...
  en_AG.UTF-8... done
  en_AU.UTF-8... done
  en_BW.UTF-8... done
  en_CA.UTF-8... done
  en_DK.UTF-8... done
  en_GB.UTF-8... done
  en_HK.UTF-8... done
  en_IE.UTF-8... done
  en_IN.UTF-8... done
  en_NG.UTF-8... done
  en_NZ.UTF-8... done
  en_PH.UTF-8... done
  en_SG.UTF-8... done
  en_US.UTF-8... done
  en_ZA.UTF-8... done
  en_ZW.UTF-8... done
Generation complete.
Checking for services that may need to be restarted...
Checking init scripts...

Restarting services possibly affected by the upgrade:
  cups: restarting...done.
  cron: restarting...done.
  atd: restarting...done.

Services restarted successfully.
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Selecting previously deselected package multiarch-support.
(Reading database ... 129857 files and directories currently installed.)
Unpacking multiarch-support (from .../multiarch-support_2.13-0ubuntu13_i386.deb) ...
Setting up multiarch-support (2.13-0ubuntu13) ...
(Reading database ... 129860 files and directories currently installed.)
Preparing to replace libgomp1 4.5.1-7ubuntu2 (using .../libgomp1_4.5.2-8ubuntu4_i386.deb) ...
Unpacking replacement libgomp1 ...
Preparing to replace gcc-4.5-base 4.5.1-7ubuntu2 (using .../gcc-4.5-base_4.5.2-8ubuntu4_i386.deb) ...
Unpacking replacement gcc-4.5-base ...
Setting up gcc-4.5-base (4.5.2-8ubuntu4) ...
(Reading database ... 129864 files and directories currently installed.)
Preparing to replace libstdc++6 4.5.1-7ubuntu2 (using .../libstdc++6_4.5.2-8ubuntu4_i386.deb) ...
Unpacking replacement libstdc++6 ...
Setting up libstdc++6 (4.5.2-8ubuntu4) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
(Reading database ... 129864 files and directories currently installed.)
Preparing to replace libgfortran3 4.5.1-7ubuntu2 (using .../libgfortran3_4.5.2-8ubuntu4_i386.deb) ...
Unpacking replacement libgfortran3 ...
Preparing to replace libgcc1 1:4.5.1-7ubuntu2 (using .../libgcc1_1%3a4.5.2-8ubuntu4_i386.deb) ...
Unpacking replacement libgcc1 ...
Setting up libgcc1 (1:4.5.2-8ubuntu4) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Selecting previously deselected package libgmpxx4ldbl.
(Reading database ... 129864 files and directories currently installed.)
Unpacking libgmpxx4ldbl (from .../libgmpxx4ldbl_2%3a4.3.2+dfsg-1ubuntu3_i386.deb) ...
Selecting previously deselected package libppl7.
Unpacking libppl7 (from .../libppl7_0.10.2-10ubuntu1_i386.deb) ...
Selecting previously deselected package libppl-c2.
Unpacking libppl-c2 (from .../libppl-c2_0.10.2-10ubuntu1_i386.deb) ...
Selecting previously deselected package libcloog-ppl0.
Unpacking libcloog-ppl0 (from .../libcloog-ppl0_0.15.9-2_i386.deb) ...
Selecting previously deselected package libelfg0.
Unpacking libelfg0 (from .../libelfg0_0.8.13-1_i386.deb) ...
Selecting previously deselected package libmpc2.
Unpacking libmpc2 (from .../libmpc2_0.9-1_i386.deb) ...
Selecting previously deselected package cpp-4.5.
Unpacking cpp-4.5 (from .../cpp-4.5_4.5.2-8ubuntu4_i386.deb) ...
Preparing to replace cpp 4:4.4.4-1ubuntu2 (using .../cpp_4%3a4.5.2-1ubuntu3_i386.deb) ...
Unpacking replacement cpp ...
Selecting previously deselected package gcc-4.5.
Unpacking gcc-4.5 (from .../gcc-4.5_4.5.2-8ubuntu4_i386.deb) ...
Preparing to replace gcc 4:4.4.4-1ubuntu2 (using .../gcc_4%3a4.5.2-1ubuntu3_i386.deb) ...
Removing old gcc doc directory.
Unpacking replacement gcc ...
Processing triggers for man-db ...
Setting up libnih1 (1.0.3-1ubuntu1) ...
Setting up libnih-dbus1 (1.0.3-1ubuntu1) ...
Setting up libc-dev-bin (2.13-0ubuntu13) ...
Setting up libc6-dev (2.13-0ubuntu13) ...
Setting up libgomp1 (4.5.2-8ubuntu4) ...
Setting up libgfortran3 (4.5.2-8ubuntu4) ...
Setting up libgmpxx4ldbl (2:4.3.2+dfsg-1ubuntu3) ...
Setting up libppl7 (0.10.2-10ubuntu1) ...
Setting up libppl-c2 (0.10.2-10ubuntu1) ...
Setting up libcloog-ppl0 (0.15.9-2) ...
Setting up libelfg0 (0.8.13-1) ...
Setting up libmpc2 (0.9-1) ...
Setting up cpp-4.5 (4.5.2-8ubuntu4) ...
Setting up cpp (4:4.5.2-1ubuntu3) ...
Setting up gcc-4.5 (4.5.2-8ubuntu4) ...
Setting up gcc (4:4.5.2-1ubuntu3) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

Anton Gladky (gladky-anton) said : #6

if you are not planning to hack the yade code, I would recommend you
to use pre-built versions of yade.
To install the stable 0.60.3 version, just follow the instruction from FAQ:

https://answers.launchpad.net/yade/+faq/1727

Anton

janaka kumara (janaka-eng) said : #7

Thanks Bruno.

Sorry I am not too sure how to do but this is what I want to do with yade.

1. simulate triaxial tests with angular particles (until now I know only triaxial tests with spheres).
2. simulate triaxial tests for mixtures of different materials (e.g. gravel and sand) using psdSizes, psdCumm.

Can these two works be done with pre-built version? Maybe then I dont need to try with source code versions. I am really sorry, my knowledge on codes are poor yet.

Kumara

Best Christian Jakob (jakob-ifgt) said : #8

The problem is, that your library is not in the right folder ...

> OSError: /usr/lib/libstdc++.so.6: cannot open shared object file: No
> such file or directory

You can create a symbolic link to avoid this error message:

ln -s /usr/local/lib/libstdc++.so.6 /usr/lib/libstdc++.so.6

If libstdc++.so.6 is not in /usr/local/lib/ then please search for it
and create the symbolic link to this path.

Christian

P.S. There is no /home/kumara/YADE-X/bin/yade-x because compilation failed.

Jérôme Duriez (jduriez) said : #9

Hello, about your goals :

"1. simulate triaxial tests with angular particles (until now I know only triaxial tests with spheres).
2. simulate triaxial tests for mixtures of different materials (e.g. gravel and sand) using psdSizes, psdCumm."

For 1. angular discrete elements do not exist now in yade (box excepted, but they can only be used as boundaries). The solution is to use numerical samples of clusters = aggregates of spheres.

So, both for 1. and 2. I think that reaching your goals require only some special operations in the realisation of the numerical sample. Even if I never used clusters, I think that all what concerns this realisation can be performed through python interface.

To conclude, I think that yes you do not need really to have access to code and use source versions.

(But you still have the right to want to, for curiosity...)

janaka kumara (janaka-eng) said : #10

Thanks Christian,

I tried your instruction but it says "permission denied". Any idea to overcome it?

ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6 /usr/lib/libstdc++.so.6
ln: creating symbolic link `/usr/lib/libstdc++.so.6': Permission denied

Christian Jakob (jakob-ifgt) said : #11

you need to be root for this ...
try:

sudo ln -s /usr/lib/i386-linux-gnu/libstdc++.so.6 /usr/lib/libstdc++.so.6

janaka kumara (janaka-eng) said : #12

Thanks everyone.

janaka kumara (janaka-eng) said : #13

Thanks Christian Jakob, that solved my question.