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

GA replaces random() unconditionally #47

Open
jeffdaily opened this issue May 2, 2017 · 2 comments
Open

GA replaces random() unconditionally #47

jeffdaily opened this issue May 2, 2017 · 2 comments
Assignees

Comments

@jeffdaily
Copy link
Member

In Makefile.am, we see

##############################################################################
# compat
#
# Although the compat directory houses replacements for missing or erroneous
# standard C functions and such sources are conditionally compiled based on
# results from configure tests, without the "random" implementation the
# m4-generated tests always fail for scatter and copy_patch.
libga_la_SOURCES += compat/random.c

First of all, I have no idea if we even still need to use the autotool functionality of LIBOBJS. See https://www.gnu.org/software/automake/manual/html_node/LIBOBJS.html for details.

The main issue here is that random.c is unconditionally compiled. Worse yet, it appears that if we don't override the system random() and srandom() we somehow break some tests. Our compat/random.c appears to be a permissively-licensed copy of BSD's random() from 1983...?

@edoapra, would it be possible to evaluate how this replacing of system provided random() affects NWChem? I would love to remove from GA such strange hacks. A related issue is that GA provides a "drand" implementation for fortran, unconditionally. So this would replace perhaps any drand() functions provided by ifort, for example. Our drand() is a wrapper around the C random() -- the same random() we already replace...

@edoapra
Copy link
Contributor

edoapra commented May 2, 2017

Jeff,
Even though drand() is still used in a few places in NWChem, I do not see any reason for keeping it around in GA land. We have already a wrapper for C random() that can be used

@edoapra
Copy link
Contributor

edoapra commented May 2, 2017

I have just removed any mention of drand() from the NWChem dev repository

@jeffhammond jeffhammond self-assigned this Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants