gpart installation fails: gpart_cpp.cpp:622:42: error: ‘PI’ was not declared in this scope
1
0
Entering edit mode
@9528593b
Last seen 2.7 years ago
Japan

I don't know if this is a bug, or I am missing something in my system. Any help appreciated

Thanks Matt Shenton

renv::install("bioc::gpart")
Installing graph [1.72.0] ...
    OK [built from source]
Moving graph [1.72.0] into the cache ...
    OK [moved to cache in 0.18 milliseconds]
Installing RBGL [1.70.0] ...
    OK [built from source]
Moving RBGL [1.70.0] into the cache ...
    OK [moved to cache in 0.18 milliseconds]
Installing OrganismDbi [1.36.0] ...
    OK [built from source]
Moving OrganismDbi [1.36.0] into the cache ...
    OK [moved to cache in 0.19 milliseconds]
Installing GO.db [3.14.0] ...
    OK [built from source]
Moving GO.db [3.14.0] into the cache ...
    OK [moved to cache in 0.44 milliseconds]
Installing org.Hs.eg.db [3.14.0] ...
    OK [built from source]
Moving org.Hs.eg.db [3.14.0] into the cache ...
    OK [moved to cache in 0.18 milliseconds]
Installing TxDb.Hsapiens.UCSC.hg19.knownGene [3.2.2] ...
    OK [built from source]
Moving TxDb.Hsapiens.UCSC.hg19.knownGene [3.2.2] into the cache ...
    OK [moved to cache in 0.3 milliseconds]
Installing Homo.sapiens [1.3.1] ...
    OK [built from source]
Moving Homo.sapiens [1.3.1] into the cache ...
    OK [moved to cache in 0.19 milliseconds]
Installing TxDb.Hsapiens.UCSC.hg38.knownGene [3.14.0] ...
    OK [built from source]
Moving TxDb.Hsapiens.UCSC.hg38.knownGene [3.14.0] into the cache ...
    OK [moved to cache in 0.18 milliseconds]
Installing gpart [1.12.0] ...
    FAILED
Error installing package 'gpart':
=================================

* installing to library ‘/home/mshenton/analysis/LDblocks/renv/staging/1’
* installing *source* package ‘gpart’ ...
** using staged installation
** libs
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG  -I'/home/mshenton/analysis/LDblocks/renv/library/R-4.1/x86_64-pc-linux-gnu/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-i2PIHO/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++14 -I"/usr/share/R/include" -DNDEBUG  -I'/home/mshenton/analysis/LDblocks/renv/library/R-4.1/x86_64-pc-linux-gnu/Rcpp/include'    -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-i2PIHO/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c gpart_cpp.cpp -o gpart_cpp.o
gpart_cpp.cpp: In function ‘uint32_t cubic_real_roots(double, double, double, Rcpp::NumericVector)’:
gpart_cpp.cpp:622:42: error: ‘PI’ was not declared in this scope
  622 |     solutions[1] = sq * cos(dxx + (2.0 * PI / 3.0)) - adiv3;
      |                                          ^~
make: *** [/usr/lib/R/etc/Makeconf:177: gpart_cpp.o] Error 1
ERROR: compilation failed for package ‘gpart’
* removing ‘/home/mshenton/analysis/LDblocks/renv/staging/1/gpart’
Error: install of package 'gpart' failed [error code 1]
install gpart renv • 2.2k views
ADD COMMENT
0
Entering edit mode

The above failure was on ubuntu 20.04.

Also fails on Centos 7 with the same error

ADD REPLY
0
Entering edit mode
Bert • 0
@d7b6aea5
Last seen 2.7 years ago
United States

Try the following:

Download and unpack the source code to a directory on your computer first, say mydir/gpart.

Then add the line to the file part_cpp.cpp in subdirectory src:

define PI 3.141593

This can be done near all the other #define lines at the top of the file. You can add digits if you want a more precise PI.

Finally, install the package from this modified version using install.packages("mydir/gpart", repos = NULL, type = "source")

Best, Bert Klei Computational Genetics WPH-UPMC

ADD COMMENT
0
Entering edit mode

define PI 3.141593 should be #define PI 3.141593

ADD REPLY

Login before adding your answer.

Traffic: 321 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6