PrincetonUniversity / SPEC

The Stepped-Pressure Equilibrium Code, an advanced MRxMHD equilibrium solver.
https://princetonuniversity.github.io/SPEC/
GNU General Public License v3.0
25 stars 6 forks source link

Fundamental flaws in Makefile #3

Closed jloizu closed 7 years ago

jloizu commented 7 years ago

The Makefile, as it is, does not handle properly the standard/debugging option represented by the flags RFLAGS/DFLAGS, which should be used when compiling xspec or dspec, respectively.

In fact, when compiling, it always ends up calling the debugging option DFLAGS even if one compiles the xspec executable.

This should be corrected.

SRHudson commented 7 years ago

Sorry, there was a small bug in the Makefile that I just fixed.

lazersos commented 7 years ago

Yes, also even for xspec the code was compiling with debug flags then linking with release flags. I've fixed this now. I've also handled the proper compilation of the .f files which are supplied as replacements for the NAG libraries. I've created a BRANCH called hotfix_Makefile. Please test and if successful I'll merge it into the master branch.

lazersos commented 7 years ago

And no if you look through the file your fix didn't fix it properly. Still compiles incorrectly with debug flags.

SRHudson commented 7 years ago

Sorry, . . . . I will address this issue after lunch when I have more time to carefully look through everything.

lazersos commented 7 years ago

@SRHudson Just take a look at the branch I pushed and see if it works for you. Then I'll merge to master.

SRHudson commented 7 years ago

I really won't have time for the next few hours. I have a thesis to review, deadline today, and a bunch of other matters to attend to.

I am entirely confident that you have fixed this. Please go ahead and merge.

jloizu commented 7 years ago

I will test it as soon as I can. Let's not start merging things without being sure; let's make solid steps.

zhucaoxiang commented 7 years ago

We can use pull request to request merge after testing, so that the master branch is only managed by Stuart to keep it consistent and clean.

And just an unrelated comment. I noticed that the GitHub account cses was assigned in several issues. I think it's just an official administrative account from the Princeton University.

zhucaoxiang commented 7 years ago

The intel compiler option worked. I also added the two missing files dcuhre.f and minpack.f in the branch hotfix_Makefile.

lazersos commented 7 years ago

@jloizu Try to pull the hotfix_Makefile branch by issuing the command git checkout hotfix_Makefile from your local repo directory (believe it's Spec_git), and let us know if you can build with make CC=intel_ipp

jloizu commented 7 years ago

This seems to work better. Now, there are a few non-friendly options that give error:

mpif90 -r8 -O2 -ip -no-prec-div -xHost -fPIC -o global_r.o -c global.F90 gfortran: error: unrecognized command line option ‘-r8’ gfortran: error: unrecognized command line option ‘-ip’ gfortran: error: unrecognized command line option ‘-no-prec-div’

Of course the easiest fix would be to remove them, but I'll wait for your feedback.

jloizu commented 7 years ago

Ignore my last comment. I was not compiling with the proper libraries.

Compilation now works fine until the very end, with one small error due to netcdf library linking option:

mpif90 -r8 -O2 -ip -no-prec-div -xHost -fPIC -o xspec global_r.o manual_r.o preset_r.o rzaxis_r.o packxi_r.o volume_r.o coords_r.o metrix_r.o ma00aa_r.o matrix_r.o mp00ac_r.o ma02aa_r.o packab_r.o tr00ab_r.o curent_r.o df00ab_r.o lforce_r.o brcast_r.o dforce_r.o newton_r.o casing_r.o bnorml_r.o jo00aa_r.o pp00aa_r.o pp00ab_r.o bfield_r.o stzxyz_r.o sc00aa_r.o hesian_r.o ra00aa_r.o numrec_r.o dcuhre_r.o minpack_r.o xspech_r.o hdfint_r.o -L/afs/@cell/common/soft/nag_mk24/fll6i24dcl/lib -lnag_nag -I/opt/hgw/tools/hdf5/1.8.17/intel15-avx-ompi110-tcp/include -L/opt/hgw/tools/hdf5/1.8.17/intel15-avx-ompi110-tcp/lib -lhdf5hl_fortran -lhdf5_hl -lhdf5_fortran -lhdf5 -lpthread -lz -lm -L/lib -lnetcdf ld: cannot find -lnetcdf Makefile:75: recipe for target 'xspec' failed make: *** [xspec] Error 1

lazersos commented 7 years ago

Fixed by changing NETCDFHOME to NETCDF_HOME in the intel_ipp subsection of the makefile. Compilation and linking achieved at IPP using Intel compiler.

jloizu commented 7 years ago

Thanks to Sam for helping with this. Now SPEC compiles properly in the IPP workstations (with intel compiler option) and on the local IPP cluster (with gfortran compiler option).

I will try now running SPEC and subsequently performing some tests.

Closing this issue.