Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix builds for macos 12.6 #18642

Closed
wants to merge 13 commits into from
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2346,7 +2346,7 @@ IF (NOT WIN32)
SET (CPACK_BUNDLE_PLIST "${VISIT_BINARY_DIR}/tools/dev/scripts/Info.plist")
SET (CPACK_BUNDLE_STARTUP_COMMAND "${VISIT_BINARY_DIR}/exe/visit_macos_launcher")
ELSE(APPLE AND VISIT_CREATE_APPBUNDLE_PACKAGE)
SET(CPACK_GENERATOR "TGZ")
SET(CPACK_GENERATOR "TXZ")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change leads to 100Mb smaller tarball on mac. Would assume similar savings on other platforms. If we could control flags to xz, we could improve that a bit more. We could do that if we used Python tools to tar and compress...as we do in the top level data dir.


SET(CPACK_PACKAGE_NAME "visit")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "VisIt ${VISIT_VERSION} is a parallel visualization and data analysis tool")
Expand Down
2 changes: 1 addition & 1 deletion src/tools/dev/masonry/bootstrap_visit.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def steps_untar(opts,ctx):
ctx.actions["src_copy_tar"] = shell(cmd="cp %s ." % opts["tarball"],
description="copy source tar",
working_dir=build_dir)
ctx.actions["src_untar"] = shell(cmd="tar -xzvf %s" % tar_base,
ctx.actions["src_untar"] = shell(cmd="tar -xvf %s" % tar_base,
description="untar source",
working_dir=build_dir)

Expand Down
4 changes: 3 additions & 1 deletion src/tools/dev/masonry/masonry.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,9 @@ def execute(self,base,key,tag,parent_res):
print("[removing existing temporary dmg file: {0}]".format(temp_dmg))
os.remove(temp_dmg)

cmd = "hdiutil create -srcFolder %s -o %s" % (src_folder, temp_dmg)
# ULMO format (xz) is 1/2 the size of default format (UDZO which is zlib level 1)
#cmd = "hdiutil create -srcFolder %s -o %s" % (src_folder, temp_dmg)
cmd = "hdiutil create -format ULMO -srcFolder %s -o %s" % (src_folder, temp_dmg)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change leads to 275Mb smaller .dmg file on mac


##########################################################################
# NOTE (cyrush) 2021-05-27
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{"bootstrap_visit":
{"version": "3.3.3",
"build_types": ["release"],
"branch": "3.3RC",
"arch": "darwin-x86_64",
"cert": "Developer ID Application: Lawrence Livermore National Laboratory (A827VH86QR)",
"entitlements": "/Users/miller86/visit/visit/33rc/src/tools/dev/masonry/opts/visit.entitlements",
"notarize": {"username":"miller86@llnl.gov",
"password":"@keychain:VisIt",
"asc_provider":"A827VH86QR",
"bundle_id":"gov.llnl.visit"},
"make_nthreads": 2,
"skip_checkout": "yes",
"git": {"mode":"ssh","git_uname":"markcmiller86"},
"build_visit": { "cmake_ver": "3.18.2",
"args":"--no-thirdparty",
"libs":["cmake",
"vtkm",
"ispc",
"embree",
"tbb",
"ospray",
"python",
"vtk",
"qt",
"qwt",
"boost",
"mpich",
"adios",
"advio",
"boxlib",
"blosc",
"cfitsio",
"cgns",
"conduit",
"fms",
"gdal",
"glu",
"h5part",
"hdf5",
"llvm",
"mfem",
"netcdf",
"pidx",
"silo",
"silex",
"szip",
"icet",
"mili",
"zlib",
"xdmf",
"uintah",
"moab"]}
}}
8 changes: 7 additions & 1 deletion src/tools/dev/scripts/bv_support/bv_advio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,12 @@ function build_advio
sed "s%FileIO IDL DocIO%FileIO DocIO%g" configure > c2
mv c2 configure
chmod 750 ./configure
# configure has a number of broken try-run code-blocks
if [[ "$OPSYS" == "Darwin" ]]; then
sed -i orig -e 's/^main()/int main()/' configure
else
sed -i.orig -e 's/^main()/int main()/' configure
fi
info "Invoking command to configure AdvIO"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many try-run blocks for sizes of types in configure defined a main() with no type which causes modern compilers to fail outright. This sed command fixes them. Its a little different on macOS then other *nix systems. Windows?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markcmiller86 Sorry, didn't see the question about Windows sooner. Not using the build_visit script on Windows, so not an issue.

ADVIO_DARWIN=""
if [[ "$OPSYS" == "Darwin" ]]; then
Expand All @@ -196,7 +202,7 @@ function build_advio
fi
set -x
env CXX="$CXX_COMPILER" CC="$C_COMPILER" \
CFLAGS="$CFLAGS $C_OPT_FLAGS" CXXFLAGS="$CXXFLAGS $CXX_OPT_FLAGS" \
CFLAGS="$CFLAGS $C_OPT_FLAGS" CXXFLAGS="$CXXFLAGS $CXX_OPT_FLAGS -Wno-error=implicit-function-declaration" \
./configure --prefix="$VISITDIR/AdvIO/$ADVIO_VERSION/$VISITARCH" --disable-gtktest $ADVIO_DARWIN $ADVIO_DEBUG
set +x
if [[ $? != 0 ]] ; then
Expand Down
70 changes: 70 additions & 0 deletions src/tools/dev/scripts/bv_support/bv_boost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,82 @@ EOF
return 0;
}

function apply_boost_fcoalesce_templates_patch
{
info "Patching boost 1.67.0 for -fcoalesce-templates"
patch -p0 << \EOF
--- tools/build/src/tools/darwin.jam.orig 2023-04-14 10:31:45.000000000 -0700
+++ tools/build/src/tools/darwin.jam 2023-04-07 10:15:50.000000000 -0700
@@ -138,10 +138,10 @@
common.handle-options darwin : $(condition) : $(command) : $(options) ;

# - GCC 4.0 and higher in Darwin does not have -fcoalesce-templates.
- if $(real-version) < "4.0.0"
- {
- flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ;
- }
+# if $(real-version) < "4.0.0"
+# {
+# flags darwin.compile.c++ OPTIONS $(condition) : -fcoalesce-templates ;
+# }
# - GCC 4.2 and higher in Darwin does not have -Wno-long-double.
if $(real-version) < "4.2.0"
{
EOF

if [[ $? != 0 ]] ; then
warn "boost patch for -fcoalesce-templates failed."
return 1
fi
return 0;
}

function apply_boost_clang_specific_storage_type
{
info "Patching boost 1.67.0 for clang-specific storage type"
patch -p0 << \EOF
--- boost/atomic/detail/ops_gcc_x86_dcas.hpp.orig 2023-04-14 10:41:18.000000000 -0700
+++ boost/atomic/detail/ops_gcc_x86_dcas.hpp 2023-04-07 10:37:15.000000000 -0700
@@ -401,13 +401,7 @@

static BOOST_FORCEINLINE storage_type load(storage_type const volatile& storage, memory_order) BOOST_NOEXCEPT
{
-#if defined(__clang__)
-
- // Clang cannot allocate rax:rdx register pairs but it has sync intrinsics
- storage_type value = storage_type();
- return __sync_val_compare_and_swap(&storage, value, value);
-
-#elif defined(BOOST_ATOMIC_DETAIL_X86_NO_ASM_AX_DX_PAIRS)
+#if defined(BOOST_ATOMIC_DETAIL_X86_NO_ASM_AX_DX_PAIRS)

// Some compilers can't allocate rax:rdx register pair either and also don't support 128-bit __sync_val_compare_and_swap
uint64_t value_bits[2];
EOF

if [[ $? != 0 ]] ; then
warn "boost patch for clang-specific storage type failed."
return 1
fi
return 0;
}

function apply_boost_patch
{
apply_boost_ppc_rounding_control_patch
if [[ $? != 0 ]] ; then
return 1
fi
if [[ "$OPSYS" == "Darwin" ]]; then
apply_boost_fcoalesce_templates_patch
if [[ $? != 0 ]] ; then
return 1
fi
apply_boost_clang_specific_storage_type
if [[ $? != 0 ]] ; then
return 1
fi
fi
return 0;
}

Expand Down
53 changes: 51 additions & 2 deletions src/tools/dev/scripts/bv_support/bv_cfitsio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,42 @@ function bv_cfitsio_ensure
fi
fi
}

function apply_cfitsio_groupc_patch
{
info "Patching cfitsio 3006 for missing header in group.c"
patch -p0 << \EOF
--- group.c.orig 2023-04-14 10:47:28.000000000 -0700
+++ group.c 2023-04-07 11:11:49.000000000 -0700
@@ -19,6 +19,7 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+#include <unistd.h> /* needed for getcwd prototype on unix machines */

#if defined(WIN32) || defined(__WIN32__)
#include <direct.h> /* defines the getcwd function on Windows PCs */
EOF

if [[ $? != 0 ]] ; then
warn "cfitsio patch for missing header in group.c failed."
return 1
fi
return 0;

}

function apply_cfitsio_patch
{
if [[ "$OPSYS" == "Darwin" ]]; then
apply_cfitsio_groupc_patch
if [[ $? != 0 ]] ; then
return 1
fi
fi
return 0
}

# *************************************************************************** #
# Function 8.9, build_cfitsio #
# *************************************************************************** #
Expand All @@ -81,10 +117,23 @@ function build_cfitsio
return 1
fi

#
info "Configuring CFITSIO . . ."
cd $CFITSIO_BUILD_DIR || error "Can't cd to cfits IO build dir."

# Patch cfitsio
apply_cfitsio_patch
if [[ $? != 0 ]] ; then
if [[ $untarred_cfitsio == 1 ]] ; then
warn "Giving up on cfitsio build because the patch failed."
return 1
else
warn "Patch failed, but continuing. I believe that this script\n" \
"tried to apply a patch to an existing directory that had\n" \
"already been patched ... that is, the patch is\n" \
"failing harmlessly on a second application."
fi
fi

info "Configuring CFITSIO . . ."
set -x
env CXX="$CXX_COMPILER" CC="$C_COMPILER" \
CFLAGS="$CFLAGS $C_OPT_FLAGS" CXXFLAGS="$CXXFLAGS $CXX_OPT_FLAGS" \
Expand Down
4 changes: 2 additions & 2 deletions src/tools/dev/scripts/bv_support/bv_gdal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ function build_gdal
fi
set -x
./configure CXX="$CXX_COMPILER" CC="$C_COMPILER" $EXTRA_FLAGS \
CFLAGS="$CFLAGS $C_OPT_FLAGS -DH5_USE_16_API" \
CXXFLAGS="$CXXFLAGS $CXX_OPT_FLAGS -DH5_USE_16_API" \
CFLAGS="$CFLAGS $C_OPT_FLAGS -DH5_USE_16_API -Wno-error=implicit-function-declaration" \
CXXFLAGS="$CXXFLAGS $CXX_OPT_FLAGS -DH5_USE_16_API -Wno-error=implicit-function-declaration" \
--prefix="$VISITDIR/gdal/$GDAL_VERSION/$VISITARCH" \
--with-libtiff=internal --with-gif=internal \
--with-png=internal --with-jpeg=internal \
Expand Down
44 changes: 41 additions & 3 deletions src/tools/dev/scripts/bv_support/bv_hdf5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,35 @@ EOF
return 0;
}

function apply_hdf5_resize_configs_are_equal_patch
{
info "Patching hdf5 1.8.14 for resize configs are equal"
patch -p0 << EOF
*** test/cache_common.h.orig 2014-10-13 04:33:37.000000000 -0700
--- test/cache_common.h 2023-04-11 20:25:27.000000000 -0700
*************** void check_and_validate_cache_size(hid_t
*** 697,702 ****
--- 697,707 ----
int32_t * cur_num_entries_ptr,
hbool_t dump_data);

+ hbool_t
+ resize_configs_are_equal(const H5C_auto_size_ctl_t *a,
+ const H5C_auto_size_ctl_t *b,
+ hbool_t compare_init);
+
void validate_mdc_config(hid_t file_id,
H5AC_cache_config_t * ext_config_ptr,
hbool_t compare_init,
EOF
if [[ $? != 0 ]] ; then
warn "HDF5 1.8.14 resize_configs_are_equal patch failed."
return 1
fi

return 0;
}

function apply_hdf5_patch
{
# Apply a patch for static if we build statically.
Expand All @@ -504,6 +533,11 @@ function apply_hdf5_patch
return 1
fi

apply_hdf5_resize_configs_are_equal_patch
if [[ $? != 0 ]]; then
return 1
fi

return 0
}

Expand Down Expand Up @@ -606,6 +640,7 @@ function build_hdf5

cf_build_parallel=""
cf_par_suffix=""
cf_extra_cflags=""
if [[ "$bt" == "serial" ]]; then
cf_build_parallel="--disable-parallel"
cf_c_compiler="$C_COMPILER"
Expand All @@ -618,14 +653,17 @@ function build_hdf5
cf_build_parallel="--enable-parallel"
cf_par_suffix="_mpi"
cf_c_compiler="$PAR_COMPILER"
if [[ "$OPSYS" == "Darwin" ]]; then
cf_extra_cflags="-Wno-error=implicit-function-declaration"
fi
fi

# In order to ensure $cf_fortranargs is expanded to build the arguments to
# configure, we wrap the invokation in 'sh -c "..."' syntax
info "Invoking command to configure $bt HDF5"
set -x
sh -c "../configure CC=\"$cf_c_compiler\" \
CFLAGS=\"$CFLAGS $C_OPT_FLAGS\" $cf_fortranargs \
CFLAGS=\"$CFLAGS $C_OPT_FLAGS ${cf_extra_cflags}\" $cf_fortranargs \
--prefix=\"$VISITDIR/hdf5${cf_par_suffix}/$HDF5_VERSION/$VISITARCH\" \
${cf_szip} ${cf_zlib} ${cf_build_type} ${cf_build_thread} \
${cf_build_parallel} ${extra_ac_flags} $build_mode"
Expand Down Expand Up @@ -661,8 +699,8 @@ function build_hdf5
fi

if [[ "$DO_GROUP" == "yes" ]] ; then
chmod -R ug+w,a+rX "$VISITDIR/hdf5"
chgrp -R ${GROUP} "$VISITDIR/hdf5"
chmod -R ug+w,a+rX "$VISITDIR/hdf5*"
chgrp -R ${GROUP} "$VISITDIR/hdf5*"
fi

popd
Expand Down
4 changes: 4 additions & 0 deletions src/tools/dev/scripts/bv_support/bv_main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ function initialize_build_visit()
export MACOSX_DEPLOYMENT_TARGET=11.0
export C_COMPILER=${C_COMPILER:-"clang"}
export CXX_COMPILER=${CXX_COMPILER:-"clang++"}
elif [[ ${VER_MAJOR} == 21 ]] ; then
export MACOSX_DEPLOYMENT_TARGET=12.6
export C_COMPILER=${C_COMPILER:-"clang"}
export CXX_COMPILER=${CXX_COMPILER:-"clang++"}
else
export MACOSX_DEPLOYMENT_TARGET=10.14
export C_COMPILER=${C_COMPILER:-"clang"}
Expand Down