From 9520b6d253fedd04cb900c3c5853a313559ee158 Mon Sep 17 00:00:00 2001 From: Sam Hatchett Date: Wed, 6 Jun 2018 18:14:36 -0500 Subject: [PATCH 1/6] fixes cmake for mac, adds define option for building tests --- CMakeLists.txt | 53 +++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 808b836..59e1356 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,27 +1,26 @@ -# CMakeLists.txt - CMake configuration file for EPANET 2.0 -# -# CMake is a cross-platform build tool. CMake generates platform native -# makefiles that can be used with your compiler of choice. CMake uses a -# generator concept to represent different build tooling. CMake automatically +# CMakeLists.txt - CMake configuration file for EPANET 2.0 +# +# CMake is a cross-platform build tool. CMake generates platform native +# makefiles that can be used with your compiler of choice. CMake uses a +# generator concept to represent different build tooling. CMake automatically # detects the platform it is running on and generates the appropriate makefiles -# for the platform default compiler. Different generators can also be specified. -# -# Note: CMake requires that your platform build system and compiler are -# properly installed. Build using Visual Studio requires msbuild shell. -# -# Example Usage: -# cd build/cmake +# for the platform default compiler. Different generators can also be specified. +# +# Note: CMake requires that your platform build system and compiler are +# properly installed. Build using Visual Studio requires msbuild shell. +# +# Example Usage: # mkdir buildproducts # cd buildproducts # cmake .. -# make -# +# make +# # Building MSYS on Windows: # ... # cmake -G "MSYS Makefiles" .. -# make -# -# Building Visual Studio on Windows: +# make +# +# Building Visual Studio on Windows: # ... # cmake -G "Visual Studio 10 2010" .. # msbuild /p:Configuration=Release ALL_BUILD.vcxproj @@ -29,23 +28,25 @@ # Generic Invocation: # cmake -E make_directory buildprod # cd build -# cmake -G GENERATOR -DCMAKE_BUILD_TYPE=Release .. +# cmake -G GENERATOR -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=1 .. # cmake --build . --target SOME_TARGET --config Release # # More information: # cmake --help -# +# # CMake is available at https://cmake.org/download/ -# +# cmake_minimum_required (VERSION 2.8.8) project(EPANET) add_subdirectory(tools/epanet-output) -add_subdirectory(tests) +IF (BUILD_TESTS) + add_subdirectory(tests) +ENDIF (BUILD_TESTS) -# Sets for output directory for executables and libraries. +# Sets for output directory for executables and libraries. set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) @@ -55,8 +56,8 @@ SET(CMAKE_POSITION_INDEPENDENT_CODE ON) IF (APPLE) - SET(CMAKE_INSTALL_NAME_DIR @executable_path) - SET(CMAKE_BUILD_WITH_INSTALL_RPATH ON) +SET(INSTALL_NAME_DIR @executable_path/../lib) +SET(CMAKE_MACOSX_RPATH 1) ENDIF (APPLE) IF (MSVC) @@ -89,8 +90,8 @@ target_include_directories(epanet PUBLIC ${PROJECT_SOURCE_DIR}/include) # EXPORT_MACRO_NAME DLLEXPORT # EXPORT_FILE_NAME epanet_export.h # STATIC_DEFINE SHARED_EXPORTS_BUILT_AS_STATIC) -# -#file(COPY ${CMAKE_CURRENT_BINARY_DIR}/epanet_export.h +# +#file(COPY ${CMAKE_CURRENT_BINARY_DIR}/epanet_export.h # DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/include) From 12d3005bd2eac775ba47f501cb1100534c1dab48 Mon Sep 17 00:00:00 2001 From: Sam Hatchett Date: Thu, 7 Jun 2018 12:03:49 -0500 Subject: [PATCH 2/6] Make it more obvious where to ask questions (#191) --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4a697d0..dd6f5d7 100755 --- a/README.md +++ b/README.md @@ -5,9 +5,11 @@ EPANET {#epanet-readme} [![Build status](https://ci.appveyor.com/api/projects/status/19wpg4g2cmj3oihl?svg=true)](https://ci.appveyor.com/project/OpenWaterAnalytics/epanet) [![Build Status](https://travis-ci.org/OpenWaterAnalytics/EPANET.svg?branch=master)](https://travis-ci.org/OpenWaterAnalytics/EPANET) -The EPANET Library is a pressurized pipe network hydraulic and water quality analysis toolkit written in C. +## For EPANET-related questions and discussion +For community discussion, FAQ, and roadmapping of the project, go to the [Community Forum](http://community.wateranalytics.org/category/epanet). -If you are interested in using/extending EPANET for academic, personal, or commercial use, then you've come to the right place. For community discussion, FAQ, and roadmapping of the project, go to the [Community Forum](http://community.wateranalytics.org/category/epanet). +## What is on this Repository? +The EPANET Library is a pressurized pipe network hydraulic and water quality analysis toolkit written in C. If you are interested in using/extending EPANET for academic, personal, or commercial use, then you've come to the right place. Please see the [`version 2.1` Release Notes](https://github.com/OpenWaterAnalytics/EPANET/blob/master/ReleaseNotes2_1.md) for information relevant to users of the previous official version (2.00.12). If you would like to contribute by addressing any of the outstanding [Issues](https://github.com/OpenWaterAnalytics/EPANET/issues), then please comment on the Issue, then Fork this repo to your own account and base your commits on the [`dev` branch](https://github.com/OpenWaterAnalytics/EPANET/tree/dev). Once you are finished, you can open a Pull Request to test the code and discuss merging your changes back into the community respository. @@ -15,4 +17,4 @@ A step-by-step tutorial on how to contribute to EPANET using GitHub is also [ava __Note:__ This repository is not affiliated with, or endorsed by, the USEPA. For the last "official" release of EPANET (2.00.12 UI and Toolkit) please go to the [EPA's GitHub repo](https://github.com/USEPA/Water-Distribution-Network-Model) or [the USEPA website](http://www2.epa.gov/water-research/epanet). It is also not the graphical user interface version. This is the hydraulic and water quality solver engine. -However, if you are interested in extending EPANET for academic, personal, or commercial use, then you've come to the right place. For community discussion, FAQ, and roadmapping of the project, go to the [Community Forum](http://community.wateranalytics.org/category/epanet). \ No newline at end of file +However, if you are interested in extending EPANET for academic, personal, or commercial use, then you've come to the right place. For community discussion, FAQ, and roadmapping of the project, go to the [Community Forum](http://community.wateranalytics.org/category/epanet). From 21b7a8ab47ee4efd6863224fd8ae43d54fd4ead1 Mon Sep 17 00:00:00 2001 From: Michael Tryby Date: Fri, 8 Jun 2018 17:08:37 -0400 Subject: [PATCH 3/6] Adding cmake variable BUILD_TESTS to Appveyor and Travis --- .travis.yml | 2 +- appveyor.yml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3d61f2..3cf3c7f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ before_install: before_script: - mkdir -p $BUILD_HOME - cd $BUILD_HOME - - cmake .. + - cmake -DBUILD_TESTS=1 .. script: - cmake --build . diff --git a/appveyor.yml b/appveyor.yml index b2e1dad..e831634 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,7 +20,6 @@ init: - set NRTEST_SCRIPT=C:\Python27\Scripts - set GENERATOR="Visual Studio 10 2010" - set BOOST_ROOT="C:\\Libraries\\boost" - - set BOOST_LIB="C:\\Libraries\\boost\\lib32-msvc-12.0" # called after repo clone install: @@ -31,8 +30,8 @@ before_build: - mkdir %BUILD_HOME% - cd %BUILD_HOME% - cmake -G %GENERATOR% + -DBUILD_TESTS=1 -DBOOST_ROOT="%BOOST_ROOT%" - -DBOOST_LIBRARYDIR="%BOOST_LIB%" -DBoost_USE_STATIC_LIBS="ON" .. # run custom build script From 9ad5c2ce9bf38695a1fdf57cac6cbfe66bb7b20d Mon Sep 17 00:00:00 2001 From: Michael Tryby Date: Fri, 15 Jun 2018 10:27:52 -0400 Subject: [PATCH 4/6] Fixing bug in appyeyor config --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 9c89a72..2fac290 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -47,7 +47,7 @@ install: before_build: - mkdir %BUILD_HOME% - cd %BUILD_HOME% - - cmake -G %GENERATOR% + - cmake -G "%GENERATOR%" -DBUILD_TESTS=1 -DBOOST_ROOT="%BOOST_ROOT%" -DBoost_USE_STATIC_LIBS="ON" .. From d374e7bf1ab5784eba5501287b62e9b89674d4e0 Mon Sep 17 00:00:00 2001 From: Michael Tryby Date: Fri, 15 Jun 2018 10:41:52 -0400 Subject: [PATCH 5/6] Changing MAXFNAME from 260 back to 259 --- src/types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.h b/src/types.h index 927eac9..a3aa962 100755 --- a/src/types.h +++ b/src/types.h @@ -49,7 +49,7 @@ typedef int INT4; #define MAXID 31 /* Max. # characters in ID name */ #define MAXMSG 79 /* Max. # characters in message text */ #define MAXLINE 255 /* Max. # characters read from input line */ -#define MAXFNAME 260 /* Max. # characters in file name */ +#define MAXFNAME 259 /* Max. # characters in file name */ #define MAXTOKS 40 /* Max. items per line of input */ #define TZERO 1.E-4 /* Zero time tolerance */ #define TRUE 1 From f11308fc72eccc8b74b18d5ddab0eb2ae0d36587 Mon Sep 17 00:00:00 2001 From: Michael Tryby Date: Fri, 15 Jun 2018 10:50:37 -0400 Subject: [PATCH 6/6] Switching Visual Studio 2017 build to 32 bit --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 2fac290..d9ef393 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -23,7 +23,7 @@ environment: BOOST_ROOT: "C:/Libraries/boost" # New build on Visual Studio 15 2017 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - GENERATOR: "Visual Studio 15 2017 Win64" + GENERATOR: "Visual Studio 15 2017" GROUP: "EXPERIMENTAL" BOOST_ROOT: "C:/Libraries/boost_1_67_0"