diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a8c41c5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,46 @@ +name: Build and Test QDyn +# Suggestion from ChatGPT + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-and-test: + runs-on: ubuntu-latest + + steps: + # Checkout the code + - name: Checkout code + uses: actions/checkout@v3 + + # Install dependencies + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y gfortran make wget tar + + # Download, build, and install FFTW library + - name: Build and install FFTW + run: | + # Specify the FFTW version + FFTW_VERSION=3.3.10 + wget http://www.fftw.org/fftw-${FFTW_VERSION}.tar.gz + tar -xzf fftw-${FFTW_VERSION}.tar.gz + cd fftw-${FFTW_VERSION} + ./configure --enable-shared --prefix=/usr/local + make -j$(nproc) + sudo make install + cd .. + + # Build the project using make + - name: Build the project + run: make + + # Run tests using make + - name: Run tests + run: make tests \ No newline at end of file diff --git a/.github/workflows/test_v2.yml b/.github/workflows/test_v2.yml new file mode 100644 index 0000000..7ed57c6 --- /dev/null +++ b/.github/workflows/test_v2.yml @@ -0,0 +1,65 @@ +name: CI + +on: + push: + branches: [ "main" ] + pull_request: + +permissions: + contents: read + +env: + FORCE_COLOR: 1 + +jobs: + intel_build: + name: Intel OneAPI build + runs-on: ubuntu-20.04 + env: + FC: mpiifort + APT_PACKAGES: >- + intel-oneapi-compiler-fortran + intel-oneapi-mpi + intel-oneapi-mpi-devel + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + + # - name: Install fftw + # run: | + # echo "Entering FFTW folder" + # cd fftw + # echo "Unpacking FFTW" + # tar -xf fftw.tar.gz + # echo "Compiling FFTW" + # cd fftw + # bash compile.sh + + - name: Add Intel repository + run: | + wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB + echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list + sudo apt-get update + + - name: Install Intel oneAPI compiler + run: | + sudo apt-get install ${{ env.APT_PACKAGES }} + source /opt/intel/oneapi/setvars.sh + printenv >> $GITHUB_ENV + + - name: Install fftw & build QDyn + run: | + echo "Entering FFTW folder" + cd fftw + echo "Unpacking FFTW" + tar -xf fftw.tar.gz + echo "Compiling FFTW" + cd fftw + bash compile.sh + echo "Compile QDyn" + cd ../../src + make clean && make diff --git a/fftw/fftw.tar.gz b/fftw/fftw.tar.gz index c6481e5..03a7e5c 100644 Binary files a/fftw/fftw.tar.gz and b/fftw/fftw.tar.gz differ diff --git a/src/Makefile b/src/Makefile index 068e09d..599d7e9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -3,23 +3,27 @@ # Compiler FC = gfortran FFLAGS = -#FFTW library needed -# LIBS = -L/home/janos/Programs/fftw/fftw-3.3.10/lib -lfftw3 -lm -llapack -# LIBS = -L/Users/janosj/Documents/Programs/fftw/fftw-3.3.10/lib -lfftw3 -lm +# FFTW library needed LIBS = -L/Users/janosj/Documents/Programs/fftw/fftw-3.3.10/lib -lfftw3 -lm -llapack LDLIBS = -lfftw3 # This is necessary only on clusters, not on MacOS +# for Github tests, I use different fftw library path +GitHub_LIBS = -L/usr/local/lib -lfftw3 -lm -llapack + # Name of program OUT = qdyn #====================================================================== # List of all files (NAME ALL F90) -OBJS = vars.o fparser.o fftw.o utils.o init.o propag.o qdyn.o +OBJS = vars.o fparser.o fftw.o utils.o init.o exactfactor.o propag.o qdyn.o myprogram: $(OBJS) $(FC) -o $(OUT) ${LIBS} ${FFLAGS} $(OBJS) ${LDLIBS} +github-build: $(OBJS) + $(FC) -o $(OUT) ${GitHub_LIBS} ${FFLAGS} $(OBJS) ${LDLIBS} + clean: /bin/rm -f *.o *.mod $(OUT)