Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (7) </ 1 [2] 3 4 5 6 7 ... >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: R myDSL effort - dependancy problem< Next Oldest | Next Newest >
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: Mar. 16 2005,12:54 QUOTE

cbagger, thanks so much.  That worked great.  Not every example you see on the internet works, you know.  Now I can finish this one off. EDIT: my problem was using the word wasn't in an echo statement instead of wasnt (without an apostrophe).  That apostrophe threw everything else off.

I'm going to submit this with the script that looks for /etc/ld.so.cache as a link, replace it if it is with a real file, and then make a new ld.so.conf file and run ldconfig on that.  That way I never harm the origional ld.so.conf and worse case the user could run ldconfig again and all my ld.so.cache changes go away.

Quote
One other thing.  So, clacker, how did you do the Octave.tar.gz?  Using apt-get?  I was not successful in this, so I had to remaster DSL.  I originally thought you compiled it from source because you also made that very nice gcc dsl.


I actually compiled it from the GNU sources.  I loaded dsl-dpkg.dsl, gcc1.dsl, and gnu-utils.dsl first.  Then I used apt-get to to install xlibs-dev.  The great thing about compiling from sources is in some cases, you can set the make PREFIX variable so that it compiles everything to work from the /opt/youpackagename directory.  The cool thing about doing that is you don't even need deb2dsl then, you have all of the files yo need in one directory so it's much easier.

Another trick I use when I make a deb from files I get using apt-get is to install the support stuff first (gcc, f77, develeopement libraries) and then use the command touch mymarker to create a dummy file.  Then I install or compile what I want.  Finally run
sudo find / -not -type 'd' -cnewer mymarker | grep -v "\/proc\/" > files
to find files that were modified or created after the time you created the dummy file mymarker.

Look at the files file and strip stuff out.  Remove /ramdisk from the front of the lines that have it, remove redundant and unwanted things like changelogs, and then use

tar -czvf mynewdsl.dsl --numeric-owner --no-recursion -T files

to make your dsl.  This method lets you make a dsl without all of the developement files included.
Back to top
Profile PM 
aesenadorjr Offline





Group: Members
Posts: 11
Joined: Feb. 2005
Posted: Mar. 16 2005,20:25 QUOTE

OK, suppose I did apt-get install to obtain gcc, g++, g77, libncurses5-dev, libreadline4-dev, make, and binutils.  Then I downloaded the R source tarball and did "./configure --prefix=/opt/R", "make", and "sudo make install".  Then I did "tar -C / --numeric-owner -czf R.tar.gz /opt/R".  Then in /home/dsl/ I did (thanks to clacker and ke4nt1) the following to make a valid R.tar.gz extension:

mkdir temp
mv R.tar.gz temp/
tar -tzf R.tar.gz | awk ' $0 !~ /.*\/$/ ' > w.txt      # create a file list without directories
tar -xzf R.tar.gz
rm R.tar.gz
mkdir tmp tmp/mydsl.menu
vi tmp/mydsl.menu/R
# create a tmp/mydsl.menu/R file containing [exec] ® {rxvt -rv -T "R" -e /opt/R/bin/R}
chmod 644 ~/temp/tmp/mydsl.menu/R
vi w.txt
# add to w.txt the line: tmp/mydsl.menu/R
tar -T w.txt --no-recursion --numeric-owner -czf R.tar.gz

I would then save the R.tar.gz somewhere permanent, reboot to fresh DSL, then load the extension with "mydsl-load /mnt/hda1/R.tar.gz".  It will load, but will not run.  I am just one year into linux so I can't really say why except guess that the shared libraries that R was compiled on is not in the original DSL.  Thus I ended up remastering to add the gcc, g++, ..., and only then I was able to make it run.

The good side of this is with my souped-up remaster I can compile a lot of other packages directly from the source tarballs (Octave, Maxima, Spice3f5 and now working on teTex) and make uci's.  The bad side of this is I can't share anything I made, and my dsl.iso is now 80 MB and growing.

Now, if only someone would tell me how to do this properly so that I can create a souped-up remaster to prepare uci's (I prefer this type very much) that can be loaded and run by anyone with the original DSL liveCD.

I initially tried the original Knoppix 3.3 CD and Quantian to compile things and create extensions, but for some reason my computer won't boot with those.  It hangs after detecting the AGP, and noagp did not work.  I guess John and Robert did something to make DSL overcome this problem.
Back to top
Profile PM 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: Mar. 16 2005,23:54 QUOTE

aesenadorjr, I feel your pain.  I believe the packages you need to load are gcc-3.3-base and libg2c0 (around 200K together).  I did what you did and got the same result, then loaded those two debs and the program worked.  One option would be to reinstall those 2 packages and use the deb2dsl script to collect the files, then join that with the tar ball for R.  Situations like this are the reason that I started saving the deb files I find myself downloading for a project.  It makes the next rounds go much faster.  They all get saved in the /var/cache/apt/archives directory so you can copy them from there.

Because those libs are not in the /opt directory, it's hard to make a tar.gz file.  There might be a way to set a command line switch in the configure to look for those libs in the /opt/R/lib directory, or you could try using the LD_LIBRARY_PATH shell variable set to /opt/R/lib

The dsl I made was around 25 megs when I made it from the debs because you'll get all of the graphics functions, demos,  and the help.  When you build it from the source like you did it's around 6 megs but you get no plotting.  You could download xlibs-dev, but then you're talking even more work because the directory that R uses for X11 won't be right and you need to set it with a switch.
Back to top
Profile PM 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: Mar. 18 2005,01:26 QUOTE

aesenadorjr, I am in the process of making a tar.gz for R.  I will try to document every step I make, and my thought process as I go along.  What to look for, what to look out for, how to make things happen.  I found that I can get it to plot in X, but it doesn't use gnuplot.  So you need to download xlibs-dev and then compile it.  give me a few days and I'll work it out as best as I can.  Even if I can't make a tar.gz, I know I can make a dsl file for this that's smaller than the 26 meg one that I submitted yesterday.  Right now it's around 7 megs.
Back to top
Profile PM 
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: Mar. 18 2005,03:42 QUOTE

OK here's how I make my packages, using R as an example.

First, you need to decide what exactly you want to have as your package and make sure that you really want to spend the time making it.  Is it available as a package on debian?  Is source code available?

Then you need to choose between making a *.dsl, a *.tar.gz, or a *.uci.  A *.dsl is nice because it's (in general) much easier to make.  You can use cbagger's deb2dsl script (which is easy) or try using the find command to get the package built.  If you want a tar.gz or uci, all files must be in the /home/dsl, /tmp/mydsl.menu, or /opt directories.  It's safe and very easy to uninstall.  If you make a uci, uninstallation happens with the mydsl button in emelfm, which is cool.  If your program writes to its directory in /opt, you can make a tar.gz but you can't make a uci.  If your program requires other directories, you need to make a dsl instead of a tar.gz.

For this package, you wanted a tar.gz.  So you get the source code (this came from gnu.org).  That usually means compiling.  I always use a liveCD, so I needed to download all of the required compilers and libraries.  You need to install gcc, g++, and make (which means you can use the gcc1.dsl package from the repository).  If you try that here, you see that you also needed f77 (or the g77 GNU fortran compiler).

I had to load the dsl-dpkg.dsl package, change /etc/apt/sources.list to unstable, and run apt-get update.  Then I ran apt-get install make gcc g77 gpp g++ which got the compilers I needed.

Most programs require libraries to compile.  You can guess which ones, or you can try running the configure command to see where it complains.  Untar you source using tar -xzvf packagename.tar.gz and cd to that directory.  Most programs compile using three commands:

./configure
make
make install


so when you type ./configure from the source directory, what does it tell yo uyou need?  In this case (as you pointed out) we need to load some more packages.  The whatever-dev deb packages are develepoment libraries for whatever libraries.  Using apt-get, you get both the base library and what you need to compile a program to use that library.  We need to apt-get:

libncurses5-dev
linreadline4-dev
xlibs-dev

xlibs-dev is a big one.  Most anything in X requires this package.  ./configure doesn't complain that it's not there because it can compile without it, but R is much better with graphics and plotting.  When you apt-get xlibs-dev, your going to get some errors.  You need to then run dpkg -i --force-overwrite *.deb on and debs that wouldn't load, then run apt-get install -f to make sure it's all OK.

Now lets try configuring again.  When you want to make a tar.gz, you want all the files under the /opt directory.  This is why you want to use the --prefix=/opt/R switch.  So you try:

./configure --prefix=/opt/R
make
make install


Now try running your program by typing /opt/R/bin/R and it should run fine.  If it's all working good, make a temp directory and a temp/opt directory and copy /opt/R into it.

mkdir temp
mkdir temp/opt
mkdir temp/tmp
mkdir temp/tmp/mydsl.menu
cp -rP /opt/R temp/opt/R

I load gnu-utils.dsl and use the find commad to make a list of the files

cd temp
find opt/ -not -type 'd' > files

Then I edit my menu.  it need to have the same name as your directory in /opt, and the same name as you final package.  it needs to be placed into the tmp/mydsl.menu directory.  mine contained [ exec ] ( R ) { rxvt -rv -T "R" -e /opt/R/bin/R} chmod this file 644.  Add the menu file name and path to the file you got from find.

One word of advice I can give you is if you spend the time downloading those debian libraries, save then somewhere.  They are all located in /var/cache/apt/archives/*.deb.  You never know, we might need them later.

Make your tar.gz file using tar -czvf R.tar.gz --numeric-owner --no-recursion -T files.  Save it somewhere and reboot.  Try to load it.  it didn't work (a window flashed open then closed).  Open an xterminal and type in /opt/R/bin/R by hand.  You can see that the library it can't find is libg2c.so.0.  If you don't happen to know which package this was in, look at the debian web site, you can search for packages that contain files in the packages section.  Reload that package and be glad you saved it's deb file so you don't need to download it again.  Use dpkg (you see it also requires gcc-3.3-base so load that too).  Now try running R from the menu and it works!

Great, but how do you add those libraries to your package?  Well, first I had to find what those files were.  Here I used deb2dsl on just the two deb files I needed to reload.  Put those two files in a directory by themselves, and run deb2dsl from that directory.  It makes a dsl file in /home/dsl/, use tar -tzf newdsl.dsl >files to get a list of the new files.  Look at them and only two of them are really important: libg2c.so.0 and libg2c.0.0.0.  Since there is a  lib directory in /opt/R/lib/R/lib that already has a .so file that R can find, let's toss our new libraries in there and repackage the tar.gz.  basically, I made a temp directory, unpacked R.tar.gz into it, got a files list of R.tar.gz, added the news files to opt/R/lib/R/lib, and added the files to the file list.  Then I retarred and rebooted.

Low and behold it works.  That's what I did.  I hope the rambling and babling helps you make other neat packages.
Back to top
Profile PM 
32 replies since Mar. 15 2005,20:16 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (7) </ 1 [2] 3 4 5 6 7 ... >/
reply to topic new topic new poll
Quick Reply: R myDSL effort - dependancy problem

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code