mkoctfile suggestion

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

mkoctfile suggestion

en254
I suggest that the -c option be added to mkoctfile.
This would have the same effect as with gcc, ie
to compile to object but not link:

So, for example, you could do
An:~/octave/sparse> mkoctfile -c make_sparse.cc -ISuperLU/SRC/
An:~/octave/sparse> mkoctfile make_sparse.o -lsuperlu -L.

This would allow it to be nicely used in Makefiles,
so that large projects with multiple source
files don't need to be recompiled from scratch
each time.
_______________________________________
Andy Adler,                [hidden email]

Patch against 2.1.31

--- mkoctfile.orig Fri Nov  3 20:57:41 2000
+++ mkoctfile Fri Nov  3 21:02:04 2000
@@ -48,6 +48,7 @@
 ldflags=
 dbg=:
 strip=false
+link=true
 
 if [ $# -eq 0 ]; then
   echo $usage_msg
@@ -88,6 +89,7 @@
   -lLIB                   Add library LIB to link command.
   -LDIR                   Add -LDIR to link command.
   -o FILE, --output FILE  Output file name.  Default extension is .oct.
+  -c                      Compile, but do not link
   -s, --strip             Strip output file.
   -v, --verbose           Echo commands as they are executed.
 
@@ -124,6 +126,9 @@
     -s | --strip)
       strip=true
     ;;
+    -c)
+      link=false
+    ;;
     *)
       echo "mkoctfile: unrecognized argument $1"
       exit 1
@@ -202,14 +207,16 @@
 
 # Link all the object files.
 
-$dbg $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags
-eval $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags
+if $link; then
+  $dbg $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags
+  eval $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags
 
 # Maybe strip it.
 
 if $strip; then
   $dbg strip $octfile
   eval strip $octfile
+fi
 fi
 
 exit 0



Reply | Threaded
Open this post in threaded view
|

mkoctfile suggestion

John W. Eaton-6
On  3-Nov-2000, Andy Adler <[hidden email]> wrote:

| I suggest that the -c option be added to mkoctfile.
| This would have the same effect as with gcc, ie
| to compile to object but not link:
|
| So, for example, you could do
| An:~/octave/sparse> mkoctfile -c make_sparse.cc -ISuperLU/SRC/
| An:~/octave/sparse> mkoctfile make_sparse.o -lsuperlu -L.
|
| This would allow it to be nicely used in Makefiles,
| so that large projects with multiple source
| files don't need to be recompiled from scratch
| each time.

I made these changes.  BTW, the ultimate source file for this script
is mkoctfile.in, so that's where the changes really belong.

Thanks,

jwe


Reply | Threaded
Open this post in threaded view
|

RE: mkoctfile suggestion

Lippert, Ross A.
In reply to this post by en254
I could not help notice the name of your file was "make_sparse".
I've been working on some ways to implement sparse matrix manipulations
at the ".m" level (I have been using mostly octave primitives and just
one hand-hacked .oct file for a kind reduction octave doesn't yet support).
Could you and I exchange information, and perhaps, if others are interested,
have a general discussion about sparse matrices in octave?


-r

-----Original Message-----
From: Andy Adler [mailto:[hidden email]]
Sent: Friday, November 03, 2000 9:29 PM
To: [hidden email]
Subject: mkoctfile suggestion


I suggest that the -c option be added to mkoctfile.
This would have the same effect as with gcc, ie
to compile to object but not link:

So, for example, you could do
An:~/octave/sparse> mkoctfile -c make_sparse.cc -ISuperLU/SRC/
An:~/octave/sparse> mkoctfile make_sparse.o -lsuperlu -L.

This would allow it to be nicely used in Makefiles,
so that large projects with multiple source
files don't need to be recompiled from scratch
each time.
_______________________________________
Andy Adler,                [hidden email]

Patch against 2.1.31

--- mkoctfile.orig Fri Nov  3 20:57:41 2000
+++ mkoctfile Fri Nov  3 21:02:04 2000
@@ -48,6 +48,7 @@
 ldflags=
 dbg=:
 strip=false
+link=true
 
 if [ $# -eq 0 ]; then
   echo $usage_msg
@@ -88,6 +89,7 @@
   -lLIB                   Add library LIB to link command.
   -LDIR                   Add -LDIR to link command.
   -o FILE, --output FILE  Output file name.  Default extension is .oct.
+  -c                      Compile, but do not link
   -s, --strip             Strip output file.
   -v, --verbose           Echo commands as they are executed.
 
@@ -124,6 +126,9 @@
     -s | --strip)
       strip=true
     ;;
+    -c)
+      link=false
+    ;;
     *)
       echo "mkoctfile: unrecognized argument $1"
       exit 1
@@ -202,14 +207,16 @@
 
 # Link all the object files.
 
-$dbg $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags
-eval $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags
+if $link; then
+  $dbg $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags
+  eval $SH_LD $SH_LDFLAGS -o $octfile $objfiles $ldflags
 
 # Maybe strip it.
 
 if $strip; then
   $dbg strip $octfile
   eval strip $octfile
+fi
 fi
 
 exit 0


Reply | Threaded
Open this post in threaded view
|

RE: mkoctfile suggestion

en254
On Mon, 6 Nov 2000, Lippert, Ross A. wrote:
> I could not help notice the name of your file was "make_sparse".
> I've been working on some ways to implement sparse matrix manipulations
> at the ".m" level (I have been using mostly octave primitives and just
> one hand-hacked .oct file for a kind reduction octave doesn't yet support).
> Could you and I exchange information, and perhaps, if others are interested,
> have a general discussion about sparse matrices in octave?

I have fairly extensive sparse functions for octave, they interface
to the SuperLU tools. They perform slightly faster than MATLAB
in some tests and a little slower in others.

My last "release" is at:

http://www.octave.org/mailing-lists/octave-sources/2000/70

I'm working on putting it at octave.sourceforge.net as well.
(I have no personal web space)

I'm slowly working on adding the missing functionality, and
could use help.

_______________________________________
Andy Adler,                [hidden email]