diff --git a/build/README.md b/build/README.md index f19cbc7826a56952be3e239407e6f26e9c8f4a4c..01d8f651732368753e65a697064164fd789ae3ac 100644 --- a/build/README.md +++ b/build/README.md @@ -13,15 +13,15 @@ This section describes the use of the pre-existing programs, once the binaries h ### cluster 1. cd to the `build/cluster` folder. -2. Run `edfb`: +2. Run `edfb_clu`: - > ./edfb + > ./edfb_clu 3. Run `clu`: > ./clu -*NOTE:* both `edfb` and `clu` expect an input which is assumed to be in a folder named `../../test_data/cluster/` (i.e. two levels above the current execution path) +*NOTE:* both `edfb_clu` and `clu` expect an input which is assumed to be in a folder named `../../test_data/cluster/` (i.e. two levels above the current execution path) 4. Run `np_cluster`: @@ -31,22 +31,22 @@ This section describes the use of the pre-existing programs, once the binaries h 5. Check the consistency between the output files (the default output file for the *FORTRAN* code is named `OCLU`, while the corresponding *C++* output has the default name of `c_OCLU`). -The default behaviour of `np_cluster` is to take the same input files as `edfb` and `clu` and to write the output in the current folder. If needed, different input and output paths can be given as command-line arguments: +The default behaviour of `np_cluster` is to take the same input files as `edfb_clu` and `clu` and to write the output in the current folder. If needed, different input and output paths can be given as command-line arguments: > ./np_cluster PATH_TO_DEDFB PATH_TO_DCLU OUTPUT_PATH ### sphere 1. cd to the `build/sphere` folder. -2. Run `edfb`: +2. Run `edfb_sph`: - > ./edfb + > ./edfb_sph 3. Run `sph`: > ./sph -*NOTE:* both `edfb` and `sph` expect an input which is assumed to be in a folder named `../../test_data/sphere/` (i.e. two levels above the current execution path) +*NOTE:* both `edfb_sph` and `sph` expect an input which is assumed to be in a folder named `../../test_data/sphere/` (i.e. two levels above the current execution path) 4. Run `np_sphere`: @@ -56,7 +56,7 @@ The default behaviour of `np_cluster` is to take the same input files as `edfb` 5. Check the consistency between the output files (the default output file for the *FORTRAN* code is named `OSPH`, while the corresponding *C++* output has the default name of `c_OSPH`). -The default behaviour of `np_sphere` is to take the same input files as `edfb` and `sph` and to write the output in the current folder. If needed, different input and output paths can be given as command-line arguments: +The default behaviour of `np_sphere` is to take the same input files as `edfb_sph` and `sph` and to write the output in the current folder. If needed, different input and output paths can be given as command-line arguments: > ./np_sphere PATH_TO_DEDFB PATH_TO_DSPH OUTPUT_PATH diff --git a/containers/docker/Dockerfile b/containers/docker/Dockerfile index 1157a744c5910567ff42c67b99881ed582cc4d6e..013c483ca45052c15956e6e50409a698bd260c0a 100644 --- a/containers/docker/Dockerfile +++ b/containers/docker/Dockerfile @@ -40,7 +40,7 @@ FROM debian:bookworm-slim AS np-tmcode-run-minimal WORKDIR /root # install the strictly needed runtime libraries needed to run the executables # and the python check scripts -RUN DEBIAN_FRONTEND=noninteractive apt update && DEBIAN_FRONTEND=noninteractive apt upgrade && DEBIAN_FRONTEND=noninteractive apt -y install libgfortran5 libgcc-s1 libhdf5-103-1 libstdc++6 libssl3 libcurl4 libsz2 zlib1g libnghttp2-14 libidn2-0 librtmp1 libssh2-1 libpsl5 libgssapi-krb5-2 libldap-2.5-0 libzstd1 libbrotli1 libaec0 libunistring2 libgmp10 libkrb5-3 libk5crypto3 libcom-err2 libkrb5support0 libsasl2-2 libp11-kit0 libtasn1-6 libkeyutils1 libffi8 python3 python-is-python3 python3-regex && rm -rf /var/lib/apt/lists/* +RUN DEBIAN_FRONTEND=noninteractive apt update && DEBIAN_FRONTEND=noninteractive apt upgrade && DEBIAN_FRONTEND=noninteractive apt -y install libgfortran5 libgcc-s1 libhdf5-103-1 libstdc++6 libssl3 libcurl4 libsz2 zlib1g libnghttp2-14 libidn2-0 librtmp1 libssh2-1 libpsl5 libgssapi-krb5-2 libldap-2.5-0 libzstd1 libbrotli1 libaec0 libunistring2 libgmp10 libkrb5-3 libk5crypto3 libcom-err2 libkrb5support0 libsasl2-2 libp11-kit0 libtasn1-6 libkeyutils1 libffi8 python3 python-is-python3 python3-regex hdf5-tools && rm -rf /var/lib/apt/lists/* COPY --from=np-tmcode-run-dev /root /root # remove everything which is not needed to run the codes RUN cd /root/np-tmcode && find build -name "*.o" -exec rm -v \{\} \; && find build -name "*.gcno" -exec rm -v \{\} \; && cd src && rm -rvf cluster libnptm trapping include sphere Makefile make.inc README.md && cd .. && rm -rvf containers && cd doc && rm -rvf src && cd build/latex && rm -rvf *.tex *.out *.sty *.ind *.log *.toc *.ilg *.idx *.aux *.eps Makefile class*.pdf diff --git a/containers/singularity/np-tmcode-run.def b/containers/singularity/np-tmcode-run.def index 924baadc0e5baf4792c8755834997056271380ba..da7025e0dd6899c8bf0698ec4615cb923bcc01ad 100644 --- a/containers/singularity/np-tmcode-run.def +++ b/containers/singularity/np-tmcode-run.def @@ -32,7 +32,7 @@ Stage: np-tmcode-run-minimal %post apt update apt -y upgrade - apt -y install libgfortran5 libgcc-s1 libhdf5-103-1 libstdc++6 libssl3 libcurl4 libsz2 zlib1g libnghttp2-14 libidn2-0 librtmp1 libssh2-1 libpsl5 libgssapi-krb5-2 libldap-2.5-0 libzstd1 libbrotli1 libaec0 libunistring2 libgmp10 libkrb5-3 libk5crypto3 libcom-err2 libkrb5support0 libsasl2-2 libp11-kit0 libtasn1-6 libkeyutils1 libffi8 python3 python-is-python3 python3-regex + apt -y install libgfortran5 libgcc-s1 libhdf5-103-1 libstdc++6 libssl3 libcurl4 libsz2 zlib1g libnghttp2-14 libidn2-0 librtmp1 libssh2-1 libpsl5 libgssapi-krb5-2 libldap-2.5-0 libzstd1 libbrotli1 libaec0 libunistring2 libgmp10 libkrb5-3 libk5crypto3 libcom-err2 libkrb5support0 libsasl2-2 libp11-kit0 libtasn1-6 libkeyutils1 libffi8 python3 python-is-python3 python3-regex hdf5-tools rm -rf /var/lib/apt/lists/* cd /usr/local/np-tmcode find build -name "*.o" -exec rm -v \{\} \; @@ -45,7 +45,7 @@ Stage: np-tmcode-run-minimal rm -rvf src/cluster /src/include /src/libntpm /src/sphere /src/trapping /src/Makefile /src/make.inc cd build/latex rm -rvf *.tex *.out *.sty *.ind *.log *.toc *.ilg *.idx *.aux *.eps Makefile class*.pdf - cp -a /usr/bin/ld.so /usr/bin/sh /usr/bin/dash /usr/bin/mkdir /usr/bin/rm /usr/bin/cp /usr/bin/python* /usr/local/bin/ + cp -a /usr/bin/ld.so /usr/bin/sh /usr/bin/dash /usr/bin/mkdir /usr/bin/rm /usr/bin/cp /usr/bin/python* /usr/bin/h5* /usr/local/bin/ rm -rvf /bin/* /usr/bin/* /sbin /usr/sbin /usr/games /usr/local/games /usr/local/bin/mkdir -p /bin /usr/local/bin/cp -av /usr/local/bin/* /bin/ diff --git a/containers/singularity/np-tmcode-run.sif b/containers/singularity/np-tmcode-run.sif index 26b865aa590a022035d0b3bb2b2bb7f4d384ab41..ef165c012d75f3722d7921179f09c9aea22ef58f 100755 Binary files a/containers/singularity/np-tmcode-run.sif and b/containers/singularity/np-tmcode-run.sif differ diff --git a/src/cluster/Makefile b/src/cluster/Makefile index 37c271251f2eff079354ab9610d1c6e4adc9fcc8..49e2fe59d5bc48d6fadbaac1a30415c218474b19 100644 --- a/src/cluster/Makefile +++ b/src/cluster/Makefile @@ -3,13 +3,13 @@ BUILDDIR=../../build/cluster include ../make.inc -all: clu edfb np_cluster +all: clu edfb_clu np_cluster clu: clu.o $(FC) $(FCFLAGS) -o $(BUILDDIR)/clu $(BUILDDIR)/clu.o $(LDFLAGS) -edfb: edfb.o - $(FC) $(FCFLAGS) -o $(BUILDDIR)/edfb $(BUILDDIR)/edfb.o $(LDFLAGS) +edfb_clu: edfb_clu.o + $(FC) $(FCFLAGS) -o $(BUILDDIR)/edfb_clu $(BUILDDIR)/edfb_clu.o $(LDFLAGS) np_cluster: $(BUILDDIR)/np_cluster.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/file_io.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sph_subs.o $(BUILDDIR)/clu_subs.o $(BUILDDIR)/cluster.o $(CXX) $(CXXFLAGS) -o $(BUILDDIR)/np_cluster $(BUILDDIR)/np_cluster.o $(BUILDDIR)/Commons.o $(BUILDDIR)/Configuration.o $(BUILDDIR)/file_io.o $(BUILDDIR)/Parsers.o $(BUILDDIR)/sph_subs.o $(BUILDDIR)/clu_subs.o $(BUILDDIR)/cluster.o $(CXXLDFLAGS) @@ -42,5 +42,5 @@ clean: rm -f $(BUILDDIR)/*.o wipe: - rm -f $(BUILDDIR)/clu $(BUILDDIR)/edfb $(BUILDDIR)/*.o + rm -f $(BUILDDIR)/clu $(BUILDDIR)/edfb_clu $(BUILDDIR)/*.o diff --git a/src/cluster/edfb.f b/src/cluster/edfb_clu.f similarity index 100% rename from src/cluster/edfb.f rename to src/cluster/edfb_clu.f diff --git a/src/make.inc b/src/make.inc index ac95b212b05534d9318db6149ea347705b09c73c..4dd67a1420877749f14490f4463781f788be16aa 100644 --- a/src/make.inc +++ b/src/make.inc @@ -1,32 +1,43 @@ +# FC defines the fortran compiler to use. If undefined, GNU Make tries to use `f77` ifndef FC override FC=gfortran endif +# FCFLAGS defines the compilation options for the fortran compiler ifndef FCFLAGS override FCFLAGS=-std=legacy -O3 endif +# LDFLAGS defines the default linker flags ifndef LDFLAGS override LDFLAGS= endif +# CXX defines the default C++ compiler to use. If undefined, GNU Make tries to use g++ ifndef CXX override CXX=g++ endif +# HDF5_INCLUDE defines the default path to the HDF5 include files to use ifndef HDF5_INCLUDE override HDF5_INCLUDE=/usr/include/hdf5/serial endif +# CXXFLAGS defines the default compilation options for the C++ compiler ifndef CXXFLAGS -override CXXFLAGS=-O3 -ggdb -pg -coverage -I$(HDF5_INCLUDE) +#override CXXFLAGS=-O3 -ggdb -pg -coverage -I$(HDF5_INCLUDE) +override CXXFLAGS=-O3 -I$(HDF5_INCLUDE) endif +# HDF5_LIB defines the default path to the HDF5 libraries to use +# CXXLDFLAGS defines the default linker flags to use for C++ codes ifndef CXXLDFLAGS ifndef HDF5_LIB override HDF5_LIB=/usr/lib/x86_64-linux-gnu/hdf5/serial endif override CXXLDFLAGS=-L/usr/lib64 -L$(HDF5_LIB) -lhdf5 $(LDFLAGS) +#else +#override CXXLDFLAGS=-L/usr/lib64 -L$(HDF5_LIB) -lhdf5 $(CXXLDFLAGS) endif %.o : %.f diff --git a/src/sphere/Makefile b/src/sphere/Makefile index 384a85b9ede135f920d78585c0f924495e9d13f9..c2e8b5c5fb609308557866c19ec08850b17b27ba 100644 --- a/src/sphere/Makefile +++ b/src/sphere/Makefile @@ -9,10 +9,10 @@ include ../make.inc #CXXFLAGS=-O2 -ggdb -pg -coverage #CXXLFLAGS=-L/usr/lib64 -lhdf5_hl -lhdf5 -all: edfb sph np_sphere +all: edfb_sph sph np_sphere -edfb: edfb.o - $(FC) $(FCFLAGS) -o $(BUILDDIR)/edfb $(BUILDDIR)/edfb.o $(LDFLAGS) +edfb_sph: edfb_sph.o + $(FC) $(FCFLAGS) -o $(BUILDDIR)/edfb_sph $(BUILDDIR)/edfb_sph.o $(LDFLAGS) sph: sph.o $(FC) $(FCFLAGS) -o $(BUILDDIR)/sph $(BUILDDIR)/sph.o $(LDFLAGS) @@ -45,5 +45,5 @@ clean: rm -f $(BUILDDIR)/*.o wipe: - rm -f $(BUILDDIR)/edfb $(BUILDDIR)/sph $(BUILDDIR)/*.o + rm -f $(BUILDDIR)/edfb_sph $(BUILDDIR)/sph $(BUILDDIR)/*.o diff --git a/src/sphere/edfb.f b/src/sphere/edfb_sph.f similarity index 100% rename from src/sphere/edfb.f rename to src/sphere/edfb_sph.f