Re: [R-pkg-devel] DLL requires the use of native symbols

2023-10-31 Thread Aixiang Jiang
Thank you so much - Ivan!

I think that I need to update R to the latest version then.

Have a great day!

Best,
Aixiang


From: Ivan Krylov 
Sent: Tuesday, October 31, 2023 1:36 AM
To: Aixiang Jiang
Cc: List r-package-devel; Simon Urbanek
Subject: Re: [R-pkg-devel] DLL requires the use of native symbols

This email came from an EXTERNAL SENDER. If you think this message is 
suspicious, please do not open any attached files or links, and forward it as 
an attachment to spamm...@bccrc.ca



Dear Simon,

Could you please look into this? The machines running r-release-macos-*
checks seem to have MassSpecWavelet < 1.66 installed instead of the
current version, 1.68. I think that MassSpecWavelet >= 1.66 would be
version-appropriate for R-4.3 (Bioconductor >= 3.17).

On Tue, 31 Oct 2023 07:31:12 +
Aixiang Jiang  wrote:

> 'DLL requires the use of native symbols'

Interesting. It's not you, it's the MassSpecWavelet package, but the
error has already been fixed there. Look at the traceback produced for
the error:

>> Error in localMaximumSlidingWindow(x, winSize) :
>>  DLL requires the use of native symbols
>> Calls: MPC_DANM ... getLocalMaximumCWT -> localMaximum ->
>>localMaximumSlidingWindow

The error happens in a function called 'localMaximumSlidingWindow',
called from 'localMaximum', called from 'getLocalMaximumCWT'.
'getLocalMaximumCWT' belongs to the MassSpecWavelet package.

The problem is that the maintainer sets R_forceSymbols(info, TRUE)
but then uses .Call() with a string containing the name of the function
instead of a special object that directly refers to that function. The
fix for that has been committed half a year ago
<https://code.bioconductor.org/browse/MassSpecWavelet/commit/496de2969b2f43f8be00f1966611497fa3053937>
and became part of the 1.66.0 release and the following versions of the
package. The fixed package versions went into Bioconductor 3.17 (for
R-4.3) but not 3.16 (for R-4.2).

--
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] DLL requires the use of native symbols

2023-10-31 Thread Ivan Krylov
Dear Simon,

Could you please look into this? The machines running r-release-macos-*
checks seem to have MassSpecWavelet < 1.66 installed instead of the
current version, 1.68. I think that MassSpecWavelet >= 1.66 would be
version-appropriate for R-4.3 (Bioconductor >= 3.17).

On Tue, 31 Oct 2023 07:31:12 +
Aixiang Jiang  wrote:

> 'DLL requires the use of native symbols'

Interesting. It's not you, it's the MassSpecWavelet package, but the
error has already been fixed there. Look at the traceback produced for
the error:

>> Error in localMaximumSlidingWindow(x, winSize) :
>>  DLL requires the use of native symbols
>> Calls: MPC_DANM ... getLocalMaximumCWT -> localMaximum ->
>>localMaximumSlidingWindow

The error happens in a function called 'localMaximumSlidingWindow',
called from 'localMaximum', called from 'getLocalMaximumCWT'.
'getLocalMaximumCWT' belongs to the MassSpecWavelet package.

The problem is that the maintainer sets R_forceSymbols(info, TRUE)
but then uses .Call() with a string containing the name of the function
instead of a special object that directly refers to that function. The
fix for that has been committed half a year ago

and became part of the 1.66.0 release and the following versions of the
package. The fixed package versions went into Bioconductor 3.17 (for
R-4.3) but not 3.16 (for R-4.2).

-- 
Best regards,
Ivan

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] DLL requires the use of native symbols

2023-10-31 Thread Aixiang Jiang
Hello everyone,

I recently submitted my NMRphasing R package. While most of the check results 
are fine, I encountered two issues on macOS. The major error is:

'DLL requires the use of native symbols'

I'm wondering how I can resolve this issue. Any help or suggestions would be 
greatly appreciated.

Thank you in advance!?


Best,
Aixiang

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] DLL requires the use of native symbols

2023-03-20 Thread Dirk Eddelbuettel


On 20 March 2023 at 21:25, Guido Kraemer wrote:
| Thanks for the pointers! I think I fixed it. Here is what I did [1]. To 
| be honest, I am not sure what was wrong before, but I followed [2], 
| especially the code box at the very end of the section. I wonder if this 
| was always wrong or if the R internals changed at some point.
| 
| 
| [1] 
| 
https://github.com/gdkrmr/coRanking/commit/012c3e340ba64e7da0adab38c8927a92dfebe432#diff-993bc9d43b232315c8f4edcd1823237e621593cd1186436fe42783c6240d4d1fL128

Looks good.
 
| [2] 
| 
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Converting-a-package-to-use-registration

Sure. I think your main issue was that you were "almost there" but didn't
actually go through calling as symbols, and the very recent change of having
R_forceSymbols() then error caught you out.

But all good now, and that's why we have checks and balances.

(One micro nit for something else I noticed: you have a nice pkgdown site,
but not linked to it anywhere.)

Cheers, Dirk

| 
| On 3/20/23 17:56, Dirk Eddelbuettel wrote:
| > On 20 March 2023 at 12:43, Duncan Murdoch wrote:
| > | It appears that you have some uses of .Call() where you are passing a
| > | character variable as the first argument, instead of registering the
| > | entry point and passing the variable containing the registration
| > | information.
| >
| > Correct. And to make the case worse, the package then calls (on line 130 of
| > coranking_main.cpp) the very 'R_forceSymbols(info, TRUE);' that is now
| > telling it about the error of using _quoted_ ("text") rather than symbol
| > references. Just removing line 130 may work.
| >   
| > |  From your second link, it looks like Rcpp has some special way to
| > | handle entry point registration.  I'm not familiar with that, I use the
| > | basic way described in Writing R Extensions, section 5.4 "Registering
| > | native routines".
| >
| > Rcpp checks if a useDynLib("nameofpackage") has `, .registration=TRUE)` and
| > if so, creates glue code with symbols (ie what Guido desires here) instead 
of
| > text variables (as was common a long time ago).
| >
| > That was the case of package 'sf' which I helped yesterday; all it took 
there
| > was to ensure it used `useDynLib("sf", .registration=TRUE)` and to re-create
| > the generated RcppExports.R via Rcpp's own `compileAttributes()` function 
(as
| > I did in PR that Edzer merged hours later).
| >
| > But none of this helps Guido as his package prefers to do it all by hand --
| > which is perfectly fine and valid, of course -- but a little bit more work.
| >
| > Hth, Dirk
| >
| -- 
| 
| Dr. Guido Kraemer
| Remote Sensing Center for Earth System Research
| Uni Leipzig
| Talstr. 35
| D-04103 Leipzig
| Germany
| 
| https://rsc4earth.de/authors/gkraemer/
| https://www.guido-kraemer.com
| https://twitter.com/gdkrmr
| 
| Phone: +49 1577 6099439
| Email:guido.krae...@uni-leipzig.de
| 
| [DELETED ATTACHMENT smime.p7s, application/pkcs7-signature]

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] DLL requires the use of native symbols

2023-03-20 Thread Guido Kraemer
Thanks for the pointers! I think I fixed it. Here is what I did [1]. To 
be honest, I am not sure what was wrong before, but I followed [2], 
especially the code box at the very end of the section. I wonder if this 
was always wrong or if the R internals changed at some point.



[1] 
https://github.com/gdkrmr/coRanking/commit/012c3e340ba64e7da0adab38c8927a92dfebe432#diff-993bc9d43b232315c8f4edcd1823237e621593cd1186436fe42783c6240d4d1fL128



[2] 
https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Converting-a-package-to-use-registration



On 3/20/23 17:56, Dirk Eddelbuettel wrote:

On 20 March 2023 at 12:43, Duncan Murdoch wrote:
| It appears that you have some uses of .Call() where you are passing a
| character variable as the first argument, instead of registering the
| entry point and passing the variable containing the registration
| information.

Correct. And to make the case worse, the package then calls (on line 130 of
coranking_main.cpp) the very 'R_forceSymbols(info, TRUE);' that is now
telling it about the error of using _quoted_ ("text") rather than symbol
references. Just removing line 130 may work.
  
|  From your second link, it looks like Rcpp has some special way to

| handle entry point registration.  I'm not familiar with that, I use the
| basic way described in Writing R Extensions, section 5.4 "Registering
| native routines".

Rcpp checks if a useDynLib("nameofpackage") has `, .registration=TRUE)` and
if so, creates glue code with symbols (ie what Guido desires here) instead of
text variables (as was common a long time ago).

That was the case of package 'sf' which I helped yesterday; all it took there
was to ensure it used `useDynLib("sf", .registration=TRUE)` and to re-create
the generated RcppExports.R via Rcpp's own `compileAttributes()` function (as
I did in PR that Edzer merged hours later).

But none of this helps Guido as his package prefers to do it all by hand --
which is perfectly fine and valid, of course -- but a little bit more work.

Hth, Dirk


--

Dr. Guido Kraemer
Remote Sensing Center for Earth System Research
Uni Leipzig
Talstr. 35
D-04103 Leipzig
Germany

https://rsc4earth.de/authors/gkraemer/
https://www.guido-kraemer.com
https://twitter.com/gdkrmr

Phone: +49 1577 6099439
Email:guido.krae...@uni-leipzig.de

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] DLL requires the use of native symbols

2023-03-20 Thread Dirk Eddelbuettel


On 20 March 2023 at 12:43, Duncan Murdoch wrote:
| It appears that you have some uses of .Call() where you are passing a 
| character variable as the first argument, instead of registering the 
| entry point and passing the variable containing the registration 
| information.

Correct. And to make the case worse, the package then calls (on line 130 of
coranking_main.cpp) the very 'R_forceSymbols(info, TRUE);' that is now
telling it about the error of using _quoted_ ("text") rather than symbol
references. Just removing line 130 may work.
 
|  From your second link, it looks like Rcpp has some special way to 
| handle entry point registration.  I'm not familiar with that, I use the 
| basic way described in Writing R Extensions, section 5.4 "Registering 
| native routines".

Rcpp checks if a useDynLib("nameofpackage") has `, .registration=TRUE)` and
if so, creates glue code with symbols (ie what Guido desires here) instead of
text variables (as was common a long time ago).

That was the case of package 'sf' which I helped yesterday; all it took there
was to ensure it used `useDynLib("sf", .registration=TRUE)` and to re-create
the generated RcppExports.R via Rcpp's own `compileAttributes()` function (as
I did in PR that Edzer merged hours later).

But none of this helps Guido as his package prefers to do it all by hand --
which is perfectly fine and valid, of course -- but a little bit more work.

Hth, Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] DLL requires the use of native symbols

2023-03-20 Thread Duncan Murdoch

I found three such calls in a quick search.  The first is here:

https://github.com/gdkrmr/coRanking/blob/3656bc0cd3032a650be8c8783414a1e62e419437/R/coranking_internals.R#L20

Duncan Murdoch

On 20/03/2023 12:43 p.m., Duncan Murdoch wrote:

It appears that you have some uses of .Call() where you are passing a
character variable as the first argument, instead of registering the
entry point and passing the variable containing the registration
information.

  From your second link, it looks like Rcpp has some special way to
handle entry point registration.  I'm not familiar with that, I use the
basic way described in Writing R Extensions, section 5.4 "Registering
native routines".

Duncan Murdoch

On 20/03/2023 11:36 a.m., Guido Kraemer wrote:


I am the maintainer of coRanking and got a message about an error, the
error can be found here [1]. I can reproduce the error on my own machine
with the latest R-devel but don't quite understand what the error means
and how I can fix it. A search leads to an issue in Rcpp [2] where the
characters in .Call are replaced by  symbols (apostrophe to backtick).
When I do this, I get an error when building the vignette:

   > NULL value passed as symbol address

What am I doing wrong and how do I fix the error?

Best

Guido


[1]
https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-gcc/coRanking-00check.html

[2] https://github.com/RcppCore/Rcpp/issues/1255


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel




__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


Re: [R-pkg-devel] DLL requires the use of native symbols

2023-03-20 Thread Duncan Murdoch
It appears that you have some uses of .Call() where you are passing a 
character variable as the first argument, instead of registering the 
entry point and passing the variable containing the registration 
information.


From your second link, it looks like Rcpp has some special way to 
handle entry point registration.  I'm not familiar with that, I use the 
basic way described in Writing R Extensions, section 5.4 "Registering 
native routines".


Duncan Murdoch

On 20/03/2023 11:36 a.m., Guido Kraemer wrote:


I am the maintainer of coRanking and got a message about an error, the
error can be found here [1]. I can reproduce the error on my own machine
with the latest R-devel but don't quite understand what the error means
and how I can fix it. A search leads to an issue in Rcpp [2] where the
characters in .Call are replaced by  symbols (apostrophe to backtick).
When I do this, I get an error when building the vignette:

  > NULL value passed as symbol address

What am I doing wrong and how do I fix the error?

Best

Guido


[1]
https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-gcc/coRanking-00check.html

[2] https://github.com/RcppCore/Rcpp/issues/1255


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel


[R-pkg-devel] DLL requires the use of native symbols

2023-03-20 Thread Guido Kraemer


I am the maintainer of coRanking and got a message about an error, the 
error can be found here [1]. I can reproduce the error on my own machine 
with the latest R-devel but don't quite understand what the error means 
and how I can fix it. A search leads to an issue in Rcpp [2] where the 
characters in .Call are replaced by  symbols (apostrophe to backtick). 
When I do this, I get an error when building the vignette:


> NULL value passed as symbol address

What am I doing wrong and how do I fix the error?

Best

Guido


[1] 
https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-gcc/coRanking-00check.html


[2] https://github.com/RcppCore/Rcpp/issues/1255

__
R-package-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-package-devel