Skip to content

Compiling inptools on Windows #19

Description

@xavierpena

Disclaimer: it's the first time I try to compile a code in c.

I am doing a lot of research, but I am failing at some step of the process.

Those are the steps I am following:

Step 1: configuring MinGW

Step 1.1: download MinGW
Step 1.2: open "MinGW Installation Manager" and download all from "Basic Setup"
Step 1.3: add "C:\MinGW\bin" to %PATH%

Step 2: downloading the source code

Step 2.1: git pull the inptools source code.
Step 2.2: git pull the EPANET patched toolkit source code.
Step 2.3: download the shapelib source code.

Step 3: compiling the source code

Step 3.1: cd path/to/inptools/src
Step 3.2: mingw32-make.exe -f Makefile.am datadir=../data EPANET_SRC=../../epanet2/src SHAPELIB_SRC=../../shapelib-1.4.1


ERROR:

C:\path\to\inptools-2.0.12.1\src>mingw32-make.exe datadir=../data EPANET_SRC=../../epanet2/src SHAPELIB_SRC=..
/../shapelib-1.4.1 -f Makefile.am
indent epanet2csv.c inpproj.c inp2shp.c shp2inp.c epanet2csvw.cpp inp2shpw.cpp inptools-about.c inptools-file-dialog.cpp
				 -kr -i8
process_begin: CreateProcess(NULL, indent epanet2csv.c inpproj.c inp2shp.c shp2inp.c epanet2csvw.cpp inp2shpw.cpp inptoo
ls-about.c inptools-file-dialog.cpp -kr -i8, ...) failed.
make (e=2): The system cannot find the file specified.
Makefile.am:52: recipe for target 'indent' failed
mingw32-make.exe: *** [indent] Error 2

OTHER INFOS:

From the inptools documentation, section "Development"

Most of the source code is plain C and should compile with virtually any C compiler.

Users on Linux or with a Linux-like build system should be able to use the standard

	./configure
	make
	make install
	in order to build and install.

The epanet2csv command does not have any external depencendies.

The inp2shp command depends on the EPANET toolkit and shapelib libraries. Please add the respective header files to your include path and link against the libraries

The inpproj command depends on the EPANET toolkit and PROJ.4 libraries. Please add the respective header files to your include path and link against the libraries.

The C++ code can be compiled using MinGW.

From the README, section "Compilation":

inp2shp and inpproj require a patched version of the EPANET Toolkit.
You can find such a patched version under https://github.com/sdteffen/epanet2
One option to compile on Windows: Build the commandline tools using MinGW.
The second option is to cross-compile on Linux, using the mingw32 package. 
You'll find Makefile targets for the individual executables in the Makefile 
generated by Automake. Instead of installing libepanet2 and libshp, you should
use the configure options --with-epanet-src and --with-shapelib-src to 
specify the location of the sources in that case. 

<= I am confused about where I can use those --with-epanet-src and --with-shapelib-src parameters.

As I wrote before, my approach was using this in the \src directory: mingw32-make.exe -f Makefile.am datadir=../data EPANET_SRC=../../epanet2/src SHAPELIB_SRC=../../shapelib-1.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions