gmake error

I am currently in the middle of installing CMake and after doing so, I have to run the “gmake” command. When I do that, here is where it stops and I don’t know what to do now.

    [90%] Linking CXX executable ../bin/ctest
        ../Utilities/cmexpat/libcmexpat.a( In function 'startParsing':
        collect2: error: ld returned 1 exit status
        gmake[2]: *** [bin/ctest] Error 1
        gmake[1]: *** [Source/CMakeFiles/ctest.dir/all] Error 2
        gmaike: *** [all] Error 2       

I contacted CMake techs and they asked me to find the error log and give them the information from there. The problem is is that I don’t know where the error log is located. I also work in a secure network so I cannot simply copy a whole log file and paste it for them to see or even here.
I have to type it all out.
What I need help is figuring out how to get that 90% to 100% install.
If you need more info, tell me exactly where I can find the error log and what you are looking for in there so I’m not typing everything from it.

That is odd, are you sure you are not leaving any of the output out of that? Looks like it is starting to print out an undefined symbol. If you run gmake again what is the output?

I’ve ran the gmake command like 3 times already and it always stops at 90% with the same output that I have put in the beginning of the original post.
Is there somewhere else that I need to be looking at to give you a better output?
If so, where should I go?

You could try gmake VERBOSE=1

So it does error out in the same spot at 90% but I am getting more output.
[90%] Linking CXX executable …/bin/ctest
cd /directory/cmake-3.25.3/Sourse && /directory/cmake-3.25.3/Bootstrap.cmk/ cmake -E cmake_link_script CMakeFiles/ctest.dir/link.txt --verbose=1
/usr/bin/g++ -03 -DNDEBUG CMakeFiles/ctest.dir/ctest.cxx.o -o …/bin/ctest libCTestLib.a libCMakeLib.a …/Utilities/std/libcmstd.a kwsys/libcmsys.a …/Utilities/cmcurl/lib/libcmcurl.a …/Utilities/cmnghttp2/libcmnghttp2.a …/Utilities/cmexpat/libcmexpat.a …/Utilities/cmjsoncpp/libcmjsoncpp.a …/Utilities/cmlibarchive/libarchive/libcmlibarchive.a -lssl -lcrypto …/Utilities/cmbip2/libcmbzip2.a …/Utilities/cmliblzma/libcmliblzma.a …/Utilities/cmzstd/libcmzstd.a …/Utilities/cmlibrhash/libcmlibrhash.a …/Utilities/cmlibuv/libcmlibuv.a -ldl -lrt -lpthread …/Utillities/cmzlib/libcmzlib.a
…/Utilities/cmexpat/libcmexpat.a(xmlparse.c.o: In fucntion ‘startParsing’:
xmlparse.c:(text+0x1d0b): undefined reference to ‘getrandom’
collect2: error: ld returned 1 exit status
gmake[2]: *** [bin/ctest’ Error 1
gmake[2]: Leaving directory ‘/directory/cmake-3.25.3’
gmake[1]: *** [Source /CMakeFiles/ctest.dir/all] Error 2
gmake[1]: Leaving directory ‘/directory/cmake-3.25.3’
gmake: *** [all] Error 2

Please excuse any typos. I have to type all this out from another server. Copy and paste won’t work on this network for security reasons.

what do you think?

Looks like something went wrong here:
The check for getrandom said you had it, but at link time it was not there.
Look in the CMakeFiles directory for mention of getrandom and try to figure out what went wrong.

I took at look at the file but I don’t really know what I’m looking at to see what is wrong.
There are multiple files in the CMakeFiles directory and not really seeing a mention of random.h or getrandom. I am still going through the rest of the dirs in the CMakeFiles. It’s just taking time.
I’m trying to see where these files are really located and I can edit the line.
I think that I might have found something but I’ll have to leave it for tomorrow.

This looks to be a bootstrap build. Could be something related to that. What platform is this?

I am installing this on a RHEL7.9 workstation. Not sure if this is the question you are asking when it comes to the platform.
I am still looking at all the CMakeFiles to see where I can find a mention of getrandom. I did make a change way back when it had stopped at less than 20%.
I went into /Utilities/cmexpat/lib/xlmparse.c
I edited the line that had getrandom to find at /usr/include/linux/random.h
Things started to continue on working till it got to 90%. I don’t know where to find the next getrandom but I figure it will be the same where I can point it to go to the same /usr/ directory.

So this is what I have tried.
Under /Utilities/cmexpat/ConfigureChecks.make
I found a line there that mentions “getrandom”.
I edited the line to “/usr/include/linux/random.h”
That didn’t work.
I have been looking at all the files to see if there is an instance of “getrandom” or “random.h”.
Does anyone happen to know where I can find that on all the files?
I don’t know where "/Utilities/cmexpat/libcmexpat.a(xmlparse.c.o) is pointing to.

It may be easier to use a system expat. I still don’t have a clear understanding of what you’re trying as I don’t see complete instructions from scratch to a full error output (e.g., I don’t know from what state your last comment started from).

Here are the steps I took to start installing cmake and the errors I got in between and what did to fix those errors.

  1. ./bootstrap
  2. Installation completed. It then states to run gmake.
  3. At 23%, I get a fatal error:
    Building C object Utilities/cmexpat/CMakeFiles/cmexpat.dir/lib/xmlparse.c.o
    /directory/Utilities/cmexpat/lib/ fatal error: sys/random.h: No such file or directory
    #include <sys/random.h> /* getrandom */
  4. vi Utilities/cmexpat/CMakeFiles/cmexpat.dir/lib/xmlparse.c.o
  5. Line 103,15, I changed it from <sys/random.h> to </usr/include/linux/random.h>
  6. Reran gmake
  7. I had to install ncurses-devel because it failed. I forget what percentage.
  8. Reran gmake
  9. At 90%, I get the error that is on the original post that I put up.

I ran the command that a tech, Libby Rose, suggested to me. export PATH=$PATH:/usr/include/linux/
This did not work either.

This is where I am now stuck and don’t know what to do to continue.

Thanks for the details. Would the CentOS 7.9 container be sufficient for testing this locally?

I don’t know. I guess. Is that something you are going to try or you want me to try out?
Like I said, we’re on RHEL7.9. That’s where I’m installing it on.

Wasn’t CentOS 7.9 release with Kernel 3.10 and glibc 2.17 (that’s what I googled)?
getrandom was introduced as syscall in kernel 3.17 as mentioned in SO. And the C function in glibc 2.25.

In an untouched CentOS, CMake should detect that the function is missing and disables its usage.

In your case the function was detected in the header. So I guess you have somehow installed newer headers, but not correctly installed the corresponding libraries.

A workaround could be probably, to set the cache var HAVE_GETRANDOM explicitly to 0.

It might really sound like I know what I’m doing but I don’t. I’m guessing most of what I’m doing.
I have no idea where I need to go to change “HAVE_GETRANDOM” to 0.
You mention the header stuff. I have no idea what I’m supposed to install to get a new header.
I am literally guessing when installing cmake.

@jtxa is saying that CentOS7.9 should not have getrandom at all. Where did you get headers that claim it?

There was a previous version of cmake already installed on the system I’m trying to install the new one. That could be it.
I tried to uninstall the old one and tried to run the ./bootstrap install from the new one.
I have tried differ variations of the install, and I keep on getting to the same error at 90%.
I don’t know if I did it wrong or right with removing the old one. Before, I had just left the old one on there and still got the 90% error.
After removing the old version of cmake, I am still in the same part.
Please let me know where to go from here.

Can I just get instructions on removing/uninstalling everything cmake so I can do a fresh install?
I don’t see a script to uninstall. Can you help?