Originally Posted by
dmh2000
you need to get the source for the library and rebuild on your machine. for that library i googled 'mpikmeans' and found this link for the project
mloss | Project details:MPIKmeans. there is a link title 'Archive: download here' that lets you download the source. then you have to use your Mac tools to build it according to instructions in the README and Makefile files.
Hey dmh2000!
Thanks for your effort!
I have the file already. The code excerpt I've posted above was from the makefile itself!
Let me post another part of the Makefile. This is where the library (.a) and object files (.o) are created (I think!)
Code:
#
# Choose your compiler
#
CC = gcc
CPP = g++
CFLAGS=-O3 -ffast-math -fomit-frame-pointer -fPIC -Werror
#
# MPI KMEANS FLAGS
#
VERBOSEFLAG=-DKMEANS_VERBOSE=0 # 0: silent, 1:iteration counter, 2:everything
PRECISION=-DINPUT_TYPE=0 # 0: double, 1:float
matlab: mpi_kmeans_mex.$(SUFFIX) mpi_assign_mex.$(SUFFIX)
standalone: mpi_kmeans_main mpi_assign_main
python: cython_wrapper
mpi_kmeans.o: mpi_kmeans.cxx mpi_kmeans.h
$(CC) $(CFLAGS) $(VERBOSEFLAG) $(PRECISION) -c -o $@ mpi_kmeans.cxx
libmpikmeans: mpi_kmeans.o
ar rc libmpikmeans.a mpi_kmeans.o
ranlib libmpikmeans.a
$(CPP) -shared -fPIC $(CFLAGS) $(VERBOSEFLAG) -o libmpikmeans.so $(VERBOSEFLAGS) $(PRECISION) mpi_kmeans.cxx
mpi_kmeans_main.o: mpi_kmeans_main.cxx
$(CC) $(CFLAGS) $(VERBOSEFLAG) $(BOOST_INCLUDE) -c -o mpi_kmeans_main.o mpi_kmeans_main.cxx
mpi_assign_main.o: mpi_assign_main.cxx
$(CC) $(CFLAGS) $(VERBOSEFLAG) $(BOOST_INCLUDE) -c -o mpi_assign_main.o mpi_assign_main.cxx
mpi_kmeans_main: libmpikmeans mpi_kmeans_main.o
$(CC) mpi_kmeans_main.o $(CFLAGS) $(VERBOSEFLAG) -L/usr/lib/ -static -o mpi_kmeans -lm libmpikmeans.a \
$(BOOST_LIB) $(LIBS)
mpi_assign_main: libmpikmeans mpi_assign_main.o
$(CC) mpi_assign_main.o $(CFLAGS) $(VERBOSEFLAG) -L/usr/lib/ -static -o mpi_assign -lm libmpikmeans.a \
$(BOOST_LIB) $(LIBS)
%_mex.o: %_mex.cxx
$(CC) $(CFLAGS) $(VERBOSEFLAG) $(MATLAB_INCLUDE) $(PRECISION) -c $^ -o $@
#
# These are the two main files we need !!
#
mpi_kmeans_mex.$(SUFFIX): libmpikmeans mpi_kmeans_mex.o
$(CC) mpi_kmeans_mex.o -shared -o mpi_kmeans_mex.$(SUFFIX) libmpikmeans.a $(MATLAB_LIB)
mpi_assign_mex.$(SUFFIX): libmpikmeans mpi_assign_mex.o
$(CC) mpi_assign_mex.o -shared -o mpi_assign_mex.$(SUFFIX) libmpikmeans.a $(MATLAB_LIB)
#
# end
#
In the readme file, it says: run make matlab. I've highlighted the parts I BELIEVE are carried out, once I use the command.
Now which line am I supposed to modify - and how?