Discussion:
port to install SPOOLES library
Mark Brethen
2018-11-16 23:08:47 UTC
Permalink
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
***@gmail.com
Mark Brethen
2018-11-17 02:20:55 UTC
Permalink
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
Post by Mark Brethen
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.
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
Mark Brethen
2018-11-17 15:37:50 UTC
Permalink
I’ve patched the Make.inc file. Does it look correct?
Mark Brethen
2018-11-17 19:16:11 UTC
Permalink
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
I’ve patched the Make.inc file. Does it look correct?
<Make.inc>
Mark Brethen
Post by Mark Brethen
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
Post by Mark Brethen
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.
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
Ryan Schmidt
2018-11-25 08:13:16 UTC
Permalink
Post by Mark Brethen
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.
Ryan Schmidt
2018-11-25 08:11:47 UTC
Permalink
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.
I’ve patched the Make.inc file. Does it look correct?
<Make.inc>
Mark Brethen
Post by Mark Brethen
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
Post by Mark Brethen
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.
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
Mark Brethen
2018-11-25 13:11:31 UTC
Permalink
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.
Loading...