PrincetonUniversity / tristan-mp-v2

Tristan-MP v2 [public]
https://princetonuniversity.github.io/tristan-v2/
BSD 3-Clause "New" or "Revised" License
12 stars 3 forks source link

Problem compiling on Ubuntu 22.04 with gcc #7

Open SennDegrare opened 2 years ago

SennDegrare commented 2 years ago

Hi, I'm not very experienced with coding of this scale, so do forgive any mistakes I make trying to express the issues. Basically I was trying to compile a Makefile created by the code $ python3 configure.py -2d -intel -mpi -hdf5 --nghosts=5 --user=user_twostream $ make all

This caused gfortran to put up a lot of errors, so I looked through some of the previous issues and changed the existing flags from FC := h5pfc FLAGS := -Ofast -O3 -DSoA -ipo -qopenmp-simd -qopt-report=5 -qopt-streaming-stores auto -diag-disable 10397 -diag-disable 10346 PFLAGS := -DHDF5 -DMPI -DtwoD -DNGHOST=5_2 to FC := gcc LD := h5pfc FFLAGS := -Ofast -O3 -DSoA #-qopenmp-simdi -qopt-report=5 -qopt-streaming-stores auto PFLAGS := -DHDF5 -DMPI -DtwoD -DNGHOST=5_2 Upon running the command again, I am faced with only 1 issue in the Makefile snippet $(BUILD_DIR)%.o: %.F90 @mkdir -p $(@D) @$(FC) $(FFLAGS) $(PFLAGS) -cpp $(addprefix -I, $(dir $(INC_FILES))) -module $(BUILD_DIR) -c $< -o $@ @echo [OK]: compiled $<

which is given as gcc: error: unrecognized command-line option ‘-module’; did you mean ‘-Mmodules’? make: *** [Makefile:53: build/src/global_namespace.o] Error 1

Needless to say, changing -module to -Mmodules doesn't help either - it gives a warning that Mmodules is valid for C++ but not Fortran and then I run into the error src/global_namespace.F90:16: Error: Can't open included file 'mpif.h' I'm not sure what to do after this, so any help would be appreciated.

haykh commented 2 years ago

hi! sorry for a late response. could you give a bit more info? it looks like you are trying to run with -intel but the compiler it uses is not an intel compiler (which is why it did not recognize the -module. if so, try configuring without the -intel flag. also, are you sure the compiler has mpi?