PrincetonUniversity / athena

Athena++ radiation GRMHD code and adaptive mesh refinement (AMR) framework
https://www.athena-astro.app
BSD 3-Clause "New" or "Revised" License
226 stars 122 forks source link

Trouble running the configure script on MacOS terminal #597

Closed Xenos3108 closed 3 months ago

Xenos3108 commented 3 months ago

I have been trying to install athena++ on my macbook, once i cloned from the github repository, when running the configure script it spits out this output input: ./configure.py --mpi --omp --mpiccmd=mpic++

output: usage: configure.py [-h] [--prob {disk,gr_torus,dmr,field_loop_poles,hb3,eos_test,field_loop,gr_mhd_inflow,shk_cloud,jet,gr_blast,fft,gr_bondi,slotted_cylinder,gr_linear_wave,lw_implode,cpaw,magnoh,gr_shock_tube,ssheet,kh,resist,orszag_tang,twoibw,hgb,visc,poisson,jeans,rt,jgg,linear_wave,strat,shock_tube,scalar_diff,blast,from_array,gr_geodesic_infall,default_pgen,noh,mignone_advection,turb,shu_osher,rotor}] [--coord {cartesian,cylindrical,spherical_polar,minkowski,sinusoidal,tilted,schwarzschild,kerr-schild,gr_user}] [--eos {adiabatic,isothermal,general/eos_table,general/hydrogen,general/ideal}] [--flux {default,hlle,hllc,hlld,roe,llf}] [--nghost NGHOST] [--nscalars NSCALARS] [-b] [-sts] [-s] [-g] [-t] [-debug] [-coverage] [-float] [-mpi] [-omp] [--grav {none,fft}] [-fft] [--fftw_path FFTW_PATH] [-hdf5] [-h5double] [--hdf5_path HDF5_PATH] [--cxx {g++,g++-simd,icpc,icpc-debug,icpc-phi,cray,bgxlc++,clang++,clang++-simd,clang++-apple}] [--ccmd CCMD] [--mpiccmd MPICCMD] [--gcovcmd GCOVCMD] [--cflag CFLAG] [--include INCLUDE] [--lib_path LIB_PATH] [--lib LIB] configure.py: error: argument --mpiccmd: expected one argument

i searched solutions online it said to me to use mpicxx instead of mpic++ but gave the same output, the other solution i found was to scrap the equal sign i.e., "./configure.py --mpi --omp --mpiccmd mpic++" but gave the same output.

what must i do? or what am i doing wrong?

tomidakn commented 3 months ago

It is not "--mpi --omp" but "-mpi -omp".

The error message is a bit misleading, because the script interprets "--mpi" as shortened "--mpiccmd".

tomidakn commented 3 months ago

Options without an argument start with "-", and options requiring an argument starts with "--".

Xenos3108 commented 3 months ago

Thank you!

another query when building athena++

i enter 'make -j4' but it spits out the following output :

mpicxx -O3 -std=c++11 -fopenmp -c src/main.cpp -o obj/main.o mpicxx -O3 -std=c++11 -fopenmp -c src/parameter_input.cpp -o obj/parameter_input.o mpicxx -O3 -std=c++11 -fopenmp -c src/bvals/bvals.cpp -o obj/bvals.o mpicxx -O3 -std=c++11 -fopenmp -c src/bvals/bvals_base.cpp -o obj/bvals_base.o clang: error: unsupported option '-fopenmp' clang: clang: error: error: unsupported option '-fopenmp' unsupported option '-fopenmp' clang: error: unsupported option '-fopenmp' make: [obj/parameter_input.o] Error 1 make: Waiting for unfinished jobs.... make: [obj/main.o] Error 1 make: [obj/bvals_base.o] Error 1 make: *** [obj/bvals.o] Error 1

what should i do?

tomidakn commented 3 months ago

Your compiler is clang, so configure the code with --cxx clang++-apple.

Xenos3108 commented 3 months ago

do you mean edit the Makefile? or will it work if i just change my compiler to g++-14?

PS: I'm sorry i have no experience in code

msbc commented 3 months ago

./configure.py -mpi -omp --cxx clang++-apple -mpiccmd=mpic++

Personally, I run it without the -mpiccmd=mpic++ on my MacBook.

Xenos3108 commented 3 months ago

Okay, that configured the file but when i try to build athena, with 'make -j4' i get this output "mpic++ -O3 -std=c++11 -Xpreprocessor -fopenmp -c src/globals.cpp -o obj/globals.o mpic++ -O3 -std=c++11 -Xpreprocessor -fopenmp -c src/main.cpp -o obj/main.o mpic++ -O3 -std=c++11 -Xpreprocessor -fopenmp -c src/parameter_input.cpp -o obj/parameter_input.o mpic++ -O3 -std=c++11 -Xpreprocessor -fopenmp -c src/bvals/bvals.cpp -o obj/bvals.o mpic++ -O3 -std=c++11 -Xpreprocessor -fopenmp -c src/bvals/bvals_base.cpp -o obj/bvals_base.o In file included from src/parameter_input.cpp:61: src/parameter_input.hpp:29:10: fatal error: 'omp.h' file not found

include

     ^~~~~~~

In file included from src/bvals/bvals.cpp:29: In file included from src/bvals/../coordinates/coordinates.hpp:24: In file included from src/bvals/../coordinates/../mesh/mesh.hpp:27: src/bvals/../coordinates/../mesh/../parameter_input.hpp:29:10: fatal error: 'omp.h' file not found

include

     ^~~~~~~

1 error generated. make: [obj/parameter_input.o] Error 1 make: Waiting for unfinished jobs.... 1 error generated. make: *** [obj/bvals.o] Error 1 In file included from src/main.cpp:37: In file included from src/fft/turbulence.hpp:20: In file included from src/fft/athena_fft.hpp:21: In file included from src/fft/../mesh/mesh.hpp:27: src/fft/../mesh/../parameter_input.hpp:29:10: fatal error: 'omp.h' file not found

include

     ^~~~~~~

1 error generated. make: *** [obj/main.o] Error 1 In file included from src/bvals/bvals_base.cpp:25: In file included from src/bvals/../mesh/mesh.hpp:27: src/bvals/../mesh/../parameter_input.hpp:29:10: fatal error: 'omp.h' file not found

include

     ^~~~~~~

1 error generated. make: *** [obj/bvals_base.o] Error 1

tomidakn commented 3 months ago

Probably you have not installed libomp. Try 'brew install libomp'

But probably you do not need -omp. Actually MPI is more efficient than OpenMP in many cases.