Commit 244cbc04 authored by Giovanni La Mura's avatar Giovanni La Mura
Browse files

Merge branch 'prepare_autoconf' into 'master'

Configuration script

Closes #13

See merge request giacomo.mulas/np_tmcode!51
parents e99276f8 06cc2ea0
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
build/include
build/aclocal.m4
build/autom4te.cache
build/config.*
build/cluster/*
build/error.log
build/libtool
build/Makefile
build/sphere/*
build/testing/*
build/trapping/*
build/libnptm/*
containers/singularity/*.sif
doc/build/*
src/*/objects/*
src/*/dynobjects/*
src/libnptm/.libs
src/libnptm/*.lo
src/*/.deps
src/*/.dirstamp
src/*/*.o
 No newline at end of file
+80 −22
Original line number Diff line number Diff line
@@ -29,11 +29,7 @@ compatibility_stage:
   allow_failure: true
   artifacts:
      paths:
         - build/cluster/*
         - build/sphere/*
         - build/testing/*
         - build/trapping/*
         - build/libnptm/*
         - build_*
      exclude:
         - ".git*"
         - ".git/**/*"
@@ -46,25 +42,80 @@ compatibility_stage:
      - echo $CI_COMMIT_BRANCH
      - echo "Getting system info ..."
      - cat /etc/os-release
      - cd src
      - echo "Running make with gnu compilers version 11..."
      - make clean && BUILDDIR=$PWD/../build_gnu11 CXX=g++-11 FC=gfortran-11 make -j
      - mkdir build_gnu11
      - cd build_gnu11
      - cp -r ../build/* .
      - CXX=g++-11 F77=gfortran-11 ./configure
      - make clean
      - make -j
      - echo "Running make with gnu compilers version 12..."
      - make clean && BUILDDIR=$PWD/../build_gnu12 CXX=g++-12 FC=gfortran-12 make -j
      - cd ..
      - rm -rf build_gnu11
      - mkdir build_gnu12
      - cd build_gnu12
      - cp -r ../build/* .
      - CXX=g++-12 F77=gfortran-12 ./configure
      - make clean
      - make -j
      - echo "Running make with gnu compilers version 13..."
      - make clean && BUILDDIR=$PWD/../build_gnu13 CXX=g++-13 FC=gfortran-13 make -j
      - cd ..
      - rm -rf build_gnu12
      - mkdir build_gnu13
      - cd build_gnu13
      - cp -r ../build/* .
      - CXX=g++-13 F77=gfortran-13 ./configure
      - make clean
      - make -j
      - echo "Running make with gnu compilers version 14..."
      - make clean && BUILDDIR=$PWD/../build_gnu14 CXX=g++-14 FC=gfortran-14 make -j
      - cd ..
      - rm -rf build_gnu13
      - mkdir build_gnu14
      - cd build_gnu14
      - cp -r ../build/* .
      - CXX=g++-14 F77=gfortran-14 ./configure
      - make clean
      - make -j
      - echo "Running make with flang version 16 and clang version 16..."
      - make clean && BUILDDIR=$PWD/../build_clang16 CXX="clang++-16 -stdlib=libstdc++ -I/usr/include/c++/13 -I/usr/include/x86_64-linux-gnu/c++/13" FC=flang-new-16 FCFLAGS=-O3 LDFLAGS="-L/usr/lib/llvm-16/lib -L/usr/lib/gcc/x86_64-linux-gnu/13" make -j
      - cd ..
      - rm -rf build_gnu14
      - mkdir build_clang16
      - cd build_clang16
      - cp -r ../build/* .
      - CXX=clang++-16 F77=flang-new-16 ./configure --with-fflags="-O3" --with-include="-I/usr/include/c++/13 -I/usr/include/x86_64-linux-gnu/c++/13" --with-ldflags="-L/usr/lib/llvm-16/lib -L/usr/lib/gcc/x86_64-linux-gnu/13" --disable-openmp
      - make clean
      - make -j
      - echo "Running make with flang version 17 and clang version 17..."
      - make clean && BUILDDIR=$PWD/../build_clang17 CXX="clang++-17 -stdlib=libstdc++ -I/usr/include/c++/13 -I/usr/include/x86_64-linux-gnu/c++/13" FC=flang-new-17 FCFLAGS=-O3 LDFLAGS="-L/usr/lib/llvm-17/lib -L/usr/lib/gcc/x86_64-linux-gnu/13" make -j
      - cd ..
      - rm -rf build_clang16
      - mkdir build_clang17
      - cd build_clang17
      - cp -r ../build/* .
      - CXX=clang++-17 F77=flang-new-17 ./configure --with-fflags="-O3" --with-include="-I/usr/include/c++/13 -I/usr/include/x86_64-linux-gnu/c++/13" --with-ldflags="-L/usr/lib/llvm-17/lib -L/usr/lib/gcc/x86_64-linux-gnu/13"  --disable-openmp
      - make clean
      - make -j
      - echo "Running make with Intel ifort and Intel icpx..."
      - make clean && LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/2024.2/lib PATH=/opt/intel/oneapi/compiler/2024.2/bin:$PATH BUILDDIR=$PWD/../build_ifort-icpx CXX=icpx FC=ifort FCFLAGS="-O3 -diag-disable=10448" make -j
      - cd ..
      - rm -rf build_clang17
      - mkdir build_ifort_icpx
      - cd build_ifort_icpx
      - cp -r ../build/* .
      - export LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/2024.2/lib
      - export PATH=/opt/intel/oneapi/compiler/2024.2/bin:$PATH
      - CXX=icpx F77=ifort ./configure --with-fflags="-O3 -diag-disable=10448" --disable-openmp
      - make clean
      - make -j
      - echo "Running make with Intel ifx and Intel icpx..."
      - make clean && LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/2024.2/lib PATH=/opt/intel/oneapi/compiler/2024.2/bin:$PATH BUILDDIR=$PWD/../build_ifx-icpx CXX=icpx FC=ifx FCFLAGS=-O3 make -j
      - echo "Running make with default MPI compilers"
      - make clean && BUILDDIR=$PWD/../build_mpi CXX=mpicxx FC=mpif90 USE_MPI=1 make -j
      - cd ..
      - rm -rf build_ifort_icpx
      - mkdir build_ifx_icpx
      - cd build_ifx_icpx
      - cp -r ../build/* .
      - export LD_LIBRARY_PATH=/opt/intel/oneapi/compiler/2024.2/lib
      - export PATH=/opt/intel/oneapi/compiler/2024.2/bin:$PATH
      - CXX=icpx F77=ifx ./configure --with-fflags="-O3" --disable-openmp
      - make clean
      - make -j
   
building_stage:
   stage: build
@@ -90,10 +141,17 @@ building_stage:
      - echo $CI_COMMIT_BRANCH
      - echo "Getting system info ..."
      - cat /etc/os-release
      - cd src
      - echo "Running make with default compilers..."
      - make clean && USE_LAPACK=1 USE_ILP64=1 make -j
      - make docs -j && make -C ../doc/build/latex -j
      - cd build
      - echo "Configuring with default compilers (MAGMA disabled)..."
      - ./configure --without-magma
      - make clean
      - echo "Building the default configuration..."
      - make -j
      - echo "Building the documentation..."
      - cd ../doc/src
      - doxygen config.dox
      - cd ../build/latex
      - make

running_stage:
   stage: run
@@ -125,7 +183,7 @@ running_stage:
      - cd ../cluster
      - echo "Running np_cluster"
      - chmod +x np_cluster
      - ./np_cluster
      - OMP_NUM_THREADS=1 ./np_cluster
      
testing_stage:
   stage: test
@@ -162,7 +220,7 @@ testing_stage:
      - export FFILE=../../test_data/cluster/OCLU
      - python3 ../../src/scripts/pycompare.py --no-progress --ffile=$FFILE --cfile=c_OCLU --html
      - echo "Testing cluster with 24 spheres"
      - ./np_cluster ../../test_data/cluster/DEDFB_24 ../../test_data/cluster/DCLU_24 .
      - OMP_NUM_THREADS=1 OMPI_ALLOW_RUN_AS_ROOT=1 OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 mpirun -n 2 ./np_cluster ../../test_data/cluster/DEDFB_24 ../../test_data/cluster/DCLU_24 .
      - echo "Comparing output of CLUSTER with 24 spheres"
      - export FFILE=../../test_data/cluster/OCLU_24
      - python3 ../../src/scripts/pycompare.py --no-progress --ffile=$FFILE --cfile=c_OCLU --html
+6 −1
Original line number Diff line number Diff line
@@ -6,7 +6,12 @@ The aim of the project, funded by PNRR-CNS, is to refactor the original, very ol

The current implementation offers a set of elementary tests to check that the original FORTRAN code can be compiled and executed on a limited set of pre-defined input data. The functionality of this initial stage can be verified by cloning the gitLab repository on a local machine and building the binaries from the `src` folder.

*NOTE:* The building process requires a working installation of the GNU Compiler Collection (`gcc`), of the GNU FORTRAN compiler (`gfortran`) and of the GNU `make` builder.
Distributing the code and its sources is possible under the terms of the GNU GPLv3 license (see *License* below). Use of this code and of any derived implementation should credit the original authors. Scientific publications should do so by citing the following references:

- Saija et al. 2001, ApJ, 559, 993, DOI:10.1086/322350
- Borghese, Denti, Saija 2007, Scattering from Model Nonspherical Particles (ISBN 978-3-540-37413-8), DOI:10.1007/978-3-540-37414-5

*NOTE:* The building process requires a working installation of a C++ and a FORTRAN compiler. Many solutions are available, but the recommended option is the *GNU Compiler Collection* `gcc` with the addition of `g++` and `gfortran`. The parallel code implementation further requires the use of parallel compilers complying with the MPI standard (*OpenMPI*, *MPICH*).

# License

build/Makefile.am

0 → 100644
+15 −0
Original line number Diff line number Diff line
LDADD=libnptm/libnptm.la -L/usr/lib64 ${USER_LDFLAGS} ${HDF5_LDFLAGS} ${LAPACKLDFLAGS} ${MAGMALDFLAGS}
lib_LTLIBRARIES=libnptm/libnptm.la
libnptm_libnptm_la_SOURCES=../src/libnptm/algebraic.cpp ../src/libnptm/clu_subs.cpp ../src/libnptm/Commons.cpp ../src/libnptm/Configuration.cpp ../src/libnptm/file_io.cpp ../src/libnptm/lapack_calls.cpp ../src/libnptm/logging.cpp ../src/libnptm/magma_calls.cpp ../src/libnptm/Parsers.cpp ../src/libnptm/sph_subs.cpp ../src/libnptm/tfrfme.cpp ../src/libnptm/TransitionMatrix.cpp ../src/libnptm/tra_subs.cpp ../src/libnptm/types.cpp
bin_PROGRAMS=cluster/edfb_clu cluster/clu cluster/np_cluster sphere/edfb_sph sphere/sph sphere/np_sphere trapping/frfme trapping/lffft trapping/np_trapping testing/test_TEDF testing/test_TTMS
cluster_edfb_clu_SOURCES=../src/cluster/edfb_clu.f
cluster_clu_SOURCES=../src/cluster/clu.f
cluster_np_cluster_SOURCES=../src/cluster/np_cluster.cpp ../src/cluster/cluster.cpp
sphere_edfb_sph_SOURCES=../src/sphere/edfb_sph.f
sphere_sph_SOURCES=../src/sphere/sph.f
sphere_np_sphere_SOURCES=../src/sphere/np_sphere.cpp ../src/sphere/sphere.cpp
trapping_frfme_SOURCES=../src/trapping/frfme.f
trapping_lffft_SOURCES=../src/trapping/lffft.f
trapping_np_trapping_SOURCES=../src/trapping/np_trapping.cpp ../src/trapping/cfrfme.cpp ../src/trapping/clffft.cpp
testing_test_TEDF_SOURCES=../src/testing/test_TEDF.cpp
testing_test_TTMS_SOURCES=../src/testing/test_TTMS.cpp

build/Makefile.in

0 → 100644
+1327 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading