- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use the ILU-preconditional BiCGStab to solve a sparse nonsymmetric linear system on a single core. I employ the funciton dcsrilu0() to create a preconditioner. But I got the following error message when I complied my code:
undefined reference to `dcsrilu0_'
I guess I must miss some links. I write my makefile like
*************************************************
CC = mpicc
CFLAGS = -Wall -g
Includes =-I/opt/intel/mkl/10.2.1.017/include
LFLAGS = -L/opt/intel/mkl/10.2.1.017/lib/em64t
LIBS =-lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64 -lmkl_solver_lp64 -lmkl_intel_lp64 -Wl,--start-group -lmkl_intel_thread -lmkl_core -Wl,--end-group -liomp5 -lpthread -lm -lmpi
srcs1 = BiCGStab_OneCore.c mmio.c
objs1 = $(srcs1: .c=.o)
prog1 = bicgstabOneCore
srcs = $(srcs1)
objs = $(objs1)
progs = $(prog1)
all : $(progs)
$(prog1): $(objs1)
$(CC) $(CFLAGS) $(Includes) $(LFLAGS) $(LIBS) -o $@ $^
.c.o:
$(CC) $(CFLAGS) $(Includes) -c $<
clean:
$(RM) -rf *.o $(progs)
*******************************************************************************
I am just wondering what's wrong with this makefile. Thanks.
Min
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Try this line - prerequisites before libs:
$(CC) $(CFLAGS) $(Includes) $(LFLAGS) $^ $(LIBS) -o $@
Thanks,
Vladimir
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2nd attempt to post reply:
Are you mixing up the advice for static and dynamic linking?
If you static link, but don't put all the necessary libraries inside the begin ... end group, and specify full paths, you will see such errors.
If you link dynamic libraries, you should require the begin...end qualifiers.
Please try adhering more closely to the advice in the link advisor, on the right column of forum header page.
If you are running on a single core, there's no point in linking the thread and OpenMP libraries, rather than sequential.
Are you mixing up the advice for static and dynamic linking?
If you static link, but don't put all the necessary libraries inside the begin ... end group, and specify full paths, you will see such errors.
If you link dynamic libraries, you should require the begin...end qualifiers.
Please try adhering more closely to the advice in the link advisor, on the right column of forum header page.
If you are running on a single core, there's no point in linking the thread and OpenMP libraries, rather than sequential.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - tim18
2nd attempt to post reply:
Are you mixing up the advice for static and dynamic linking?
If you static link, but don't put all the necessary libraries inside the begin ... end group, and specify full paths, you will see such errors.
If you link dynamic libraries, you should require the begin...end qualifiers.
Please try adhering more closely to the advice in the link advisor, on the right column of forum header page.
If you are running on a single core, there's no point in linking the thread and OpenMP libraries, rather than sequential.
Are you mixing up the advice for static and dynamic linking?
If you static link, but don't put all the necessary libraries inside the begin ... end group, and specify full paths, you will see such errors.
If you link dynamic libraries, you should require the begin...end qualifiers.
Please try adhering more closely to the advice in the link advisor, on the right column of forum header page.
If you are running on a single core, there's no point in linking the thread and OpenMP libraries, rather than sequential.
Thanks for your reply.
I tried the MKL link line advisor and was given the following suggested link line:
-L$MKLPATH $MKLPATH/libmkl_solver_lp64_sequential.a -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread
So I modified my makefile as follows:
LIBS = /opt/intel/mkl/10.2.1.017/lib/em64t/libmkl_solver_lp64_sequential.a -Wl,--start-group -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -Wl,--end-group -lpthread
But, still I got the same error message. Also, if I use static link, it's even worse.
Btw, the reanson I linked the thread and OpenMP is that I previously compiled my sequential programs and parallel programs simultaneously and the makefile worked fine. At that time, I called functions in lapack, scalapack, blacs
and there was no problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Try this line - prerequisites before libs:
$(CC) $(CFLAGS) $(Includes) $(LFLAGS) $^ $(LIBS) -o $@
Thanks,
Vladimir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting - Vladimir Koldakov (Intel)
Hi,
Try this line - prerequisites before libs:
$(CC) $(CFLAGS) $(Includes) $(LFLAGS) $^ $(LIBS) -o $@
Thanks,
Vladimir
Hi Vladimir,
I just modified my makefile according to your suggestion. It works now!!!
Thank you so much.
Min
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page