bug message reminder

When adressing a model crash or bug, please remember to include an entire model setup in your post that reproduces the crash or exposes the bug. Also add the XBlog.txt file. This is necessary information for people that are trying to help you. Including your model setup can be achieved by adding the zipped run directory (excluding output) as an attachment to the post.

Forum

RE: Compiling Xbeach with netcdf

Giovanni Besio, modified 4 Years ago.

Compiling Xbeach with netcdf

Capillary Posts: 12 Join Date: 10/25/12 Recent Posts
Dear all,
I am compiling Xbeach trunk 4684 on open suse 13.1 and when I give the with-netcdf option I get the following error:
ncoutput.F90(49): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [NETCDF]
use netcdf
-------^

Actually I set in the .bashrc the path as:
export PATH=$PATH:/opt/netcdf/bin/
export PATH=$PATH:/opt/netcdf/include
export PATH=$PATH:/opt/netcdf/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/netcdf/lib64/
export NETCDF=/opt/netcdf/
export JASPERLIB=/home/wavewatch/usr/wrf/software/jasper/lib64
export JASPERINC=/home/wavewatch/usr/wrf/software/jasper/include

I tried with netCDF-Fortran 4.4.2 compiled with ifort or mpif90 and I get the same error.

any hint?

Regards

giovanni
Bas Hoonhout, modified 4 Years ago.

RE: Compiling Xbeach with netcdf

Infra-gravity Posts: 362 Join Date: 5/20/11 Recent Posts
Hi Giovanni,

These questions are difficult to answer since they are often machine specific.
I assume the netcdf_fortran check in your configure script fails as well?

What netcdf related files are in the directories you referenced?
Did you have a chance to compile this version on another machine?
Or did you try to compile the latest version (4686)? This one has been built successfully on our linux build servers.

Bas
Giovanni Besio, modified 4 Years ago.

RE: Compiling Xbeach with netcdf

Capillary Posts: 12 Join Date: 10/25/12 Recent Posts
Dear Bas,
I just downloaded version 4869 and I tried to compile it but I get the same error as for the post before.
Actually I compiled without errors netcdf-4.3.3.1 for c and netcdf-4.4.2 for fortran with ifort and icc that I am using for all the compilations. Note that I used hdf5, slib and zlib compiled with the same ifort and icc to compile netcdf.

In order to get the rgiht configuration I use the following configure script:
CC=/opt/intel/bin/icc CXX=/opt/intel/bin/icpc FC=/opt/intel/bin/ifort F77=/opt/intel/bin/ifort MPICXX=/opt/mpich-install/bin/mpicxx MPIFC=/opt/mpich-install/bin/mpif90 FCLIBS='-L/opt/intel/composer_xe_2013_sp1.3.174/compiler/lib/intel64 -L/lib/../lib64 -L/lib/../lib/ -L/usr/lib/x86_64-linux-gnu/ -L/usr/lib/../lib/ -L/lib64 -L/lib/ -L/usr/lib -L/usr/lib/i386-linux-gnu -L/opt/mpich-install/lib64 -lifport -lifcore -limf -lsvml -lm -lipgo -lirc -lpthread -lirc_s -ldl -lmpifort' FLIBS='-L/opt/intel/composer_xe_2013_sp1.3.174/compiler/lib/intel64 -L/lib/x86_64-linux-gnu/ -L/lib/../lib64 -L/lib/../lib/ -L/opt/mpich-install/lib64 -L/usr/lib/x86_64-linux-gnu/ -L/usr/lib/../lib/ -L/lib64 -L/lib/ -L/usr/lib -L/usr/lib/i386-linux-gnu -lifport -lifcore -limf -lsvml -lm -lipgo -lirc -lpthread -lirc_s -ldl' LIBS=' -L/opt/mpich-install/lib64 -L/opt/intel/composer_xe_2013_sp1.3.174/compiler/lib/intel64 -lrt -lexpat -lstdc++ -limf -lsvml -lirng -lintlc -lmpich -lmpifort' PPFLAGS='-I/opt/zlib-1.2.8/include -I/opt/szip-2.1/include -I/opt/hdf5-1.8.15/include -I/opt/netcdf_4.3.3.1_cc/include -I/opt/netcdf_4.4.2_fortran/include' LDFLAGS='-L/opt/zlib-1.2.8/lib -L/opt/szip-2.1/lib64 -L/opt/hdf5-1.8.15/lib64 -L/opt/netcdf_4.3.3.1_cc/lib64 -L/opt/netcdf_4.4.2_fortran/lib64' ./configure --prefix=/opt/Xbeach/compiled/4869 --with-mpi --with-netcdf


If I do not include the --with-netcdf option I get anyway an error:
make[4]: Entering directory `/opt/Temp/xbeach-trunk_4869/src/xbeachlibrary'
PPFC libxbeach_la-output.lo
ifort: command line warning #10006: ignoring unknown option '-ffree-line-length-none'
output.F90(6): error #7002: Error in opening the compiled module file. Check INCLUDE paths. [NCOUTPUT_MODULE]
use ncoutput_module
-------^
compilation aborted for output.F90 (code 1)


Do you have any hint?

I am experiencing the same compilation errors for netcdf with Delft3D...
Giovanni Besio, modified 4 Years ago.

RE: Compiling Xbeach with netcdf

Capillary Posts: 12 Join Date: 10/25/12 Recent Posts
Sorry, I was not correct

Without netcdf I get this error:

ifort: command line warning #10006: ignoring unknown option '-ffree-line-length-none'
vegetation.F90(417): error #5102: Cannot open include file 'RFveg.inc'
include 'RFveg.inc'
------------^
vegetation.F90(485): error #6404: This name does not have a type, and must have an explicit type. [RFVEG]
urf0(irf) = f0*RFveg(irf+3,ih0,it0)+f1*RFveg(irf+3,ih1,it0)+ f2*RFveg(irf+3,ih0,it1)+f3*RFveg(irf+3,ih1,it1)
-----------------------^
compilation aborted for vegetation.F90 (code 1)
make[4]: *** [libxbeach_la-vegetation.lo] Error 1
make[4]: Leaving directory `/opt/xbeach/trunk_4869/src/xbeachlibrary'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/opt/xbeach/trunk_4869/src/xbeachlibrary'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/opt/xbeach/trunk_4869/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/opt/xbeach/trunk_4869'
make: *** [all] Error 2


It does seem that there is some problem with the definition of the module RFveg


Giovanni
Benjamin Carrion, modified 4 Years ago.

RE: Compiling Xbeach with netcdf

Capillary Posts: 5 Join Date: 8/4/14 Recent Posts
Hi Giovanni,

I'm also struggling with compiling XBeach and Delft3d.
It looks like you're using a Linux machine, right? Did you have any luck with the instalation? Any hint or where to look at.

I'm using an Ubuntu distribution, so the paths are different, and I can't quite find the location of my right netcdf executables... at least, I think that's the problem

Anyhow, if you could solve your problem, and could shed some light on how to proceed, I'd appreciate it.

Cheers,
Benjamin
Giovanni Besio, modified 4 Years ago.

RE: Compiling Xbeach with netcdf

Capillary Posts: 12 Join Date: 10/25/12 Recent Posts
Hi Benjamin,
I am using a dual six core with
Open Suse 13.1
ifort 14.0.3 20140422

I compiled netcdf for fortran and for c but it seems that it does not like them or I am not able to provide the right setting in order to include them in the final compilation

Anyway the error I was reporting does not occur with netcdf because I was compiling without it

Giovanni
Giovanni Besio, modified 4 Years ago.

RE: Compiling Xbeach with netcdf

Capillary Posts: 12 Join Date: 10/25/12 Recent Posts
Look,
I compiled with ifort the following packages:
szip-2.1
zlib-1.2.8
hdf5-1.8.15
netcdf_4.4.2 for fortran

and I set

export NETCDFROOT=/opt/netcdf_4.4.2_fortran
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$NETCDFROOT/lib64/pkgconfig

but when I give the command configure, it seems that netcdf is not there:

checking pkg-config is at least version 0.9.0... yes
checking for NETCDF_FORTRAN... no
checking for NETCDF... no
configure: error: Package requirements (netcdf >= 4) were not met:

No package 'netcdf' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables NETCDF_CFLAGS
and NETCDF_LIBS to avoid the need to call pkg-config.


I do not understand why

G
Bas Hoonhout, modified 4 Years ago.

RE: Compiling Xbeach with netcdf

Infra-gravity Posts: 362 Join Date: 5/20/11 Recent Posts
Hi Giovanni,

Sorry, I've been out of office for a while. Any progress on this issue?

Did you try using the gfortran compiler instead of ifort? Our linux machines are using gfortran, so just to exclude the possibility of a compiler issue.

Furthermore, it seems that you are using the 64 bit netCDF libraries. You are working on a 64-bit environment then, I assume?

I think the RFveg.inc error is unrelated. If this is still an issue, we should start a separate thread.

Bas
CB
Cüneyt Baykal, modified 4 Years ago.

RE: Compiling Xbeach with netcdf

Wind Posts: 37 Join Date: 4/8/15 Recent Posts
Hi Giovanni,

I am having a netcdf related error in my compilation as well. How did you compile the netcdf libraries before configuring xbeach?

I have used the following to compile netcdf libraries.

# netcdf-c
git clone https://github.com/Unidata/netcdf-c.git; cd netcdf-c    # To update, just git pull
autoreconf -i -f
CPPFLAGS=-I/truba/home/cbaykal/XBeach/local/include LDFLAGS=-L/truba/home/cbaykal/XBeach/local/lib ./configure --prefix=/truba/home/cbaykal/XBeach/local --enable-parallel-tests --disable-dap --disable-dap-remote-tests --disable-shared --disable-netcdf-4
make check
make install

# netcdf-fortran
git clone https://github.com/Unidata/netcdf-fortran.git; cd netcdf-fortran     # To update, just git pull
autoreconf -i -f
export LD_LIBRARY_PATH=/truba/home/cbaykal/XBeach/local/lib:${LD_LIBRARY_PATH}
CPPFLAGS=-I/truba/home/cbaykal/XBeach/local/include LDFLAGS=-L/truba/home/cbaykal/XBeach/local/lib LIBS="-L/truba/home/cbaykal/XBeach/local/lib -lnetcdf -L/truba/home/cbaykal/XBeach/local/lib -lhdf5_hl -lhdf5 -L/truba/home/cbaykal/XBeach/local/lib -lz -lm" ./configure --prefix=/truba/home/cbaykal/XBeach/local --disable-shared
make check
make install


yet I get the error

/usr/bin/ld: /truba/home/cbaykal/XBeach/local/lib/libnetcdff.a(netcdf.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/truba/home/cbaykal/XBeach/local/lib/libnetcdff.a: could not read symbols: Bad value
Fedor Baart, modified 4 Years ago.

RE: Compiling Xbeach with netcdf

Capillary Posts: 24 Join Date: 3/2/11 Recent Posts
Cüneyt Baykal:
Hi Giovanni,
/usr/bin/ld: /truba/home/cbaykal/XBeach/local/lib/libnetcdff.a(netcdf.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/truba/home/cbaykal/XBeach/local/lib/libnetcdff.a: could not read symbols: Bad value


When you get this error you are mixing binaries that have been compiled with and without position independent code (-fPIC). Most of the time this is caused by mixing objects build for static libraries with objects build for dynamic libraries. I would try to build again without the option --disable-shared and running
make clean
before you run configure again.

Both xbeach and netcdf will build both a static and dynamic version of the libraries (using libtool). If you want to build only static versions of the netcdf libraries you should also only build a static version of xbeach. My suggestion would be to just build with the default options, so you get both static and dynamic versions of the libraries.

If you're building from github you might want to checkout a released version (for example git checkout v4.3.3.1) for a more stable experience.

HTH,

Fedor
CB
Cüneyt Baykal, modified 4 Years ago.

RE: Compiling Xbeach with netcdf

Wind Posts: 37 Join Date: 4/8/15 Recent Posts
Thanks Fedor,
maybe my main problem was that I didnt know exactly which options to choose for which package. I am trying to install xbeach to a centos 6.4 cluster.

Simply, I selected the following combination and had min errors, but at the end, while installing xbeach I got that error.

first installed zlib then
for hdf5 I did
--enable-parallel ??
--enable-fortran ??

for netcdf-c
--enable-parallel-tests ??
--disable-dap ??
--disable-dap-remote-tests ??
--disable-shared ****** so this one should also be shared ???
--disable-netcdf-4 ****** otherwise it gives the error that it cant see hdf5 lib.

for netcdf-fortran
--disable-shared ******* I will make it enabled

My contradiction was due to below given statement in:
https://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html#build_parallel

"If the HDF5 used by netCDF has been built with parallel I/O, then netCDF will also be built with inherited support for parallel I/O. This allows parallel I/O access to netCDF-4/HDF5 files. Note that shared libraries are not supported for parallel HDF5, which makes linking more difficult to get right. (See /ref netcdf_formats for more information about the netCDF format variants.)

From the top-level netCDF-4 source directory, the following builds netCDF-4 with parallel I/O, assuming H5DIR specifies where parallel HDF5 was installed:
$ # Build, test, and install netCDF-4 with HDF5 parallel support
$ CC=mpicc CPPFLAGS=-I${H5DIR}/include LDFLAGS=-L${H5DIR}/lib \
./configure --disable-shared --enable-parallel-tests --prefix=${NCDIR}
$ make check
$ make install
"
JM
Jaap Meijer, modified 4 Years ago.

RE: Compiling Xbeach with netcdf

Capillary Posts: 2 Join Date: 9/11/15 Recent Posts
Dear all,

Thanks for your comments so far. I still have a remaining problem with compiling Xbeach Kingsday on an Linux Mint sytem.
Compiling Xbeach without netcdf works and even with netcdf I see that it finds netcdf fortran by giving the message: " checking for NETCDF_FORTRAN yes".
However it breaks down after the following commands,

make clean
make distclean
./configure --with-netcdf --prefix /home/janjaapmeijer/local
make

at the moment where it comes to:

PPFC libxbeach_la-ncoutput.lo

Any ideas? I have added the config.log, but as an relatively unexperienced I couldn't read what the problem exactly was.

Thanks for your help.

Cheers Jaap

Attachments:

CB
Cüneyt Baykal, modified 4 Years ago.

RE: Compiling Xbeach with netcdf

Wind Posts: 37 Join Date: 4/8/15 Recent Posts
Hi Jaap,
Could you share your settings that you used while installing netcdf and rest?
in which order? which version? and with which options?

I am also having trouble with the netcdf.

Best
JM
Jaap Meijer, modified 4 Years ago.

RE: Compiling Xbeach with netcdf

Capillary Posts: 2 Join Date: 9/11/15 Recent Posts
Hi Cüneyt,

I made a small document with all the steps that I took, but as I said this does not work yet, when trying to build xbeach with netcdf.

I hope it is useful for you. Any suggestions for improvement?

Cheers Jaap


3. install the following packages

# INSTALL GFORTRAN
sudo apt-get install gfortran

% check version
gfortran --version

# INSTALL AUTOMAKE
# https://www.gnu.org/software/automake/
sudo apt-get install automake
automake --add-missing


# BUILD AND INSTALL SZIP
https://www.hdfgroup.org/HDF5/release/obtain5.html

tar -xvf szip-2.1.tar.gz
cd szip-2.1
(sudo apt install libc6-dev # if: configure: error: C compiler cannot create executables)
SDIR=/usr/local
./configure --prefix=${SDIR}
make check
make install # or sudo make install, if root permissions required


# BUILD AND INSTALL ZLIB
# http://www.zlib.net/
tar -xvf zlib-1.2.8.tar.gz
cd zlib-1.2.8/

ZDIR=/usr/local
./configure --prefix=${ZDIR}
make check
make install # or sudo make install, if root permissions required


# BUILD AND INSTALL HDF5
tar -xvf hdf5-1.8.16.tar
cd hdf5-1.8.16/
(sudo apt-get install g++ # if: error: C++ preprocessor "/lib/cpp" fails sanity check)

export LD_LIBRARY_PATH=${H5DIR}/lib:${LD_LIBRARY_PATH}

H5DIR=/usr/local
FC=gfortran ./configure --with-szlib=${SDIR} --with-zlib=${ZDIR} --prefix=${H5DIR} --enable-shared --enable-hl

make check
make install # or sudo make install, if root permissions required

# BUILD AND INSTALL NETCDF-4
# https://www.unidata.ucar.edu/software/netcdf/docs/getting_and_building_netcdf.html

tar -xzf netcdf-4.4.0.tar.gz
cd netcdf-4.4.0

CC=/usr/local/cc
NCDIR=/usr/local

FC=gfortran CPPFLAGS=-I${H5DIR}/include LDFLAGS=-L${H5DIR}/lib ./configure --enable-netcdf-4 --enable-dap --enable-shared --prefix=${NCDIR}

make check
make install # or sudo make install, if root permissions required

tar -xvf netcdf-fortran-4.4.2.tar.gz
netcdf-fortran-4.4.2/

NFDIR=/usr/local
CPPFLAGS=-I${NCDIR}/include LDFLAGS=-L${NCDIR}/lib \
./configure --prefix=${NFDIR}

make check
make install or sudo make install

% check version
nc-config --version

sudo apt-get install libnetcdf-dev


4. compile the XBeach source code
export PATH="/usr/bin:$PATH"

export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
echo $PATH
export PATH=$PATH:/usr/local/bin

(make clean) - clear previous compiled versions
(make distclean) - "

FC=gfortran ./configure --with-netcdf --prefix /home/janjaapmeijer/local

make check
make install # or sudo make install, if root permissions required
TH
Torben Helsloot, modified 3 Years ago.

RE: Compiling Xbeach with netcdf

Capillary Posts: 1 Join Date: 11/23/16 Recent Posts
I do not think you need to install all those packages. The 'libnetcdf-dev' package already includes everything you need.
I received the error message that netcdf.mod could not be found. After copying the netcdf.mod file into the directory from which I was building XBeach the compilation completed successfully. It may not be a pretty solution but it worked.
ML
Mario Mascagni, modified 2 Years ago.

RE: Compiling Xbeach with netcdf

Capillary Posts: 3 Join Date: 11/24/11 Recent Posts
Dear all,

I am trying to compile the XBeach-v1.22.4867-Kingsday/ with mpi and netcdf on Linux (Gentoo), but I am getting the following errors:

--------------------------------------------------------------------------------------------^
ncoutput.F90:280:16:

if (par%nz .gt. 1) then
1
Error: ‘nz’ at (1) is not a member of the ‘parameters’ structure
ncoutput.F90:281:56:

NF90(nf90_def_dim(ncid, 'nz', par%nz, Q3Ddimid))
1
Error: ‘nz’ at (1) is not a member of the ‘parameters’ structure
ncoutput.F90:282:9:

end if
1
Error: Expecting END SUBROUTINE statement at (1)
ncoutput.F90:805:28:

if(par%remdryoutput==1) then
1
Error: ‘remdryoutput’ at (1) is not a member of the ‘parameters’ structure
ncoutput.F90:809:9:

endif
1
Error: Expecting END SUBROUTINE statement at (1)
ncoutput.F90:1196:37:

if(par%remdryoutput==1) call postprocessvar_r2(s%wetz, t, dFill, r2)
1
Error: ‘remdryoutput’ at (1) is not a member of the ‘parameters’ structure
make[4]: *** [Makefile:660: libxbeach_la-ncoutput.lo] Error 1
------------------------------------------------------------------------------------------------------------^

I tried to compile the trunk first, but it is missing the configure file and a lot of installation files. I just update my trunk mirror with svn support, but is still missing the files.

--------------------------------------------------------------------------------
So, I am using the gcc version: x86_64-pc-linux-gnu-6.3.0

the necdf configuration:
--cc        -> mpicc
  --cflags    -> -I/usr/include
  --libs      -> -L/usr/lib64 -lnetcdf

  --has-c++   -> no
  --cxx       ->

  --has-c++4  -> yes
  --cxx4      -> x86_64-pc-linux-gnu-g++
  --cxx4flags -> -I/usr/include
  --cxx4libs  -> -L/usr/lib64 -lnetcdf_c++4 -lnetcdf

  --has-fortran-> yes
  --fc        -> x86_64-pc-linux-gnu-gfortran
  --fflags    -> -I/usr/include
  --flibs     -> -L/usr/lib -lnetcdff -Wl,-O1 -Wl,--as-needed -lnetcdf -lnetcdf
  --has-f90   -> no
  --has-f03   -> yes

  --has-dap   -> yes
  --has-nc2   -> yes
  --has-nc4   -> yes
  --has-hdf5  -> yes
  --has-hdf4  -> yes
  --has-logging-> no
  --has-pnetcdf-> no
  --has-szlib ->

  --prefix    -> /usr
  --includedir-> /usr/include
  --libdir    -> /usr/lib64
  --version   -> netCDF 4.4.1.1


the netcdf-fortran config.:
--cc        -> x86_64-pc-linux-gnu-gcc
  --cflags    ->  -I/usr/include

  --fc        -> x86_64-pc-linux-gnu-gfortran
  --fflags    -> -I/usr/include
  --flibs     -> -L/usr/lib -lnetcdff -Wl,-O1 -Wl,--as-needed -lnetcdf -lnetcdf
  --has-f90   -> no
  --has-f03   -> yes

  --has-nc2   -> yes
  --has-nc4   -> yes

  --prefix    -> /usr
  --includedir-> /usr/include
  --version   -> netCDF-Fortran 4.4.3

-------------------------------------------------

I am calling:
./configure FCFLAGS=-ffree-line-length-none --with-netcdf --with-mpi


checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/x86_64-pc-linux-gnu/bin/ld
checking if the linker (/usr/x86_64-pc-linux-gnu/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/x86_64-pc-linux-gnu/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... gawk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/x86_64-pc-linux-gnu/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of gcc... none
checking whether make supports nested variables... (cached) yes
checking whether we are using the GNU Fortran compiler... yes
checking whether gfortran accepts -g... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gfortran option to produce PIC... -fPIC
checking if gfortran PIC flag -fPIC works... yes
checking if gfortran static flag -static works... yes
checking if gfortran supports -c -o file.o... yes
checking if gfortran supports -c -o file.o... (cached) yes
checking whether the gfortran linker (/usr/x86_64-pc-linux-gnu/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for openmpif90... no
checking for mpif90... mpif90
checking for MPI_Init... yes
checking for mpif.h... yes
checking for isnan... yes
checking for IEEE_ARITHMETIC... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for NETCDF_FORTRAN... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: creating doc/man/Makefile
config.status: creating src/Makefile
config.status: creating src/makeincludes/Makefile
config.status: creating src/xbeachlibrary/Makefile
config.status: creating src/xbeach/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing libtool commands
config.status: executing depfiles commands


Thanks for any help!
ML
Mario Mascagni, modified 2 Years ago.

RE: Compiling Xbeach with netcdf

Capillary Posts: 3 Join Date: 11/24/11 Recent Posts
I was able to install Xbeach with mpi and netcdf on my notebook by downloading the installation files that were missing from the trunk folder and I also downloaded the ncoutput.lo file direct from the github page. After that, it was possible to compile the Xbeach without errors.
LX
Ludy Xu, modified 1 Year ago.

RE: Compiling Xbeach with netcdf

Capillary Posts: 2 Join Date: 7/12/18 Recent Posts

Hi, Mario,

 I'm still trying to install xbeach with mpi and netcdf on my sever. I have the same error message,

checking for openmpif90... no
checking for mpif90... mpif90
checking for MPI_Init... no
checking for MPI_Init in -lfmpi... no
checking for MPI_Init in -lmpichf90... no
checking for MPI_Init in -lmpi... no
checking for MPI_Init in -lmpich... no
checking for Fortran flag needed to accept free-form source... unknown
configure: error: Fortran does not accept free-form source

Can you share the methods how do you install it without errors? Thanks a lot.

ML
Mario Luiz Mascagni, modified 1 Year ago.

RE: Compiling Xbeach with netcdf

Capillary Posts: 3 Join Date: 11/24/11 Recent Posts

Hi Ludy Xu;

I have the following packages related to xbeach compilation installed on my system:

- sys-devel/gcc v7.3.0-r3, with flags: cilk cxx fortran go graphite multilib nls nptl objc objc++ openmp pch pie sanitize ssp vtv

- sys-devel/autoconf v2.13

- sys-devel/automake v1.15.1-r2

- openmpi v3.1.1, with flags: cxx fortran ipv6 romio

- sys-libs/zlib v1.2.11-r2

- sci-libs/hdf5 v1.10.1, with flags: fortran hl mpi szip zlib

- sci-libs/netcdf v4.3.0

- sci-libs/netcdf-cxx v4.4.0

- sci-libs/netcdf-fortran v4.4.3

First, check if you are missing any of these packages in your system.

PS: I remember that versions 5.* of gcc presented a lot of bugs. So, if that is your case, I advise you to update your gcc. And it is advised also to recompile all other packages with the new gcc in this cenario.

Once you have all packages ok, (including xbeach, I have downloaded the trunk version and update it with svn), go to the xbeach dir and try the following commands:

$> make unistall #to clean your system of any precompiled program you might have in your xbeach directory

$> CC=gcc; FC=mpif90; ./configure with-mpi with-netcdf

$> make

Good luck!