#2598 closed defect (fixed)
g.extension compilation fails
Reported by: | ewcgrass | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.0.3 |
Component: | Default | Version: | svn-releasebranch70 |
Keywords: | Cc: | ||
CPU: | x86-64 | Platform: | Linux |
Description (last modified by )
Running GRASS 7.0.1svn(64bit)-2015-02-21, Python 2.7.0, wxPython 2.8.12.0, Linux-2.6.35.14-106.fc14.x86_64-x86_64-with-fedora-14
running g.extension (from gui or from command line) gives:
--snip-- g.extension extension=r.damflood svnurl=http://svn.osgeo.org/grass/grass-addons/grass7 Fetching <r.damflood> from GRASS-Addons SVN repository (be patient)... Compiling... mkdir: cannot create directory `/usr/local/grass7.0.1svn- x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown- linux-gnu': Permission denied make: *** [/usr/local/grass7.0.1svn-x86_64-unknown-linux- gnu-21_02_2015/dist.x86_64-unknown-linux-gnu] Error 1 ERROR: Compilation failed, sorry. Please check above error messages. --snip--
where g.extension appears to be wanting to write temporary files while compiling (and installing?) to a directory with root privileges, instead of at $HOME/.grass7/addons which based on manual pages should be the default local directory if "s" flag is not set.
I have had same problem with various GRASS-6 versions (where I simply stopped trying to install addons), except for GRASS-6.4.4svn-x86_64-02-11-2013, where g.extension works but with messages like:
--snip-- /usr/local/grass6.4.4svn-x86_64-unknown-linux-gnu- 02_11_2013/include/Make/Grass.make:423: warning: overriding recipe for target `/home/rick/data/grassdata/ns-nad83-utm- 25m- 10m/PERMANENT/.tmp/localhost.localdomain/7565.0/r.flip/bin' --snip--
as an apparent work-around, which allowed addons to be installed into $HOME/.grass6/addons directory.
Change History (16)
comment:1 by , 10 years ago
Description: | modified (diff) |
---|---|
Milestone: | → 7.0.1 |
comment:2 by , 10 years ago
comment:3 by , 10 years ago
Replying to ewcgrass:
> --snip-- > g.extension extension=r.damflood svnurl=http://svn.osgeo.org/grass/grass-addons/grass7
strange please try to run this module with --v
flag. I cannot reproduce this error.
comment:4 by , 10 years ago
Here is the output with the --verbose flag
g.extension --verbose extension=r.damflood svnurl=http://svn.osgeo.org/grass/grass-addons/grass7 Fetching <r.damflood> from GRASS-Addons SVN repository (be patient)... A r.damflood/SWE.c A r.damflood/SWE.h A r.damflood/main.c A r.damflood/r.damflood.html A r.damflood/dam_failure.png A r.damflood/Makefile Checked out revision 64750. Compiling... mkdir: cannot create directory `/usr/local/grass7.0.1svn- x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown- linux-gnu': Permission denied make: *** [/usr/local/grass7.0.1svn-x86_64-unknown-linux- gnu-21_02_2015/dist.x86_64-unknown-linux-gnu] Error 1 ERROR: Compilation failed, sorry. Please check above error messages. mkdir -p /usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu (Wed Feb 25 18:07:45 2015) Command finished (2 sec)
Again, g.extension wants to create temporary directories in /usr/local/grass.... where it does not have permission to do so.
I ran g.extension repeatedly, each time manually creating (as root user) the directories that are wanting to be created and causing permission errors (i.e. /bin.x86_64-unknown-linux-gnu, /dist.x86_64-unknown-linux-gnu, and within this latter one, /driver/db, /fonts, /include/grass, /lib). As I was approaching of this, these were the messages being received:
g.extension --verbose extension=r.damflood svnurl=http://svn.osgeo.org/grass/grass-addons/grass7 Fetching <r.damflood> from GRASS-Addons SVN repository (be patient)... A r.damflood/SWE.c A r.damflood/SWE.h A r.damflood/main.c A r.damflood/r.damflood.html A r.damflood/dam_failure.png A r.damflood/Makefile Checked out revision 64750. mkdir -p /tmp/tmpmAdoGF/r.damflood/bin mkdir -p /tmp/tmpmAdoGF/r.damflood/etc mkdir -p /usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/docs Compiling... mkdir: cannot create directory `/usr/local/grass7.0.1svn- x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown- linux-gnu/docs': Permission denied make: *** [/usr/local/grass7.0.1svn-x86_64-unknown-linux- gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/docs] Error 1 ERROR: Compilation failed, sorry. Please check above error messages. (Wed Feb 25 18:43:56 2015) Command finished (2 sec)
and
g.extension --verbose extension=r.damflood svnurl=http://svn.osgeo.org/grass/grass-addons/grass7 Fetching <r.damflood> from GRASS-Addons SVN repository (be patient)... A r.damflood/SWE.c A r.damflood/SWE.h A r.damflood/main.c A r.damflood/r.damflood.html A r.damflood/dam_failure.png A r.damflood/Makefile Checked out revision 64750. mkdir -p /tmp/tmpEhkPVn/r.damflood/bin mkdir -p /tmp/tmpEhkPVn/r.damflood/etc mkdir -p /tmp/tmpEhkPVn/r.damflood/docs/html mkdir -p /tmp/tmpEhkPVn/r.damflood/docs/man mkdir -p /tmp/tmpEhkPVn/r.damflood/docs/man/man1 mkdir -p /usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/tools Compiling... mkdir: cannot create directory `/usr/local/grass7.0.1svn- x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown- linux-gnu/tools': Permission denied make: *** [/usr/local/grass7.0.1svn-x86_64-unknown-linux- gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/tools] Error 1 ERROR: Compilation failed, sorry. Please check above error messages. (Wed Feb 25 18:45:34 2015) Command finished (2 sec)
So as I'm creating the requested directories within /dist.x86_64-unknown-linux-gnu, it's appearing as if g.extension is able to create the directories and files it needs in /tmp.
Finally, after creating the last of the two directories causing permission errors (i.e. /dist.x86_64-unknown-linux-gnu/docs and /dist.x86_64-unknown-linux-gnu/tools), this is what I get as output:
g.extension --verbose extension=r.damflood svnurl=http://svn.osgeo.org/grass/grass-addons/grass7 Fetching <r.damflood> from GRASS-Addons SVN repository (be patient)... A r.damflood/SWE.c A r.damflood/SWE.h A r.damflood/main.c Compiling... A r.damflood/r.damflood.html A r.damflood/dam_failure.png A r.damflood/Makefile Checked out revision 64750. mkdir -p /tmp/tmpwy0eZb/r.damflood/bin mkdir -p /tmp/tmpwy0eZb/r.damflood/etc mkdir -p /tmp/tmpwy0eZb/r.damflood/docs/html mkdir -p /tmp/tmpwy0eZb/r.damflood/docs/man mkdir -p /tmp/tmpwy0eZb/r.damflood/docs/man/man1 test -d OBJ.x86_64-unknown-linux-gnu || mkdir -p OBJ.x86_64-unknown-linux-gnu gcc -g -Wall -Werror-implicit-function-declaration -fno-common -I/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/include -I/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/include -DPACKAGE=\""grassmods"\" -I/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/include -I/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/include -DRELDIR=\"/tmp/tmpwy0eZb/r.damflood\" -o OBJ.x86_64-unknown-linux-gnu/SWE.o -c SWE.c SWE.c: In function ‘shallow_water’: SWE.c:526:5: warning: "/*" within comment SWE.c:527:5: warning: "/*" within comment SWE.c:53:25: warning: unused variable ‘volume’ SWE.c:46:68: warning: unused variable ‘Gsx’ SWE.c:46:63: warning: unused variable ‘Gdx’ SWE.c:46:38: warning: unused variable ‘Fdw’ SWE.c:46:33: warning: unused variable ‘Fup’ SWE.c:263:24: warning: ‘vol_res’ may be used uninitialized in this function gcc -g -Wall -Werror-implicit-function-declaration -fno-common -I/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/include -I/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/include -DPACKAGE=\""grassmods"\" -I/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/include -I/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/include -DRELDIR=\"/tmp/tmpwy0eZb/r.damflood\" -o OBJ.x86_64-unknown-linux-gnu/main.o -c main.c main.c: In function ‘main’: main.c:267:3: error: implicit declaration of function ‘G_add_keyword’ main.c:477:3: error: implicit declaration of function ‘G_find_raster2’ main.c:477:17: warning: cast to pointer from integer of different size main.c:481:17: warning: cast to pointer from integer of different size main.c:485:21: warning: cast to pointer from integer of different size main.c:489:20: warning: cast to pointer from integer of different size main.c:494:13: warning: cast to pointer from integer of different size main.c:497:13: warning: cast to pointer from integer of different size main.c:501:13: warning: cast to pointer from integer of different size main.c:505:13: warning: cast to pointer from integer of different size main.c:511:3: error: implicit declaration of function ‘Rast_open_old’ main.c:587:3: error: implicit declaration of function ‘Rast_allocate_f_buf’ main.c:587:15: warning: assignment makes pointer from integer without a cast main.c:589:3: error: implicit declaration of function ‘Rast_allocate_d_buf’ main.c:589:15: warning: assignment makes pointer from integer without a cast main.c:591:19: warning: assignment makes pointer from integer without a cast main.c:593:18: warning: assignment makes pointer from integer without a cast main.c:595:11: warning: assignment makes pointer from integer without a cast main.c:596:11: warning: assignment makes pointer from integer without a cast main.c:598:11: warning: assignment makes pointer from integer without a cast main.c:600:11: warning: assignment makes pointer from integer without a cast main.c:603:3: error: implicit declaration of function ‘Rast_window_rows’ main.c:604:3: error: implicit declaration of function ‘Rast_window_cols’ main.c:646:4: error: implicit declaration of function ‘Rast_get_f_row’ main.c:647:4: error: implicit declaration of function ‘Rast_get_d_row’ main.c:719:3: error: implicit declaration of function ‘Rast_close’ main.c:990:5: error: implicit declaration of function ‘Rast_open_new’ main.c:1006:17: warning: assignment makes pointer from integer without a cast main.c:1009:15: warning: assignment makes pointer from integer without a cast main.c:1012:21: warning: assignment makes pointer from integer without a cast main.c:1024:8: error: implicit declaration of function ‘Rast_set_d_null_value’ main.c:1050:7: error: implicit declaration of function ‘Rast_put_d_row’ main.c:1157:12: warning: assignment makes pointer from integer without a cast main.c:1160:14: warning: assignment makes pointer from integer without a cast main.c:1163:18: warning: assignment makes pointer from integer without a cast main.c:1167:15: warning: assignment makes pointer from integer without a cast main.c:1168:17: warning: assignment makes pointer from integer without a cast main.c:1169:17: warning: assignment makes pointer from integer without a cast main.c:1172:15: warning: assignment makes pointer from integer without a cast main.c:1173:17: warning: assignment makes pointer from integer without a cast main.c:1174:17: warning: assignment makes pointer from integer without a cast main.c:1176:20: warning: assignment makes pointer from integer without a cast main.c:1181:15: warning: assignment makes pointer from integer without a cast main.c:1182:17: warning: assignment makes pointer from integer without a cast main.c:1185:20: warning: assignment makes pointer from integer without a cast main.c:1289:2: error: implicit declaration of function ‘Rast_put_row’ main.c:240:17: warning: unused variable ‘time’ main.c:235:8: warning: unused variable ‘tmp’ main.c:234:7: warning: unused variable ‘tmp_int’ main.c:225:10: warning: unused variable ‘i_cont’ main.c:218:18: warning: unused variable ‘v_tot’ main.c:218:10: warning: unused variable ‘temp_d’ main.c:217:7: warning: unused variable ‘temp_i’ main.c:216:7: warning: unused variable ‘pippo’ main.c:205:9: warning: unused variable ‘Q’ main.c:166:20: warning: unused variable ‘cellhd’ main.c:1439:1: warning: control reaches end of non-void function make: *** [OBJ.x86_64-unknown-linux-gnu/main.o] Error 1 ERROR: Compilation failed, sorry. Please check above error messages. (Wed Feb 25 18:49:38 2015) Command finished (3 sec)
For other modules, I get:
g.extension --verbose extension=r.basin svnurl=http://svn.osgeo.org/grass/grass-addons/grass7 Fetching <r.basin> from GRASS-Addons SVN repository (be patient)... A r.basin/r.basin.html A r.basin/r.basin1.gif A r.basin/r.basin2.gif A r.basin/r.basin.py A r.basin/Makefile Checked out revision 64750. mkdir -p /tmp/tmp5e0Kat/r.basin/bin mkdir -p /tmp/tmp5e0Kat/r.basin/etc mkdir -p /tmp/tmp5e0Kat/r.basin/docs/html mkdir -p /tmp/tmp5e0Kat/r.basin/docs/man mkdir -p /tmp/tmp5e0Kat/r.basin/docs/man/man1 Compiling... mkdir -p /tmp/tmp5e0Kat/r.basin/scripts /usr/bin/install -c r.basin.py /tmp/tmp5e0Kat/r.basin/scripts/r.basin if [ "/tmp/tmp5e0Kat/r.basin/scripts/r.basin" != "" ] ; then GISRC=/tmp/grass7-rick-29248/gisrc GISBASE=/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015 PATH="/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/bin:/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/bin:/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/scripts:$PATH" PYTHONPATH="/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/etc/python:/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/gui/wxpython:$PYTHONPATH" LD_LIBRARY_PATH="/tmp/tmp5e0Kat/r.basin/bin:/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/scripts:/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/lib:/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/lib:/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/lib" LC_ALL=C /tmp/tmp5e0Kat/r.basin/scripts/r.basin --html-description < /dev/null | grep -v '</body>\|</html>' > r.basin.tmp.html ; fi VERSION_NUMBER=7.0.1svn VERSION_DATE=2015 \ python /usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/tools/mkhtml.py r.basin > /tmp/tmp5e0Kat/r.basin/docs/html/r.basin.html rm r.basin.tmp.html python: can't open file '/usr/local/grass7.0.1svn-x86_64 -unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux- gnu/tools/mkhtml.py': [Errno 2] No such file or directory make: *** [/tmp/tmp5e0Kat/r.basin/docs/html/r.basin.html] Error 2 ERROR: Compilation failed, sorry. Please check above error messages. (Wed Feb 25 18:53:44 2015) Command finished (2 sec)
and
g.extension --verbose extension=r.flip svnurl=http://svn.osgeo.org/grass/grass-addons/grass7 Fetching <r.flip> from GRASS-Addons SVN repository (be patient)... Compiling... A r.flip/main.c A r.flip/Makefile A r.flip/r.flip.html Checked out revision 64750. mkdir -p /tmp/tmpN28bVY/r.flip/bin mkdir -p /tmp/tmpN28bVY/r.flip/etc mkdir -p /tmp/tmpN28bVY/r.flip/docs/html mkdir -p /tmp/tmpN28bVY/r.flip/docs/man mkdir -p /tmp/tmpN28bVY/r.flip/docs/man/man1 test -d OBJ.x86_64-unknown-linux-gnu || mkdir -p OBJ.x86_64-unknown-linux-gnu gcc -g -Wall -Werror-implicit-function-declaration -fno-common -I/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/include -I/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/include -DPACKAGE=\""grassmods"\" -I/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/include -I/usr/local/grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu/include -DRELDIR=\"/tmp/tmpN28bVY/r.flip\" -o OBJ.x86_64-unknown-linux-gnu/main.o -c main.c main.c: In function ‘main’: main.c:46:5: error: implicit declaration of function ‘G_add_keyword’ main.c:74:5: error: implicit declaration of function ‘Rast_open_old’ main.c:75:5: error: implicit declaration of function ‘Rast_get_map_type’ main.c:76:5: error: implicit declaration of function ‘Rast_allocate_d_buf’ main.c:76:12: warning: assignment makes pointer from integer without a cast main.c:79:5: error: implicit declaration of function ‘Rast_open_new’ main.c:82:2: warning: pointer/integer type mismatch in conditional expression main.c:84:5: error: implicit declaration of function ‘Rast_window_rows’ main.c:85:5: error: implicit declaration of function ‘Rast_window_cols’ main.c:92:2: error: implicit declaration of function ‘Rast_get_d_row’ main.c:100:2: error: implicit declaration of function ‘Rast_put_d_row’ main.c:103:5: error: implicit declaration of function ‘Rast_close’ main.c:106:5: error: implicit declaration of function ‘Rast_read_colors’ main.c:107:2: error: implicit declaration of function ‘Rast_write_colors’ main.c:109:5: error: implicit declaration of function ‘Rast_short_history’ main.c:110:5: error: implicit declaration of function ‘Rast_command_history’ main.c:111:5: error: implicit declaration of function ‘Rast_write_history’ make: *** [OBJ.x86_64-unknown-linux-gnu/main.o] Error 1 ERROR: Compilation failed, sorry. Please check above error messages. (Wed Feb 25 18:54:56 2015) Command finished (2 sec)
It's no longer clear to me whether the compilation error is now due to permission problems, or to some other causes.
As I had indicated earlier, g.extension worked in GRASS-6.4.4svn, where there appeared to maybe have been some sort of a work-around by using a /tmp directory located inside the current LOCATION/MAPSET/PERMANENT and where the addons ended up being installed in $HOME/.grass6/addons?
In fear of having presented too much stuff, I hope that this helps to shed some light on where the problem might be? Please let me know what next to do. Thanks.
follow-up: 6 comment:5 by , 10 years ago
I too encountered this yesterday. I just changed the permissions of my grass 7 install tree in usr/lib/grass70, with:
sudo chmod 777 /usr/lib/grass70/scripts
and it worked fine. The module compiled and installed into ~/.grass7/scripts. I'm not sure why it needed write permissions for /usr/lib/grass70/scripts, but it seems like that was the problem on my machine...
I am using the current grass 7.0 stable from the grass-stable ubuntu PPA repository.
comment:6 by , 10 years ago
Replying to isaacullah:
I too encountered this yesterday.
hm, I tested builds for Ubuntu on Launchpad and it works. Correct situation is
- compilation is done in /tmp dir
- addons installed to .grass7/addons (if no -s flag is given)
No idea what could be wrong.
follow-up: 12 comment:7 by , 10 years ago
I have managed to get g.extension to compile several (but not all) addon modules. I did this by copying (as root user) all files located inside the grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/include/grass and /include/Make, grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/tools, and grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/lib directories, into the respective sub-directories inside grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015/dist.x86_64-unknown-linux-gnu. It would appear that the requirement for the /dist.x86_64-unknown-linux-gnu directory may have somehow found it's way into a make or other file somewhere, perhaps as a remnant from past development work? I suggest this because I found reference to that directory in the /include/Make/Platform.make.orig file. My search for references to this directory were not extensive, so perhaps it is present elsewhere too?
I am not a coder, but I do not view what I have done to get g.extension to compile to be a proper fix (it is a band-aid fix only). However, I am hoping this information may help those who are more familiar with the code related to g.extension, or to other compilation activities within GRASS, to find the source of this problem?
The modules that still refuse to compile appear to be doing so because of some issues related to file permissions (??) and/or missing header files. For example, I have not been able to find geos_c.h anywhere within the /grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015 directory, which is needed to compile r.stream.order, r.stream.snap, v.surf.mass, v.centerpoint, etc. Also, some errors appear to maybe be related to syntax errors; for example for modules v.transects and r.stream.basins.
I intend to report back with more information as/if time permits for me to "explore" more deeply into the remaining compilation problems.
follow-up: 13 comment:8 by , 10 years ago
Have resolved the geos_c.h header file issue by installing the geos-devel package system-wide. Geos-devel should be added to the optional requirements.html list.
comment:12 by , 9 years ago
Replying to ewcgrass:
The modules that still refuse to compile appear to be doing so because of some issues related to file permissions (??) and/or missing header files. For example, I have not been able to find geos_c.h anywhere within the /grass7.0.1svn-x86_64-unknown-linux-gnu-21_02_2015 directory, which is needed to compile r.stream.order, r.stream.snap, v.surf.mass, v.centerpoint, etc. Also, some errors appear to maybe be related to syntax errors; for example for modules v.transects and r.stream.basins.
The file "geos_c.h" is provided by the "geos-devel" package which must be installed.
comment:13 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Replying to ewcgrass:
Have resolved the geos_c.h header file issue by installing the geos-devel package system-wide. Geos-devel should be added to the optional requirements.html list.
r.damflood addon: fixed comment in comment and missing include file in r67415.
Closing, feel free to reopen if any issue is unsolved here.
follow-up: 15 comment:14 by , 9 years ago
Markus, in running g.extension to attempt to compile r.damflood on the 7.0.3RC1 version from http://grassmac.wikidot.com (GRASS 7.0.3 development 4 Jan 2016) r.damflood does not compile and indicates a SWE.c error which I don't know if this is related to the fix you contributed to r67415 or some other issue with my system?
This is the error I currently have:
g.extension --verbose extension=r.damflood operation=add Fetching <r.damflood> from GRASS-Addons SVN repository (be patient)... A r.damflood/SWE.c A r.damflood/SWE.h A r.damflood/main.c A r.damflood/r.damflood.html A r.damflood/dam_failure.png A r.damflood/Makefile Checked out revision 67490. Compiling... mkdir -p /var/folders/m3/4x793z_n5sl0v4glj4qlz1sh0000gp/T/tmpP5reiG/r.damflood/bin mkdir -p /var/folders/m3/4x793z_n5sl0v4glj4qlz1sh0000gp/T/tmpP5reiG/r.damflood/etc mkdir -p /var/folders/m3/4x793z_n5sl0v4glj4qlz1sh0000gp/T/tmpP5reiG/r.damflood/docs/html mkdir -p /var/folders/m3/4x793z_n5sl0v4glj4qlz1sh0000gp/T/tmpP5reiG/r.damflood/docs/man mkdir -p /var/folders/m3/4x793z_n5sl0v4glj4qlz1sh0000gp/T/tmpP5reiG/r.damflood/docs/man/man1 test -d OBJ.x86_64-apple-darwin14.5.0 || mkdir -p OBJ.x86_64-apple-darwin14.5.0 gcc -I/usr/local/include -g -O2 -arch i386 -arch x86_64 -I/usr/local/include -I/Applications/GRASS-7.0.app/Contents/MacOS/include -I/Applications/GRASS-7.0.app/Contents/MacOS/include -DPACKAGE=\""grassmods"\" -I/Applications/GRASS-7.0.app/Contents/MacOS/include -I/Applications/GRASS-7.0.app/Contents/MacOS/include -DRELDIR=\"/private/var/folders/m3/4x793z_n5sl0v4glj4qlz1sh0000gp/T/tmpP5reiG/r.damflood\" -o OBJ.x86_64-apple-darwin14.5.0/SWE.o -c SWE.c SWE.c:521:9: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value] if (fabs(m_u2[row][col]>=1000 )){ ^ SWE.c:521:9: note: use function 'abs' instead if (fabs(m_u2[row][col]>=1000 )){ ^~~~ abs SWE.c:707:31: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute- value] if ((timestep/res_ns*(abs(ab s(m_v2[row][col])+sqrt(g*m_h2[row][col]))))>1){ ^ SWE.c:707:31: note: use function 'fabs' instead if ((timestep/res_ns*(abs(ab s(m_v2[row][col])+sqrt(g*m_h2[row][col]))))>1){ ^~~ fabs SWE.c:707:27: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute- value] if ((timestep/res_ns*(abs(ab s(m_v2[row][col])+sqrt(g*m_h2[row][col]))))>1){ ^ SWE.c:707:27: note: use function 'fabs' instead if ((timestep/res_ns*(abs(ab s(m_v2[row][col])+sqrt(g*m_h2[row][col]))))>1){ ^~~ fabs 3 warnings generated. SWE.c:521:9: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value] if (fabs(m_u2[row][col]>=1000 )){ ^ SWE.c:521:9: note: use function 'abs' instead if (fabs(m_u2[row][col]>=1000 )){ ^~~~ abs SWE.c:707:31: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute- value] if ((timestep/res_ns*(abs(ab s(m_v2[row][col])+sqrt(g*m_h2[row][col]))))>1){ ^ SWE.c:707:31: note: use function 'fabs' instead if ((timestep/res_ns*(abs(ab s(m_v2[row][col])+sqrt(g*m_h2[row][col]))))>1){ ^~~ fabs SWE.c:707:27: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute- value] if ((timestep/res_ns*(abs(ab s(m_v2[row][col])+sqrt(g*m_h2[row][col]))))>1){ ^ SWE.c:707:27: note: use function 'fabs' instead if ((timestep/res_ns*(abs(ab s(m_v2[row][col])+sqrt(g*m_h2[row][col]))))>1){ ^~~ fabs 3 warnings generated. main.c:223:9: error: expected parameter declarator char* strcat(char* s, const char* ct); ^ /usr/include/secure/_string.h:125:38: note: expanded from macro 'strcat' __builtin___strcat_chk (dest, src, __darwin_obsz (dest)) ^ /usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz' #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0) ^ /usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL' # define _USE_FORTIFY_LEVEL 2 ^ main.c:223:9: error: expected ')' /usr/include/secure/_string.h:125:38: note: expanded from macro 'strcat' __builtin___strcat_chk (dest, src, __darwin_obsz (dest)) ^ /usr/include/secure/_common.h:39:62: note: expanded from macro '__darwin_obsz' #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0) ^ /usr/include/secure/_common.h:30:32: note: expanded from macro '_USE_FORTIFY_LEVEL' # define _USE_FORTIFY_LEVEL 2 ^ main.c:223:9: note: to match this '(' /usr/include/secure/_string.h:125:38: note: expanded from macro 'strcat' __builtin___strcat_chk (dest, src, __darwin_obsz (dest)) ^ /usr/include/secure/_common.h:39:53: note: expanded from macro '__darwin_obsz' #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0) ^ main.c:223:9: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] char* strcat(char* s, const char* ct); ^ /usr/include/secure/_string.h:125:38: note: expanded from macro 'strcat' __builtin___strcat_chk (dest, src, __darwin_obsz (dest)) ^ /usr/include/secure/_common.h:39:31: note: expanded from macro '__darwin_obsz' #define __darwin_obsz(object) __builtin_object_size (object, _USE_FORTIFY_LEVEL > 1 ? 1 : 0) ^ main.c:223:9: error: conflicting types for '__builtin___strcat_chk' /usr/include/secure/_string.h:125:3: note: expanded from macro 'strcat' __builtin___strcat_chk (dest, src, __darwin_obsz (dest)) ^ main.c:223:9: note: '__builtin___strcat_chk' is a builtin with type 'char *(char *, const char *, unsigned long)' /usr/include/secure/_string.h:125:3: note: expanded from macro 'strcat' __builtin___strcat_chk (dest, src, __darwin_obsz (dest)) ^ gcc -I/usr/local/include -g -O2 -arch i386 -arch x86_64 -I/usr/local/include -I/Applications/GRASS-7.0.app/Contents/MacOS/include -I/Applications/GRASS-7.0.app/Contents/MacOS/include -DPACKAGE=\""grassmods"\" -I/Applications/GRASS-7.0.app/Contents/MacOS/include -I/Applications/GRASS-7.0.app/Contents/MacOS/include -DRELDIR=\"/private/var/folders/m3/4x793z_n5sl0v4glj4qlz1sh0000gp/T/tmpP5reiG/r.damflood\" -o OBJ.x86_64-apple-darwin14.5.0/main.o -c main.c 1 warning and 3 errors generated. make: *** [OBJ.x86_64-apple-darwin14.5.0/main.o] Error 1 ERROR: Compilation failed, sorry. Please check above error messages.
Thanks for any ideas...
comment:15 by , 9 years ago
Replying to rdzur:
r.damflood does not compile...
... main.c:223:9: error: expected ')' /usr/include/secure/_string.h:125:38: note: expanded from macro 'strcat' __builtin___strcat_chk (dest, src, __darwin_obsz (dest)) ...
There was some unused code which caused the issue (seems like strcat
is a macro on Mac which caused a cryptic message, all fine with gcc 5.2.1 and clang 3.6.2 on Ubuntu 15.10). Code removed in r67491.
In general, r.damflood would use some clean up (a lot of unused variables, abs/fabs etc.).
comment:16 by , 9 years ago
I can also confirm that the code compiles on Ubuntu 14.04:
$ gcc --version gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
Replying to ewcgrass:
To clarify: compilation is always done in tmp dir. If -s flag is given than the modules is installed to $GISBASE, otherwise to $HOME.grass7/addons.