aboutsummaryrefslogtreecommitdiff
path: root/pso
diff options
context:
space:
mode:
Diffstat (limited to 'pso')
-rw-r--r--pso/README.build.txt4
-rw-r--r--pso/README.txt3
-rw-r--r--pso/config-pd-darwin.txt30
-rw-r--r--pso/config-pd-linux.txt28
-rw-r--r--pso/makefile.pd-darwin4
-rw-r--r--pso/makefile.pd-linux79
6 files changed, 116 insertions, 32 deletions
diff --git a/pso/README.build.txt b/pso/README.build.txt
index fdb40c4..441e5ea 100644
--- a/pso/README.build.txt
+++ b/pso/README.build.txt
@@ -6,13 +6,13 @@ Note: Flext is required to compile this external!
To build & Install (under linux):
- edit makefile.pd-linux to suit your needs
+ edit config-pd-linux.txt to suit your needs
make -f makefile.pd-linux
To build & Install (under OSX):
- edit makefile.pd-darwin to suit your needs
+ edit config-pd-darwin.txt to suit your needs
make -f makefile.pd-darwin
diff --git a/pso/README.txt b/pso/README.txt
index b5a2b2b..7438674 100644
--- a/pso/README.txt
+++ b/pso/README.txt
@@ -25,6 +25,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
USAGE:
+MAX: Put it in your externals folder.
+PD: Put it in your extra folder.
+
The PSO object requires three arguments (see below). The object has one inlet and three outlets.
In order to calculate one iteration of the PSO send it a bang. The three outlets are:
diff --git a/pso/config-pd-darwin.txt b/pso/config-pd-darwin.txt
new file mode 100644
index 0000000..862f727
--- /dev/null
+++ b/pso/config-pd-darwin.txt
@@ -0,0 +1,30 @@
+# PSO - Particle Swarm Optimizer - Copyright Ben Bogart 2003
+# makefile adapted from pool - Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+#
+
+# your c++ compiler (define only if it's different than g++)
+# CXX=g++
+
+# where are the PD header files?
+# leave it blank if it is a system directory (like /usr/local/include),
+# since gcc 3.2 complains about it
+PDPATH=/usr/local/pd/src
+
+# where is the PD executable?
+PD=/usr/local/pd/bin/pd
+
+# where do the flext libraries reside?
+FLEXTPATH=/usr/local/pd/flext
+
+# where should flext libraries be built?
+TARGDIR=./pd-darwin
+
+# where should pool be installed?
+# (leave blank to omit installation)
+INSTPATH=/usr/local/pd/extra
+
+# additional compiler flags
+# (check if they match your system!)
+UFLAGS=-malign-power -maltivec
+
+
diff --git a/pso/config-pd-linux.txt b/pso/config-pd-linux.txt
new file mode 100644
index 0000000..6dd1808
--- /dev/null
+++ b/pso/config-pd-linux.txt
@@ -0,0 +1,28 @@
+# PSO - Particle Swarm Optimizer - Copyright Ben Bogart 2003
+# makefile adapted from pool - Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+#
+
+# your c++ compiler (define only if it's different than g++)
+# CXX=g++
+
+# where are the PD header files?
+# leave it blank if it is a system directory (like /usr/local/include),
+# since gcc >= 3.2 complains about it
+PDPATH=/usr/local/include
+
+# where do the flext libraries reside?
+FLEXTPATH=/usr/local/lib/pd/flext
+
+# where should flext libraries be built?
+TARGDIR=./pd-linux
+
+# where should the external be installed?
+# (leave blank to omit installation)
+INSTPATH=/usr/local/lib/pd/extra
+
+# user defined compiler flags
+UFLAGS=
+
+# define for shared build
+#FLEXT_SHARED=1
+
diff --git a/pso/makefile.pd-darwin b/pso/makefile.pd-darwin
index 47bcc48..5fd70f9 100644
--- a/pso/makefile.pd-darwin
+++ b/pso/makefile.pd-darwin
@@ -31,8 +31,8 @@ FRAMEWORKS=Carbon
NAME=pso
# all the source files from the package
-SRCS=main.cpp pool.cpp data.cpp
-HDRS=pool.h
+SRCS=main.cpp
+HDRS=
DIR=.
diff --git a/pso/makefile.pd-linux b/pso/makefile.pd-linux
index aa6a721..0bd5193 100644
--- a/pso/makefile.pd-linux
+++ b/pso/makefile.pd-linux
@@ -1,64 +1,82 @@
# PSO - Particle Swarm Optimizer - Copyright Ben Bogart 2003
-# makefile adapted from prepend - Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
+# makefile adapted from pool - Copyright (c) 2002 Thomas Grill (xovo@gmx.net)
#
-# Makefile for gcc
+# Makefile for gcc @ linux
#
-# usage: make -f makefile.pd-linux
+# usage:
+# to build run "make -f makefile.pd-linux"
+# to install (as root), do "make -f makefile.pd-linux install"
#
-# ---------------------------------------------
-NAME=pso
+CONFIG=config-pd-linux.txt
+
+include $(CONFIG)
+
+# compiler+linker stuff
+INCLUDES=$(PDPATH)
+FLAGS=-DFLEXT_SYS=2
+CFLAGS=-O2 $(UFLAGS)
+LIBS=
-# where to build
-TARGDIR=./pd-linux
+ifdef FLEXT_SHARED
+CFLAGS+=-shared -DFLEXT_SHARED
+LDFLAGS+=-L $(FLEXTPATH)
-# where to install ### EDIT! ###
-INSTDIR=
+ifeq ($(CXX),icc)
+LDFLAGS+=-i_dynamic
+else
+LDFLAGS+=-Wl,-Bdynamic
+endif
-# flext stuff ### EDIT! ###
-FLEXTPATH=/usr/local/lib/pd/flext
-FLEXTLIB=$(FLEXTPATH)/flext.a
+FLEXTLIB=-lflext
-# compiler+linker stuff ### EDIT! ###
-INCLUDES=/usr/lib/pd/include
-FLAGS=-DPD
-CFLAGS=-O6 -mcpu=pentium
-LIBS=m
+else
+FLEXTLIB=$(FLEXTPATH)/flext_t.a
+endif
+
+
+# ---------------------------------------------
# the rest can stay untouched
# ----------------------------------------------
+NAME=pso
+
# all the source files from the package
-SRCS=main.cpp
+SRCS=main.cpp
HDRS=
+DIR=.
+
TARGET=$(TARGDIR)/$(NAME).pd_linux
# default target
all: $(TARGDIR) $(TARGET)
-$(SRCS): $(HDRS)
+$(patsubst %,$(DIR)/%,$(SRCS)): $(patsubst %,$(DIR)/%,$(HDRS)) $(CONFIG)
touch $@
$(TARGDIR):
mkdir $(TARGDIR)
-$(TARGDIR)/%.o : %.cpp
+$(TARGDIR)/%.o : $(DIR)/%.cpp
$(CXX) -c $(CFLAGS) $(FLAGS) $(patsubst %,-I%,$(INCLUDES) $(FLEXTPATH)) $< -o $@
-$(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS)) $(FLEXTLIB)
- $(CXX) $(LDFLAGS) -shared $^ $(patsubst %,-l%,$(LIBS)) -o $@
+$(TARGET) : $(patsubst %.cpp,$(TARGDIR)/%.o,$(SRCS))
+ $(CXX) -shared $(LDFLAGS) -o $@ $^ $(FLEXTLIB) $(patsubst %,-l%,$(LIBS))
+ strip --strip-unneeded $@
chmod 755 $@
-$(INSTDIR):
- mkdir $(INSTDIR)
+$(INSTPATH):
+ mkdir $(INSTPATH)
-install:: $(INSTDIR)
+install:: $(INSTPATH)
-install:: $(TARGET)
- cp $^ $(INSTDIR)
- chown root.root $(patsubst %,$(INSTDIR)/%,$(notdir $^))
+install:: $(TARGET)
+ cp $^ $(INSTPATH)
+ chown root.root $(patsubst %,$(INSTPATH)/%,$(notdir $^))
+ chmod 755 $(patsubst %,$(INSTPATH)/%,$(notdir $^))
.PHONY: clean
clean:
@@ -67,3 +85,8 @@ clean:
+
+
+
+
+