GMP on visual studio c++ - visual-studio

I'm new for the c++ programming. I installed OpenSSL for my visual studio. I would like to install GMP for visual studio. How should I do that? There is no file such as gmp.exe. I dont know how to install this. Any help would be appreciated.

It isn't that hard to install GMP on windows.
First, download the GMP tar file. You have to install cygwin on windows with gcc, make and m4.
You can then run linux command using cygwin. Decompress the tar file, then (RECOMMEND to check out the INSTALL file).
Do ./configure, if you need anything special like running c++ gmp code, you have to add flags.
Do./configure --help to check it out.
Then run make, make check, and finally run make install.
You will have to add the path back to your project properties. Enjoy !

Related

CLion Installation: Cmake compilers not found, GDB not found

I'm switching from VS to CLion and they said I needed to install Cygwin and CMake. I then installed both of them. I tried use bundled, but CLion still gives me these errors make: not found C Compiler: not found C++ Compiler: not found GDB: not found.
I have installed CMake under the path C:\Users\Gaga\Downloads\cmake-3.4.1 but I don't see a cmake.exe, the closest thing is cmake.cxx.
Without these I'm not able to compile anything, please help
In the "Use specified" field I put C:\cygwin64\bin\cmake.exe your path may be different. Just ensure you have CMake, Make, gdb and gcc installed already in Cygwin (using the Cygwin setup.exe not via the CMake website) but I believe Clion checks if you have them installed after inputting the path.
The workaround would be to use MinGW. If you download it from the website it should come with cmake, and take care of the errors.
http://mingw.org/
When extract it and go to the installer you should check something like gcc and then from the top left corner something like 'install packages'
Be sure not to accidentally download the source, which I did, which would lead you toward this error: CLion: CMake Errors Source directory does not exist
Edit: So over a year later, I've learned a little more about Cygwin and mingw beyond what the internet says. CLion needs a "Unix-like" environment. If you use CLion on MacOS or a Linux it's already Unix based. Anything that is "POSIX" compliant will work. CygWin is a terminal emulator for windows where Unix commands like mkdir work. MinGW is something similar but not posix. Comes with GCC tho. I'm still a noob.
I had the same problem.
While installing cygwin, need to select the packages of cmake, gcc, gdb
Got the answer from the below link.
Select Packages while installing cygwin
After the installation go to the configuration page and select the cygwin directory. CLion will identify the configuration and you are done...

Trying to build ruby on visual studio with zlib

I'm trying to build ruby on visual studio with zlib and I'm having problems with it.
I have prepared everything to build it but I don't know how to specify where the zlib library and headers are.
I have the source code in $(ProjectDir)/..
I am buildin in $(ProjectDir)/$(Platform)/$(Configuration)
I build with command line, and I have it like this
mkdir $(Platform)\$(Configuration)
cd $(Platform)\$(Configuration)\
..\..\..\win32\configure.bat --target=i386-mswin32 --prefix=$(ProjectDir)$(Platform)\$(Configuration)\bin
If I go to ext/zlib, I can execute
extconf.rb --with-zlib-lib=$(ProjectDir)..\..\zlib-1.2.8\zlib-1.2.8\$(Platform)\$(Configuration)\lib --with-zlib-include=$(ProjectDir)..\..\zlib-1.2.8
and creates the makefile correcly, but I don't know how to pass zlib lib
and include paths to the configuration script.
I have tried with
..\..\..\win32\configure.bat --target=i386-mswin32 --prefix=$(ProjectDir)$(Platform)\$(Configuration)\bin --with-zlib-lib=$(ProjectDir)..\..\zlib-1.2.8\zlib-1.2.8\$(Platform)\$(Configuration)\lib --with-zlib-include=$(ProjectDir)..\..\zlib-1.2.8
but that doesn't works
I suppose it has something to do with the '--with-ext="a,b,..."' option or with the "--path" that is specified in the help command, but I don't know how to specify it and the documentation is really bad.
I would be very gratefull if you could help me.
The instructions below are for Ruby 2.2.5 – if you want to build some other version or use different folder paths, change accordingly. I used these to successfully build Ruby 2.2.5 and 2.3.1 from source with zlib using VS2013 Community Update 5 on Windows 8.1 Pro x64.
Create folders:
C:\ruby-2.2.5\build
C:\ruby-2.2.5\src
Untar ruby-2.2.5.tar.gz and put the sources in C:\ruby-2.2.5\src
Unzip the zlib distribution archive (zlib128-dll.zip) into C:\zlib128-dll
Run Developer Command Prompt for VS2013, then run:
SET INCLUDE=%INCLUDE%;C:\zlib128-dll\include
SET LIB=%LIB%;C:\zlib128-dll\lib
SET PATH=%PATH%;C:\zlib128-dll
cd C:\ruby-2.2.5\build
..\src\win32\configure.bat
nmake
nmake DESTDIR=C:/ruby-2.2.5 install
Done. You should now have a fully working, zlib-enabled, Ruby build in C:\ruby-2.2.5\usr.

How to install cabal packages with extra libraries under Windows?

I'm trying to install monadiccp with the "RuntimeGecode" flag so that it includes the Gecode libraries:
cabal install monadiccp --flags="RuntimeGecode Debug" --extra-lib-dirs="D:\Programme\Gecode\lib;d:\programme\Gecode\bin" --extra-include-dirs=D:\Programme\Gecode\include\
But that doesn't work, it fails with:
ld.exe: cannot find -lgecodesupport
ld.exe: cannot find -lgecodeset
And so on... See the -v3 log output.
What am I doing wrong? The libraries don't seem any special, so are there some extra steps I need to do in Windows?
Update: The binaries downloadable from gecode.org are compiled with Visual Studio and aren't compatible with gcc (see this answer for the root problem). As suggested by Stephen, I'll try to build Gecode with MinGW/MSYS from source now.

use MinGW to create exe file in windows from GNU source package

the basic idea was, I wanted to generate the call graph in text format for several c files. After googling around for long time, i found cflow, which can deliver everything I want, but it is only runable in Linux or else. Then I began to search how to compile the cflow source files on the web to a exe file. I found MinGW which should be able to do the cross-platform compilation.
After installing the MinGW and the MSYS and running the usual commands "./configure; make; make install", I simply got an error that "mkdir" was not found. Actually. Actually I was wondering whether this is the correct way to compile the whole package.
Does anyone has an idea how I can build the cflow.exe correctly in Windows? If there is a tutorial or something like this, I will be very thankful.
Song
Solution
Please try this Github repository "MinGW + MSYS build of GNU cflow 1.4" (For Windows).
https://github.com/noahp/cflow-mingw
It contains already compiled "cflow.exe",and an instruction about how to build cflow using mingw and msys.
Test
System Environment:Win 8.1 (x64)
1.I tested the "cflow.exe" downloaded from the github repository , and amazingly it worked!
2.I followed the mingw compiling instruction,and it successfully compiled "cflow 1.5".
Command:
bash configure
make
I was able to do that today. I'm using cygwin, after installing gcc, binutils, make and after downloading the gnu cflow.tar.gz, it was as easy as ./configure ; make ; make install.

How can I setup linux to compile FORTRAN code into windows binaries?

I'm working on a FORTRAN project and I would like to build all of the binaries that I want to maintain on a linux machine that is dedicated for automated builds. I have successfully used mingw to build 32-bit and 64-bit binaries from C source for windows machines on the linux machine with the following packages on Ubuntu.
apt-get install mingw32
apt-get install mingw-w64
Then I run the following commands to actually compile:
gcc -b amd64-mingw32msvc -V 4.4.4 -o <...other options>
However, the mingw packages that I've obtained via apt-get do not include FORTRAN compilers.
Anybody got any ideas on what I can do?
if you got mingw32 and the Gnu C cross compiler is working for you ... when why not just get the Gnu Fortran cross compiler, too?
http://www.nber.org/sys-admin/mingw32-fortran-fedora.html
EXAMPLE apt-get install mingw32-gcc-fortran
I know this is an old thread but a few things seem to have changed and people might still be interested in the topic.
Problem: I want to use my linux machine to compile some code and create a .exe that I can send to people using Windows.
Solution: Essentially here: http ://mxe.cc/
What I did:
Check to see if your system has all the software you need here
run
git clone -b stable https://github.com/mxe/mxe.git
It will download a few small things and create the directory "mxe" (probably in your home folder)
cd into that mxe directory and run "make". HOWEVER: this would take hours and take up a few GB on your hard drive so instead run something like
make mpfr eigen opencsg cgal qt
For more ideas on how to shorten that all see this or the mxe tutorial or somewhere else ;)
The easiest way to compile stuff then seems to be something like:
~/mxe/usr/bin/i686-pc-mingw32-gfortran -c main.f95
~/mxe/usr/bin/i686-pc-mingw32-gfortran main.o -o outfile.exe
Of course you can chose something other than fortran, just consult the mxe/usr/bin to see what its called.
You can always download and install a prebuilt compiler from the MinGW(-w64) project itself:
Windows 64-bit: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/4.6.2-1/
Windows 32-bit: http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/rubenvb/4.6.2-1/
Just unpack somewhere and add the cross*/bin directory to PATH.
I include (obj)c(++) and fortran.
On Ubuntu 18.04 I use
apt install gfortran-mingw-w64
Then use the compiler x86_64-w64-mingw32-gfortran in place of gfortran. If you're using cmake, you can configure the compiler from the build directory like so:
FC=x86_64-w64-mingw32-gfortran cmake ..

Resources