AnnabelPerry / Polly

GNU General Public License v3.0
0 stars 0 forks source link

Polly build generalization plan #1

Closed eddelbuettel closed 3 years ago

eddelbuettel commented 3 years ago

Ok, so you have src/Makevars as I suspected:

HTS_CFLAGS = -I/sw/eb/sw/HTSlib/1.10.2-GCC-8.3.0/include -I/sw/eb/sw/XZ/5.2.4-GCCcore-8.3.0/include -I/sw/eb/sw/zlib/1.2.11-GCCcore-8.3.0/include -I/sw/eb/sw/bzip2/1.0.8-GCCcore-8.3.0/include  
HTS_LIBS = -L/sw/eb/sw/HTSlib/1.10.2-GCC-8.3.0/lib -lhts  

These values we will need to 'discover' in a script call configure.

eddelbuettel commented 3 years ago

Oh, and the little things :cry: -- configure and configure.ac have to be one level up. Not in src/ but in the main directory.

AnnabelPerry commented 3 years ago

I will fix this - thank you!

On Wed, Aug 11, 2021 at 9:43 PM Dirk Eddelbuettel @.***> wrote:

Oh, and the little things 😢 -- configure and configure.ac have to be one level up. Not in src/ but in the main directory.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AnnabelPerry/Polly/issues/1#issuecomment-897303910, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU6OBNUELDPPOZJJQNTJPQLT4MYNJANCNFSM5B773ZZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

eddelbuettel commented 3 years ago

I had (earlier) looked around to see if I had simpler shell script around pkg-config and while I thought I had I did not find anything. Given that you already ventured this far we may continue with configure.ac

eddelbuettel commented 3 years ago

And then ... it just works:

root@654274ae0405:/work# R CMD INSTALL .
* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘Polly’ ...
** using staged installation
checking for pkg-config... /usr/bin/pkg-config
configure: creating ./config.status
config.status: creating src/Makevars
** libs
g++ -std=gnu++14 -shared -L/usr/lib/R/lib -Wl,-z,relro -o Polly.so PollyR.o RcppExports.o -lhts -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/00LOCK-work/00new/Polly/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (Polly)
root@654274ae0405:/work# 

I am in a Docker container here hence root and the random hostname. But it finds my hts library and links to it. And it loads:

> library(Polly)
> 
eddelbuettel commented 3 years ago

It needed one more fix: AC_OUTPUT(src/Makevars) in configure.ac as we are now above src/.

AnnabelPerry commented 3 years ago

Ok, on my supercomputer cluster I moved configure to Polly, ran autoconf and ./configure, then ran R CMD INSTALL and loaded library(Polly) from R. This works with no errors, but when I run "check" in RStudio, I get this error:

Error in dyn.load(dllfile) : unable to load shared object '/home/annabelperry/R/Polly/src/Polly.so': libhts.so.3: cannot open shared object file: No such file or directory Calls: ... -> load_dll -> library.dynam2 -> dyn.load Execution halted

Do you think this matters since the program loads in R on the command terminal? I'm going to test a few of the functions and also double-check that the files on the cluster are identical to those in the repo

On Wed, Aug 11, 2021 at 9:53 PM Dirk Eddelbuettel @.***> wrote:

It needed one more fix: AC_OUTPUT(src/Makevars) in configure.ac as we are now above src/.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AnnabelPerry/Polly/issues/1#issuecomment-897307052, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU6OBNRM6HKUTVVSOWBGQC3T4MZRJANCNFSM5B773ZZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

eddelbuettel commented 3 years ago

What you need to look at carefully is the line(s) that compile and link. You see them in terminal. You can also see them in RStudio.

If you are on the same computer (i.e. if you run RStudio on the server) then they should be the same.

If you run RStudio somewhere (you didn't exactly say....) then it matters if that computer has libhts and pkg-config.

eddelbuettel commented 3 years ago

We will also need to do a bit of cleanup on your repo. I'll get to that tomorrow -- getting a bit late here.

AnnabelPerry commented 3 years ago

Ok, thank you. I am running RStudio through the supercomputers. There is an "interactive apps" widget through which I access RStudio. I'll check the compilation/linking details in the morning as well. Have a good night, and thank you for all of your help

On Wed, Aug 11, 2021 at 10:10 PM Dirk Eddelbuettel @.***> wrote:

What you need to look at carefully is the line(s) that compile and link. You see them in terminal. You can also see them in RStudio.

If you are on the same computer (i.e. if you run RStudio on the server) then they should be the same.

If you run RStudio somewhere (you didn't exactly say....) then it matters if that computer has libhts and pkg-config.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AnnabelPerry/Polly/issues/1#issuecomment-897313284, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU6OBNVQEVBLG53KDS457XDT4M3TBANCNFSM5B773ZZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

eddelbuettel commented 3 years ago

If you can get some help on the computing centre side, take it. They sometimes have things like 'modules' that pop services in and out, and it may just be that your RStudio there is launched without knowledge of the HTS library and header. Hard for me to say from here but at the end of the day RStudio invokes the same R CMD ... commands as R on the command-line ....

AnnabelPerry commented 3 years ago

Will do, thank you so much for all of your help with this project!

On Wed, Aug 11, 2021 at 10:16 PM Dirk Eddelbuettel @.***> wrote:

If you can get some help on the computing centre side, take it. They sometimes have things like 'modules' that pop services in and out, and it may just be that your RStudio there is launched without knowledge of the HTS library and header. Hard for me to say from here but at the end of the day RStudio invokes the same R CMD ... commands as R on the command-line ....

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AnnabelPerry/Polly/issues/1#issuecomment-897315535, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU6OBNWEJ6C4VQJ2R4KQPQLT4M4HVANCNFSM5B773ZZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

AnnabelPerry commented 3 years ago

I tested one of the functions using R from the command terminal, and it yielded the expected output. I think the RStudio issue is specific to the supercomputer cluster and not a bug in the package itself. I'm in contact with the computer center at my school to see if they can resolve this, but the package itself is now functional. Thank you so, so much for your help.

On Thu, Aug 12, 2021 at 7:02 AM Annabel Perry < @.***> wrote:

Will do, thank you so much for all of your help with this project!

On Wed, Aug 11, 2021 at 10:16 PM Dirk Eddelbuettel < @.***> wrote:

If you can get some help on the computing centre side, take it. They sometimes have things like 'modules' that pop services in and out, and it may just be that your RStudio there is launched without knowledge of the HTS library and header. Hard for me to say from here but at the end of the day RStudio invokes the same R CMD ... commands as R on the command-line ....

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AnnabelPerry/Polly/issues/1#issuecomment-897315535, or unsubscribe https://github.com/notifications/unsubscribe-auth/AU6OBNWEJ6C4VQJ2R4KQPQLT4M4HVANCNFSM5B773ZZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

eddelbuettel commented 3 years ago

I just sent you a first pull request that cleans a few things up. Give it a good look.

I also think you have another problem in your use on the cluster that is simply nonstandard: you also need to set the zlip and bzip2 headers. So your configure.ac may need to take account of that too?

(Lastly, as aside most people seem to prefer replying to these message on the GitHub website e.g. at https://github.com/AnnabelPerry/Polly/issues/1. Maybe give it a go too :)

AnnabelPerry commented 3 years ago

Thank you! I'll get on this this morning

eddelbuettel commented 3 years ago

Good plan. (And at GitHub you can also edit your past snippets to fix typos as I just did with one of mine ;-) )

eddelbuettel commented 3 years ago

BTW I also (late yesterday) glanced at what Rhtslib does: it includes the HTS library and builds it locally. You may just have to do the same "eventually" as most places, CRAN included, are unlikely to have the HTS library installed. We cross that bridge when we get there though....