A quantum computer simulator

PR:		27628
Submitted by:	Brad Huntting <huntting@glarp.com>
This commit is contained in:
Ying-Chieh Liao 2001-05-29 16:56:08 +00:00
parent 7cc70d6ae6
commit cfe6e9364d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=43278
15 changed files with 341 additions and 0 deletions

View file

@ -35,6 +35,7 @@
SUBDIR += osf1_base SUBDIR += osf1_base
SUBDIR += pcemu SUBDIR += pcemu
SUBDIR += prodosemu SUBDIR += prodosemu
SUBDIR += qcl
SUBDIR += quasi88 SUBDIR += quasi88
SUBDIR += rtc SUBDIR += rtc
SUBDIR += sim SUBDIR += sim

21
emulators/qcl/Makefile Normal file
View file

@ -0,0 +1,21 @@
# ports collection makefile for: qcl
# Date created: 23 May 2001
# Whom: Brad Huntting <huntting@glarp.com>
#
# $FreeBSD$
#
PORTNAME= qcl
PORTVERSION= 0.4.1
CATEGORIES= emulators math
MASTER_SITES= http://tph.tuwien.ac.at/~oemer/tgz/
EXTRACT_SUFX= .tgz
MAINTAINER= huntting@glarp.com
LIB_DEPENDS= gnugetopt.1:${PORTSDIR}/devel/libgnugetopt
post-install:
strip ${PREFIX}/bin/qcl
.include <bsd.port.mk>

1
emulators/qcl/distinfo Normal file
View file

@ -0,0 +1 @@
MD5 (qcl-0.4.1.tgz) = 0ff6cdb3c29cc3c533f3b27018662a57

View file

@ -0,0 +1,124 @@
--- Makefile.orig Wed Jan 17 13:17:06 2001
+++ Makefile Thu May 24 15:51:01 2001
@@ -14,29 +14,25 @@
# Directory for Standard .qcl files
-QCLDIR = /usr/local/lib/qcl
+QCLDIR = ${PREFIX}/share/qcl
# Path for qcl binaries
-QCLBIN = /usr/local/bin
+QCLBIN = ${PREFIX}/bin
# Debugging options
-DEBUG = -g -DQCL_DEBUG -DQC_DEBUG
-#DEBUG = -O2
+DEBUG = -O2
# Comment out if you don't have GNU readline on your system
# explicit linking against libtermcap or libncurses may be required
RLOPT = -DQCL_USE_READLINE
-#RLLIB = -lreadline
-RLLIB = -lreadline -lncurses
+RLLIB = -lreadline
# Replace with lex and yacc on non-GNU systems (untested)
-LEX = flex
-YACC = bison
-INSTALL = install
+INSTALL = install -c
##### You shouldn't have to edit the stuff below #####
@@ -44,13 +40,15 @@
QCLIB = $(QCDIR)/libqc.a
QCLINC = lib
-CC = g++
-CPP = $(CC) -E
-CFLAGS = -c -Wall $(DEBUG) $(RLOPT) -I$(QCDIR) -DDEF_INCLUDE_PATH="\"$(QCLDIR)\""
-LFLAGS = -L$(QCDIR) $(DEBUG) -lm -lfl -lqc $(RLLIB)
+CXXFLAGS += -Wall $(DEBUG) $(RLOPT) -I$(QCDIR) -I${PREFIX}/include -DDEF_INCLUDE_PATH="\"$(QCLDIR)\""
+LDFLAGS += -L$(QCDIR) $(DEBUG) -L${PREFIX}/lib -lgnugetopt -lm -lfl -lqc $(RLLIB)
+
+FILESCC = debug.cc error.cc eval.cc exec.cc extern.cc lex.cc \
+ options.cc parse.cc print.cc qcl.cc quheap.cc symbols.cc \
+ syntax.cc typcheck.cc types.cc yacc.cc
+FILESH = debug.h error.h extern.h options.h parse.h quheap.h \
+ symbols.h syntax.h types.h yacc.h
-FILESCC = $(wildcard *.cc)
-FILESH = $(wildcard *.h)
SOURCE = $(FILESCC) $(FILESH) qcl.lex qcl.y Makefile
@@ -58,23 +56,11 @@
lex.o yacc.o print.o quheap.o extern.o eval.o exec.o \
parse.o options.o debug.o
-all: do-it-all
+all: build
+
-ifeq (.depend,$(wildcard .depend))
-include .depend
-do-it-all: build
-else
-do-it-all: dep
- make
-endif
-
-#### Rules for depend
-
-dep: lex.cc yacc.cc yacc.h $(QCLIB)
- for i in *.cc; do \
- $(CPP) -I$(QCDIR) -MM $$i; \
- echo -e '\t$(CC) $(CFLAGS)' $$i '\n'; \
- done > .depend
+dep: $(FILESCC) $(FILESH)
+ $(CXX) -M $(CXXFLAGS) $(FILESCC) >.depend
lex.cc: qcl.lex
$(LEX) -olex.cc qcl.lex
@@ -86,24 +72,24 @@
mv yacc.cc.h yacc.h
$(QCLIB):
- cd $(QCDIR) && make libqc.a
+ cd $(QCDIR) && $(MAKE) $(MAKEFLAGS) libqc.a
#### Rules for build
build: qcl $(QCLINC)/default.qcl
qcl: $(OBJECTS) qcl.o $(QCLIB)
- $(CC) $(OBJECTS) qcl.o $(LFLAGS) -o qcl
+ $(CXX) $(OBJECTS) qcl.o $(LDFLAGS) -o qcl
qcl-static: $(OBJECTS) qcl.o $(QCLIB)
- $(CC) -static $(OBJECTS) qcl.o $(LFLAGS) -o qcl-static
+ $(CXX) -static $(OBJECTS) qcl.o $(LDFLAGS) -o qcl-static
strip qcl-static
$(QCLINC)/default.qcl: extern.cc
grep "^//!" extern.cc | cut -c5- > $(QCLINC)/default.qcl
install: build
- $(INSTALL) -m 0755 -d $(QCLBIN) $(QCLDIR)
+ umask 022; mkdir -p $(QCLDIR); chmod 0755 $(QCLDIR)
$(INSTALL) -m 0755 ./qcl $(QCLBIN)
$(INSTALL) -m 0644 ./lib/default.qcl $(QCLDIR)
$(INSTALL) -m 0644 ./lib/dft.qcl $(QCLDIR)
@@ -115,6 +101,7 @@
$(INSTALL) -m 0644 ./lib/roulette.qcl $(QCLDIR)
$(INSTALL) -m 0644 ./lib/shor.qcl $(QCLDIR)
$(INSTALL) -m 0644 ./lib/swap.qcl $(QCLDIR)
+ $(INSTALL) -m 0644 ./lib/grover.qcl $(QCLDIR)
#### Other Functions

View file

@ -0,0 +1 @@
A quantum computer simulator

5
emulators/qcl/pkg-descr Normal file
View file

@ -0,0 +1,5 @@
This is a port of qcl, a quantum computer simulator.
WWW: http://tph.tuwien.ac.at/~oemer/qcl.html
- brad.huntting@glarp.com

13
emulators/qcl/pkg-plist Normal file
View file

@ -0,0 +1,13 @@
bin/qcl
share/qcl/default.qcl
share/qcl/dft.qcl
share/qcl/expmod.qcl
share/qcl/fanout.qcl
share/qcl/functions.qcl
share/qcl/modarith.qcl
share/qcl/qufunct.qcl
share/qcl/roulette.qcl
share/qcl/shor.qcl
share/qcl/swap.qcl
share/qcl/grover.qcl
@dirrm share/qcl

5
emulators/qcl/scripts/configure vendored Normal file
View file

@ -0,0 +1,5 @@
#!/bin/sh
cd $WRKSRC
rm -f .depend
make dep

21
science/qcl/Makefile Normal file
View file

@ -0,0 +1,21 @@
# ports collection makefile for: qcl
# Date created: 23 May 2001
# Whom: Brad Huntting <huntting@glarp.com>
#
# $FreeBSD$
#
PORTNAME= qcl
PORTVERSION= 0.4.1
CATEGORIES= emulators math
MASTER_SITES= http://tph.tuwien.ac.at/~oemer/tgz/
EXTRACT_SUFX= .tgz
MAINTAINER= huntting@glarp.com
LIB_DEPENDS= gnugetopt.1:${PORTSDIR}/devel/libgnugetopt
post-install:
strip ${PREFIX}/bin/qcl
.include <bsd.port.mk>

1
science/qcl/distinfo Normal file
View file

@ -0,0 +1 @@
MD5 (qcl-0.4.1.tgz) = 0ff6cdb3c29cc3c533f3b27018662a57

124
science/qcl/files/patch-aa Normal file
View file

@ -0,0 +1,124 @@
--- Makefile.orig Wed Jan 17 13:17:06 2001
+++ Makefile Thu May 24 15:51:01 2001
@@ -14,29 +14,25 @@
# Directory for Standard .qcl files
-QCLDIR = /usr/local/lib/qcl
+QCLDIR = ${PREFIX}/share/qcl
# Path for qcl binaries
-QCLBIN = /usr/local/bin
+QCLBIN = ${PREFIX}/bin
# Debugging options
-DEBUG = -g -DQCL_DEBUG -DQC_DEBUG
-#DEBUG = -O2
+DEBUG = -O2
# Comment out if you don't have GNU readline on your system
# explicit linking against libtermcap or libncurses may be required
RLOPT = -DQCL_USE_READLINE
-#RLLIB = -lreadline
-RLLIB = -lreadline -lncurses
+RLLIB = -lreadline
# Replace with lex and yacc on non-GNU systems (untested)
-LEX = flex
-YACC = bison
-INSTALL = install
+INSTALL = install -c
##### You shouldn't have to edit the stuff below #####
@@ -44,13 +40,15 @@
QCLIB = $(QCDIR)/libqc.a
QCLINC = lib
-CC = g++
-CPP = $(CC) -E
-CFLAGS = -c -Wall $(DEBUG) $(RLOPT) -I$(QCDIR) -DDEF_INCLUDE_PATH="\"$(QCLDIR)\""
-LFLAGS = -L$(QCDIR) $(DEBUG) -lm -lfl -lqc $(RLLIB)
+CXXFLAGS += -Wall $(DEBUG) $(RLOPT) -I$(QCDIR) -I${PREFIX}/include -DDEF_INCLUDE_PATH="\"$(QCLDIR)\""
+LDFLAGS += -L$(QCDIR) $(DEBUG) -L${PREFIX}/lib -lgnugetopt -lm -lfl -lqc $(RLLIB)
+
+FILESCC = debug.cc error.cc eval.cc exec.cc extern.cc lex.cc \
+ options.cc parse.cc print.cc qcl.cc quheap.cc symbols.cc \
+ syntax.cc typcheck.cc types.cc yacc.cc
+FILESH = debug.h error.h extern.h options.h parse.h quheap.h \
+ symbols.h syntax.h types.h yacc.h
-FILESCC = $(wildcard *.cc)
-FILESH = $(wildcard *.h)
SOURCE = $(FILESCC) $(FILESH) qcl.lex qcl.y Makefile
@@ -58,23 +56,11 @@
lex.o yacc.o print.o quheap.o extern.o eval.o exec.o \
parse.o options.o debug.o
-all: do-it-all
+all: build
+
-ifeq (.depend,$(wildcard .depend))
-include .depend
-do-it-all: build
-else
-do-it-all: dep
- make
-endif
-
-#### Rules for depend
-
-dep: lex.cc yacc.cc yacc.h $(QCLIB)
- for i in *.cc; do \
- $(CPP) -I$(QCDIR) -MM $$i; \
- echo -e '\t$(CC) $(CFLAGS)' $$i '\n'; \
- done > .depend
+dep: $(FILESCC) $(FILESH)
+ $(CXX) -M $(CXXFLAGS) $(FILESCC) >.depend
lex.cc: qcl.lex
$(LEX) -olex.cc qcl.lex
@@ -86,24 +72,24 @@
mv yacc.cc.h yacc.h
$(QCLIB):
- cd $(QCDIR) && make libqc.a
+ cd $(QCDIR) && $(MAKE) $(MAKEFLAGS) libqc.a
#### Rules for build
build: qcl $(QCLINC)/default.qcl
qcl: $(OBJECTS) qcl.o $(QCLIB)
- $(CC) $(OBJECTS) qcl.o $(LFLAGS) -o qcl
+ $(CXX) $(OBJECTS) qcl.o $(LDFLAGS) -o qcl
qcl-static: $(OBJECTS) qcl.o $(QCLIB)
- $(CC) -static $(OBJECTS) qcl.o $(LFLAGS) -o qcl-static
+ $(CXX) -static $(OBJECTS) qcl.o $(LDFLAGS) -o qcl-static
strip qcl-static
$(QCLINC)/default.qcl: extern.cc
grep "^//!" extern.cc | cut -c5- > $(QCLINC)/default.qcl
install: build
- $(INSTALL) -m 0755 -d $(QCLBIN) $(QCLDIR)
+ umask 022; mkdir -p $(QCLDIR); chmod 0755 $(QCLDIR)
$(INSTALL) -m 0755 ./qcl $(QCLBIN)
$(INSTALL) -m 0644 ./lib/default.qcl $(QCLDIR)
$(INSTALL) -m 0644 ./lib/dft.qcl $(QCLDIR)
@@ -115,6 +101,7 @@
$(INSTALL) -m 0644 ./lib/roulette.qcl $(QCLDIR)
$(INSTALL) -m 0644 ./lib/shor.qcl $(QCLDIR)
$(INSTALL) -m 0644 ./lib/swap.qcl $(QCLDIR)
+ $(INSTALL) -m 0644 ./lib/grover.qcl $(QCLDIR)
#### Other Functions

1
science/qcl/pkg-comment Normal file
View file

@ -0,0 +1 @@
A quantum computer simulator

5
science/qcl/pkg-descr Normal file
View file

@ -0,0 +1,5 @@
This is a port of qcl, a quantum computer simulator.
WWW: http://tph.tuwien.ac.at/~oemer/qcl.html
- brad.huntting@glarp.com

13
science/qcl/pkg-plist Normal file
View file

@ -0,0 +1,13 @@
bin/qcl
share/qcl/default.qcl
share/qcl/dft.qcl
share/qcl/expmod.qcl
share/qcl/fanout.qcl
share/qcl/functions.qcl
share/qcl/modarith.qcl
share/qcl/qufunct.qcl
share/qcl/roulette.qcl
share/qcl/shor.qcl
share/qcl/swap.qcl
share/qcl/grover.qcl
@dirrm share/qcl

5
science/qcl/scripts/configure vendored Normal file
View file

@ -0,0 +1,5 @@
#!/bin/sh
cd $WRKSRC
rm -f .depend
make dep