0

This may be a simple question, but I do not know much about compiling.

I have a makefile which can be compiled with gcc or icc and i want to compile it on a cluster. It is a standalone program. I have compiled it with gcc ( march= native ) in my home folder. Is it possible that I can compile it with ICC as well (at some other location than home home folder). Following is the original makefile,

# GNU
# Make sure you set the correct -march for your machine
CC = gcc
CXX = g++
MACHINE = -march=native
CXXFLAGS = -ffast-math -fopenmp -O3 -Wall -fPIC $(MACHINE) -I ../boostIncl
CFLAGS = -std=c99 -fopenmp $(CXXFLAGS)

mmbgx : mmbgx.o rundir.o qnorm.o sokal.o bgx_frontend.o 
    $(CXX) -fopenmp $(MACHINE) mmbgx.o rundir.o qnorm.o sokal.o bgx_frontend.o -o mmbgx

mmbgx.dll : bgx.o rundir.o qnorm.o sokal.o 
    $(CXX) -shared -mno-cygwin mmbgx.o rundir.o qnorm.o sokal.o -o mmbgx.dll

mmbgx.so : mmbgx.o rundir.o qnorm.o sokal.o 
    $(CXX) -shared -fopenmp mmbgx.o rundir.o qnorm.o sokal.o -o mmbgx.so

.PHONY : clean

clean : 
    rm -f mmbgx *.o *.so *.exe *.dll

mmbgx.o: mmbgx.cc rand.hh rundir.hh qnorm.h sokal.hh bgx_updates.hh rwm.hh bgx.hh
rundir.o: rundir.cc rundir.hh
sokal.o: sokal.cc sokal.hh
bgx_frontend.o: bgx_frontend.cc bgx.hh
qnorm.o: qnorm.c qnorm.h

# ICC
# Make sure you set the correct -march for your machine
#CC = icc
#CXX = icc
#LINKER = icpc -Bstatic -openmp-link static
#MACHINE =
#CXXFLAGS = -Bstatic -fast -openmp -openmp-link static -O3 -fPIC $(MACHINE) -I /apps/boost/1.34.0/include/boost-1_34
#CFLAGS = -std=c99 -openmp -openmp-link static $(CXXFLAGS)
#
#mmbgx : mmbgx.o rundir.o qnorm.o sokal.o bgx_frontend.o
#  $(LINKER) -openmp $(MACHINE) mmbgx.o rundir.o qnorm.o sokal.o bgx_frontend.o -o mmbgx
#
#mmbgx.dll : mmbgx.o rundir.o qnorm.o sokal.o
#  $(CXX) -shared -mno-cygwin mmbgx.o rundir.o qnorm.o sokal.o -o mmbgx.dll
#
#bgx.so : bgx.o rundir.o qnorm.o sokal.o
#  $(CXX) -shared mmbgx.o rundir.o qnorm.o sokal.o -o mmbgx.so
#
#.PHONY : clean
#
#clean :
#  rm -f mmbgx *.o *.so *.exe *.dll
#
#mmbgx.o: mmbgx.cc rand.hh rundir.hh qnorm.h sokal.hh bgx_updates.hh rwm.hh bgx.hh
#rundir.o: rundir.cc rundir.hh
#sokal.o: sokal.cc sokal.hh
#bgx_frontend.o: bgx_frontend.cc bgx.hh
#qnorm.o: qnorm.c qnorm.h

i tried compiling with ICC, by uncommenting the GCC part and commenting the gcc. but I am getting error,

Makefile.standalone:39: *** missing separator.  Stop. 

39 would be $(LINKER) -openmp $(MACHINE) mmbgx.o rundir.o qnorm.o sokal.o bgx_frontend.o -o mmbgx

i'll appreciate your help.

Polar.Ice
  • 138
  • 2
  • 12
  • The first character on a recipe body line must be a tab character. That line probably doesn't have one. Also that makefile is horrifically redundant. – Etan Reisner Oct 23 '14 at 16:31
  • thanks. Do i need to specify MACHINE= -march=native in icc versiona s well? – Polar.Ice Oct 23 '14 at 16:38
  • I have no idea. I would trust that whoever wrote that makefile got at least the variable values and commands right (even if they didn't understand how to create a more reasonable makefile). – Etan Reisner Oct 23 '14 at 16:41

0 Answers0