An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20080916/9265985c/attachment.pl>
odesolve dynload example
7 messages · Peter Dalgaard, Setzer.Woodrow@epamail.epa.gov, Thomas Petzoldt +1 more
Redding, Matthew wrote:
Hello R Developers, This is my first foray into using c-code with R, so please forgive my foolishness. I had a look at the archives and did not find anything on this, so hopefully I am not doubling up. I have tried to use R cmd to create an object file from the odesolve dynload example. I am using windows and have just installed rtools, and have the latest version of stable R (2..7.2). This is what happened: C:\Program Files\R\R-2.7.2\library\odesolve\dynload\c>Rcmd SHLIB mymod.c making mymod.d from mymod.c windres --preprocessor="gcc -E -xc -DRC_INVOKED" -I C:/PROGRA~1/R/R-27~1.2/include -i mymod_res.rc -o mymod_res.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 Cannot export myderivs: symbol not found Cannot export myjac: symbol not found Cannot export mymod: symbol not found mymod.o: In function `mymod': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload/c /mymod.c:14: undefined reference to `GLOBAL_OFFSET_TA BLE_' mymod.o: In function `myderivs': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload/c /mymod.c:21: undefined reference to `GLOBAL_OFFSET_TA BLE_' mymod.o: In function `myjac': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload/c /mymod.c:30: undefined reference to `GLOBAL_OFFSET_TA BLE_' collect2: ld returned 1 exit status make: *** [mymod.dll] Error 1 Any ideas what I have not got set up properly? What do I need to do to get this firing? Advice appreciated.
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
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:
Hello R Developers, This is my first foray into using c-code with R, so please forgive my foolishness. I had a look at the archives and did not find anything on this, so hopefully I am not doubling up. I have tried to use R cmd to create an object file from the odesolve dynload example. I am using windows and have just installed rtools, and have the latest version of stable R (2..7.2). This is what happened: C:\Program Files\R\R-2.7.2\library\odesolve\dynload\c>Rcmd SHLIB
mymod.c
making mymod.d from mymod.c windres --preprocessor="gcc -E -xc -DRC_INVOKED" -I C:/PROGRA~1/R/R-27~1.2/include -i mymod_res.rc -o mymod_res.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 Cannot export myderivs: symbol not found Cannot export myjac: symbol not found Cannot export mymod: symbol not found mymod.o: In function `mymod': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload/c
/mymod.c:14: undefined reference to `GLOBAL_OFFSET_TA BLE_' mymod.o: In function `myderivs': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload/c
/mymod.c:21: undefined reference to `GLOBAL_OFFSET_TA BLE_' mymod.o: In function `myjac': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload/c
/mymod.c:30: undefined reference to `GLOBAL_OFFSET_TA BLE_' collect2: ld returned 1 exit status make: *** [mymod.dll] Error 1 Any ideas what I have not got set up properly? What do I need to do to get this firing? Advice appreciated.
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:
Hello R Developers,
This is my first foray into using c-code with R, so please forgive my
foolishness.
I had a look at the archives and did not find anything on this, so
hopefully I am not doubling up.
I have tried to use R cmd to create an object file from the odesolve
dynload example.
I am using windows and have just installed rtools, and have the latest
version of stable R (2..7.2).
This is what happened:
C:\Program Files\R\R-2.7.2\library\odesolve\dynload\c>Rcmd SHLIB mymod.c
making mymod.d from mymod.c
windres --preprocessor="gcc -E -xc -DRC_INVOKED" -I
C:/PROGRA~1/R/R-27~1.2/include -i mymod_res.rc -o mymod_res.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
Cannot export myderivs: symbol not found
Cannot export myjac: symbol not found
Cannot export mymod: symbol not found
mymod.o: In function `mymod':
/home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload/c
/mymod.c:14: undefined reference to `GLOBAL_OFFSET_TA
BLE_'
mymod.o: In function `myderivs':
/home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload/c
/mymod.c:21: undefined reference to `GLOBAL_OFFSET_TA
BLE_'
mymod.o: In function `myjac':
/home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload/c
/mymod.c:30: undefined reference to `GLOBAL_OFFSET_TA
BLE_'
collect2: ld returned 1 exit status
make: *** [mymod.dll] Error 1
Any ideas what I have not got set up properly? What do I need to do to
get this firing?
Advice appreciated.
Kind regards,
Matt Redding
********************************DISCLAIMER**************...{{dropped:15}}
______________________________________________ R-devel at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Thomas Petzoldt Technische Universitaet Dresden Institut fuer Hydrobiologie thomas.petzoldt at tu-dresden.de 01062 Dresden http://tu-dresden.de/hydrobiologie/ GERMANY
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:
Hello R Developers, This is my first foray into using c-code with R, so please forgive my foolishness. I had a look at the archives and did not find anything on this, so hopefully I am not doubling up. I have tried to use R cmd to create an object file from the odesolve dynload example. I am using windows and have just installed rtools, and have the latest version of stable R (2..7.2). This is what happened: C:\Program Files\R\R-2.7.2\library\odesolve\dynload\c>Rcmd SHLIB
mymod.c
making mymod.d from mymod.c windres --preprocessor="gcc -E -xc -DRC_INVOKED" -I C:/PROGRA~1/R/R-27~1.2/include -i mymod_res.rc -o mymod_res.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 Cannot export myderivs: symbol not found Cannot export myjac: symbol not found Cannot export mymod: symbol not found mymod.o: In function `mymod': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload /c
/mymod.c:14: undefined reference to `GLOBAL_OFFSET_TA BLE_' mymod.o: In function `myderivs': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload /c
/mymod.c:21: undefined reference to `GLOBAL_OFFSET_TA BLE_' mymod.o: In function `myjac': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload /c
/mymod.c:30: undefined reference to `GLOBAL_OFFSET_TA BLE_' collect2: ld returned 1 exit status make: *** [mymod.dll] Error 1 Any ideas what I have not got set up properly? What do I need to do to get this firing? Advice appreciated.
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:
Hello R Developers, This is my first foray into using c-code with R, so please forgive my foolishness. I had a look at the archives and did not find anything on this, so hopefully I am not doubling up. I have tried to use R cmd to create an object file from the odesolve dynload example. I am using windows and have just installed rtools, and have the latest version of stable R (2..7.2). This is what happened: C:\Program Files\R\R-2.7.2\library\odesolve\dynload\c>Rcmd SHLIB
mymod.c
making mymod.d from mymod.c windres --preprocessor="gcc -E -xc -DRC_INVOKED" -I C:/PROGRA~1/R/R-27~1.2/include -i mymod_res.rc -o mymod_res.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 Cannot export myderivs: symbol not found Cannot export myjac: symbol not found Cannot export mymod: symbol not found mymod.o: In function `mymod': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload /c
/mymod.c:14: undefined reference to `GLOBAL_OFFSET_TA BLE_' mymod.o: In function `myderivs': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload /c
/mymod.c:21: undefined reference to `GLOBAL_OFFSET_TA BLE_' mymod.o: In function `myjac': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload /c
/mymod.c:30: undefined reference to `GLOBAL_OFFSET_TA BLE_' collect2: ld returned 1 exit status make: *** [mymod.dll] Error 1 Any ideas what I have not got set up properly? What do I need to do to get this firing? Advice appreciated.
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:
Hello R Developers, This is my first foray into using c-code with R, so please forgive my foolishness. I had a look at the archives and did not find anything on this, so hopefully I am not doubling up. I have tried to use R cmd to create an object file from the odesolve dynload example. I am using windows and have just installed rtools, and have the latest version of stable R (2..7.2). This is what happened: C:\Program Files\R\R-2.7.2\library\odesolve\dynload\c>Rcmd SHLIB
mymod.c
making mymod.d from mymod.c windres --preprocessor="gcc -E -xc -DRC_INVOKED" -I C:/PROGRA~1/R/R-27~1.2/include -i mymod_res.rc -o mymod_res.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 Cannot export myderivs: symbol not found Cannot export myjac: symbol not found Cannot export mymod: symbol not found mymod.o: In function `mymod': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload /c
/mymod.c:14: undefined reference to `GLOBAL_OFFSET_TA BLE_' mymod.o: In function `myderivs': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload /c
/mymod.c:21: undefined reference to `GLOBAL_OFFSET_TA BLE_' mymod.o: In function `myjac': /home/setzer/tasks/Programming_Projects/odesolve/odesolve/inst/dynload /c
/mymod.c:30: undefined reference to `GLOBAL_OFFSET_TA BLE_' collect2: ld returned 1 exit status make: *** [mymod.dll] Error 1 Any ideas what I have not got set up properly? What do I need to do to get this firing? Advice appreciated.
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}}