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

Add support for building shared/dynamic libraries #1578

Merged
merged 14 commits into from
Nov 4, 2024
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
*.mod
*.smod
*.o
*.lo
*.Plo
*.dirstamp
*.Po
Makefile
Expand Down Expand Up @@ -43,6 +45,15 @@ examples/*/*.nek5000
examples/*/*0.f0*
*.chkp
*.lst
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
src/libneko.la
src/.libs/libneko.la
src/.libs/libneko.lai
ltmain.sh

# Ignore temporary files
*~
Expand Down
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ACLOCAL_AMFLAGS = -I m4 --install
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = neko.pc

Expand Down
5 changes: 4 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ AM_MAINTAINER_MODE
AC_CONFIG_MACRO_DIR([m4])
AC_CANONICAL_HOST
AC_LANG(Fortran)
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_SED
AC_PROG_MAKE_SET
LT_INIT([disable-shared])
LT_LANG([Fortran])

AC_ARG_ENABLE(contrib,
AS_HELP_STRING([--enable-contrib],[Compile various tools]),
Expand Down
2 changes: 1 addition & 1 deletion contrib/average_field_in_space/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bin_PROGRAMS = average_field_in_space
average_field_in_space_SOURCES = average_field_in_space.f90
average_field_in_space_LDADD = $(top_builddir)/src/libneko.a
average_field_in_space_LDADD = $(top_builddir)/src/libneko.la
average_field_in_space_LDFLAGS = $(LDFLAGS) $(LIBS)
AM_FCFLAGS = -I@top_builddir@/src
2 changes: 1 addition & 1 deletion contrib/average_fields_in_time/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bin_PROGRAMS = average_fields_in_time
average_fields_in_time_SOURCES = average_fields_in_time.f90
average_fields_in_time_LDADD = $(top_builddir)/src/libneko.a
average_fields_in_time_LDADD = $(top_builddir)/src/libneko.la
average_fields_in_time_LDFLAGS = $(LDFLAGS) $(LIBS)
AM_FCFLAGS = -I@top_builddir@/src
2 changes: 1 addition & 1 deletion contrib/calc_lift_from_field/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bin_PROGRAMS = calc_lift_from_field
calc_lift_from_field_SOURCES = calc_lift_from_field.f90
calc_lift_from_field_LDADD = $(top_builddir)/src/libneko.a
calc_lift_from_field_LDADD = $(top_builddir)/src/libneko.la
calc_lift_from_field_LDFLAGS = $(LDFLAGS) $(LIBS)
AM_FCFLAGS = -I@top_builddir@/src
2 changes: 1 addition & 1 deletion contrib/genmeshbox/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bin_PROGRAMS = genmeshbox
genmeshbox_SOURCES = genmeshbox.f90
genmeshbox_LDADD = $(top_builddir)/src/libneko.a
genmeshbox_LDADD = $(top_builddir)/src/libneko.la
genmeshbox_LDFLAGS = $(LDFLAGS) $(LIBS)
AM_FCFLAGS = -I@top_builddir@/src
2 changes: 1 addition & 1 deletion contrib/map_to_equidistant_1d/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bin_PROGRAMS = map_to_equidistant_1d
map_to_equidistant_1d_SOURCES = map_to_equidistant_1d.f90
map_to_equidistant_1d_LDADD = $(top_builddir)/src/libneko.a
map_to_equidistant_1d_LDADD = $(top_builddir)/src/libneko.la
map_to_equidistant_1dLDFLAGS = $(LDFLAGS) $(LIBS)
AM_FCFLAGS = -I@top_builddir@/src
2 changes: 1 addition & 1 deletion contrib/mesh_checker/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bin_PROGRAMS = mesh_checker
mesh_checker_SOURCES = mesh_checker.f90
mesh_checker_LDADD = $(top_builddir)/src/libneko.a
mesh_checker_LDADD = $(top_builddir)/src/libneko.la
mesh_checker_LDFLAGS = $(LDFLAGS) $(LIBS)
AM_FCFLAGS = -I@top_builddir@/src
2 changes: 1 addition & 1 deletion contrib/postprocess_fluid_stats/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bin_PROGRAMS = postprocess_fluid_stats
postprocess_fluid_stats_SOURCES = postprocess_fluid_stats.f90
postprocess_fluid_stats_LDADD = $(top_builddir)/src/libneko.a
postprocess_fluid_stats_LDADD = $(top_builddir)/src/libneko.la
postprocess_fluid_stats_LDFLAGS = $(LDFLAGS) $(LIBS)
AM_FCFLAGS = -I@top_builddir@/src
2 changes: 1 addition & 1 deletion contrib/prepart/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bin_PROGRAMS = prepart
prepart_SOURCES = prepart.f90
prepart_LDADD = $(top_builddir)/src/libneko.a
prepart_LDADD = $(top_builddir)/src/libneko.la
prepart_LDFLAGS = $(LDFLAGS) $(LIBS)
AM_FCFLAGS = -I@top_builddir@/src
4 changes: 2 additions & 2 deletions contrib/rea2nbin/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
bin_PROGRAMS = rea2nbin
rea2nbin_SOURCES = rea2nbin.f90
rea2nbin_LDADD = $(top_builddir)/src/libneko.a
rea2nbin_LDADD = $(top_builddir)/src/libneko.la
rea2nbin_LDFLAGS = $(LDFLAGS) $(LIBS)
AM_FCFLAGS = -I@top_builddir@/src
AM_FCFLAGS = -I@top_builddir@/src
4 changes: 3 additions & 1 deletion doc/pages/user-guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Neko can be installed in various ways, either building directly from source, man

## Building from source

To build Neko, you will need a Fortran compiler supporting the Fortran-08 standard, autotools, pkg-config, a working MPI installation supporting the Fortran 2008 bindings (`mpi_f08`), BLAS/LAPACK and JSON-Fortran. Optional dependencies are PFunit, gslib and ParMETIS.
To build Neko, you will need a Fortran compiler supporting the Fortran-08 standard, autotools, libtool, pkg-config, a working MPI installation supporting the Fortran 2008 bindings (`mpi_f08`), BLAS/LAPACK and JSON-Fortran. Optional dependencies are PFunit, gslib and ParMETIS.

Follow the steps below to install the less common dependencies (e.g. JSON-Fortran).

Expand Down Expand Up @@ -108,6 +108,8 @@ Features are enabled and disabled by passing either `--enable-FEATURE[=arg]` or
| `--enable-contrib` | Compile various tools |
| `--enable-device-mpi` | Enable device aware MPI |
| `--enable-openmp` | Enable OpenMP |
| `--enable-shared` | Build shared libraries (default: no) |
| `--enable-static` | Build static libraries (default: yes) |
timfelle marked this conversation as resolved.
Show resolved Hide resolved

Optional packages are controlled by passing either `--with-PACKAGE[=ARG]` or `--without-PACKAGE` to `configure`. A list of all supported optional packages are given in the table below.

Expand Down
10 changes: 10 additions & 0 deletions regen.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#!/bin/sh

echo "Updating configuration..."
echo "Running libtoolize"
if which libtoolize > /dev/null 2>&1; then
libtoolize -i
elif which glibtoolize > /dev/null 2>&1; then
glibtoolize -i
else
echo "No libtoolize found on your system"
exit 1
fi

rm -fr autom4te.cache
rm aclocal.m4

Expand Down
Loading
Loading