Skip to content

odesolve dynload example

7 messages · Peter Dalgaard, Setzer.Woodrow@epamail.epa.gov, Thomas Petzoldt +1 more

#
Redding, Matthew wrote:
I'm a bit rusty on the windows tools, but it looks like mymod.o and  
mymod_res.rc  not being made above. Any chance that you have old 
versions lying around?
#
I'm the maintainer of odesolve.  In the ...odesolve/dynload/c directory
of the windows distribution are two files that should not be: mymod.o
and mymod.so (I just noticed them).  Try deleting  them and rerunning
your compilation.

By the way, you might want to take a look at deSolve, which supercedes
odesolve.  deSolve includes lsoda with the same API as in odesolve, but
also includes several other ode solvers you might find useful.  In the
next several months, odesolve will be deprecated.

R. Woodrow Setzer, Ph. D.
National Center for Computational Toxicology
http://www.epa.gov/comptox
US Environmental Protection Agency
Mail Drop B205-01/US EPA/RTP, NC 27711
Ph: (919) 541-0128    Fax: (919) 541-1194


                                                                        
             Peter Dalgaard                                             
             <p.dalgaard at bios                                           
             tat.ku.dk>                                              To 
             Sent by:                 "Redding, Matthew"                
             r-devel-bounces@         <Matthew.Redding at dpi.qld.gov.au>  
             r-project.org                                           cc 
                                      r-devel at r-project.org             
                                                                Subject 
             09/16/2008 01:59         Re: [Rd] odesolve dynload example 
             AM
Redding, Matthew wrote:
mymod.c
mymod_res.o
I'm a bit rusty on the windows tools, but it looks like mymod.o and
mymod_res.rc  not being made above. Any chance that you have old
versions lying around?

--
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907

______________________________________________
R-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
#
Hi Matthew,

thank you for the bug report, Woodrow Setzer just uploaded a minor 
bugfix and I assume he informed you off-list.

One additional note for the records:

We suggest odesolve users should switch over to the new deSolve package. 
It is maintained by the the same (and two additional) authors like 
odesolve. It is almost ;-) fully compatible to odesolve and will replace 
it completely. The authors renamed it to deSolve, because it's able to 
solve also DAE and PDE systems, not only ODEs, so the name odesolve was 
too narrow and is now deprecated.

Note that deSolve has a package vignette about writing models in 
compiled code.

Thomas Petzoldt
Redding, Matthew wrote:

  
    
#
Thanks so much for the answer.

I will let you know how things go.

I will definitely look into desolve

Kind regards

-----Original Message-----
From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r-project.org] On Behalf Of Setzer.Woodrow at epamail.epa.gov
Sent: Tuesday, 16 September 2008 10:28 PM
To: Peter Dalgaard
Cc: Redding, Matthew; r-devel at r-project.org
Subject: Re: [Rd] odesolve dynload example

I'm the maintainer of odesolve.  In the ...odesolve/dynload/c directory of the windows distribution are two files that should not be: mymod.o and mymod.so (I just noticed them).  Try deleting  them and rerunning your compilation.

By the way, you might want to take a look at deSolve, which supercedes odesolve.  deSolve includes lsoda with the same API as in odesolve, but also includes several other ode solvers you might find useful.  In the next several months, odesolve will be deprecated.

R. Woodrow Setzer, Ph. D.
National Center for Computational Toxicology http://www.epa.gov/comptox US Environmental Protection Agency Mail Drop B205-01/US EPA/RTP, NC 27711
Ph: (919) 541-0128    Fax: (919) 541-1194


                                                                        
             Peter Dalgaard                                             
             <p.dalgaard at bios                                           
             tat.ku.dk>                                              To 
             Sent by:                 "Redding, Matthew"                
             r-devel-bounces@         <Matthew.Redding at dpi.qld.gov.au>  
             r-project.org                                           cc 
                                      r-devel at r-project.org             
                                                                Subject 
             09/16/2008 01:59         Re: [Rd] odesolve dynload example 
             AM
Redding, Matthew wrote:
mymod.c
mymod_res.o
I'm a bit rusty on the windows tools, but it looks like mymod.o and mymod_res.rc  not being made above. Any chance that you have old versions lying around?

--
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907

______________________________________________
R-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
R-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

********************************DISCLAIMER****************************=...{{dropped:12}}
#
Hi Woodrow, Peter and others.

Getting rid of those excess files smoothed the process a little:

Rcmd SHLIB mymod.c
C:\Program Files\R\R-2.7.2\library\odesolve\dynload\c>Rcmd SHLIB mymod.c
gcc  -std=gnu99  -IC:/PROGRA~1/R/R-27~1.2/include     -O3 -Wall  -c mymod.c -o mymod.o
gcc  -std=gnu99  -shared -s  -o mymod.dll mymod.def mymod.o mymod_res.o  -LC:/PROGRA~1/R/R-27~1.2/bin    -lR

This completed without returning an error.

The problem now is that it did not produce a "mymod.so" in the folder, only a mymod.o.

so the dyn.load() command in the example R program has nothing to work with..

Any ideas?

Kind regards, 

Matt Redding

-----Original Message-----
From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r-project.org] On Behalf Of Setzer.Woodrow at epamail.epa.gov
Sent: Tuesday, 16 September 2008 10:28 PM
To: Peter Dalgaard
Cc: Redding, Matthew; r-devel at r-project.org
Subject: Re: [Rd] odesolve dynload example

I'm the maintainer of odesolve.  In the ...odesolve/dynload/c directory of the windows distribution are two files that should not be: mymod.o and mymod.so (I just noticed them).  Try deleting  them and rerunning your compilation.

By the way, you might want to take a look at deSolve, which supercedes odesolve.  deSolve includes lsoda with the same API as in odesolve, but also includes several other ode solvers you might find useful.  In the next several months, odesolve will be deprecated.

R. Woodrow Setzer, Ph. D.
National Center for Computational Toxicology http://www.epa.gov/comptox US Environmental Protection Agency Mail Drop B205-01/US EPA/RTP, NC 27711
Ph: (919) 541-0128    Fax: (919) 541-1194


                                                                        
             Peter Dalgaard                                             
             <p.dalgaard at bios                                           
             tat.ku.dk>                                              To 
             Sent by:                 "Redding, Matthew"                
             r-devel-bounces@         <Matthew.Redding at dpi.qld.gov.au>  
             r-project.org                                           cc 
                                      r-devel at r-project.org             
                                                                Subject 
             09/16/2008 01:59         Re: [Rd] odesolve dynload example 
             AM
Redding, Matthew wrote:
mymod.c
mymod_res.o
I'm a bit rusty on the windows tools, but it looks like mymod.o and mymod_res.rc  not being made above. Any chance that you have old versions lying around?

--
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907

______________________________________________
R-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
R-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

********************************DISCLAIMER****************************=...{{dropped:12}}
#
Excuse me, my mistake.

Of course on windows the Rcmd SHLIB makes a DLL... not a .so file.

So with the modification to the R script, it now works beautifully!

Thanks to all for your patience.

Matt 

-----Original Message-----
From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r-project.org] On Behalf Of Redding, Matthew
Sent: Wednesday, 17 September 2008 1:04 PM
To: Setzer.Woodrow at epamail.epa.gov; Peter Dalgaard
Cc: r-devel at r-project.org
Subject: Re: [Rd] odesolve dynload example

Hi Woodrow, Peter and others.

Getting rid of those excess files smoothed the process a little:

Rcmd SHLIB mymod.c
C:\Program Files\R\R-2.7.2\library\odesolve\dynload\c>Rcmd SHLIB mymod.c
gcc  -std=gnu99  -IC:/PROGRA~1/R/R-27~1.2/include     -O3 -Wall  -c mymod.c -o mymod.o
gcc  -std=gnu99  -shared -s  -o mymod.dll mymod.def mymod.o mymod_res.o  -LC:/PROGRA~1/R/R-27~1.2/bin    -lR

This completed without returning an error.

The problem now is that it did not produce a "mymod.so" in the folder, only a mymod.o.

so the dyn.load() command in the example R program has nothing to work with..

Any ideas?

Kind regards, 

Matt Redding

-----Original Message-----
From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r-project.org] On Behalf Of Setzer.Woodrow at epamail.epa.gov
Sent: Tuesday, 16 September 2008 10:28 PM
To: Peter Dalgaard
Cc: Redding, Matthew; r-devel at r-project.org
Subject: Re: [Rd] odesolve dynload example

I'm the maintainer of odesolve.  In the ...odesolve/dynload/c directory of the windows distribution are two files that should not be: mymod.o and mymod.so (I just noticed them).  Try deleting  them and rerunning your compilation.

By the way, you might want to take a look at deSolve, which supercedes odesolve.  deSolve includes lsoda with the same API as in odesolve, but also includes several other ode solvers you might find useful.  In the next several months, odesolve will be deprecated.

R. Woodrow Setzer, Ph. D.
National Center for Computational Toxicology http://www.epa.gov/comptox US Environmental Protection Agency Mail Drop B205-01/US EPA/RTP, NC 27711
Ph: (919) 541-0128    Fax: (919) 541-1194


                                                                        
             Peter Dalgaard                                             
             <p.dalgaard at bios                                           
             tat.ku.dk>                                              To 
             Sent by:                 "Redding, Matthew"                
             r-devel-bounces@         <Matthew.Redding at dpi.qld.gov.au>  
             r-project.org                                           cc 
                                      r-devel at r-project.org             
                                                                Subject 
             09/16/2008 01:59         Re: [Rd] odesolve dynload example 
             AM
Redding, Matthew wrote:
mymod.c
mymod_res.o
I'm a bit rusty on the windows tools, but it looks like mymod.o and mymod_res.rc  not being made above. Any chance that you have old versions lying around?

--
   O__  ---- Peter Dalgaard             ?ster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907

______________________________________________
R-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
R-devel at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

********************************DISCLAIMER****************************=....{{dropped:17}}