R myDSL effort - dependancy problem


Forum: myDSL Extensions (deprecated)
Topic: R myDSL effort - dependancy problem
started by: Doofer

Posted by Doofer on Mar. 15 2005,20:16
I'd really like R (GPL stats package - yes, you can google on 'r'... which is cool...) as a myDSL extension. I've tried installing it, but apt-get gives a perl dependancy error, and downloading and dpkg-ing kicks up a long list of unmet dependencies.

However, before I beetle off and bloat my DSL distro with loads of libs, I note that the myDSL extension for Octave seems to work fine, despite needing many of the same libraries as R.

R is to SPSS or SPLUS what Octave is to Matlab. It's about my being able to show my colleagues that DSL is a realistic working environment they can carry with them, rather than a curio for computer freaks. I already have my students learning stats with R... blazing the GPL/non-Gates trail here, even if my linux skills are limited...

Posted by mikshaw on Mar. 15 2005,21:05
My guess is that the Octave extension was created by first installing all dependencies, then Octave, and then the deps would have been included in the extension.
Posted by clacker on Mar. 16 2005,01:10
Doofer, I was able to install R from debian by using apt-get (/etc/apt/sources.list set to unstable) but running from the liveCD I had to remove two links and replace them with copies before I started.  I had to run the following as root before I ran apt-get install r-base:

Code Sample
rm /etc/ld.so.conf
rm /etc/ld.so.cache
cp /KNOPPIX/etc/ld.so.conf /etc/ld.so.conf
cp /KNOPPIX/etc/ld.so.cache /etc/ld.so.cache


I was able to make a dsl file (24 megs).  perl is newer than the version in GTK2.dsl, and that download is 15 megs where only 5 is perl.  The version of tcltk is newer than the version in the repository so I couldn't use those either.

What I need help on, and then I can upload this dsl, is creating a script that runs ldconfig.  I don't want to overwrite anyone's files, but I do need to run ldconfig to add the atlas library.  Here is what I have so far, but it doesn't work.  My first if statement is flawed but I don't know how to write it correctly:

Code Sample
#!/bin/bash
#
# an example of getting around ld.so.cache and ld.so.conf problems
#
# check first to see if your files are already in the ld.so.conf
# this will avoid duplicate entries
#
# test for atlas being installed already
#
if true
###### if grep /usr/lib/atlas /etc/ld.so.conf > /dev/null ### failed, why???
then
   echo it's already loaded # assume it went well before and exit
else
   echo it wasn't there
   if [ -L /etc/ld.so.cache ] # if it's a symbolic link, we need to replace it with a real file
   then
       echo it was a symbolic link
       sudo rm -f /etc/ld.so.cache
       sudo cp /KNOPPIX/etc/ld.so.cache /etc/ld.so.cache
   fi
   cat /etc/ld.so.conf > /home/dsl/tmpconfig
   echo /usr/lib/atlas >> /home/dsl/tmpconfig
   sudo ldconfig -f /home/dsl/tmpconfig
   rm tmpconfig
fi
exit


I thought

if grep word file
then
   echo true
else
   echo false
fi


was a valid statement.  Can some one show me the way?  All I want to do is get a writable ld.so.cache and the use ldconfig to write to it.  I can't believe I'm so close and then getting closelined by an if statement.

Posted by cbagger01 on Mar. 16 2005,04:56
Try this:

Code Sample

if test `grep word file -c` -ge 1
then
    echo true
else
    echo false
fi

Posted by aesenadorjr on Mar. 16 2005,05:01
I was able to make a R.uci file, but the process I used made it impossible to share the file because I had to remaster DSL to include gcc, g77, g++, make, binutils, libncurses-dev, and libreadline-dev (following meo's procedures, see posts).  I downloaded the R source tarball from the R-CRAN site and compiled it afterwards.  Note that I did not need to have Perl as this was used only for compiling the man/info/html docs.  Unfortunately, the libraries I obtained by apt-get install was from the testing branch and is newer than the ones in the original DSL liveCD.  I tested my R.uci to confirm that it works with my remastered DSL and not work on the original.

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.

Posted by clacker on Mar. 16 2005,12:54
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.

Posted by aesenadorjr on Mar. 16 2005,20:25
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.

Posted by clacker on Mar. 16 2005,23:54
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.

Posted by clacker on Mar. 18 2005,01:26
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.
Posted by clacker on Mar. 18 2005,03:42
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.

Posted by Doofer on Mar. 18 2005,11:24
Thanks guys, this is superb. I can't wait to give the myDSL extension that results from all this hard work a whirl.

One of R 's great strengths is its huge range of add-on libraries of functions - I'm hoping that the myDSL being created will include those in r-recommended. I think the 'walk-through' above will make it possible for anyone to add any of the more obscure ones.

Posted by clacker on Mar. 18 2005,13:44
I guess I should have added a step between 1 and 2 of "ask the people who want the extension exactly what they want."  No Doofer, I didn't put in the r-recommended.  I see I would need to run tools/rsync-recommended before compiling to get them.  The tar.gz I submitted last night doesn't have this, but I'm pretty sure that the dsl I submitted the night before (made from the r-base debian package) does have them.

It's times like this you can be glad that you saved all of those *.deb files!

EDIT: I reloaded and recompiled.  I think r-recommended got loaded.  I also needed to get the rsync debian package.  It's only 500K bigger compressed.  I hope it's correct.

Posted by Doofer on Mar. 18 2005,17:23
That's a good point for any developer! If r-recommended is in there now, you should be able to type
library (foreign)
at the R prompt without getting an error.

Posted by clacker on Mar. 18 2005,18:02
I typed library(foreign) at the prompt and got:

Code Sample
> library(foreign)
Error in library(foreign) : There is no package called 'foreign'


when I typed library() I got:

Code Sample
> library()

Packages in library '/opt/R/lib/R/library':

base                    The R Base Package
datasets                The R Datasets Package
grDevices               The R Graphics Devices and Support for Colours
                       and Fonts
graphics                The R Graphics Package
grid                    The Grid Graphics Package
methods                 Formal Methods and Classes
splines                 Regression Spline Functions and Classes
stats                   The R Stats Package
stats4                  Statistical functions using S4 classes
tcltk                   Tcl/Tk Interface
tools                   Tools for Package Development
utils                   The R Utils Package

(END)


I followed the same procedure as before only I also loaded the rsync deb file and ran tools/rsync-recommended just before I ran ./configure.  Is there anything else I can check?  Perhaps I needed to set some switch in the configure?  I'll keep trying.

One other thing, when submitting a dsl package, it's nice to tel ke4nt1 a little about it and how to run some things in it.  That way if it doesn't work on a different machine he can tell.  Better that than "yup, there's a command cursor, it must be running correctly!"  Is there an "acid test" for the R you want?  Particular things you really need?  I submitted something like this in with the email:

Code Sample
x = 1:20
x
y = 3*x^2
plot(x,y)
rr = c(1,2,3,3,3,5)
mean(rr)
mode(rr)
demo(graphics)
q()

Posted by Doofer on Mar. 18 2005,19:45
Ah - this is where my unfamiliarity with Debian may be a problem. It depends on what form the libraries are in r-recommended.
In a typical linux setup, you'd install R, and if there was an R package/library you needed, you'd dowload the package.tar.gz and, in xterm:
R INSTALL package.tar.gz
and it would install it (and compile where necessary - some of the libraries are just R syntax, so don't have any compilable code as such).
An alternative for a known distro would be to just slot the compiled library into the R lib directory.
So if it's got r-recommended in the extension, perhaps it's got eg. foreign_0.8-5.tar.gz in the path, so you in a terminal you type:
R INSTALL foreign_0.8-5.tar.gz
and it slots it into the right directories, then at the R prompt you type:
library(foreign)
and no errors are reported...

(Maybe, for convenience, in r-recommended they've just called it foreign.tar.gz)

I'd be happy to give your extension a run-through, if only I knew whereabouts on the damnsmalllinux site it was... and/or how to access it from DSL.

I hope this helps.

Posted by clacker on Mar. 19 2005,19:13
I submitted the tar.gz , so first k4nt1 needs to check it out, then he puts it into the testing section of the repository.  After some people have had a chance to try it out and make sure it's OK, it gets moved, probably to apps.  So look for it in testing.
Posted by Doofer on Mar. 20 2005,09:25
Many thanks. I note from cran.r-project.org/doc/manuals/R-admin.html  that running rsync.recommended looks as if it should get the packages in r-recommended okay. But of course the recommended 'R INSTALL pkg' methods _won't_ work in DSL unless one has all the compilers loaded.

Just as at Section 5.3 'Removing packages' they point out you can deinstall by just remove the package directory, so one could just compile a new package for DSL and pop that directory in R/libs... adding the sprinkling of whatever linux libs the new R library might need...

However, I'm not sure your process does this, since one only finds out which libs an R library needs, when one R INSTALLs the package. So, surely, to find out you'd have to R INSTALL each of the packages in r-recommended in turn, to find out which linux libs are needed?

(Not that r-recommended contains too many R packages to make this practical, but I don't see how else one could determine which libs are needed to R INSTALL - in some cases, compile - them.)

In summary, k4nt1 should be able to type at the R-prompt:
library(KernSmooth)
library(VR)
library(boot)
library(cluster)
library(foreign)
library(lattice)
library(mgcv)
library(nlme)
library(rpart)
library(survival)
and if these R-libraries all load without errors, all is well with r-recommended. I just suspect they will have to be R INSTALLed first.

(I _think_ what I've just said makes sense.... still metabolizing last night's real ales...)

Posted by softgun on Mar. 21 2005,16:03
This is great stuff Clacker!
It must go into the documentation.
A few questions
Quote:
Then you need to choose between making a *.dsl, a *.tar.gz, or a *.uci.  

If we need to do some post install configuration which is the best choice?

quote:
 If your program requires other directories, you need to make a dsl instead of a tar.gz.

Does other directories mean say /var/lib ?

I am trying to make postgresql as an extension and it can be put into one directory with ./configure --prefix=/opt/oio/postgresql

but it also creates a /var/lib/postgresql....

Posted by clacker on Mar. 21 2005,22:56
Doofer, that link looked great.  I can't get to it before the end of the week but that page had lots of good info on compiling and using the libraries.  I might not have been running ./tools/rsync-recommended from the top of my source directory but rsync-recommended from within the tools directory.

softgun, I believe that you can do post installation instructions for any of the three (dsl, tar.gz, uci).  You would need to write a script and call it from the menu you create.  If you need to change or modify any file within /opt/yourdir then it can't be a uci. One of the features of the uci is it lets the user uninstall it, so if your script modifies or adds files into other directories, they won't get uninstalled like the user expects.  If you make a script to call you program, and set the PATH and LD_LIBRARY_PATH variables before calling your program, any of the 3 is fine.

As far as I know, if the files in the package aren't all under either the /opt, /home, or /tmp directories you can 't make a tar.gz or uci.  So I don't think you can include a /var/lib directory in a tar.gz or uci file.  Some packages don't lend themselves well to being placed into /opt because other programs need to call them and would need the PATH variable set to /opt/yourdir all the time to find them.  I have gotten around this by making a menu option that opens a new bash shell that runs the export commands as part of it's initialization.

I've had fairly good luck using ./configure --prefix=/opt/yourdir to put my files into the /opt directory.  Many times I've had problems not with the binaries but the libraries they look for.  Is the /var/lib/postgresql directory created so that other programs can use the postgresql libraries as well as postgresql itself?  have you tried moving them under the /opt/oio/postgresql directory and setting LD_LIBRAY_PATH?  something like:

export LD_LIBRAY_PATH=$LD_LIBRAY_PATH:/opt/oio/postgresql/lib

and then calling your binary?

Posted by softgun on Mar. 22 2005,16:45
Thanks Clacker,

I will try this and get back to you soon.

Posted by softgun on Mar. 27 2005,16:10
Hi Clacker,

I did most of what you said, but I am asked for a library file called zlib during make. i downloaded the latest zlib.
Now how can I put this in and make postgresql read it during make?

I ran configure --with libraries=/opt/lib afte adding the LD_LIBRARY_ PATH but despite the fact that zlib is there in a packed file in the /opt/lib, the make program repeats that it cannot find the particular file!

I then did something undesireable but worked around by doing configure --without-zlib and make ran and said postgresql was ready to install. When runnign make install, it aain stops saying another file called ascii_moi.so is missing from $libdir/, but the file IS there in the library path!

Any reason for this? Iis it a ownership problem?

i also found that we can edit the Makefile to set the prefix if there is no way to do this from the configure.

I am getting warmed to this thanks to you! :-)

Posted by clacker on Mar. 27 2005,23:59
How did you load zlib?  Did you use apt-get?  I've found when a configure/make asks for a library, you need to apt-get the -dev version of that package so that you get the include files.  In this case I guess that's zlib1g-dev.  If you don't get the dev version, gcc can't use the *.h files to let the compiler know where things are in the libraries.  Once the program has been compiled, in most cases those *-dev files are no longer needed.
Posted by clacker on Mar. 28 2005,02:19
Quote
In summary, k4nt1 should be able to type at the R-prompt:
library(KernSmooth)
library(VR)
library(boot)
library(cluster)
library(foreign)
library(lattice)
library(mgcv)
library(nlme)
library(rpart)
library(survival)
and if these R-libraries all load without errors, all is well with r-recommended. I just suspect they will have to be R INSTALLed first.


I remade the R.tar.gz package.  It turns out I needed to apt-get perl, tcl8.3, and tk8.3 to get things in recomended to compile.  I tried the above libraries and all but VR loaded.  I believe VR compiled, because it failed without perl like I said, but I don't see it when I type library(VR).

It's up to around 15 megs now.  demo() now gives you a nice list of the available demos, and the html help is there.  I set the R_BROWSER configuration variable so that R would use firefox.  It wants java for some of it's help pages, but you should be able to load that extension from the repository.  You might need the tcltk, gcc1, and gtk2 extensions for some things, but I did write a working function without it.

Try it out, if you like it it's yours to keep. :)

Posted by Doofer on Mar. 28 2005,08:55
That's a really good piece of work!
I shall check the the testing area (the one accessed from the DSL front page, yes?) daily, in eager anticipation; once it's up I'll give it a workout.
Many thanks for this.

Posted by softgun on Mar. 28 2005,10:45
Quote (clacker @ Mar. 27 2005,18:59)
How did you load zlib?  Did you use apt-get?  I've found when a configure/make asks for a library, you need to apt-get the -dev version of that package so that you get the include files.  In this case I guess that's zlib1g-dev.  If you don't get the dev version, gcc can't use the *.h files to let the compiler know where things are in the libraries.  Once the program has been compiled, in most cases those *-dev files are no longer needed.

Hi Clacker,

I installed zlib with the source tar file. i had to get the latest version because there was a security issue in the erlier versions.
i will try apt-get and see if there is a dev file as well. You are right. Without the dev file many programs in Debian systems do not compile. This happened to me with compiling zope which needs python-dev!

Posted by clacker on Mar. 28 2005,14:48
softgun, I know I'm kind of putting this all in the wrong spot, but since this post is about making hard dsl packages, I guess it's OK.

Part of the problem compiling is knowing what you need to have installed first.  If you look at the debian packages page for < the postgresql  package >, you can get a quick feel for the dependancies you need.  Right off the bat,  I see that python, zlib1g, and the MIT Kerberos runtime libraries are required that postgresql can run.  You might need mailx as well, I don't know though.  perhaps if it isn't found at configuration time compilation can continue without it.

As far as some of your other problems, I see that adduser is required.  Why?  I believe that the installation creates a postgresql user.  I saw on this < postgresql installation tutorial > that you need to be that user in order to configure the package.  If you are running from the liveCD, the files that handle users and passwords are links to the CD, so they are not writable.  you might want to look at the /usr/sbin/addusers.lua and /etc/init.d/ssh_addusers scripts to see how dsl manages to make this happen.  You are going to need to add back in a user when you run your shell script to initialize your package.

I also see from that tutorial that /etc/ld.so.conf needs to be apended and ldconfig needs to be run.  I've had trouble with ld.so.conf and ld.so.cache and packages before because they are links to the CD and therefore not writable.  I've tried replacing the links with their respective files on the CD, adding the lines I needed to ld.so.conf by looking at the ld.so.conf file after installation the first time, and then calling ldconfig.

Have you tried installing to the liveCD by downloading the debs using apt-get install postgresql?  it's tough but do-able.  You run into a problem with "group add failed"  Get around this by running sudo /etc/init.d/ssh_addusers before installing.  The second problem I ran into was that /etc/mailname was a link and couldn't be modified.  You can use:

rm /etc/mailname
cp /KNOPPIX/etc/mailname /etc/mailname

To get around that.  Then it requires a group and two new users to exist.  I ran:

useradd uucp
useradd mail
groupadd mail

I was then able to get the packages to install, but I don't know enough to know how to start up the server.  At least that's a place for you to start.

Posted by softgun on Mar. 29 2005,11:35
Thanks and more thanks! How very kind of you to do all this. I will try all you said and give it a go ASAP. Then i will get back to you.
Posted by Doofer on April 11 2005,08:15
Being impatient I know, but any idea how long it will take to get into the Testing area?
Posted by Doofer on April 12 2005,20:14
Shame on me, such impatience, tsk tsk! It's in Testing!

Looking good! Responds fine.

Problems so far:

1. All the libraries seem to load and function so far, apart from tcltk:
> library(tcltk)
Error in firstlib(which.lib.loc, package) :
       Tcl/Tk support is not available on this system
Error in library(tcltk) : .First.lib failed for 'tcltk'

This is a pity, as using:
options(pager=tkpager)
gives 'Help' files in separate windows, so you can readily cut & paste examples of code from help into the console.

Loading the tcltk myDSL doesn't seem to help.

2. If I want to use another shell (eg. to have black text on white bg) I have to dig deeper to get R (/ramdisk/opt/R/bin/R) - it'd be nice if R was on the path? Or not?

Anyway, fantastic! Perhaps I should be handing students DSL disks with this on....

Posted by Doofer on April 12 2005,20:37
Oh, and having shut R down, I can't re-start it from the myDSL R menu entry. I get:

dsl@box:/opt/R/bin$ R
mkdir: Cannot create directory `/tmp/Rtmp1114-9289': Permission denied
mkdir: Cannot create directory `/tmp/Rtmp1114': Permission denied
ERROR: cannot create temporary R session directory

Unless I start it directly as root from a shell.



PS. Is there somewhere else I should be sending reports on this, as it's now in Testing?

Posted by clacker on April 15 2005,15:21
Doofer,

1) I have no idea here.  I'll look into it, but right now I don't know why tcltk doesn't work.  Maybe I needed to compile with the tcl-dev and tk-dev packages as well.  it's missing the tkpager binary altogether.

2) Use whatever shell you want.  If the file name is too long, set the path or type:
      sudo ln -s /opt/R/bin/R /usr/bin/R

3) I didn't have your restart problem so I can't fix it.

Posted by ke4nt1 on April 15 2005,16:16
Might simply need to add the symlinks from tcl8.4 to tcl
and wish8.4 to wish ..

I'm not sure why they aren't like that already..
Might be a debian thing..  editing the scripts also works..

Usually , the scripts want to see wish and tcl..

73
ke4nt

Posted by clacker on April 15 2005,17:17
no, the problem was that I compiled R when I didn't have tcl8.3-dev and tk8.3-dev loaded.  Then when I did, the R program looked for them in the /usr/lib/tcl8.3 directory instead of the /lib/tcl8.3 directory.  I need to make a shell script to do

export TCL_LIBRARY=/lib/tcl8.3
/opt/R/bin/R -g tk

with the new compile and then everything is OK.  It loads in a tcltk window and runs help from separate windows.  There is a help entry box that doesn't work, but the rest looks OK.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.