Parallel and C++ options are mutually exclusive?


#1

There are FreeBSD ports that depend on the C++ option.
Now I need to add another port that depends on the Parallel option.
If they aren’t compatible, how can both programs be run at the same time?

Is there any way to make these two options not mutually exclusive?


#2

Hi, Yuri!

Are you the maintainer of HDF5 port for FreeBSD [1]?
If so, I just want to say thank you :clap: for maintaining the port.

I don’t know the answer to your question but
is there a FreeBSD port example that is mutually exclusive?
E.g. science/pkg-c++ , science/pkg-parallel

I’m curious how FreeBSD manages packages when the two options are mutually exclusive.

[1] https://cgit.freebsd.org/ports/commit/science/hdf5?id=54ac4c3184668d200211012bb74e42f7720e30c5


#3

No, I am not a maintainer of the hdf5 port.

It is very difficult to find ports that depend on c++ and parallel because these options are embedded in the hdf5 port.

I’m curious how FreeBSD manages packages when the two options are mutually exclusive.

This is a very undesirable situation. It isn’t handled gracefully. The PARALLEL port option is currently non-default, and it looks like nobody is using it. If some port would need to use the c++ and some other ports would need to use the parallel option - hdf5 should be modified and these options should be made compatible, Otherwise some ports can’t exist.


#4

The port maintainer could build with --enable-unsupported (or ALLOW_UNSUPPORTED in CMake). It’s marked as “unsupported”, but that’s mainly because we don’t test parallel HDF5 with those wrappers. A serial program built with parallel HDF5 should be fine.

I’ve been thinking about removing this restriction, but I haven’t had time to address the documentation tasks that would be required.


#5

I think FreeBSD should follow what OpenBSD does. Don’t use PARALLEL.

http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/math/hdf5/Makefile?rev=1.24&content-type=text/x-cvsweb-markup&only_with_tag=HEAD


#6

I don’t understand what are you suggesting.


#7

My suggestion is simple.
Remove all (or comment out) lines related to PARALLEL in Makefile of FreeBSD HDF5 port.

   # OPTIONS_RADIO_SUPPORT=	CXX PARALLEL
   # PARALLEL_CMAKE_BOOL=	HDF5_ENABLE_PARALLEL
   # PARALLEL_USES=		localbase:ldflags mpi:mpich
   # PARALLEL_VARS=		FCFLAGS+=-I${LOCALBASE}/include

#8

You probably mean to always enable it.
Then this option should simply be made default. No need to remove it.
I am going to suggest such change.


#9

When both CXX and PARALLEL options are enabled the build fails:

In file included from /disk-samsung/freebsd-ports/science/hdf5/work/CMake-hdf5-1.12.2/hdf5-1.12.2/hl/c++/src/H5PacketTable.cpp:23:
In file included from /disk-samsung/freebsd-ports/science/hdf5/work/CMake-hdf5-1.12.2/hdf5-1.12.2/hl/src/H5HLprivate2.h:24:
/disk-samsung/freebsd-ports/science/hdf5/work/CMake-hdf5-1.12.2/hdf5-1.12.2/src/H5private.h:532:2: error: “no suitable MPI type for size_t”
#error “no suitable MPI type for size_t”
^


#10

No, always disable it.


#11

The Damask project https://damask.mpie.de/ expects hdf5 with PARALLEL option ON.


#12

Thanks for sharing the link.
It’s good to know DADF5.
Can your team move alway from MPI to Dask?

BTW, DAMASK rhymes well with DASK. :slight_smile:


#13

@yuri - Can you provide more context about your error? Are you building with the Autotools or CMake? C++ should work with parallel enabled if you build with --enable-unsupported. If that’s broken on FreeBSD, we’ll have to fix things.


#14

I think –enable-unsupported should be gone first before we ask FreeBSD users to try something unsupported.


#15

I build the FreeBSD port that builds with cmake.
In the port I tried to enable both CXX and PARALLEL options at the same time, and got this error. ALLOW_UNSUPPORTED=ON is used.
They build fine separately. But they fail together with the above message.


#16

I tried the C++ w/ parallel combination under CMake (on Linux - I don’t have access to a FreeBSD install) and it works for both HDF5 1.12.2 and 1.13.3. What C/C++ compiler and MPI library are you using?