Opened 3 years ago

Closed 19 months ago

#3091 closed defect (fixed)

The RUN_GISBASE variable is not set correctly on FreeBSD

Reported by: pieside Owned by: grass-dev@…
Priority: normal Milestone: 7.2.2
Component: Default Version: 7.0.4
Keywords: FreeBSD Cc:
CPU: x86-64 Platform: Other Unix

Description

I'm trying to port Grass7 in the ports tree to make the installation easier on FreeBSD.

The include/Make/Platform.make file contains the RUN_GISBASE variable with the following value:

dist.amd64.portbld-freebsd11.0

The compilation search the includes files (e.g., gis.h) in this directory. But it is empty. All the includes are located in another directory:

dist.amd64

Why is the first directory empty?

This thread https://forums.freebsd.org/threads/56766/#post-323057 suggests the Makefile contains rules to create those directories. I presume the solution lives somewhere in a file in the include/Make/ directory but I can't figure it out

Attachments (1)

Platform.make (7.2 KB) - added by pieside 3 years ago.

Download all attachments as: .zip

Change History (7)

Changed 3 years ago by pieside

Attachment: Platform.make added

comment:1 in reply to:  description Changed 3 years ago by glynn

Replying to pieside:

The compilation search the includes files (e.g., gis.h) in this directory.

The include flags are actually:

INC		= -I$(ARCH_DISTDIR)/include -I$(GISBASE)/include

from Grass.make.

But it is empty. All the includes are located in another directory:

dist.amd64

Headers are supposed to be installed in $(ARCH_INCDIR), which is set to

ARCH_INCDIR     = $(ARCH_DISTDIR)/include/grass

Note that ARCH_DISTDIR is set thus:

ARCH_DISTDIR	= $(GRASS_HOME)/dist.$(ARCH)

and both GRASS_HOME and ARCH appear to be set correctly in your attached Platform.make file:

ARCH                = amd64-portbld-freebsd11.0

GRASS_HOME          = /usr/ports/databases/grass7/work/grass-7.0.4

Why is the first directory empty?

Is it only headers that are in dist.amd64? Everything that will eventually be installed should be within the dist.amd64-portbld-freebsd11.0 directory except for the grass71 startup script, which should be in bin.amd64-portbld-freebsd11.0. Knowing which files go where would provide some clues as to the source of the problem.

I suggest that you examine the output from "make". If you didn't capture it to a file, run "make clean" then re-build with e.g.

make >build.log 2>&1

Check for the "install" commands which install headers, e.g.

/usr/bin/install -c  -m 644 gmath.h /usr/ports/databases/grass7/work/grass-7.0.4/dist.amd64-portbld-freebsd11.0/include/grass/gmath.h

If those look okay, there's something wrong with the install program (or the install-sh script, if that's being used). Otherwise, the issue may be with the build system.

comment:2 Changed 3 years ago by pieside

After some tests, I found that the issue is probably coming from the ports tree framework which overrides the value of ARCH. This seems to comfort that the issue may be with the build system.

To avoid duplicate and because it seems to be FreeBSD specific, I continue the discussion here: https://forums.freebsd.org/threads/56766/#post-323073

comment:3 in reply to:  2 Changed 3 years ago by glynn

Replying to pieside:

After some tests, I found that the issue is probably coming from the ports tree framework which overrides the value of ARCH. This seems to comfort that the issue may be with the build system.

Setting ARCH= on the make command line will override the setting of ARCH in Platform.make.

Ideally, that should work; i.e. you should be able to set ARCH to whatever you feel like and everything should use that setting consistently. But it doesn't, because configure.in does:

AC_SUBST(ARCH)

...

GISBASE="${WINDSTDIR}/dist.${ARCH}"
GRASS_BIN="${DSTDIR}/bin.${ARCH}"

AC_SUBST(GISBASE)
AC_SUBST(GRASS_BIN)

So the value of ARCH chosen by the configure script gets used to set 3 distinct variables, and overriding ARCH on the command line only changes one of them (although GRASS_BIN isn't actually used).

GISBASE is actually used to set RUN_GISBASE, which is used when executing GRASS commands or scripts as part of the build process. On Unix, this will typically end up being identical to ARCH_DISTDIR, which is the base directory where generated files are placed. But on Windows, RUN_GISBASE needs to use Windows' native filename syntax, whereas everything else uses the Unix-like syntax of MinGW/MSys.

One possible solution is to have configure substitute WINDSTDIR rather than GISBASE and change Platform.make.in to:

RUN_GISBASE         = @WINDSTDIR@/dist.$(ARCH)

That should ensure that ARCH_DISTDIR and RUN_GISBASE are equivalent even if ARCH is overridden on the command line.

comment:4 Changed 2 years ago by neteler

Milestone: 7.0.57.0.6

comment:5 Changed 19 months ago by lbartoletti

Hi,

You can close this tickets, we have patched files for FreeBSD.

Regards.

comment:6 in reply to:  5 Changed 19 months ago by neteler

Milestone: 7.0.67.2.2
Resolution: fixed
Status: newclosed

Replying to lbartoletti:

Hi,

You can close this tickets, we have patched files for FreeBSD.

... solved in #2940, closing.

Note: See TracTickets for help on using tickets.