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
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
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.
--- 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
Responsible Changed From-To: freebsd-ports-bugs->maho I'll handle this
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
State Changed From-To: open->closed Committed, thanks!