How to install SWIG?

Noob question ahead ...

I am trying to install SWIG on Windows. According to the INSTALL document, I have to

cd into the directory containing the package source code and type ./configure to configure the package for your system.

I tried the command both in the root directory and in the /CCache (these are the only ones that have configure and configure.in files), however, the shell reports that

C:\swigwin-2.0.4>./configure
'.' is not recognized as an internal or external command,
operable program or batch file.

What am I missing?

+7
source share
3 answers

The page http://www.swig.org/download.html has a specific download for Windows with a pre-created version of swig.exe. You can download it and avoid problems with compiling swig yourself.

If you really need to, you can consult the Doc / Manual / Windows.html file, which contains instructions for Windows to create SWIG.

Finally, to answer your specific question, syntax

 ./configure 

is a UNIX-style command that means "run a program named configure in the current directory" (period)

On Windows you must enter

 .\configure 

or even simpler, since all files are executed on Windows, only

 configure 

... BUT this will not work, since the specified "configure" script is a bash script that will not be run in the Windows shell.

+6
source

no installation required. you just need to set the environment variable to point to the "swig" executable, which is located under the swig root directory

On the SWIG website you can download, for example, the zip swigwin-2.0.7 directory for Windows swig. unzip it to a directory of your choice, for example, in the "C:\Program Files" directory, if you want. After that, you have the swig executable in the directory "C:\Program Files\swigwin-2.0.7" : "C\Program Files\swigwin-2.0.7\swig" you should now set the environment variable "path" to indicate to this swig exec: add the path "C: \ Program Files \ swigwin-2.0.7" to the variable "path" for this, according to my example; that’s all you need to use swig on windows. Now you can play with swig like this, open the "cmd" prompt and just type "swig --help" at this prompt, you will see a list of options that you can use with swig. If you have visual C ++, you can use, for example, codeblock, this is my case, so the link below can help you: http://wiki.codeblocks.org/index.phptitle=Adding_support_for_non_C/C%2B%2B_files_to_the_build_system

+30
source

Download Miniconda .

Then follow this guide and run: conda install -c anaconda swig

0
source

All Articles