Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to compile R package from source #2

Open
gavinsimpson opened this issue Jan 19, 2016 · 3 comments
Open

Failing to compile R package from source #2

gavinsimpson opened this issue Jan 19, 2016 · 3 comments

Comments

@gavinsimpson
Copy link

I am running into errors when building the filzback R package from source, specifically an error is thrown during R CMD check filzbach_1.2-1.tar.gz when trying to install the package for checking. The error I am seeing is for example using build.sh, but I see the same when I build outside the R source tree:

* checking for file ‘filzbach/DESCRIPTION’ ... OK
* preparing ‘filzbach’:
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files
* checking for empty or unneeded directories
* building ‘filzbach_1.2-1.tar.gz’

* using log directory ‘/home/gavin/work/git/filzbach/src/R/filzbach.Rcheck’
* using R version 3.2.3 Patched (2015-12-10 r69760)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ‘filzbach/DESCRIPTION’ ... OK
* checking extension type ... Package
* this is package ‘filzbach’ version ‘1.2-1’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘filzbach’ can be installed ... ERROR
Installation failed.
See ‘/home/gavin/work/git/filzbach/src/R/filzbach.Rcheck/00install.out’ for details.
* DONE

Status: 1 ERROR
See
  ‘/home/gavin/work/git/filzbach/src/R/filzbach.Rcheck/00check.log’
for details.

The log in 00install.out contains:

$ cat filzbach.Rcheck/00install.out 
* installing *source* package ‘filzbach’ ...
** libs
ccache g++ -std=c++11 -I/home/gavin/R/build/3.2-patched/include -DNDEBUG -DFILZBACH_LIB -I/usr/local/include    -fpic  -ggdb -O2 -m64 -pipe -Wall -pedantic -mtune=native -c catherine_loader.cpp -o catherine_loader.o
ccache g++ -std=c++11 -I/home/gavin/R/build/3.2-patched/include -DNDEBUG -DFILZBACH_LIB -I/usr/local/include    -fpic  -ggdb -O2 -m64 -pipe -Wall -pedantic -mtune=native -c filzbachR.cpp -o filzbachR.o
ccache g++ -std=c++11 -I/home/gavin/R/build/3.2-patched/include -DNDEBUG -DFILZBACH_LIB -I/usr/local/include    -fpic  -ggdb -O2 -m64 -pipe -Wall -pedantic -mtune=native -c metropolis.cpp -o metropolis.o
metropolis.cpp:98:0: warning: ignoring #pragma omp threadprivate [-Wunknown-pragmas]
 #pragma omp threadprivate(currentchain)
 ^
metropolis.cpp:102:0: warning: ignoring #pragma omp threadprivate [-Wunknown-pragmas]
 #pragma omp threadprivate(metr_k)
 ^
metropolis.cpp:182:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
 #pragma warning(push)
 ^
metropolis.cpp:183:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
 #pragma warning(disable:4996)
 ^
metropolis.cpp:185:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
 #pragma warning(pop)
 ^
metropolis.cpp:856:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
   #pragma omp parallel for /* reduction(+:ltotnew_currentchain)*/
 ^
metropolis.cpp:1705:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
  #pragma omp parallel for
 ^
metropolis.cpp:1869:0: warning: ignoring #pragma omp critical [-Wunknown-pragmas]
     #pragma omp critical
 ^
metropolis.cpp:2041:0: warning: ignoring #pragma omp critical [-Wunknown-pragmas]
 #pragma omp critical
 ^
metropolis.cpp:2113:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
  #pragma omp parallel for
 ^
metropolis.cpp:2146:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
  #pragma omp parallel for
 ^
In file included from metropolis.cpp:3:0:
dwp_stats.h:8:22: error: declaration of ‘double gamma(double)’ has a different exception specifier
 double gamma(double x);
                      ^
In file included from /usr/include/math.h:69:0,
                 from /usr/include/c++/5.3.1/cmath:44,
                 from stdafx.h:17,
                 from metropolis.cpp:1:
/usr/include/bits/mathcalls.h:264:15: error: from previous declaration ‘double gamma(double) throw ()’
 __MATHCALL (gamma,, (_Mdouble_));
               ^
metropolis.cpp: In function ‘int _mkdir(const char*)’:
metropolis.cpp:14:62: warning: no return statement in function returning non-void [-Wreturn-type]
 inline int _mkdir(const char* dirname){ mkdir(dirname, 0777);}
                                                              ^
metropolis.cpp: In function ‘void executeLikelihood()’:
metropolis.cpp:824:10: warning: unused variable ‘ltotnew_currentchain’ [-Wunused-variable]
   double ltotnew_currentchain=0.0;
          ^
metropolis.cpp: In function ‘void calc_IC()’:
metropolis.cpp:1438:9: warning: unused variable ‘pD’ [-Wunused-variable]
  double pD = dmean_sum1 - datmean;
         ^
/home/gavin/R/build/3.2-patched/etc/Makeconf:141: recipe for target 'metropolis.o' failed
make: *** [metropolis.o] Error 1
ccache g++ -std=c++11 -I/home/gavin/R/build/3.2-patched/include -DNDEBUG -DFILZBACH_LIB -I/usr/local/include    -fpic  -ggdb -O2 -m64 -pipe -Wall -pedantic -mtune=native -c metropolis.cpp -o metropolis.o
metropolis.cpp:98:0: warning: ignoring #pragma omp threadprivate [-Wunknown-pragmas]
 #pragma omp threadprivate(currentchain)
 ^
metropolis.cpp:102:0: warning: ignoring #pragma omp threadprivate [-Wunknown-pragmas]
 #pragma omp threadprivate(metr_k)
 ^
metropolis.cpp:182:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
 #pragma warning(push)
 ^
metropolis.cpp:183:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
 #pragma warning(disable:4996)
 ^
metropolis.cpp:185:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
 #pragma warning(pop)
 ^
metropolis.cpp:856:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
   #pragma omp parallel for /* reduction(+:ltotnew_currentchain)*/
 ^
metropolis.cpp:1705:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
  #pragma omp parallel for
 ^
metropolis.cpp:1869:0: warning: ignoring #pragma omp critical [-Wunknown-pragmas]
     #pragma omp critical
 ^
metropolis.cpp:2041:0: warning: ignoring #pragma omp critical [-Wunknown-pragmas]
 #pragma omp critical
 ^
metropolis.cpp:2113:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
  #pragma omp parallel for
 ^
metropolis.cpp:2146:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
  #pragma omp parallel for
 ^
In file included from metropolis.cpp:3:0:
dwp_stats.h:8:22: error: declaration of ‘double gamma(double)’ has a different exception specifier
 double gamma(double x);
                      ^
In file included from /usr/include/math.h:69:0,
                 from /usr/include/c++/5.3.1/cmath:44,
                 from stdafx.h:17,
                 from metropolis.cpp:1:
/usr/include/bits/mathcalls.h:264:15: error: from previous declaration ‘double gamma(double) throw ()’
 __MATHCALL (gamma,, (_Mdouble_));
               ^
metropolis.cpp: In function ‘int _mkdir(const char*)’:
metropolis.cpp:14:62: warning: no return statement in function returning non-void [-Wreturn-type]
 inline int _mkdir(const char* dirname){ mkdir(dirname, 0777);}
                                                              ^
metropolis.cpp: In function ‘void executeLikelihood()’:
metropolis.cpp:824:10: warning: unused variable ‘ltotnew_currentchain’ [-Wunused-variable]
   double ltotnew_currentchain=0.0;
          ^
metropolis.cpp: In function ‘void calc_IC()’:
metropolis.cpp:1438:9: warning: unused variable ‘pD’ [-Wunused-variable]
  double pD = dmean_sum1 - datmean;
         ^
/home/gavin/R/build/3.2-patched/etc/Makeconf:141: recipe for target 'metropolis.o' failed
make: *** [metropolis.o] Error 1
ERROR: compilation failed for package ‘filzbach’
* removing ‘/home/gavin/work/git/filzbach/filzbach.Rcheck/filzbach’

This is on (Fedora) Linux with

> version
               _                                          
platform       x86_64-pc-linux-gnu                        
arch           x86_64                                     
os             linux-gnu                                  
system         x86_64, linux-gnu                          
status         Patched                                    
major          3                                          
minor          2.3                                        
year           2015                                       
month          12                                         
day            10                                         
svn rev        69760                                      
language       R                                          
version.string R version 3.2.3 Patched (2015-12-10 r69760)
nickname       Wooden Christmas-Tree
@vassilyl
Copy link
Contributor

@gavinsimpson which g++ version do you have (g++ --version)?

@gavinsimpson
Copy link
Author

@vassilyl my GCC tool chain is v 5.3.1

$ g++ --version
g++ (GCC) 5.3.1 20151207 (Red Hat 5.3.1-2)

The definition that seems to be clashing and causing the error is supplied in the glibc library, which is v 2.21-8.fc22.

Let me know if you need anything further.

@vassilyl
Copy link
Contributor

@gavinsimpson I failed to reproduce the error you mentioned. On my fresh Fedora 23 system with R 3.2.3 and gcc 5.3.1 the package sets up without errors. Can you please try install on your system the source package 1.2-2 from the latest release v1.2-beta2?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants