Jump to content

How do I use CMake to build files?

Gat Pelsinger

I need to use GMP and MPFR library for C, but looks like I need to compile them using CMake. I couldn't find proper instructions on how to do it, especially on Windows.

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

The GMP and MPFR libraries use GNU Makefiles, not CMake. The thread here might be useful for getting the make command working: https://stackoverflow.com/questions/32127524/how-to-install-and-use-make-in-windows

 

In short, GNU Makefiles isn't native to Windows so you'd need to do some work to get those libraries ready. I think installing Windows Subsystem for Linux would be a good start.

 

Computer engineering grad student, cybersecurity researcher, and hobbyist embedded systems developer

 

Daily Driver:

CPU: Ryzen 7 4800H | GPU: RTX 2060 | RAM: 16GB DDR4 3200MHz C16

 

Gaming PC:

CPU: Ryzen 5 5600X | GPU: EVGA RTX 2080Ti | RAM: 32GB DDR4 3200MHz C16

Link to comment
Share on other sites

Link to post
Share on other sites

@dcgreen2k So, Cmake is a different thing, and it cannot open Makefiles?

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Gat Pelsinger said:

@dcgreen2k So, Cmake is a different thing, and it cannot open Makefiles?

Correct, CMake will not work with regular Makefiles.

Computer engineering grad student, cybersecurity researcher, and hobbyist embedded systems developer

 

Daily Driver:

CPU: Ryzen 7 4800H | GPU: RTX 2060 | RAM: 16GB DDR4 3200MHz C16

 

Gaming PC:

CPU: Ryzen 5 5600X | GPU: EVGA RTX 2080Ti | RAM: 32GB DDR4 3200MHz C16

Link to comment
Share on other sites

Link to post
Share on other sites

@dcgreen2k So, I got make installed, but how do I actually use it to compile my directory?

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Gat Pelsinger said:

@dcgreen2k So, I got make installed, but how do I actually use it to compile my directory?

Inside the parent folder for both of those libraries, there's a text file called INSTALL that shows the commands you need to run. The main commands will be:

./configure
make
make install

 

Computer engineering grad student, cybersecurity researcher, and hobbyist embedded systems developer

 

Daily Driver:

CPU: Ryzen 7 4800H | GPU: RTX 2060 | RAM: 16GB DDR4 3200MHz C16

 

Gaming PC:

CPU: Ryzen 5 5600X | GPU: EVGA RTX 2080Ti | RAM: 32GB DDR4 3200MHz C16

Link to comment
Share on other sites

Link to post
Share on other sites

@dcgreen2k I can't seem to run the commands. First of all, in CMD, the "./" doesn't work and writing only "configure" also does nothing. I tried combinations of these keywords either I get no targets or nothing to be done. If I use powershell, doing "./configure make" just opens the box to choose a program to open the file with, and doing "make ./configure" also says that nothing to be done.

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

@dcgreen2k I am so done with programming on Windows. Programming is the only and THE only field where actually the expected OS is Linux. Pretty much else everywhere there is very little support for Linux, but on programming, programmers flex so hard and dominate Windows users for not having any support and manual for Windows. A few days ago, I was trying to configure Vim, and pretty much everything to it was related to Linux. I found this one little video from a kid that actually seemed to work, and other's were on all Linux, and then I found a custom vimrc file, but installing it was batch file which was entirely coded in a Linux batch language. I messed up my stuff so hard that I rage quit. And now even here. First of all I have slightest clue what Cmake and make and all things are, upon that there is very little and unclear instructions and documentation, and out of all there is, it's all for Linux. You know, other than Grandmas, real people also use Windows, and that also for programming.

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

12 hours ago, Gat Pelsinger said:

@dcgreen2k I am so done with programming on Windows. Programming is the only and THE only field where actually the expected OS is Linux.

Looks like the next step is to start learning how to use Linux then.

 

Jokes aside, there's little native support for C and C++ development on Windows outside of Visual Studio (not VSCode). There's a reason I keep recommending it. Other than that, it might help to learn how to program in a language that's less dependent on your operating system, like Java or Python.

 

My opinion is that, yes, programming is generally much easier on Linux. But it's also highly dependent on what you're trying to do. I work in cybersecurity research and mainly use Python for my job. My entire team uses Linux because it's easier to work with. However, I've also had cases where Windows was easier to use, like when I programmed in Java with a specific software stack and in C# with Unity. Cases like this are one reason "dual booting" is a popular option.

Computer engineering grad student, cybersecurity researcher, and hobbyist embedded systems developer

 

Daily Driver:

CPU: Ryzen 7 4800H | GPU: RTX 2060 | RAM: 16GB DDR4 3200MHz C16

 

Gaming PC:

CPU: Ryzen 5 5600X | GPU: EVGA RTX 2080Ti | RAM: 32GB DDR4 3200MHz C16

Link to comment
Share on other sites

Link to post
Share on other sites

14 hours ago, Gat Pelsinger said:

@dcgreen2k I can't seem to run the commands. First of all, in CMD, the "./" doesn't work and writing only "configure" also does nothing. I tried combinations of these keywords either I get no targets or nothing to be done. If I use powershell, doing "./configure make" just opens the box to choose a program to open the file with, and doing "make ./configure" also says that nothing to be done.

@dcgreen2k

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

15 hours ago, Gat Pelsinger said:

@dcgreen2k I can't seem to run the commands. First of all, in CMD, the "./" doesn't work and writing only "configure" also does nothing. I tried combinations of these keywords either I get no targets or nothing to be done. If I use powershell, doing "./configure make" just opens the box to choose a program to open the file with, and doing "make ./configure" also says that nothing to be done.

They don't work because those are Linux commands. Do you have Windows Subsystem for Linux installed, like I mentioned previously?

Computer engineering grad student, cybersecurity researcher, and hobbyist embedded systems developer

 

Daily Driver:

CPU: Ryzen 7 4800H | GPU: RTX 2060 | RAM: 16GB DDR4 3200MHz C16

 

Gaming PC:

CPU: Ryzen 5 5600X | GPU: EVGA RTX 2080Ti | RAM: 32GB DDR4 3200MHz C16

Link to comment
Share on other sites

Link to post
Share on other sites

@dcgreen2k LINUX COMMANDS? I am literally dying. Just having less support wasn't enough that stuff outright doesn't work in Windows? It's like I accidently entered in an enemy country. When a Linux guy steps in the Windows world, and wants to install something, the instruction might be "the installation is straight forward to make your lives easy! Just go into control panel, change x,y, change these, using this do this and run this and stuff..." and then you realize. oh, I am a Linux user and this ain't gonna work. The guy asks for Linux instructions and just to hear "sorry sir, the program won't work on Linux". This is the same bullying I am getting after getting into programming, where I step into the Linux world as a Windows user accidently. I am so used for everything's instruction being for Windows that when I saw that in programming, there is actually no instructions for Windows, I just thought it's just not possible.

 

It's like those videos which tell you "CHANGE this setting to get a massive fps boost" or "change this setting to make your games look a LOT better" and they proceed to open the Nvidia control panel, and luckily manage to also address AMD, but I am here like, wait I got no Nvidia or AMD control panel? Oh you know why? I am an Intel user(integrated) :(. what abou' me? Sorry sir, this doesn't work on Intel IGPUs.

 

I am not a Windows fanboy at all. No no, go hell with Windows. It's just that making the jump is hard and mostly I had problem with drivers and program compatibility. There is one part where Linux just has no support and that's why it's dead, like in drivers and program support, because it is not worth it to support this by the actual money making companies, where as because of the love of Linux by programmers there is maximum support for Linux in programming field. For any library you want or programming toolkit you want, aside from Windows, there is always going to be a Linux equivalent, and I don't know if I love it or hate it. 

 

39 minutes ago, dcgreen2k said:

They don't work because those are Linux commands. Do you have Windows Subsystem for Linux installed, like I mentioned previously?

I don't have WSL currently installed. And I rather not do it because I am running out of storage. Surely there is a way to install the library in Windows right? Like how is there not a way?

Microsoft owns my soul.

 

Also, Dell is evil, but HP kinda nice.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×