Install from source on ubuntu

469 views
Skip to first unread message

Vince Schulz

unread,
Mar 6, 2015, 4:46:06 PM3/6/15
to plink2...@googlegroups.com
Hi,

I am having trouble installing plink2  from source on ubuntu to run pca. 

I moved Makefile.std to Makefile, and ran

sudo apt-get install libblas-dev libatlas-dev
 but got

(stuff...)
plink_calc.c: In function ‘int32_t unrelated_herit_batch(uint32_t, char*, char*, uint32_t, char*, int32_t, Rel_info*)’:
plink_calc.c:2849:39: warning: ignoring return value of ‘size_t fread(void*, size_t, size_t, FILE*)’, declared with attribute warn_unused_result [-Wunused-result]
/usr/bin/ld: cannot find -lcblas
/usr/bin/ld: cannot find -latlas
collect2: ld returned 1 exit status
make: *** [plink] Error 1

Any hints?

Thanks,

Vince

Christopher Chang

unread,
Mar 6, 2015, 4:51:40 PM3/6/15
to plink2...@googlegroups.com
You will probably have to edit the Makefile and/or a few #include lines to point to the location of your BLAS/LAPACK installation (which will vary from system to system).  Sorry about the inconvenience.

(If you didn't need PCA, you could probably uncomment "#define NOLAPACK" in plink_common.h instead.)

Vince Schulz

unread,
Mar 7, 2015, 10:16:27 AM3/7/15
to plink2...@googlegroups.com
Sorry, I am clueless, and don't know what I would modify.  Where would I add #include lines--in some of the C code files?  I don't know what this would even look like, what the library name is. And what would need to be modified in the Makefile?

Could I just add a symlink  to the required files in the spot that the install script is looking for? If so, what files are needed, and where is the install script expecting them to be?  And I could delete the links after making plink or it is needed for running?  I have
/usr/lib/lapack/liblapack.a
/usr/lib/lapack/liblapack.so
/usr/lib/libblas/libblas.a
/usr/lib/libblas/libblas.so

Christopher Chang

unread,
Mar 7, 2015, 3:15:11 PM3/7/15
to plink2...@googlegroups.com
I do not have much experience modifying the Makefile and #includes to build on different Linux installations.  But my best guess is that, if you do not have libcblas.so on your system, you should install ATLAS, and then modify the BLASFLAGS=-L/usr/lib64/atlas line in the Makefile to point to your ATLAS installation.  This may work without any modifications to .c or .h files.

Vince Schulz

unread,
Mar 7, 2015, 5:57:15 PM3/7/15
to plink2...@googlegroups.com
I got the installation to work by also doing

sudo apt-get install  libatlas-base-dev

in addition to the install that I had done before:

sudo apt-get install libblas-dev libatlas-dev

That wasn't obvious from the amazon cloud or mac examples in the documentation. 

Vince

Christopher Chang

unread,
Mar 7, 2015, 6:05:18 PM3/7/15
to plink2...@googlegroups.com
Thanks for the note, I will add that remark to the documentation.  (It looks like Amazon Linux diverges slightly from Ubuntu in including libatlas-base-dev in "atlas-devel".)
Reply all
Reply to author
Forward
0 new messages