port to install SPOOLES library

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

port to install SPOOLES library

Mark Brethen-2
From the SPOOLES documentation:

The SPOOLES library operates in serial, multithreaded and MPI environments. The code for these three environments is fairly segregated. The MPI directory contains all source and driver code for MPI programs. The MT directory contains all source and driver code for multithreaded programs. All other directories contain serial code.2 The MPI source code is compiled into a spoolesMPI.a library. The multithreaded source code is compiled into a spoolesMT.a library. The serial code is compiled into a spooles.a library.

I would like to offer the user the option of MT or MPI. The build phase would look something like this:

if defined(WITH_MPI)
                cd ${WRKSRC}/MPI/src ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
                cd ${WRKSRC}_SHARED/MPI/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
                cd ${WRKSRC}_SHARED ; ld -Bshareable -o libspooles.so.1 -x -soname libspooles.so.1 --whole-archive spooles.a
       
        else
                cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} global -f makefile
                cd ${WRKSRC}/MT/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
                cd ${WRKSRC}_SHARED; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} global -f makefile)
                cd ${WRKSRC}_SHARED/MT/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
                cd ${WRKSRC}_SHARED ; ld -Bshareable -o libspooles.so.1 -x -soname libspooles.so.1 --whole-archive spooles.a
        endif

There’s probably an easy way to do this using the MPI portgroup. Can you suggest some ports to look at as an example?


Mark Brethen
[hidden email]



Reply | Threaded
Open this post in threaded view
|

Re: port to install SPOOLES library

Mark Brethen-2
So is this port a good candidate for the mpi port group? If not then I’ll just whitelist a compiler if the mpi variant is chosen.


Mark Brethen
[hidden email]



> On Nov 16, 2018, at 5:08 PM, Mark Brethen <[hidden email]> wrote:
>
> From the SPOOLES documentation:
>
> The SPOOLES library operates in serial, multithreaded and MPI environments. The code for these three environments is fairly segregated. The MPI directory contains all source and driver code for MPI programs. The MT directory contains all source and driver code for multithreaded programs. All other directories contain serial code.2 The MPI source code is compiled into a spoolesMPI.a library. The multithreaded source code is compiled into a spoolesMT.a library. The serial code is compiled into a spooles.a library.
>
> I would like to offer the user the option of MT or MPI. The build phase would look something like this:
>
> if defined(WITH_MPI)
>        cd ${WRKSRC}/MPI/src ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>        cd ${WRKSRC}_SHARED/MPI/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>        cd ${WRKSRC}_SHARED ; ld -Bshareable -o libspooles.so.1 -x -soname libspooles.so.1 --whole-archive spooles.a
>
> else
>        cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} global -f makefile
>        cd ${WRKSRC}/MT/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>        cd ${WRKSRC}_SHARED; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} global -f makefile)
>        cd ${WRKSRC}_SHARED/MT/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>        cd ${WRKSRC}_SHARED ; ld -Bshareable -o libspooles.so.1 -x -soname libspooles.so.1 --whole-archive spooles.a
> endif
>
> There’s probably an easy way to do this using the MPI portgroup. Can you suggest some ports to look at as an example?
>
>
> Mark Brethen
> [hidden email]
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: port to install SPOOLES library

Mark Brethen-2
I’ve patched the Make.inc file. Does it look correct?



Mark Brethen
[hidden email]



> On Nov 16, 2018, at 8:20 PM, Mark Brethen <[hidden email]> wrote:
>
> So is this port a good candidate for the mpi port group? If not then I’ll just whitelist a compiler if the mpi variant is chosen.
>
>
> Mark Brethen
> [hidden email]
>
>
>
>> On Nov 16, 2018, at 5:08 PM, Mark Brethen <[hidden email]> wrote:
>>
>> From the SPOOLES documentation:
>>
>> The SPOOLES library operates in serial, multithreaded and MPI environments. The code for these three environments is fairly segregated. The MPI directory contains all source and driver code for MPI programs. The MT directory contains all source and driver code for multithreaded programs. All other directories contain serial code.2 The MPI source code is compiled into a spoolesMPI.a library. The multithreaded source code is compiled into a spoolesMT.a library. The serial code is compiled into a spooles.a library.
>>
>> I would like to offer the user the option of MT or MPI. The build phase would look something like this:
>>
>> if defined(WITH_MPI)
>>        cd ${WRKSRC}/MPI/src ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>        cd ${WRKSRC}_SHARED/MPI/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>        cd ${WRKSRC}_SHARED ; ld -Bshareable -o libspooles.so.1 -x -soname libspooles.so.1 --whole-archive spooles.a
>>
>> else
>>        cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} global -f makefile
>>        cd ${WRKSRC}/MT/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>        cd ${WRKSRC}_SHARED; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} global -f makefile)
>>        cd ${WRKSRC}_SHARED/MT/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>        cd ${WRKSRC}_SHARED ; ld -Bshareable -o libspooles.so.1 -x -soname libspooles.so.1 --whole-archive spooles.a
>> endif
>>
>> There’s probably an easy way to do this using the MPI portgroup. Can you suggest some ports to look at as an example?
>>
>>
>> Mark Brethen
>> [hidden email]
>>
>>
>>
>


Make.inc (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: port to install SPOOLES library

Mark Brethen-2
The installation instructions for SPOOLES has this to say about multithreaded libraries:

To build a multithreaded library, one must go to the MT/src directory. Now we have two choices — to build a separate spoolesMT.a library, or two merge the multithreaded code into the spooles.a library. We recommend the first, via typing make spoolesMT.a, though the second is perfectly fine by typing make makeLib. If Perl is not installed, type make -f makeGlobalLib for the latter behavior.

Much the same applies to the MPI library. To build a MPI library, one must go to the MPI/src directory. Now we have two choices — to build a separate spoolesMPI.a library, or two merge the MPI code into the spooles.a library. We recommend the first, via typing make spoolesMPI.a, though the second is perfectly fine by typing make makeLib. If Perl is not installed, type make -f makeGlobalLib for the latter behavior.

Is there a preference for macports build (i.e. merge them or build separate)?


Mark Brethen
[hidden email]



> On Nov 17, 2018, at 9:37 AM, Mark Brethen <[hidden email]> wrote:
>
> I’ve patched the Make.inc file. Does it look correct?
> <Make.inc>
>
> Mark Brethen
> [hidden email]
>
>
>
>> On Nov 16, 2018, at 8:20 PM, Mark Brethen <[hidden email]> wrote:
>>
>> So is this port a good candidate for the mpi port group? If not then I’ll just whitelist a compiler if the mpi variant is chosen.
>>
>>
>> Mark Brethen
>> [hidden email]
>>
>>
>>
>>> On Nov 16, 2018, at 5:08 PM, Mark Brethen <[hidden email]> wrote:
>>>
>>> From the SPOOLES documentation:
>>>
>>> The SPOOLES library operates in serial, multithreaded and MPI environments. The code for these three environments is fairly segregated. The MPI directory contains all source and driver code for MPI programs. The MT directory contains all source and driver code for multithreaded programs. All other directories contain serial code.2 The MPI source code is compiled into a spoolesMPI.a library. The multithreaded source code is compiled into a spoolesMT.a library. The serial code is compiled into a spooles.a library.
>>>
>>> I would like to offer the user the option of MT or MPI. The build phase would look something like this:
>>>
>>> if defined(WITH_MPI)
>>>        cd ${WRKSRC}/MPI/src ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>>        cd ${WRKSRC}_SHARED/MPI/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>>        cd ${WRKSRC}_SHARED ; ld -Bshareable -o libspooles.so.1 -x -soname libspooles.so.1 --whole-archive spooles.a
>>>
>>> else
>>>        cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} global -f makefile
>>>        cd ${WRKSRC}/MT/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>>        cd ${WRKSRC}_SHARED; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} global -f makefile)
>>>        cd ${WRKSRC}_SHARED/MT/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>>        cd ${WRKSRC}_SHARED ; ld -Bshareable -o libspooles.so.1 -x -soname libspooles.so.1 --whole-archive spooles.a
>>> endif
>>>
>>> There’s probably an easy way to do this using the MPI portgroup. Can you suggest some ports to look at as an example?
>>>
>>>
>>> Mark Brethen
>>> [hidden email]
>>>
>>>
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: port to install SPOOLES library

Ryan Schmidt-24
In reply to this post by Mark Brethen-2
How specifically have you patched it? A diff would be more useful for seeing that.

I do see the line "CC = $(CC)", which is a no-op: it assigns CC to itself. So that's not useful.


On Nov 17, 2018, at 09:37, Mark Brethen wrote:

> I’ve patched the Make.inc file. Does it look correct?
> <Make.inc>
>
> Mark Brethen
> [hidden email]
>
>
>
>> On Nov 16, 2018, at 8:20 PM, Mark Brethen <[hidden email]> wrote:
>>
>> So is this port a good candidate for the mpi port group? If not then I’ll just whitelist a compiler if the mpi variant is chosen.
>>
>>
>> Mark Brethen
>> [hidden email]
>>
>>
>>
>>> On Nov 16, 2018, at 5:08 PM, Mark Brethen <[hidden email]> wrote:
>>>
>>> From the SPOOLES documentation:
>>>
>>> The SPOOLES library operates in serial, multithreaded and MPI environments. The code for these three environments is fairly segregated. The MPI directory contains all source and driver code for MPI programs. The MT directory contains all source and driver code for multithreaded programs. All other directories contain serial code.2 The MPI source code is compiled into a spoolesMPI.a library. The multithreaded source code is compiled into a spoolesMT.a library. The serial code is compiled into a spooles.a library.
>>>
>>> I would like to offer the user the option of MT or MPI. The build phase would look something like this:
>>>
>>> if defined(WITH_MPI)
>>>        cd ${WRKSRC}/MPI/src ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>>        cd ${WRKSRC}_SHARED/MPI/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>>        cd ${WRKSRC}_SHARED ; ld -Bshareable -o libspooles.so.1 -x -soname libspooles.so.1 --whole-archive spooles.a
>>>
>>> else
>>>        cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} global -f makefile
>>>        cd ${WRKSRC}/MT/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>>        cd ${WRKSRC}_SHARED; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} global -f makefile)
>>>        cd ${WRKSRC}_SHARED/MT/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>>        cd ${WRKSRC}_SHARED ; ld -Bshareable -o libspooles.so.1 -x -soname libspooles.so.1 --whole-archive spooles.a
>>> endif
>>>
>>> There’s probably an easy way to do this using the MPI portgroup. Can you suggest some ports to look at as an example?
>>>
>>>
>>> Mark Brethen
>>> [hidden email]
>>>
>>>
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: port to install SPOOLES library

Ryan Schmidt-24
In reply to this post by Mark Brethen-2


On Nov 17, 2018, at 13:16, Mark Brethen wrote:

> The installation instructions for SPOOLES has this to say about multithreaded libraries:
>
> To build a multithreaded library, one must go to the MT/src directory. Now we have two choices — to build a separate spoolesMT.a library, or two merge the multithreaded code into the spooles.a library. We recommend the first, via typing make spoolesMT.a, though the second is perfectly fine by typing make makeLib. If Perl is not installed, type make -f makeGlobalLib for the latter behavior.
>
> Much the same applies to the MPI library. To build a MPI library, one must go to the MPI/src directory. Now we have two choices — to build a separate spoolesMPI.a library, or two merge the MPI code into the spooles.a library. We recommend the first, via typing make spoolesMPI.a, though the second is perfectly fine by typing make makeLib. If Perl is not installed, type make -f makeGlobalLib for the latter behavior.
>
> Is there a preference for macports build (i.e. merge them or build separate)?

I have no idea. I don't have any background about this software or how it's typically used. Going with the developers' recommendation might be best, if that's how other software that uses this library expects it to be packaged.

However, the whole static library (.a) thing is not especially desired in MacPorts. We want dynamic libraries, for all the usual reasons.


Reply | Threaded
Open this post in threaded view
|

Re: port to install SPOOLES library

Mark Brethen-2
In reply to this post by Ryan Schmidt-24
The combined diff is too large to send as an attachment. Below is the patch to Make.inc, placeholders are reinplaced in the post-patch phase.




diff -ur spooles.2.2.orig/Make.inc spooles.2.2/Make.inc
--- spooles.2.2.orig/Make.inc   1999-01-18 15:48:55.000000000 -0600
+++ spooles.2.2/Make.inc        2018-11-17 09:36:12.000000000 -0600
@@ -12,7 +12,7 @@
 # for solaris
 #
 # CC = gcc
-  CC = /usr/lang-4.0/bin/cc
+  CC = @@CC@@
 #
 # for sgi
 #
@@ -28,14 +28,14 @@
 #
 # OPTLEVEL =
 # OPTLEVEL = -g -v
-  OPTLEVEL = -O
+# OPTLEVEL = -O
 # OPTLEVEL = -xO5 -v
 # OPTLEVEL = -O3
 # OPTLEVEL = -O4
 # CFLAGS = -Wall -g
 # CFLAGS = -Wall -pg
 # CFLAGS = $(OPTLEVEL) -D_POSIX_C_SOURCE=199506L
-  CFLAGS = $(OPTLEVEL)
+  CFLAGS = @@CFLAGS@@
 # CFLAGS = -Wall $(OPTLEVEL)
 #
 #----------------------------------------
@@ -43,15 +43,15 @@
 #  set any load flags
 #
 #  LDFLAGS = -Wl,+parallel -Wl,+tm,spp2000 # for hp exemplar
-   LDFLAGS =
+   LDFLAGS = @@LDFLAGS@@
 #
 #---------------------------------------------------------------------
 #
 #  set any thread libraries
 #
 # THREAD_LIBS =
-# THREAD_LIBS = -D_REENTRANT=199506L -lpthread
-  THREAD_LIBS = -D_POSIX_C_SOURCE=199506L -lpthread
+  THREAD_LIBS = -D_REENTRANT=199506L -lpthread
+# THREAD_LIBS = -D_POSIX_C_SOURCE=199506L -lpthread
 # THREAD_LIBS = -lpthread
 #
 #---------------------------------------------------------------------
@@ -79,15 +79,15 @@
 #  set the ranlib environment
 #  (if ranlib is not needed, we echo the library name)
 #
-# RANLIB = ranlib
-  RANLIB = echo
+  RANLIB = ranlib
+# RANLIB = echo
 #
 #---------------------------------------------------------------------
 #
 #  set suffix rule *.c --> *.o
 #
-.c.o :
-       $(PURIFY) $(CC) -c $(CFLAGS) $<
+#.c.o :
+#      $(PURIFY) $(CC) -c $(CFLAGS) $<
 #
 #---------------------------------------------------------------------
 #
@@ -102,8 +102,8 @@
 #
 #  MPI install library
 #
-# MPI_INSTALL_DIR =
-  MPI_INSTALL_DIR = /usr/local/mpich-1.0.13
+  MPI_INSTALL_DIR = @@PREFIX@@
+# MPI_INSTALL_DIR = /usr/local/mpich-1.0.13
 #
 #---------------------------------------------------------------------
 #
@@ -115,7 +115,7 @@
 #
 # for solaris
 #
-  MPI_LIB_PATH = -L$(MPI_INSTALL_DIR)/lib/solaris/ch_p4
+  MPI_LIB_PATH = -L$(MPI_INSTALL_DIR)/lib/mpich-mp
 #
 # for hp
 #
@@ -142,6 +142,6 @@
 #  MPI include path
 #
 # MPI_INCLUDE_DIR =
-  MPI_INCLUDE_DIR = -I$(MPI_INSTALL_DIR)/include
+  MPI_INCLUDE_DIR = -I$(MPI_INSTALL_DIR)/include/mpich-mp
 #
 #---------------------------------------------------------------------


Mark Brethen
[hidden email]



> On Nov 25, 2018, at 2:11 AM, Ryan Schmidt <[hidden email]> wrote:
>
> How specifically have you patched it? A diff would be more useful for seeing that.
>
> I do see the line "CC = $(CC)", which is a no-op: it assigns CC to itself. So that's not useful.
>
>
> On Nov 17, 2018, at 09:37, Mark Brethen wrote:
>
>> I’ve patched the Make.inc file. Does it look correct?
>> <Make.inc>
>>
>> Mark Brethen
>> [hidden email]
>>
>>
>>
>>> On Nov 16, 2018, at 8:20 PM, Mark Brethen <[hidden email]> wrote:
>>>
>>> So is this port a good candidate for the mpi port group? If not then I’ll just whitelist a compiler if the mpi variant is chosen.
>>>
>>>
>>> Mark Brethen
>>> [hidden email]
>>>
>>>
>>>
>>>> On Nov 16, 2018, at 5:08 PM, Mark Brethen <[hidden email]> wrote:
>>>>
>>>> From the SPOOLES documentation:
>>>>
>>>> The SPOOLES library operates in serial, multithreaded and MPI environments. The code for these three environments is fairly segregated. The MPI directory contains all source and driver code for MPI programs. The MT directory contains all source and driver code for multithreaded programs. All other directories contain serial code.2 The MPI source code is compiled into a spoolesMPI.a library. The multithreaded source code is compiled into a spoolesMT.a library. The serial code is compiled into a spooles.a library.
>>>>
>>>> I would like to offer the user the option of MT or MPI. The build phase would look something like this:
>>>>
>>>> if defined(WITH_MPI)
>>>>        cd ${WRKSRC}/MPI/src ; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>>>        cd ${WRKSRC}_SHARED/MPI/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>>>        cd ${WRKSRC}_SHARED ; ld -Bshareable -o libspooles.so.1 -x -soname libspooles.so.1 --whole-archive spooles.a
>>>>
>>>> else
>>>>        cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} global -f makefile
>>>>        cd ${WRKSRC}/MT/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>>>        cd ${WRKSRC}_SHARED; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} global -f makefile)
>>>>        cd ${WRKSRC}_SHARED/MT/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} -f makeGlobalLib
>>>>        cd ${WRKSRC}_SHARED ; ld -Bshareable -o libspooles.so.1 -x -soname libspooles.so.1 --whole-archive spooles.a
>>>> endif
>>>>
>>>> There’s probably an easy way to do this using the MPI portgroup. Can you suggest some ports to look at as an example?
>>>>
>>>>
>>>> Mark Brethen
>>>> [hidden email]
>>>>
>>>>
>>>>
>>>
>>
>


Portfile (6K) Download Attachment