Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checks: Use of INFINITY and NAN instead of divisions #2681

Merged
merged 2 commits into from
Jan 16, 2023

Conversation

neteler
Copy link
Member

@neteler neteler commented Dec 3, 2022

  • use of INFINITY (1/0 = INFINITY) rather than only division by zero (this is supported by gcc and other compilers but not on Windows)
  • use of NAN (0/0 = NAN) rather than only division by zero

Extracted from WIP PR #289

TODO: not sure about the changes in "raster/r.in.lidar/point_binning.c", taken from #289

In preparation for CMake support.

@neteler neteler added the Windows Microsoft Windows specific label Dec 3, 2022
@neteler neteler added this to the 8.3.0 milestone Dec 3, 2022
@neteler neteler requested review from nilason and metzm December 3, 2022 15:10
@neteler
Copy link
Member Author

neteler commented Dec 3, 2022

not sure about the changes in "raster/r.in.lidar/point_binning.c", taken from #289

CI fails here:

 gcc  -std=gnu99 -fPIC -Wall -Wno-error=maybe-uninitialized -Werror  -I/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/include -I/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/include    -DPACKAGE=\""grasslibs"\"   -I/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/include -I/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/include -DRELDIR=\"lib/raster3d\" -o OBJ.x86_64-pc-linux-gnu/mask.o -c mask.c
mask.c: In function ‘Rast3d_mask_tile’:
mask.c:317:20: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  317 |             tile = (int*) + xLength;
      |                    ^
mask.c:319:16: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
  319 |         tile = (int*) + yLength;
      |                ^
cc1: all warnings being treated as errors
make[3]: *** [../../include/Make/Compile.make:32: OBJ.x86_64-pc-linux-gnu/mask.o] Error 1

Copy link
Contributor

@nilason nilason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a welcome change, adding INFINITY and NAN (both being C99 feats)!

As I see it the changes to the two files:

raster/r.in.lidar/point_binning.c

lib/raster3d/mask.c

are not related to INFINITY nor NAN.

coming from commits named void* arithmetic (GCC extension) is not allowed in msvc:
rkanavath@54116bb
rkanavath@ba30799

They can therefore be dropped from this PR.

lib/gmath/la.c Outdated Show resolved Hide resolved
@neteler neteler requested a review from nilason December 3, 2022 17:28
@neteler
Copy link
Member Author

neteler commented Dec 3, 2022

Remaining error:

gcc  -std=gnu11 -fPIC -Wall -Wno-error=maybe-uninitialized -Werror  -I/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/include -I/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/include   -fopenmp -DPACKAGE=\""grassmods"\"   -I/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/include -I/home/runner/work/grass/grass/dist.x86_64-pc-linux-gnu/include -DRELDIR=\"raster/r.univar\" -o OBJ.x86_64-pc-linux-gnu/r.univar_main.o -c r.univar_main.c
r.univar_main.c: In function ‘main’:
r.univar_main.c:168:21: error: overflow in conversion from ‘float’ to ‘CELL’ {aka ‘int’} changes value from ‘+QNaNf’ to ‘0’ [-Werror=overflow]
  168 |     zone_info.min = NAN;  /* set to nan as default */
      |                     ^~~
r.univar_main.c:169:21: error: overflow in conversion from ‘float’ to ‘CELL’ {aka ‘int’} changes value from ‘+QNaNf’ to ‘0’ [-Werror=overflow]
  169 |     zone_info.max = NAN;  /* set to nan as default */
      |                     ^~~
cc1: all warnings being treated as errors

What to do with that? (direct PR edits welcome)

@neteler neteler requested a review from nilason December 3, 2022 20:37
lib/vector/Vlib/box.c Outdated Show resolved Hide resolved
lib/vector/Vlib/box.c Outdated Show resolved Hide resolved
lib/vector/Vlib/box.c Outdated Show resolved Hide resolved
raster/r.in.bin/main.c Outdated Show resolved Hide resolved
raster/r.in.lidar/info.c Outdated Show resolved Hide resolved
raster/r.in.pdal/info.cpp Outdated Show resolved Hide resolved
raster/r.out.gdal/main.c Outdated Show resolved Hide resolved
raster/r.out.gdal/main.c Outdated Show resolved Hide resolved
raster3d/r3.in.lidar/info.c Outdated Show resolved Hide resolved
vector/v.cluster/main.c Outdated Show resolved Hide resolved
vector/v.cluster/main.c Outdated Show resolved Hide resolved
raster/r.in.pdal/info.cpp Outdated Show resolved Hide resolved
@nilason
Copy link
Contributor

nilason commented Dec 4, 2022

Ohh, I found another inf in r.series:

lo = -1.0 / 0.0; /* -inf */

neteler added a commit to neteler/grass that referenced this pull request Dec 5, 2022
neteler pushed a commit to neteler/grass that referenced this pull request Dec 5, 2022
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989265 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989193 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989189 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989180 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669988019 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669987997 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669987899 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669986420 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669986410 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669985337 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984062 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984050 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984037 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984013 +0100

inital work on grass cmake build

wip: cmake fixes

add find iconv script

fix blas error wrong target added

link with dl lib on linux

disable some modules (wip)

search whatever is fftw's inlcude dir

driver lib depends on iconv

fftw in required package

build fftw modules

add python libs

test with py3

install sqlfiles to etc/sql

install lock, clean_temp, echo to ./etc/

install libs

link with dl lib

cleanup cmake code

fix python script & lib install dirs

fixed gisbase for grass startup script

install modules to bin

add PNG as dependency to r.out.png

install __init__.py

wrong install dir for python api

install with rpath to avoid LD_LIBRARY_PATH

whitespace fixes

MSVC: check for _WIN32 to use msvc and mingw32

MSVC: disable some programs temporarily

update cmake scripts to manage thirdparty libs

disable X11 on windows

update generation of config.h

fix list of cmake depends

msvc compile fixes

use INIFINITY rather than gcc only division by zero

ignore visual studio, cmake files

use INFINITY rather than divide by zero

use _WIN32 for mingw32 and msvc

add ssize_t for msvc

msvc add _USE_MATH_DEFINES an d export dll

keep check for long long int in cache

include driver/init.c when building display drivers

use _WIN32 to build msvc and mingw32

update cmake for lib/db

link with libm only on unix

msvc: skip chmod on windows msvc

use INFINITY rather than diivide by zero

add msvc specific headers: unistd.h, dirent.h

grass moved to git... So follow that in cmake.

fix check for HAVE_LONG_LONG

include math.h only on msvc. To be discussed

void* arithmetic (GCC extension) is not allowed in msvc

disable d.mon, d.font on msvc. TBD

missing O_ACCMODE on msvc

Add unistd.h on windows

Source copied from http://stackoverflow.com/a/826027

dbmi_base: add dirent.h and dirent.c for msvc

use macro INFINITY rather than GCC divide by zero

MSVC: fix missing strings.h

use math defines on msvc

update find package of fftw

added required defines into parent scope

update setting of HAVE_* defines. 1/n

use cmake target check if possible

add odbc target on windows

update values in generated config.h

reorganize cmake option defaults, cmake flags, macros

cmake c and cxx flags include _CRT_SECURE_NO_WARNINGS to avoid a lot msdn warnings
check_target macro is a helper to reduce number of lines in include/CMakeLists.txt

simlib: min, max are already available

Find which C standard library does not provide them
And if there is one, see if grass support that compiler/platform combination
To be discussed

CMake: reorganize cmake functions, macros, find_scripts (Like a Pro)

make_script_in_dir is renamed to build_script_in_subdir

I still don't the naming of macro is clear.
One without knowledge of CMake, AutoMake or any
other build scripting  experience must be able to deduct
what is the macro/functions.

Even if there will be a header comment with 'PURPOSE' field.

fix define used in lib/rst/interp_float

fix tools/timer build

add gettimeofday windowss implemenation from postgresql

CMake: reorganize cmake functions (2)

MSVC: copy UINT64CONST(x) from postgresql

WIP: disable pyc generation with g.parser on msvc

fix ccmath complex struct for msvc

take out GCC'sim and stick to C standard

copy external/ccmath/ccmath.h to include/grass/ccmath_grass.h

CMake: enable cmake export all symbols on for shared libs

CMake: build lib/python on MSVC

fix ctypesgen.cmake
reorg cmake functions used by python
add new cmake function to copy_python_files and compile

MSVC: include sys/time.h if available or time.h

CMake: remove debug trace

CMake: minor cleanup

CMake: make gui/images

CMake: fix run_grass of locale_strings and ctypesgen

CMake: link with postgres is optional

gid_t, uid_t, pid_t exists on *nix

use find_library_suffix to switch between debug and rest

avoid touch  .stamp files and depend on generated pyc file

CMake: update definiition of HAVE_PROJ_H

include winsock.h only on msvc

CMake: remove annoying logs

for fix TODO for g.version

CMake: depend on pyc file not on a new .stamp file

CMake: fix syntax error

CMake: fix sqlite include dir variable

CMake: detect version of proj4 before activating defines

MSVC: avoid pulling min max on windows

CMake: update list of enabled modules

TODO r.watershed, fix cmake proj4 library varname

Revert "simlib: min, max are already available"

This reverts commit ab2b961.

CMake: update proj library variables (remove suffix 4)

use macro INFINITY

MSVC: fix gisinit initialized flag

export initialized using dllexport when building.
export macros has been generated by CMake's GenerateExportHeader.
cmake calls this for all libraries in build_module function.

There is a change in initialized variable decl on msvc and rest of compilers.
This point has to be discussed with other devs

MSVC: fix min, max macro stuff

update TODO, list of modules not built by cmake

CMake: update find scripts to find debug then release

update list of options.
WITH_PYTHON addded to build python bindings (default is OFF)

CMake: zlib is check with cmake target

demolocation is configured in lib/init/CMakeLists.txt

CMake: generate grass.py and grass.sh scripts (build tree)

CMake: fix startup script generation (install tree)

fix generation of startup scripts

fix g.list building 1/2

MSVC: missing regex, use PCRE (wip)

lib/init: fix startup script on linux

fix input configure_file

activate building g.remove on msvc

add cmake messages for lib/init/

include sys/time.h if not on msvc.

As we don't include grass/config.h we cannot simply check against
HAVE_SYS_TIME_H

install proj data files

geotiff_csv only required in windows

check this with devs

wip: add compile defs via interface library

fix g.version, grass_gproj with proj6

create startup shell scripts in bin

fix startup script

MSVC: configure run_grass.bat, run_python.bat

generate html docs

fix copy_python_file (used in gui/wxpython, lib/python)

build all gui/wxpython modules

wrapper scripts to build html docs

skip html-description for g.parser

update msvc target properties

fix install directory for running from binary tree

install tools for buildtree and installtree

fix build docs using cmake POST_BUILD

update mkhtml.py for cmake

copy header to binary directory using add_custom_command

install extra files in lib/gis using post_build

add copy_header as depdendency to grass_datetime

first install tools directory

find cairo debug and then release libs

add POST_BUILD target for documentation only if WITH_DOCS

build gui/wxpython, fix html description generation

MSVC: uninitialized variable

CMake: update to work with autoconf and cmake

CMake: install et copy gui/images gui/icons

CMake: fix grass version date

CMake: fix building gui (python files, docs, html)

fix dist include dir name

build docs only if requested

fix typo

fix cmake syntax errors

cmake linux fixes

check for _WIN32 define to work with msvc

fix newline at end of file

WIP: update helper cmake scripts

update copy_header target

use gisbase as dist directory for build tree

cmake: fix build for db/drivers

ignore __pycache__ directory when scanning for .py files

wip: use a gisbase as dist directory

WIP: temporary fix for find_library output variable

CMake: move wxpython cmake codes to gui/wxpython

raise ScriptError

wip wip build docs

minor cleanup

install html docs for driver db

update building html docs (wip)

add missing dependencies for v.lrs

update building python modules (wip)

use target property to check if running python script (docs)

cleanup cmake helper functions (exe, libs, python, docs)

copy strings.h and unistd.h on msvc

python files (target) depend only grass.script if building docs

fix build docs for windows and linux (wip)

seperate list of g.gui.* modules

try to make generic build docs (wip)

build docs html for not win32 (wip)

fix cmake syntax error

update pgm extension for running html description

remove temp files after docs are finished

CMake: fix IN_LIST syntax

ficx cmake syntax error

fix again linux html description for python with a main script

wip: include from config build is breaking msvc

msvc: disable db drivers (wip)

add test.raster3d.lib into NO_HTML_DESCR_TARGETS

CMake: missing endif()

x extension on running html descr

copy r.in.wms directory to etc/

fix building py modules

add grass dll directory to path windows grass.bat

debug linux build failures

cmake missing endif

set main script file only for those selected modules

cmake: fix python docs for linux and windows

create scripts directory in gisbase

cmake debug message

add missing include

add cmake find scripts for liblas, netcdf, postgresql

update proj4 detection to support 4.x, 5.x , 6.x versions

update cmake functions to build grass modules

add proj4 version defines (support 5.x+)

add options for v.in.dwg and liblas modules

activate build of modules deactivated

detecting of new 3rdd party libraries

fix i.landsat.acca on msvc

add dll export macro for iostream, dspf, calc

fix r.terraflow on msvc

use _WIN32 rather than __MINGW32__ for msvc

use infinity macro to build on msvc

missing include on msvc

copy VERSIONUMBER and license to gisbase/etc

support for multiple proj4 version

update building lib/python (except ctypes)

use INFINITY macro to work with msvc

fix building gui/wxpython/xml

use approach with cmake env command for cross platform build

void* arithmetic is not allowed in msvc

To be discussed

copy __init__.py for python/grass/

fix wrong cmake varible used

copy init py to etc/python/grass/

db/drviers: odbc, sqlite, dbf,  ogr, postgresql

check for PQCmdTuples in postgresql

add defines to be posix conformat on msvc

bring in testing using ctest (wip)

improve proj4 detection

Signed-off-by: Rashad Kanavath <mohammedrashadkm@gmail.com>

keep proj4 version string in cache (very useful later)

find optional packages quietly

use PRIMARY_DEPENDS option in build_module

generate wxpython menu xml stuff after building all executables

ogsf and nviz depends on grass_raster

update gui/wxpython build

add missing modules to build

missing v.clip

install html file is exists

cmake cleanup

reorder dependencies of gui/wxpython modules

avoid breakage in autconf build

missing file copy

fix mkhtml doc building, exe, lib, python, gui

fix find scripts on windows

fix always out of date for custom targets

fix missing optional dependds to grass gis library

fix missing math.h include

wrong path used under cmake binary directory

keep autoconf build  conflict with cmake

.bat files must be in scripts/

fix installation of gui/images, gui/icons

Revert "install html file is exists"

This reverts commit 9e83f6f.

Apply suggestions from code review

trivial changes (comment style) applied

moved tools/ -> utils/

sync to main

sync to main

fix indentation

remove trailing white space

remove trailing white space

revert C related INFINITY/NAN changes (taken care of in OSGeo#2681)
neteler added a commit to neteler/grass that referenced this pull request Dec 5, 2022
@nilason
Copy link
Contributor

nilason commented Dec 8, 2022

Just realised there are tests in configure for this:

grass/aclocal.m4

Lines 303 to 324 in bcf83ad

dnl checks for complete floating-point support (infinity, NaN)
define(LOC_FP_TEST,[
#include <float.h>
int main(void) {
double one = 1.0;
double zero = 0.0;
if (one/zero > DBL_MAX) /* infinity */
if (zero/zero != zero/zero) /* NaN */
return 0;
return 1;
}
])
AC_DEFUN([LOC_CHECK_FP_INF_NAN],[
AC_MSG_CHECKING([for full floating-point support]$1)
AC_RUN_IFELSE([AC_LANG_SOURCE([LOC_FP_TEST])],[ AC_MSG_RESULT(yes)
$2],[ AC_MSG_RESULT(no)
$3],[ AC_MSG_RESULT([unknown (cross-compiling)])
$4
])
])

Let's consider how to handle them before merging this

@nilason nilason added C Related code is in C C++ Related code is in C++ labels Jan 6, 2023
@neteler
Copy link
Member Author

neteler commented Jan 10, 2023

I have attempted to update the PR formatting to match the clang-format changes in main, using

for i in $(gh pr view 2681 --json files --jq '.files.[].path') ; do clang-format -i $i ; done

But looking at the "Files changed" tab, these formatting changes are yet shown while I hoped for seeing only the relevant changes of this PR.
What's the trick? I guess a rebase step is needed? Since also other PRs are affected I'd like to learn how it is done in git.

@nilason
Copy link
Contributor

nilason commented Jan 10, 2023

I have attempted to update the PR formatting to match the clang-format changes in main, using

for i in $(gh pr view 2681 --json files --jq '.files.[].path') ; do clang-format -i $i ; done

But looking at the "Files changed" tab, these formatting changes are yet shown while I hoped for seeing only the relevant changes of this PR. What's the trick? I guess a rebase step is needed? Since also other PRs are affected I'd like to learn how it is done in git.

Even gave some good general advice in gdal ml, but they don't relate to existing PRs specifically.

Not being a git-magician myself, attempt to "merge main" turned hopeless, this is because you have to fix conflicts stepwise for each commit. As we in the end always squashing PRs to main, I see no reason (generally) not to squash-rebase.
Here's what I have done in some of my old PRs:

  1. Apply clang-format to modified files in a new commit
  2. Rebase interactively (git rebase -i HEAD~[no-of-commits-in-PR])
  3. Either squash or fixup the commits in the PR to a single commit
  4. git rebase main
  5. assuming no conflicts: git push --force

@neteler
Copy link
Member Author

neteler commented Jan 11, 2023

  1. Rebase interactively (git rebase -i HEAD~[no-of-commits-in-PR])

(just a small note to self)
Seems that the needed [no-of-commits-in-PR] is shown by:

git rev-list --count HEAD ^main
11

which corresponds to what the "Commits" tabs above shows. Useful to automate also the count step...

- use of `INFINITY` rather than only division by zero (this is supported by gcc and other compilers but not on Windows)
- use of `NAN` rather than only division by zero

Extracted from WIP PR OSGeo#289

Further changes on top:

- fix indentation
- revert void* arithmetic change
- remove superfluous comments
- use 0 (zero) to init integers
- 0/0 = NAN, 1/0 = INFINITY
- Include math.h for Windows
- Use c++ include
- r.series: add INFINITY
- apply clang-format to match reformatting in `main` by using `for i in $(gh pr view 2681 --json files --jq '.files.[].path') ; do clang-format -i $i ; done`

Co-authored-by: @rkanavath
Co-authored-by: @nilason
@neteler
Copy link
Member Author

neteler commented Jan 11, 2023

Pfew, seems it work out. Thanks for your git help, @nilason !

@neteler
Copy link
Member Author

neteler commented Jan 16, 2023

@nilason any objections to merge this PR? After your approval we got more changes :-)

@nilason
Copy link
Contributor

nilason commented Jan 16, 2023

@nilason any objections to merge this PR? After your approval we got more changes :-)

Please, go ahead and merge!

@neteler neteler merged commit a946ca6 into OSGeo:main Jan 16, 2023
@neteler neteler deleted the cmake_prep_infinity_nan branch January 16, 2023 13:53
ninsbl pushed a commit to ninsbl/grass that referenced this pull request Feb 17, 2023
* cmake support preparation: use of INFINITY and NAN

- use of `INFINITY` rather than only division by zero (this is supported by gcc and other compilers but not on Windows)
- use of `NAN` rather than only division by zero

Extracted from WIP PR OSGeo#289

Further changes on top:

- fix indentation
- revert void* arithmetic change
- remove superfluous comments
- use 0 (zero) to init integers
- 0/0 = NAN, 1/0 = INFINITY
- Include math.h for Windows
- Use c++ include
- r.series: add INFINITY
- apply clang-format to match reformatting in `main` by using `for i in $(gh pr view 2681 --json files --jq '.files.[].path') ; do clang-format -i $i ; done`

Co-authored-by: @rkanavath
Co-authored-by: @nilason
lbartoletti pushed a commit to lbartoletti/grass that referenced this pull request Jun 3, 2023
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989265 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989193 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989189 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989180 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669988019 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669987997 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669987899 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669986420 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669986410 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669985337 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984062 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984050 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984037 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984013 +0100

inital work on grass cmake build

wip: cmake fixes

add find iconv script

fix blas error wrong target added

link with dl lib on linux

disable some modules (wip)

search whatever is fftw's inlcude dir

driver lib depends on iconv

fftw in required package

build fftw modules

add python libs

test with py3

install sqlfiles to etc/sql

install lock, clean_temp, echo to ./etc/

install libs

link with dl lib

cleanup cmake code

fix python script & lib install dirs

fixed gisbase for grass startup script

install modules to bin

add PNG as dependency to r.out.png

install __init__.py

wrong install dir for python api

install with rpath to avoid LD_LIBRARY_PATH

whitespace fixes

MSVC: check for _WIN32 to use msvc and mingw32

MSVC: disable some programs temporarily

update cmake scripts to manage thirdparty libs

disable X11 on windows

update generation of config.h

fix list of cmake depends

msvc compile fixes

use INIFINITY rather than gcc only division by zero

ignore visual studio, cmake files

use INFINITY rather than divide by zero

use _WIN32 for mingw32 and msvc

add ssize_t for msvc

msvc add _USE_MATH_DEFINES an d export dll

keep check for long long int in cache

include driver/init.c when building display drivers

use _WIN32 to build msvc and mingw32

update cmake for lib/db

link with libm only on unix

msvc: skip chmod on windows msvc

use INFINITY rather than diivide by zero

add msvc specific headers: unistd.h, dirent.h

grass moved to git... So follow that in cmake.

fix check for HAVE_LONG_LONG

include math.h only on msvc. To be discussed

void* arithmetic (GCC extension) is not allowed in msvc

disable d.mon, d.font on msvc. TBD

missing O_ACCMODE on msvc

Add unistd.h on windows

Source copied from http://stackoverflow.com/a/826027

dbmi_base: add dirent.h and dirent.c for msvc

use macro INFINITY rather than GCC divide by zero

MSVC: fix missing strings.h

use math defines on msvc

update find package of fftw

added required defines into parent scope

update setting of HAVE_* defines. 1/n

use cmake target check if possible

add odbc target on windows

update values in generated config.h

reorganize cmake option defaults, cmake flags, macros

cmake c and cxx flags include _CRT_SECURE_NO_WARNINGS to avoid a lot msdn warnings
check_target macro is a helper to reduce number of lines in include/CMakeLists.txt

simlib: min, max are already available

Find which C standard library does not provide them
And if there is one, see if grass support that compiler/platform combination
To be discussed

CMake: reorganize cmake functions, macros, find_scripts (Like a Pro)

make_script_in_dir is renamed to build_script_in_subdir

I still don't the naming of macro is clear.
One without knowledge of CMake, AutoMake or any
other build scripting  experience must be able to deduct
what is the macro/functions.

Even if there will be a header comment with 'PURPOSE' field.

fix define used in lib/rst/interp_float

fix tools/timer build

add gettimeofday windowss implemenation from postgresql

CMake: reorganize cmake functions (2)

MSVC: copy UINT64CONST(x) from postgresql

WIP: disable pyc generation with g.parser on msvc

fix ccmath complex struct for msvc

take out GCC'sim and stick to C standard

copy external/ccmath/ccmath.h to include/grass/ccmath_grass.h

CMake: enable cmake export all symbols on for shared libs

CMake: build lib/python on MSVC

fix ctypesgen.cmake
reorg cmake functions used by python
add new cmake function to copy_python_files and compile

MSVC: include sys/time.h if available or time.h

CMake: remove debug trace

CMake: minor cleanup

CMake: make gui/images

CMake: fix run_grass of locale_strings and ctypesgen

CMake: link with postgres is optional

gid_t, uid_t, pid_t exists on *nix

use find_library_suffix to switch between debug and rest

avoid touch  .stamp files and depend on generated pyc file

CMake: update definiition of HAVE_PROJ_H

include winsock.h only on msvc

CMake: remove annoying logs

for fix TODO for g.version

CMake: depend on pyc file not on a new .stamp file

CMake: fix syntax error

CMake: fix sqlite include dir variable

CMake: detect version of proj4 before activating defines

MSVC: avoid pulling min max on windows

CMake: update list of enabled modules

TODO r.watershed, fix cmake proj4 library varname

Revert "simlib: min, max are already available"

This reverts commit ab2b961.

CMake: update proj library variables (remove suffix 4)

use macro INFINITY

MSVC: fix gisinit initialized flag

export initialized using dllexport when building.
export macros has been generated by CMake's GenerateExportHeader.
cmake calls this for all libraries in build_module function.

There is a change in initialized variable decl on msvc and rest of compilers.
This point has to be discussed with other devs

MSVC: fix min, max macro stuff

update TODO, list of modules not built by cmake

CMake: update find scripts to find debug then release

update list of options.
WITH_PYTHON addded to build python bindings (default is OFF)

CMake: zlib is check with cmake target

demolocation is configured in lib/init/CMakeLists.txt

CMake: generate grass.py and grass.sh scripts (build tree)

CMake: fix startup script generation (install tree)

fix generation of startup scripts

fix g.list building 1/2

MSVC: missing regex, use PCRE (wip)

lib/init: fix startup script on linux

fix input configure_file

activate building g.remove on msvc

add cmake messages for lib/init/

include sys/time.h if not on msvc.

As we don't include grass/config.h we cannot simply check against
HAVE_SYS_TIME_H

install proj data files

geotiff_csv only required in windows

check this with devs

wip: add compile defs via interface library

fix g.version, grass_gproj with proj6

create startup shell scripts in bin

fix startup script

MSVC: configure run_grass.bat, run_python.bat

generate html docs

fix copy_python_file (used in gui/wxpython, lib/python)

build all gui/wxpython modules

wrapper scripts to build html docs

skip html-description for g.parser

update msvc target properties

fix install directory for running from binary tree

install tools for buildtree and installtree

fix build docs using cmake POST_BUILD

update mkhtml.py for cmake

copy header to binary directory using add_custom_command

install extra files in lib/gis using post_build

add copy_header as depdendency to grass_datetime

first install tools directory

find cairo debug and then release libs

add POST_BUILD target for documentation only if WITH_DOCS

build gui/wxpython, fix html description generation

MSVC: uninitialized variable

CMake: update to work with autoconf and cmake

CMake: install et copy gui/images gui/icons

CMake: fix grass version date

CMake: fix building gui (python files, docs, html)

fix dist include dir name

build docs only if requested

fix typo

fix cmake syntax errors

cmake linux fixes

check for _WIN32 define to work with msvc

fix newline at end of file

WIP: update helper cmake scripts

update copy_header target

use gisbase as dist directory for build tree

cmake: fix build for db/drivers

ignore __pycache__ directory when scanning for .py files

wip: use a gisbase as dist directory

WIP: temporary fix for find_library output variable

CMake: move wxpython cmake codes to gui/wxpython

raise ScriptError

wip wip build docs

minor cleanup

install html docs for driver db

update building html docs (wip)

add missing dependencies for v.lrs

update building python modules (wip)

use target property to check if running python script (docs)

cleanup cmake helper functions (exe, libs, python, docs)

copy strings.h and unistd.h on msvc

python files (target) depend only grass.script if building docs

fix build docs for windows and linux (wip)

seperate list of g.gui.* modules

try to make generic build docs (wip)

build docs html for not win32 (wip)

fix cmake syntax error

update pgm extension for running html description

remove temp files after docs are finished

CMake: fix IN_LIST syntax

ficx cmake syntax error

fix again linux html description for python with a main script

wip: include from config build is breaking msvc

msvc: disable db drivers (wip)

add test.raster3d.lib into NO_HTML_DESCR_TARGETS

CMake: missing endif()

x extension on running html descr

copy r.in.wms directory to etc/

fix building py modules

add grass dll directory to path windows grass.bat

debug linux build failures

cmake missing endif

set main script file only for those selected modules

cmake: fix python docs for linux and windows

create scripts directory in gisbase

cmake debug message

add missing include

add cmake find scripts for liblas, netcdf, postgresql

update proj4 detection to support 4.x, 5.x , 6.x versions

update cmake functions to build grass modules

add proj4 version defines (support 5.x+)

add options for v.in.dwg and liblas modules

activate build of modules deactivated

detecting of new 3rdd party libraries

fix i.landsat.acca on msvc

add dll export macro for iostream, dspf, calc

fix r.terraflow on msvc

use _WIN32 rather than __MINGW32__ for msvc

use infinity macro to build on msvc

missing include on msvc

copy VERSIONUMBER and license to gisbase/etc

support for multiple proj4 version

update building lib/python (except ctypes)

use INFINITY macro to work with msvc

fix building gui/wxpython/xml

use approach with cmake env command for cross platform build

void* arithmetic is not allowed in msvc

To be discussed

copy __init__.py for python/grass/

fix wrong cmake varible used

copy init py to etc/python/grass/

db/drviers: odbc, sqlite, dbf,  ogr, postgresql

check for PQCmdTuples in postgresql

add defines to be posix conformat on msvc

bring in testing using ctest (wip)

improve proj4 detection

Signed-off-by: Rashad Kanavath <mohammedrashadkm@gmail.com>

keep proj4 version string in cache (very useful later)

find optional packages quietly

use PRIMARY_DEPENDS option in build_module

generate wxpython menu xml stuff after building all executables

ogsf and nviz depends on grass_raster

update gui/wxpython build

add missing modules to build

missing v.clip

install html file is exists

cmake cleanup

reorder dependencies of gui/wxpython modules

avoid breakage in autconf build

missing file copy

fix mkhtml doc building, exe, lib, python, gui

fix find scripts on windows

fix always out of date for custom targets

fix missing optional dependds to grass gis library

fix missing math.h include

wrong path used under cmake binary directory

keep autoconf build  conflict with cmake

.bat files must be in scripts/

fix installation of gui/images, gui/icons

Revert "install html file is exists"

This reverts commit 9e83f6f.

Apply suggestions from code review

trivial changes (comment style) applied

moved tools/ -> utils/

sync to main

sync to main

fix indentation

remove trailing white space

remove trailing white space

revert C related INFINITY/NAN changes (taken care of in OSGeo#2681)
lbartoletti pushed a commit to lbartoletti/grass that referenced this pull request Jun 3, 2023
lbartoletti pushed a commit to lbartoletti/grass that referenced this pull request Jun 5, 2023
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989265 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989193 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989189 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989180 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669988019 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669987997 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669987899 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669986420 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669986410 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669985337 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984062 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984050 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984037 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984013 +0100

inital work on grass cmake build

wip: cmake fixes

add find iconv script

fix blas error wrong target added

link with dl lib on linux

disable some modules (wip)

search whatever is fftw's inlcude dir

driver lib depends on iconv

fftw in required package

build fftw modules

add python libs

test with py3

install sqlfiles to etc/sql

install lock, clean_temp, echo to ./etc/

install libs

link with dl lib

cleanup cmake code

fix python script & lib install dirs

fixed gisbase for grass startup script

install modules to bin

add PNG as dependency to r.out.png

install __init__.py

wrong install dir for python api

install with rpath to avoid LD_LIBRARY_PATH

whitespace fixes

MSVC: check for _WIN32 to use msvc and mingw32

MSVC: disable some programs temporarily

update cmake scripts to manage thirdparty libs

disable X11 on windows

update generation of config.h

fix list of cmake depends

msvc compile fixes

use INIFINITY rather than gcc only division by zero

ignore visual studio, cmake files

use INFINITY rather than divide by zero

use _WIN32 for mingw32 and msvc

add ssize_t for msvc

msvc add _USE_MATH_DEFINES an d export dll

keep check for long long int in cache

include driver/init.c when building display drivers

use _WIN32 to build msvc and mingw32

update cmake for lib/db

link with libm only on unix

msvc: skip chmod on windows msvc

use INFINITY rather than diivide by zero

add msvc specific headers: unistd.h, dirent.h

grass moved to git... So follow that in cmake.

fix check for HAVE_LONG_LONG

include math.h only on msvc. To be discussed

void* arithmetic (GCC extension) is not allowed in msvc

disable d.mon, d.font on msvc. TBD

missing O_ACCMODE on msvc

Add unistd.h on windows

Source copied from http://stackoverflow.com/a/826027

dbmi_base: add dirent.h and dirent.c for msvc

use macro INFINITY rather than GCC divide by zero

MSVC: fix missing strings.h

use math defines on msvc

update find package of fftw

added required defines into parent scope

update setting of HAVE_* defines. 1/n

use cmake target check if possible

add odbc target on windows

update values in generated config.h

reorganize cmake option defaults, cmake flags, macros

cmake c and cxx flags include _CRT_SECURE_NO_WARNINGS to avoid a lot msdn warnings
check_target macro is a helper to reduce number of lines in include/CMakeLists.txt

simlib: min, max are already available

Find which C standard library does not provide them
And if there is one, see if grass support that compiler/platform combination
To be discussed

CMake: reorganize cmake functions, macros, find_scripts (Like a Pro)

make_script_in_dir is renamed to build_script_in_subdir

I still don't the naming of macro is clear.
One without knowledge of CMake, AutoMake or any
other build scripting  experience must be able to deduct
what is the macro/functions.

Even if there will be a header comment with 'PURPOSE' field.

fix define used in lib/rst/interp_float

fix tools/timer build

add gettimeofday windowss implemenation from postgresql

CMake: reorganize cmake functions (2)

MSVC: copy UINT64CONST(x) from postgresql

WIP: disable pyc generation with g.parser on msvc

fix ccmath complex struct for msvc

take out GCC'sim and stick to C standard

copy external/ccmath/ccmath.h to include/grass/ccmath_grass.h

CMake: enable cmake export all symbols on for shared libs

CMake: build lib/python on MSVC

fix ctypesgen.cmake
reorg cmake functions used by python
add new cmake function to copy_python_files and compile

MSVC: include sys/time.h if available or time.h

CMake: remove debug trace

CMake: minor cleanup

CMake: make gui/images

CMake: fix run_grass of locale_strings and ctypesgen

CMake: link with postgres is optional

gid_t, uid_t, pid_t exists on *nix

use find_library_suffix to switch between debug and rest

avoid touch  .stamp files and depend on generated pyc file

CMake: update definiition of HAVE_PROJ_H

include winsock.h only on msvc

CMake: remove annoying logs

for fix TODO for g.version

CMake: depend on pyc file not on a new .stamp file

CMake: fix syntax error

CMake: fix sqlite include dir variable

CMake: detect version of proj4 before activating defines

MSVC: avoid pulling min max on windows

CMake: update list of enabled modules

TODO r.watershed, fix cmake proj4 library varname

Revert "simlib: min, max are already available"

This reverts commit ab2b961.

CMake: update proj library variables (remove suffix 4)

use macro INFINITY

MSVC: fix gisinit initialized flag

export initialized using dllexport when building.
export macros has been generated by CMake's GenerateExportHeader.
cmake calls this for all libraries in build_module function.

There is a change in initialized variable decl on msvc and rest of compilers.
This point has to be discussed with other devs

MSVC: fix min, max macro stuff

update TODO, list of modules not built by cmake

CMake: update find scripts to find debug then release

update list of options.
WITH_PYTHON addded to build python bindings (default is OFF)

CMake: zlib is check with cmake target

demolocation is configured in lib/init/CMakeLists.txt

CMake: generate grass.py and grass.sh scripts (build tree)

CMake: fix startup script generation (install tree)

fix generation of startup scripts

fix g.list building 1/2

MSVC: missing regex, use PCRE (wip)

lib/init: fix startup script on linux

fix input configure_file

activate building g.remove on msvc

add cmake messages for lib/init/

include sys/time.h if not on msvc.

As we don't include grass/config.h we cannot simply check against
HAVE_SYS_TIME_H

install proj data files

geotiff_csv only required in windows

check this with devs

wip: add compile defs via interface library

fix g.version, grass_gproj with proj6

create startup shell scripts in bin

fix startup script

MSVC: configure run_grass.bat, run_python.bat

generate html docs

fix copy_python_file (used in gui/wxpython, lib/python)

build all gui/wxpython modules

wrapper scripts to build html docs

skip html-description for g.parser

update msvc target properties

fix install directory for running from binary tree

install tools for buildtree and installtree

fix build docs using cmake POST_BUILD

update mkhtml.py for cmake

copy header to binary directory using add_custom_command

install extra files in lib/gis using post_build

add copy_header as depdendency to grass_datetime

first install tools directory

find cairo debug and then release libs

add POST_BUILD target for documentation only if WITH_DOCS

build gui/wxpython, fix html description generation

MSVC: uninitialized variable

CMake: update to work with autoconf and cmake

CMake: install et copy gui/images gui/icons

CMake: fix grass version date

CMake: fix building gui (python files, docs, html)

fix dist include dir name

build docs only if requested

fix typo

fix cmake syntax errors

cmake linux fixes

check for _WIN32 define to work with msvc

fix newline at end of file

WIP: update helper cmake scripts

update copy_header target

use gisbase as dist directory for build tree

cmake: fix build for db/drivers

ignore __pycache__ directory when scanning for .py files

wip: use a gisbase as dist directory

WIP: temporary fix for find_library output variable

CMake: move wxpython cmake codes to gui/wxpython

raise ScriptError

wip wip build docs

minor cleanup

install html docs for driver db

update building html docs (wip)

add missing dependencies for v.lrs

update building python modules (wip)

use target property to check if running python script (docs)

cleanup cmake helper functions (exe, libs, python, docs)

copy strings.h and unistd.h on msvc

python files (target) depend only grass.script if building docs

fix build docs for windows and linux (wip)

seperate list of g.gui.* modules

try to make generic build docs (wip)

build docs html for not win32 (wip)

fix cmake syntax error

update pgm extension for running html description

remove temp files after docs are finished

CMake: fix IN_LIST syntax

ficx cmake syntax error

fix again linux html description for python with a main script

wip: include from config build is breaking msvc

msvc: disable db drivers (wip)

add test.raster3d.lib into NO_HTML_DESCR_TARGETS

CMake: missing endif()

x extension on running html descr

copy r.in.wms directory to etc/

fix building py modules

add grass dll directory to path windows grass.bat

debug linux build failures

cmake missing endif

set main script file only for those selected modules

cmake: fix python docs for linux and windows

create scripts directory in gisbase

cmake debug message

add missing include

add cmake find scripts for liblas, netcdf, postgresql

update proj4 detection to support 4.x, 5.x , 6.x versions

update cmake functions to build grass modules

add proj4 version defines (support 5.x+)

add options for v.in.dwg and liblas modules

activate build of modules deactivated

detecting of new 3rdd party libraries

fix i.landsat.acca on msvc

add dll export macro for iostream, dspf, calc

fix r.terraflow on msvc

use _WIN32 rather than __MINGW32__ for msvc

use infinity macro to build on msvc

missing include on msvc

copy VERSIONUMBER and license to gisbase/etc

support for multiple proj4 version

update building lib/python (except ctypes)

use INFINITY macro to work with msvc

fix building gui/wxpython/xml

use approach with cmake env command for cross platform build

void* arithmetic is not allowed in msvc

To be discussed

copy __init__.py for python/grass/

fix wrong cmake varible used

copy init py to etc/python/grass/

db/drviers: odbc, sqlite, dbf,  ogr, postgresql

check for PQCmdTuples in postgresql

add defines to be posix conformat on msvc

bring in testing using ctest (wip)

improve proj4 detection

Signed-off-by: Rashad Kanavath <mohammedrashadkm@gmail.com>

keep proj4 version string in cache (very useful later)

find optional packages quietly

use PRIMARY_DEPENDS option in build_module

generate wxpython menu xml stuff after building all executables

ogsf and nviz depends on grass_raster

update gui/wxpython build

add missing modules to build

missing v.clip

install html file is exists

cmake cleanup

reorder dependencies of gui/wxpython modules

avoid breakage in autconf build

missing file copy

fix mkhtml doc building, exe, lib, python, gui

fix find scripts on windows

fix always out of date for custom targets

fix missing optional dependds to grass gis library

fix missing math.h include

wrong path used under cmake binary directory

keep autoconf build  conflict with cmake

.bat files must be in scripts/

fix installation of gui/images, gui/icons

Revert "install html file is exists"

This reverts commit 9e83f6f.

Apply suggestions from code review

trivial changes (comment style) applied

moved tools/ -> utils/

sync to main

sync to main

fix indentation

remove trailing white space

remove trailing white space

revert C related INFINITY/NAN changes (taken care of in OSGeo#2681)
lbartoletti pushed a commit to lbartoletti/grass that referenced this pull request Jun 5, 2023
lbartoletti pushed a commit to lbartoletti/grass that referenced this pull request Jun 6, 2023
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989265 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989193 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989189 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669989180 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669988019 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669987997 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669987899 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669986420 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669986410 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669985337 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984062 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984050 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984037 +0100

parent 464ffca
author Rashad Kanavath <mohammedrashadkm@gmail.com> 1497210739 +0200
committer Markus Neteler <neteler@gmail.com> 1669984013 +0100

inital work on grass cmake build

wip: cmake fixes

add find iconv script

fix blas error wrong target added

link with dl lib on linux

disable some modules (wip)

search whatever is fftw's inlcude dir

driver lib depends on iconv

fftw in required package

build fftw modules

add python libs

test with py3

install sqlfiles to etc/sql

install lock, clean_temp, echo to ./etc/

install libs

link with dl lib

cleanup cmake code

fix python script & lib install dirs

fixed gisbase for grass startup script

install modules to bin

add PNG as dependency to r.out.png

install __init__.py

wrong install dir for python api

install with rpath to avoid LD_LIBRARY_PATH

whitespace fixes

MSVC: check for _WIN32 to use msvc and mingw32

MSVC: disable some programs temporarily

update cmake scripts to manage thirdparty libs

disable X11 on windows

update generation of config.h

fix list of cmake depends

msvc compile fixes

use INIFINITY rather than gcc only division by zero

ignore visual studio, cmake files

use INFINITY rather than divide by zero

use _WIN32 for mingw32 and msvc

add ssize_t for msvc

msvc add _USE_MATH_DEFINES an d export dll

keep check for long long int in cache

include driver/init.c when building display drivers

use _WIN32 to build msvc and mingw32

update cmake for lib/db

link with libm only on unix

msvc: skip chmod on windows msvc

use INFINITY rather than diivide by zero

add msvc specific headers: unistd.h, dirent.h

grass moved to git... So follow that in cmake.

fix check for HAVE_LONG_LONG

include math.h only on msvc. To be discussed

void* arithmetic (GCC extension) is not allowed in msvc

disable d.mon, d.font on msvc. TBD

missing O_ACCMODE on msvc

Add unistd.h on windows

Source copied from http://stackoverflow.com/a/826027

dbmi_base: add dirent.h and dirent.c for msvc

use macro INFINITY rather than GCC divide by zero

MSVC: fix missing strings.h

use math defines on msvc

update find package of fftw

added required defines into parent scope

update setting of HAVE_* defines. 1/n

use cmake target check if possible

add odbc target on windows

update values in generated config.h

reorganize cmake option defaults, cmake flags, macros

cmake c and cxx flags include _CRT_SECURE_NO_WARNINGS to avoid a lot msdn warnings
check_target macro is a helper to reduce number of lines in include/CMakeLists.txt

simlib: min, max are already available

Find which C standard library does not provide them
And if there is one, see if grass support that compiler/platform combination
To be discussed

CMake: reorganize cmake functions, macros, find_scripts (Like a Pro)

make_script_in_dir is renamed to build_script_in_subdir

I still don't the naming of macro is clear.
One without knowledge of CMake, AutoMake or any
other build scripting  experience must be able to deduct
what is the macro/functions.

Even if there will be a header comment with 'PURPOSE' field.

fix define used in lib/rst/interp_float

fix tools/timer build

add gettimeofday windowss implemenation from postgresql

CMake: reorganize cmake functions (2)

MSVC: copy UINT64CONST(x) from postgresql

WIP: disable pyc generation with g.parser on msvc

fix ccmath complex struct for msvc

take out GCC'sim and stick to C standard

copy external/ccmath/ccmath.h to include/grass/ccmath_grass.h

CMake: enable cmake export all symbols on for shared libs

CMake: build lib/python on MSVC

fix ctypesgen.cmake
reorg cmake functions used by python
add new cmake function to copy_python_files and compile

MSVC: include sys/time.h if available or time.h

CMake: remove debug trace

CMake: minor cleanup

CMake: make gui/images

CMake: fix run_grass of locale_strings and ctypesgen

CMake: link with postgres is optional

gid_t, uid_t, pid_t exists on *nix

use find_library_suffix to switch between debug and rest

avoid touch  .stamp files and depend on generated pyc file

CMake: update definiition of HAVE_PROJ_H

include winsock.h only on msvc

CMake: remove annoying logs

for fix TODO for g.version

CMake: depend on pyc file not on a new .stamp file

CMake: fix syntax error

CMake: fix sqlite include dir variable

CMake: detect version of proj4 before activating defines

MSVC: avoid pulling min max on windows

CMake: update list of enabled modules

TODO r.watershed, fix cmake proj4 library varname

Revert "simlib: min, max are already available"

This reverts commit ab2b961.

CMake: update proj library variables (remove suffix 4)

use macro INFINITY

MSVC: fix gisinit initialized flag

export initialized using dllexport when building.
export macros has been generated by CMake's GenerateExportHeader.
cmake calls this for all libraries in build_module function.

There is a change in initialized variable decl on msvc and rest of compilers.
This point has to be discussed with other devs

MSVC: fix min, max macro stuff

update TODO, list of modules not built by cmake

CMake: update find scripts to find debug then release

update list of options.
WITH_PYTHON addded to build python bindings (default is OFF)

CMake: zlib is check with cmake target

demolocation is configured in lib/init/CMakeLists.txt

CMake: generate grass.py and grass.sh scripts (build tree)

CMake: fix startup script generation (install tree)

fix generation of startup scripts

fix g.list building 1/2

MSVC: missing regex, use PCRE (wip)

lib/init: fix startup script on linux

fix input configure_file

activate building g.remove on msvc

add cmake messages for lib/init/

include sys/time.h if not on msvc.

As we don't include grass/config.h we cannot simply check against
HAVE_SYS_TIME_H

install proj data files

geotiff_csv only required in windows

check this with devs

wip: add compile defs via interface library

fix g.version, grass_gproj with proj6

create startup shell scripts in bin

fix startup script

MSVC: configure run_grass.bat, run_python.bat

generate html docs

fix copy_python_file (used in gui/wxpython, lib/python)

build all gui/wxpython modules

wrapper scripts to build html docs

skip html-description for g.parser

update msvc target properties

fix install directory for running from binary tree

install tools for buildtree and installtree

fix build docs using cmake POST_BUILD

update mkhtml.py for cmake

copy header to binary directory using add_custom_command

install extra files in lib/gis using post_build

add copy_header as depdendency to grass_datetime

first install tools directory

find cairo debug and then release libs

add POST_BUILD target for documentation only if WITH_DOCS

build gui/wxpython, fix html description generation

MSVC: uninitialized variable

CMake: update to work with autoconf and cmake

CMake: install et copy gui/images gui/icons

CMake: fix grass version date

CMake: fix building gui (python files, docs, html)

fix dist include dir name

build docs only if requested

fix typo

fix cmake syntax errors

cmake linux fixes

check for _WIN32 define to work with msvc

fix newline at end of file

WIP: update helper cmake scripts

update copy_header target

use gisbase as dist directory for build tree

cmake: fix build for db/drivers

ignore __pycache__ directory when scanning for .py files

wip: use a gisbase as dist directory

WIP: temporary fix for find_library output variable

CMake: move wxpython cmake codes to gui/wxpython

raise ScriptError

wip wip build docs

minor cleanup

install html docs for driver db

update building html docs (wip)

add missing dependencies for v.lrs

update building python modules (wip)

use target property to check if running python script (docs)

cleanup cmake helper functions (exe, libs, python, docs)

copy strings.h and unistd.h on msvc

python files (target) depend only grass.script if building docs

fix build docs for windows and linux (wip)

seperate list of g.gui.* modules

try to make generic build docs (wip)

build docs html for not win32 (wip)

fix cmake syntax error

update pgm extension for running html description

remove temp files after docs are finished

CMake: fix IN_LIST syntax

ficx cmake syntax error

fix again linux html description for python with a main script

wip: include from config build is breaking msvc

msvc: disable db drivers (wip)

add test.raster3d.lib into NO_HTML_DESCR_TARGETS

CMake: missing endif()

x extension on running html descr

copy r.in.wms directory to etc/

fix building py modules

add grass dll directory to path windows grass.bat

debug linux build failures

cmake missing endif

set main script file only for those selected modules

cmake: fix python docs for linux and windows

create scripts directory in gisbase

cmake debug message

add missing include

add cmake find scripts for liblas, netcdf, postgresql

update proj4 detection to support 4.x, 5.x , 6.x versions

update cmake functions to build grass modules

add proj4 version defines (support 5.x+)

add options for v.in.dwg and liblas modules

activate build of modules deactivated

detecting of new 3rdd party libraries

fix i.landsat.acca on msvc

add dll export macro for iostream, dspf, calc

fix r.terraflow on msvc

use _WIN32 rather than __MINGW32__ for msvc

use infinity macro to build on msvc

missing include on msvc

copy VERSIONUMBER and license to gisbase/etc

support for multiple proj4 version

update building lib/python (except ctypes)

use INFINITY macro to work with msvc

fix building gui/wxpython/xml

use approach with cmake env command for cross platform build

void* arithmetic is not allowed in msvc

To be discussed

copy __init__.py for python/grass/

fix wrong cmake varible used

copy init py to etc/python/grass/

db/drviers: odbc, sqlite, dbf,  ogr, postgresql

check for PQCmdTuples in postgresql

add defines to be posix conformat on msvc

bring in testing using ctest (wip)

improve proj4 detection

Signed-off-by: Rashad Kanavath <mohammedrashadkm@gmail.com>

keep proj4 version string in cache (very useful later)

find optional packages quietly

use PRIMARY_DEPENDS option in build_module

generate wxpython menu xml stuff after building all executables

ogsf and nviz depends on grass_raster

update gui/wxpython build

add missing modules to build

missing v.clip

install html file is exists

cmake cleanup

reorder dependencies of gui/wxpython modules

avoid breakage in autconf build

missing file copy

fix mkhtml doc building, exe, lib, python, gui

fix find scripts on windows

fix always out of date for custom targets

fix missing optional dependds to grass gis library

fix missing math.h include

wrong path used under cmake binary directory

keep autoconf build  conflict with cmake

.bat files must be in scripts/

fix installation of gui/images, gui/icons

Revert "install html file is exists"

This reverts commit 9e83f6f.

Apply suggestions from code review

trivial changes (comment style) applied

moved tools/ -> utils/

sync to main

sync to main

fix indentation

remove trailing white space

remove trailing white space

revert C related INFINITY/NAN changes (taken care of in OSGeo#2681)
lbartoletti pushed a commit to lbartoletti/grass that referenced this pull request Jun 6, 2023
@wenzeslaus wenzeslaus changed the title cmake support preparation: use of INFINITY and NAN checks: Use of INFINITY and NAN instead of divisions Jun 6, 2023
neteler added a commit to nilason/grass that referenced this pull request Nov 7, 2023
* cmake support preparation: use of INFINITY and NAN

- use of `INFINITY` rather than only division by zero (this is supported by gcc and other compilers but not on Windows)
- use of `NAN` rather than only division by zero

Extracted from WIP PR OSGeo#289

Further changes on top:

- fix indentation
- revert void* arithmetic change
- remove superfluous comments
- use 0 (zero) to init integers
- 0/0 = NAN, 1/0 = INFINITY
- Include math.h for Windows
- Use c++ include
- r.series: add INFINITY
- apply clang-format to match reformatting in `main` by using `for i in $(gh pr view 2681 --json files --jq '.files.[].path') ; do clang-format -i $i ; done`

Co-authored-by: @rkanavath
Co-authored-by: @nilason
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C C++ Related code is in C++ Windows Microsoft Windows specific
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants