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

Problem compiling STITCH #45

Closed
rmott opened this issue Feb 9, 2021 · 4 comments
Closed

Problem compiling STITCH #45

rmott opened this issue Feb 9, 2021 · 4 comments

Comments

@rmott
Copy link

rmott commented Feb 9, 2021

Hi Robbie

I get the following error when I tried to compile and install the latest version:

These are the commands I used:

git clone --recursive https://github.com/rwdavies/STITCH.git
cd STITCH
./scripts/install-dependencies.sh
cd releases
wget https://github.com/rwdavies/stitch/releases/download/1.6.5/STITCH_1.6.5.tar.gz

which all worked fine (I think), but for this I get:

R CMD INSTALL STITCH_1.6.5.tar.gz
......
make[1]: Leaving directory /tmp/Rtmpk4rgvu/R.INSTALL7ac33fe861c2/STITCH/src/SeqLib/src' fatal: Not a git repository: ../../../../.git/modules/STITCH/src/SeqLib/modules/htslib make[1]: Entering directory /tmp/Rtmpk4rgvu/R.INSTALL7ac33fe861c2/STITCH/src/SeqLib/htslib'
gcc -std=c99 -g -Wall -O2 -I. -I/usr/local/include -fPIC -c -o kfunc.o kfunc.c
kfunc.c: In function ‘kf_erfc’:
kfunc.c:74:16: error: ‘M_SQRT2’ undeclared (first use in this function)
z = fabs(x) * M_SQRT2;
^
kfunc.c:74:16: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [kfunc.o] Error 1
make[1]: Leaving directory `/tmp/Rtmpk4rgvu/R.INSTALL7ac33fe861c2/STITCH/src/SeqLib/htslib'
make: *** [SeqLib] Error 2
ERROR: compilation failed for package ‘STITCH’

  • removing ‘/share/apps/mottlab/R-3.6.1/lib64/R/library/STITCH’
@rwdavies
Copy link
Owner

rwdavies commented Feb 9, 2021

Hey Richard!

I just tried a clean install on a linux box and it worked for me. This is what ran on my machine

gcc -m64 -g -Wall -O2 -I. -I/usr/local/include -fPIC  -c -o kfunc.o kfunc.c

I then tried to turn on -std=c99 and I ran into trouble

gcc -m64 -std=c99 -g -Wall -O2 -I. -I/usr/local/include -fPIC -std=c99  -c -o kfunc.o kfunc.c 

E> kfunc.c: In function ‘kf_erfc’:
E> kfunc.c:74:16: error: ‘M_SQRT2’ undeclared (first use in this function)
E> 74 | z = fabs(x) * M_SQRT2;
E> | ^~~~~~~
E> kfunc.c:74:16: note: each undeclared identifier is reported only once for each function it appears in
E> make[1]: *** [Makefile:134: kfunc.o] Error 1
E> make[1]: *** Waiting for unfinished jobs....

So maybe check what your `~/.R/Makevars` file has in it? How old is your R and the gcc that was used to install it, could be time for a change? Or use R with newer gcc?

@rmott
Copy link
Author

rmott commented Feb 10, 2021 via email

@rmott
Copy link
Author

rmott commented Feb 10, 2021 via email

@rwdavies
Copy link
Owner

Yeah, those warnings are fine, just need to clean up the code.

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