<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Compiling problems: gfortran and the C_LOC function</title>
  <link rel="self" href="https://dlt-acc.firelay.cloud/c/message_boards/find_thread?p_l_id=3231581&amp;threadId=3393866" />
  <subtitle>Compiling problems: gfortran and the C_LOC function</subtitle>
  <id>https://dlt-acc.firelay.cloud/c/message_boards/find_thread?p_l_id=3231581&amp;threadId=3393866</id>
  <updated>2026-05-15T15:08:38Z</updated>
  <dc:date>2026-05-15T15:08:38Z</dc:date>
  <entry>
    <title>Compiling problems: gfortran and the C_LOC function</title>
    <link rel="alternate" href="https://dlt-acc.firelay.cloud/c/message_boards/find_message?p_l_id=3231581&amp;messageId=3393865" />
    <author>
      <name>Marcello Magaldi</name>
    </author>
    <id>https://dlt-acc.firelay.cloud/c/message_boards/find_message?p_l_id=3231581&amp;messageId=3393865</id>
    <updated>2019-11-20T12:39:46Z</updated>
    <published>2019-11-20T12:33:21Z</published>
    <summary type="html">Hello everybody!&lt;br /&gt;After many years I downloaded again d3d, specifically tag #59659, revision #65450. I know the process is painful as I had compiled previous versions in the past: all prerequisites are installed. &lt;br /&gt;I am now in an Ubuntu 16.04.6 LTS (xenial) 64bit machine which comes with GNU compilers (ver 5.4.0). I edited the build.sh script to point to the right directories of all prerequisistes and started building d3d with the -gnu and -64bit options. &lt;br /&gt;The logs/configure.log and logs/make.log files go thru without problems.&lt;br /&gt;Unfortunately the bulding process stops for the logs/make_dflowfm.log file which terminates as below:&lt;br /&gt;&lt;br /&gt;&lt;div class="lfr-code"&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;1&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;libtool: compile:  /opt/mpich/mpich_3_2_1_gcc5.4/bin/mpif90 -DHAVE_CONFIG_H -I. -I../../../../.. -I./../include -I./../../dflowfm_lib/include -I./../include -I../../../../../utils_lgpl/ec_module/packages/ec_module/src -I../../../../../utils_lgpl/io_netcdf/packages/io_netcdf/src -I../../../../../utils_lgpl/gridgeom/packages/gridgeom/src -I../../../../../utils_lgpl/deltares_common/packages/deltares_common/src -I../../../../../utils_lgpl/deltares_common/packages/deltares_common_mpi/src -I../../../../../utils_gpl/morphology/packages/morphology_data/src -I../../../../../utils_gpl/morphology/packages/morphology_io/src -I../../../../../utils_gpl/morphology/packages/morphology_kernel/src -I../../../../../utils_gpl/trachytopes/packages/trachytopes_io/src -I../../../../../utils_gpl/trachytopes/packages/trachytopes_kernel/src -I../../../../../utils_gpl/flow1d/packages/flow1d_core/src -I../../../../../utils_gpl/flow1d/packages/flow1d_io/src -I../../../../../third_party_open/kdtree2/src-f90 -I../../../../../third_party_open/libsigwatch -I../../../../../utils_lgpl/kdtree_wrapper/packages/kdtree_wrapper/src -DWITH_DELFTONLINE -DHAVE_DISPLAY=0 -I/opt/netcdf/netcdfC/netcdfC_4_6_1_gcc5.4/include -I/opt/netcdf/netcdfC/netcdfC_4_6_1_gcc5.4/include -I/opt/netcdf/netcdfF/netcdfF_4_4_4_gcc5.4/include -O2 -ffree-line-length-none -cpp -c ../../dflowfm_lib/src/unstruc_bmi.F90  -fPIC -o ../../dflowfm_lib/src/.libs/unstruc_bmi.o&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;2&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;../../dflowfm_lib/src/unstruc_bmi.F90:1567:19:          x = c_loc(valdambreak(1, item_index))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;3&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;                   1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;4&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;Error: Argument X at (1) to C_LOC shall have either the POINTER or the TARGET attribute&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;5&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;../../dflowfm_lib/src/unstruc_bmi.F90:1570:19:          x = c_loc(valdambreak(2, item_index))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;6&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;                   1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;7&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;Error: Argument X at (1) to C_LOC shall have either the POINTER or the TARGET attribute&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;8&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;Makefile:839: recipe for target &amp;#39;../../dflowfm_lib/src/unstruc_bmi.lo&amp;#39; failed&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;9&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;make[3]: *** [../../dflowfm_lib/src/unstruc_bmi.lo] Error 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;10&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;make[3]: Leaving directory &amp;#39;/home/magaldi/Delft3dOct19/src/engines_gpl/dflowfm/packages/dflowfm_kernel/src&amp;#39;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;11&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;Makefile:493: recipe for target &amp;#39;install-recursive&amp;#39; failed&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;12&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;make[2]: *** [install-recursive] Error 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;13&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;make[2]: Leaving directory &amp;#39;/home/magaldi/Delft3dOct19/src/engines_gpl/dflowfm/packages/dflowfm_kernel&amp;#39;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;14&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;Makefile:494: recipe for target &amp;#39;install-recursive&amp;#39; failed&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;15&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;make[1]: *** [install-recursive] Error 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;16&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;make[1]: Leaving directory &amp;#39;/home/magaldi/Delft3dOct19/src/engines_gpl/dflowfm/packages&amp;#39;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;17&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;Makefile:493: recipe for target &amp;#39;install-recursive&amp;#39; failed&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;18&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;make: *** [install-recursive] Error 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="line-numbers"&gt;19&lt;/td&gt;&lt;td class="lines"&gt;&lt;div class="line"&gt;make: Leaving directory &amp;#39;/home/magaldi/Delft3dOct19/src/engines_gpl/dflowfm&amp;#39;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;br /&gt;This looks to be a known issue: Intel compilers are more permissive while NAG and Gfortran compilers both generate errors when argument to the C_LOC function do not have a TARGET or POINTER attribute set (see &lt;a href="https://www.pgroup.com/userforum/viewtopic.php?t=6364"&gt;https://www.pgroup.com/userforum/viewtopic.php?t=6364&lt;/a&gt; ).&lt;br /&gt;Did anyone else stumble on the same problem? &lt;br /&gt;Any hints to solve and allow the building process to finish?&lt;br /&gt;Thank you in advance,&lt;br /&gt;Marcello</summary>
    <dc:creator>Marcello Magaldi</dc:creator>
    <dc:date>2019-11-20T12:33:21Z</dc:date>
  </entry>
</feed>
