mirror of
https://git.savannah.gnu.org/git/make.git
synced 2024-11-24 12:19:02 +00:00
No description
9251546bac
Artem Klimov noticed that current shuffle implementation suffers from probability bias due to a typical bug in the shuffling implementation. When we consider already shuffled element we slightly bias their propability. https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm suggests shuffling each "struck" element only once. Before the change probabilities of 4-element array to land from `i` index to `j` index are: 0 1 2 3 _____ _____ _____ _____ 0 | 25.00 29.30 24.60 21.10 1 | 25.00 22.25 28.13 24.63 2 | 25.00 23.44 22.26 29.30 3 | 25.00 25.01 25.01 24.98 Note that `0->1` probability is almost 29% while `0->3` os only 21%. After the change probabilities are not as biased: 0 1 2 3 _____ _____ _____ _____ 0 | 24.99 24.99 25.01 25.01 1 | 24.99 25.04 24.99 24.99 2 | 25.01 25.00 25.00 24.99 3 | 25.01 24.98 25.00 25.01 * src/shuffle.c (random_shuffle_array): Fix biased shuffle by avoiding already "struck" elements. |
||
---|---|---|
doc | ||
gl | ||
mk | ||
po | ||
scripts | ||
src | ||
tests | ||
.ccls | ||
.clangd | ||
.dir-locals.el | ||
.gitignore | ||
AUTHORS | ||
autogen.sh | ||
autopull.sh | ||
Basic.mk.template | ||
bootstrap | ||
bootstrap-funclib.sh | ||
bootstrap.bat | ||
bootstrap.conf | ||
build.cfg.in | ||
build.sh | ||
build_w32.bat | ||
builddos.bat | ||
ChangeLog.1 | ||
ChangeLog.2 | ||
ChangeLog.3 | ||
configure.ac | ||
COPYING | ||
maintMakefile | ||
make-gdb.py | ||
Makefile.am | ||
makefile.com | ||
NEWS | ||
prepare_vms.com | ||
README.customs | ||
README.DOS | ||
README.git | ||
README.in | ||
README.OS2 | ||
README.VMS | ||
README.W32 | ||
README.zOS | ||
TODO.private | ||
vms_export_symbol_test.com |
-*-text-*- GNU Make has been ported to z/OS, tested on z/OS V2R4. PREREQUISITES ------------- Building GNU Make requires certain tools be installed on your z/OS system. These tools can be downloaded from: https://github.com/ZOSOpenTools For detailed instructions on how to set up these tools, visit https://zosopentools.github.io/meta/#/Guides/Pre-req You will need curl, tar, and gzip to download and unpack the GNU Make release package, but presumably you've already worked this out if you're reading this document! You will need the IBM C/C++ compiler. You can download a web deliverable add-on feature to your XL C/C++ compiler here: https://www-40.ibm.com/servers/resourcelink/svc00100.nsf/pages/xlCC++V241ForZOsV24 Alternatively, you can install and manage C/C++ for Open Enterprise Languages on z/OS using RedHat OpenShift Container Platform and IBM Z and Cloud Modernization Stack. GNU Make has a dependency on the ZOSLIB library, which is documented here: https://zosopentools.github.io/meta/#/Guides/Zoslib. To obtain the latest release of zoslib, you can download it from here: https://github.com/ZOSOpenTools/zoslibport/releases. BUILDING -------- If you are trying to build from a checked-out Git workspace, see README.git. Before building GNU Make, you will need to ensure that the following environment variables are set, to turn on z/OS enhanced ASCII support: export _BPXK_AUTOCVT=ON export _CEE_RUNOPTS="$_CEE_RUNOPTS FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)" export _TAG_REDIR_ERR=txt export _TAG_REDIR_IN=txt export _TAG_REDIR_OUT=txt To ensure proper functioning of xlclang, set the following environment variables before building: export _CC_CCMODE=1 export _C89_CCMODE=1 export _CXX_CCMODE=1 Set PATH_TO_ZOSLIB to the location of your zoslib installation; e.g.: PATH_TO_ZOSLIB=$HOME/zopen/prod/zoslib Invoke ./configure as follows: ./configure \ CC=xlclang \ CPPFLAGS="-DNSIG=42 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE -D_OPEN_SYS_FILE_EXT=1 -D_AE_BIMODAL=1 -D_ENHANCED_ASCII_EXT=0xFFFFFFF -DZOSLIB_OVERRIDE_CLIB=1" \ CFLAGS="-qascii -std=gnu11 -qnocsect -qenum=int -I$PATH_TO_ZOSLIB/include" \ LDFLAGS="-L$PATH_TO_ZOSLIB/lib" \ LIBS="-lzoslib $PATH_TO_ZOSLIB/lib/CXXRT64.x" If you have an instance of make already available you can build with: make If not, you can build with: ./build.sh TESTING ------- To run the regression tests you'll need to install Perl and enable it. Then you can run: ./make check INSTALLING ---------- Copy the "make" program to wherever you want it to be installed, on your PATH.