Bug 52019 - enhancement to math/spooles
Summary: enhancement to math/spooles
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Maho Nakata
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-10 07:00 UTC by Pedro F. Giffuni
Modified: 2003-06-10 11:59 UTC (History)
0 users

See Also:


Attachments
patch-spooles.uu (6.21 KB, application/base64)
2003-05-11 20:54 UTC, Pedro F. Giffuni
no flags Details
patch-spooles (5.84 KB, text/plain)
2003-05-27 00:31 UTC, Pedro F. Giffuni
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro F. Giffuni 2003-05-10 07:00:25 UTC
By default spooles build the optional multithreaded support in the same
library. As thecomentation suggests it would be better make it as different
library called libspoolesMT.a. 
For now we just ifdef out the threading support as the only port that uses it
(CalculiX) doesn't use it and can give problems.

Fix: 

__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer--w6C3bKcXe8KMtIBiwTGhwzQ57kcC5UCnH6IJNaJoYWQQSQCJ
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

diff -ruN spooles.orig/Makefile spooles/Makefile
--- spooles.orig/Makefile	Fri May  9 16:14:07 2003
+++ spooles/Makefile	Fri May  9 16:14:30 2003
@@ -33,17 +33,23 @@
 .else
 PLIST_SUB+=     MPI=""
 .endif
+.if !defined(USE_MT)
+PLIST_SUB+=     MT="@comment "
+.else
+PLIST_SUB+=     MT=""
+.endif
 
 post-patch:
 
-.if defined(USE_MPI)
+.if defined(USE_MPI) || defined(USE_MT)
 	@${REINPLACE_CMD} -e 's+%%LOCALBASE%%+${LOCALBASE}+g;' ${WRKSRC}/Make.inc
 .endif
 
 post-build:
 .if defined(USE_MPI)
 	@(cd ${WRKSRC}/MPI/src; $(MAKE) -f makeGlobalLib)
-.else
+.endif
+.if defined(USE_MT)
 	@(cd ${WRKSRC}/MT/src; $(MAKE) -f makeGlobalLib)
 .endif
 
@@ -54,6 +60,10 @@
 	${MKDIR} ${PREFIX}/include/spooles/MPI
 	${INSTALL_DATA} ${WRKSRC}/MPI/*.h ${PREFIX}/include/spooles/MPI
 .endif
+.if defined(USE_MT)
+	${MKDIR} ${PREFIX}/include/spooles/MT
+	${INSTALL_DATA} ${WRKSRC}/MT/*.h ${PREFIX}/include/spooles/MT
+.endif
 	${INSTALL_DATA} ${WRKSRC}/*.h ${PREFIX}/include/spooles/
 	${MKDIR} ${PREFIX}/include/spooles/A2
 	${INSTALL_DATA} ${WRKSRC}/A2/*.h ${PREFIX}/include/spooles/A2
@@ -99,8 +109,6 @@
 	${INSTALL_DATA} ${WRKSRC}/Lock/*.h ${PREFIX}/include/spooles/Lock
 	${MKDIR} ${PREFIX}/include/spooles/MSMD
 	${INSTALL_DATA} ${WRKSRC}/MSMD/*.h ${PREFIX}/include/spooles/MSMD
-	${MKDIR} ${PREFIX}/include/spooles/MT
-	${INSTALL_DATA} ${WRKSRC}/MT/*.h ${PREFIX}/include/spooles/MT
 	${MKDIR} ${PREFIX}/include/spooles/PatchAndGoInfo
 	${INSTALL_DATA} ${WRKSRC}/PatchAndGoInfo/*.h
${PREFIX}/include/spooles/PatchAndGoInfo
 	${MKDIR} ${PREFIX}/include/spooles/Pencil
diff -ruN spooles.orig/pkg-plist spooles/pkg-plist
--- spooles.orig/pkg-plist	Fri May  9 16:14:07 2003
+++ spooles/pkg-plist	Fri May  9 16:14:43 2003
@@ -48,7 +48,6 @@
 include/spooles/MSMD.h
 include/spooles/MSMD/MSMD.h
 include/spooles/MT.h
-include/spooles/MT/spoolesMT.h
 include/spooles/Network.h
 include/spooles/PatchAndGoInfo/PatchAndGoInfo.h
 include/spooles/PatchAndGoInfo.h
@@ -102,6 +101,8 @@
 lib/libspooles.a
 %%MPI%%include/spooles/MPI/spoolesMPI.h
 %%MPI%%@dirrm include/spooles/MPI
+%%MT%%include/spooles/MT/spoolesMT.h
+%%MT%%@dirrm include/spooles/MT
 @dirrm include/spooles/A2
 @dirrm include/spooles/BPG
 @dirrm include/spooles/Chv
@@ -124,7 +125,6 @@
 @dirrm include/spooles/InpMtx
 @dirrm include/spooles/Lock
 @dirrm include/spooles/MSMD
-@dirrm include/spooles/MT
 @dirrm include/spooles/PatchAndGoInfo
 @dirrm include/spooles/Pencil
 @dirrm include/spooles/SolveMap
Comment 1 Pedro F. Giffuni 2003-05-11 20:54:07 UTC
Previous patch was a bandaid to solve the CalculiX problems. This new patch
version will hopefully fix forever the multithreaded issues and also cleaned a
make warning while there.

__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer
Comment 2 chat95 2003-05-13 17:29:38 UTC
Hi, Pedro,

> Previous patch was a bandaid to solve the CalculiX problems. This new patch
> version will hopefully fix forever the multithreaded issues and also cleaned a
> make warning while there.
This patch is better than I made, I think.

However, I have two questions.

a. MPI is still *not* thread safe, so your choice is good.
b. which is better to link, -pthread (posix thread) or -lc_r
   (userland thread)

I ask some other people.
Comment 3 Pedro F. Giffuni 2003-05-13 21:04:23 UTC
 --- Nakata Maho <chat95@mbox.kyoto-inet.or.jp> wrote: > Hi,
Pedro,

> 
> However, I have two questions.
> 
> a. MPI is still *not* thread safe, so your choice is good.
> b. which is better to link, -pthread (posix thread) or -lc_r
>    (userland thread)
> 
> I ask some other people.
>

Fortunately for us, the port doesn't link any threading
libraries. 5.0 doesn't like -pthread only -lc_r. Threads is an
area that is changing daily especially with KSE comming, in
fact, there is a threads mailing list. 

The ports tree has ${PTHREADS_CFLAGS} $(PTHREAD_LIBS} variables,
so when possible I left that decision to the makefiles in my
ports. 
 
cheers,

    Pedro.

__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer
Comment 4 Maho Nakata freebsd_committer freebsd_triage 2003-05-26 08:55:48 UTC
Responsible Changed
From-To: freebsd-ports-bugs->maho

I'll handle this
Comment 5 Pedro F. Giffuni 2003-05-27 00:31:01 UTC
I implemented some suggestions that Maho made and I found a bug.
This version is much better.

__________________________________________________
It's Samaritans' Week. Help Samaritans help others. 
Call 08709 000032 to give or donate online now at http://www.samaritans.org/support/donations.shtm
Comment 6 Maho Nakata freebsd_committer freebsd_triage 2003-06-10 11:58:47 UTC
State Changed
From-To: open->closed

Committed, thanks!