LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-19-2013, 04:48 PM   #1
ejspeiro
Member
 
Registered: Feb 2011
Distribution: Ubuntu 14.04 LTS (Trusty Tahr)
Posts: 203

Rep: Reputation: 26
Advantages of using mpicc versus gcc with explicit linkage


This thread is composed of 2 questions:

Question number 1:

This is a makefile I just wrote:

Code:
IMPI = /opt/intel/impi/3.2.0.011/include64/

ABLAS = $(HOME)/libraries/BLAS/libblas.a
ALAPACK = $(HOME)/libraries/lapack-3.4.1/liblapack.a
ASCALAPACK = $(HOME)/libraries/scalapack-2.0.2/libscalapack.a

LMPI = -L/opt/intel/impi/3.2.0.011/lib64 -lmpi -lmpigf -lmpigi

HOSTF = mpd.hosts

default: blogs

# Linking stage:
blogs: blogs.o
	gfortran -g -o blogs blogs.o $(ASCALAPACK) $(ALAPACK) $(ABLAS) \
	$(LMPI) -lrt -lpthread -ldl

# Compiling stage:
blogs.o: blogs.c
	gcc -I$(IMPI) -c -DAdd_ -g -Wall -Werror blogs.c

# Utilities:
clean:
	rm -f *.o blogs
	clear

run:
	mpirun -r ssh -f $(HOSTF) -np $(np) `pwd`/blogs

debug:
	mpirun -r ssh -f $(HOSTF) -l -np 1 xterm -sb -wf -e gdb -x blogs.gdbc\
	`pwd`/blogs
What is wrong with it?!? It won't rebuild after I modify my source code.

Question number 2: General culture!

Is there any advantage/disadvantage in compiling MPI code, as in the previous Makefile, that is, using the gcc compilers with all of the linkage information, rather than using mpicc?

I know that:

Code:
[ejspeiro@node01 scalapack-ex07]$ mpicc -show
gcc -I/opt/intel/impi/3.2.0.011/include64 -L/opt/intel/impi/3.2.0.011/lib64 -Xlinker --enable-new-dtags -Xlinker -rpath -Xlinker $libdir -Xlinker -rpath -Xlinker /opt/intel/mpi-rt/3.2 -lmpi -lmpigf -lmpigi -lrt -lpthread -ldl
So I have parsed that and eliminated everything that I THOUGHT was redundant? Was I 0k?

This is the kind of question , which I expect helps people (and myself) to learn more!

Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: OpenOffice versus LibreOffice versus The World LXer Syndicated Linux News 0 03-06-2013 12:30 AM
What are the advantages/disadvantages of using systemd versus sysvinit? ReaperX7 Linux - General 11 10-22-2012 11:22 AM
cannot find mpicc libraries KBriggs Linux - Software 4 01-06-2011 01:01 PM
LXer: Linux: GCC, Useful versus Useless Warnings LXer Syndicated Linux News 0 11-29-2006 11:33 AM
mpicc: command not found ArthurHuang Programming 1 08-05-2006 05:51 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration