# This makefile can be used to compile im3d on a 64-bit system with a 64-bit MPICH package. # For Linux or UNIX systems I recommend using the gcc for compilation. # On Windows I recommend using mingw32. #CC = gcc #CC = mingw32-gcc CC = mpicc #CFLAGS = -O2 -Wall -ansi -pedantic #CFLAGS = -O2 -Wall -pedantic #CFLAGS = -O1 -Wall CFLAGS32 = -O1 -Wall -m32# 32 bit, -arch i386 CFLAGS64 = -O1 -Wall# 64 bit LDFLAGS = -m32# -v #LIBFLAG = -L. -lstruct_s -lm# serial LIBFLAG = -L. -lstruct_m -lm# mpi # Notes on warning level: # Using -Wall and -pedantic will return many warnings, because of non-allowed # comment styles in the codes. I recommend using just -Wall. # Notes on the compiler optimization options -OX: # It is not recommended to use -O2 or -O3. On Linux systems no problems using # these options have been observed so far; however, on windows systems porgram # crashes and hang-ups did occur when using -O2 or -O3. # In windows, the inverse sqr tables will not work with -O2. # If unsure, compile all with -O1 only. objects = im3d.o mpimod.o const.o init.o material.o target.o matrix.o index.o magic.o fileio.o cfgwriter.o mshwriter.o aivxyz.o bulk.o utils.o random.o im3d : $(objects) $(CC) $(LDFLAGS) -o im3d $(objects) $(LIBFLAG) im3d.o: im3d.h im3d.c $(CC) -c $(CFLAGS64) im3d.c mpimod.o: mpimod.h mpimod.c $(CC) -c $(CFLAGS64) mpimod.c const.o: const.h const.c $(CC) -c $(CFLAGS32) const.c init.o: init.h init.c $(CC) -c $(CFLAGS64) init.c material.o: material.h material.c $(CC) -c $(CFLAGS64) material.c target.o: target.h target.c $(CC) -c $(CFLAGS64) target.c matrix.o: matrix.h matrix.c $(CC) -c $(CFLAGS64) matrix.c index.o: index.h index.c $(CC) -c $(CFLAGS32) index.c magic.o: magic.h magic.c $(CC) -c $(CFLAGS32) magic.c fileio.o: fileio.h fileio.c $(CC) -c $(CFLAGS32) fileio.c cfgwriter.o: cfgwriter.h cfgwriter.c $(CC) -c $(CFLAGS32) cfgwriter.c mshwriter.o: mshwriter.h mshwriter.c $(CC) -c $(CFLAGS32) mshwriter.c aivxyz.o: aivxyz.h aivxyz.c $(CC) -c $(CFLAGS32) aivxyz.c bulk.o: bulk.h bulk.c $(CC) -c $(CFLAGS64) bulk.c utils.o: utils.h utils.c $(CC) -c $(CFLAGS64) utils.c random.o: random.h random.c $(CC) -c $(CFLAGS32) random.c #.c.o : # $(CC) -c $(CFLAGS) $< clean: rm -f im3d *.o clear: rm *.o